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 » Bug on DropList?
Bug on DropList? [message #20672] Tue, 31 March 2009 12:53 Go to next message
JoseB is currently offline  JoseB
Messages: 37
Registered: March 2009
Member
drpList.Add("1-First");
drpList.Add("2-Second");
drpList.Add("3-Third");
drpList.Add("4-Fourth");

...

String strTemp = AsString(drpList.GetValue());
PromptOK("You selected: " + strTemp);
It works well.




drpList.Add( AttrText("1-First").Ink(Yellow));
drpList.Add( AttrText("2-Second").Ink(Yellow));
drpList.Add( AttrText("3-Third").Ink(Yellow));
drpList.Add( AttrText("4-Fourth").Ink(Yellow));
...
String strTemp = AsString(drpList.GetValue());
PromptOK("You selected: " + strTemp);

Gives an Exception...


Thanks

Jose





[Updated on: Tue, 31 March 2009 12:53]

Report message to a moderator

Re: Bug on DropList? [message #20675 is a reply to message #20672] Tue, 31 March 2009 13:04 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I agree it would be nice if that worked, but Value doesn't intrinsically support AttrText so it requires manual conversion:
String s = ValueTo<AttrText>(~list).text;
or wrap it in a function.

I think AttrText is intended to be used as a quick way of customizing text that isn't going to be read-back by the application. But I'm suprised it doesn't at least have a Value contructor (AttrText(const Value &v)).
Previous Topic: How To call the Color picker window?
Next Topic: DropList - Changing colors
Goto Forum:
  


Current Time: Wed Apr 24 12:14:23 CEST 2024

Total time taken to generate the page: 0.03432 seconds