Home > Software engineering >  Duilib click event GetCurSel for a list control is the last of the index
Duilib click event GetCurSel for a list control is the last of the index

Time:11-14

CodePudding user response:

As title, the trouble you have studied Duilib to explain

CodePudding user response:

Int nIndex=plist - & gt; GetCurSel ();//click return 1 for the first time at the back of the return per click is the index of the previous
CListTextElementUI * pListElement=static_cast & lt; CListTextElementUI * & gt; (plist - & gt; GetItemAt (nIndex));

CodePudding user response:

You're response DUI_MSGTYPE_ITEMCLICK this notice after
?If it is, because it is first send this notice again selected code, so as you say
You can change the code, or change the idea

CodePudding user response:

reference hurryboylqs reply: 3/f
are you response DUI_MSGTYPE_ITEMCLICK this notice after
?If it is, because it is first send this notice again selected code, so as you say
You can change the code, or change the idea to realize


How does this change more appropriate?

CodePudding user response:

Events should be in the wrong, to the first dui source layer, and then step tracking, you can find the right event, to obtain and read his source, it is easy to understand,

CodePudding user response:

Duilib controls in just after the click, numerical, immediately get back to the numerical haven't had time to update and get wrong, because we have two solutions, one is to use the value of a variable to record the last time, then according to increase or decrease operation to modify this value, the second way is to duilib source code, look at the business process of the index increase is in what place, then come back after the value, in addition there may be a kind of method, is to obtain numerical don't in the click event to do, can be placed in another click event to specially set out under this value to get

CodePudding user response:

https://blog.csdn.net/qq_37059136/article/details/87871960
  • Related