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 » LineEdit, EditFields, DocEdit » [BUG] DropList selection goes blank... (When moving focus away from an initial selection of a drop list, the drop list displays a blank selection.)
[BUG] DropList selection goes blank... [message #50469] Sun, 04 November 2018 20:38 Go to next message
ptkacz is currently offline  ptkacz
Messages: 89
Registered: March 2017
Member
Here's a bit of code that populates a DropList and selects one of the options to display as default value:

dropList.Add("Cows");
dropList.Add("Apples");
dropList.Add("Cars");
dropList.Set("Cars");


Initially when the drop-list displays, "Cars" lists as the default selection. Upon selection, "Cars" still lists, followed by the drop list of values, Cows (highlighted), Apples, and Cars. When focus is removed away from the drop-list, the original selected entry is cleared.

Now, if a selection was made from the drop-list was previously user selected, and the drop-list is selected, followed by focus being removed and the drop-list collapsing, the previous selection would continue to display.

Why is this behaviour happening?


Peter
Re: [BUG] DropList selection goes blank... [message #50471 is a reply to message #50469] Mon, 05 November 2018 19:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ptkacz wrote on Sun, 04 November 2018 20:38
Here's a bit of code that populates a DropList and selects one of the options to display as default value:

dropList.Add("Cows");
dropList.Add("Apples");
dropList.Add("Cars");
dropList.Set("Cars");


Initially when the drop-list displays, "Cars" lists as the default selection. Upon selection, "Cars" still lists, followed by the drop list of values, Cows (highlighted), Apples, and Cars. When focus is removed away from the drop-list, the original selected entry is cleared.

Now, if a selection was made from the drop-list was previously user selected, and the drop-list is selected, followed by focus being removed and the drop-list collapsing, the previous selection would continue to display.

Why is this behaviour happening?


Peter


Wrong method. Use SetData or operator<<=.

Mirek
Re: [BUG] DropList selection goes blank... [message #50525 is a reply to message #50469] Tue, 13 November 2018 01:28 Go to previous messageGo to next message
ptkacz is currently offline  ptkacz
Messages: 89
Registered: March 2017
Member
Thanks Mirek!

Incorrect method, yes. The documentation mentions the SetData / GetData methods only in passing, in the paragraph at the top of the page. Probably should list it in amongst the other Public Methods!
Re: [BUG] DropList selection goes blank... [message #50529 is a reply to message #50525] Tue, 13 November 2018 09:12 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ptkacz wrote on Tue, 13 November 2018 01:28
Thanks Mirek!

Incorrect method, yes. The documentation mentions the SetData / GetData methods only in passing, in the paragraph at the top of the page. Probably should list it in amongst the other Public Methods!


Yeah, well, it is because it is so "central" feature of U++.

If widget holds single value, it has SetData/GetData. And you are supposed to always use ~ and <<= (or SetData/GetData if you have operator overloading phobia, but then it is unlikely that you would like U++ Smile

Mirek
Previous Topic: [BUG] EditDouble, SetData() can prevent U++ program from running...
Next Topic: Empty DocEdit pre-selecting keypresses (nightly)
Goto Forum:
  


Current Time: Thu Mar 28 15:49:48 CET 2024

Total time taken to generate the page: 0.01626 seconds