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++ Core » Problem with Droplists and new Value
Problem with Droplists and new Value [message #36519] Mon, 04 June 2012 15:18 Go to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi all,

In order to activate new Value, SVO_VALUE flag must be added to the main package configuration. All is working well except when you need to use DropList and want to add richtext items to the droplist with AttrText for example.

In that case, the GetIndex() function retuns -1 and Assertation message error ">=0 and <GetCount() in Vcont.h" is displayed.

A test case is enclosed. This shows that DropList::GetIndex() returns systematically -1. I am running MS Win XP and MSC9 for compilation.

So how to keep the possibility of using richtext encoding in droplist items using AttrText as before new Value was implemented? Anybody has an idea ?

Thanks in advance
_____________________

Regards

Biobytes

[Updated on: Mon, 04 June 2012 21:33]

Report message to a moderator

Re: Problem with Droplists and new Value [message #36551 is a reply to message #36519] Fri, 08 June 2012 15:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
AttrText cannot be used as key in droplist, because it lacks comparison operator. This would be broken without SVO_VALUE as well.

Easy solution in this case is to use integer index

dl.Add(0, AttrText("First").SetFont(Arial(12)).Bold().Ink(Red));

(and you can assign values directly then by SetData/<<=, no need to use SetIndex).

Mirek
Re: Problem with Droplists and new Value [message #36554 is a reply to message #36551] Fri, 08 June 2012 19:10 Go to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hello Mirek,

Thank you very much for your reply. Sure it is clear that using int index in Add function solves completely the problem. Sorry for not having thought about it, I was so blind Embarassed .

_______________________________
Regards

Biobytes
Previous Topic: A warning in Diag.h
Next Topic: String isn't pickable?
Goto Forum:
  


Current Time: Fri Apr 19 23:04:18 CEST 2024

Total time taken to generate the page: 0.96759 seconds