U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Key in DropList cannot be same
Re: Key in DropList cannot be same [message #14227 is a reply to message #14207] Wed, 20 February 2008 14:45 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
bonami wrote on Tue, 19 February 2008 21:22

simplified
do not spend so long time figuring it out, just ask me to clarify next time. i've already been grateful.


First

GetKey(l.GetIndex())

is (almost) the same as

~l

(but AFAIK, l.GetIndex can return -1, which will crash here).

Second, I start to realize the problem. Yes, "GetIndex" in fact searches for the first key that is equal. Solution is simple - do not put equal keys into DropList Wink

You can solve your problem by adding separate mapping array (keys are then indicies to this array).

Mirek
 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message
Previous Topic: Two questions on U++
Next Topic: Layout and Paint event processing
Goto Forum:
  


Current Time: Tue Jul 28 17:15:03 GMT+2 2026

Total time taken to generate the page: 0.00815 seconds