Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 13979
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: Mon May 13 08:40:56 CEST 2024

Total time taken to generate the page: 0.02623 seconds