|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » WithDropChoice simple proposal
WithDropChoice simple proposal [message #53911] |
Thu, 14 May 2020 21:48 |
luoganda
Messages: 205 Registered: November 2016
|
Experienced Member |
|
|
This is missing somewhere in WithDropChoice - so one can get current edited(or specified index) value.
For myself - i have added this after
'Value Get(int i) const { return select.Get(i); }'
So, adding something like this would be fine.
DropChoice& GetDropChoice()const { return select; } <=toGetSpecifiedIndexVal,etc
Value operator~()const { return select.Get(); } <=toGetCurrent(eg EditString) edited! value
|
|
|
|
|
Re: WithDropChoice simple proposal [message #53950 is a reply to message #53911] |
Sun, 17 May 2020 12:28 |
luoganda
Messages: 205 Registered: November 2016
|
Experienced Member |
|
|
Also "What is the context where you need this?".
Suppose one has WithDropChoice<EditString> - eg 10 string 'templates' values added - but some of the words are adjustable.
Eg value: "Template 'adjustableValue' some more words". When one selects one of this 'adjustable template' list value - that adjustableValue can be changed by user for whatever one wants to if needed(eg also for sdr software, etc) - this is the context in which is used. I have made some small app - and it's value is indespensible - not just an option - but a must. I guess something like this is also meant in linux/win native gui-s.
There is SuggestControl which adds new values - but WithDropChoice<EditString> doesn't need to - although that extra select and optionally change - is very handy(a must) in some apps.
Also overriding ~operator doesn't have to do the same as i have written - this should probably return current original selected value from list, but something like 'GetCurrentValue'(and 'GetSelected' value) in some kind of way - should be there, else many of us will have to patch every new upp release.
And maybe 'DropChoice& GetDropChoice()' should be const - but i almost doubt this - because if it's const - many functionality is automatically not accesible to user.
But if it's meant for safety - at least GetDropChoice could be const and GetDropChoiceObject should not be.
[Updated on: Sun, 17 May 2020 12:37] Report message to a moderator
|
|
|
|
Re: WithDropChoice simple proposal [message #53987 is a reply to message #53911] |
Tue, 19 May 2020 23:54 |
luoganda
Messages: 205 Registered: November 2016
|
Experienced Member |
|
|
"The last value that user selected is IMO meaningless as he can edit it at his will."
It's not meaningles - it's ideal!
User chooses it and he may(or may not) edit it(the whole story behind using EditString with WithDropChoice) - this is very needed in some apps.
Also - EditString is not accessible by current WithDropChoice funcs - if it is - i would be glad to know about it.
Besides, if i would need something that i don't want to change - i would use DropList - wouldn't i.
And - also - how to get CurrentSelectedIndex with current functions? is there a func fot it? i didn't find it.
[Updated on: Tue, 19 May 2020 23:55] Report message to a moderator
|
|
|
Re: WithDropChoice simple proposal [message #54184 is a reply to message #53911] |
Fri, 05 June 2020 21:52 |
luoganda
Messages: 205 Registered: November 2016
|
Experienced Member |
|
|
ahh, never mind, i didn't realized some things..
Although for WithDropChoice my oppinion is that there should be at least
const DropChoice& GetDropChoice() <= for GetIndex, Get(i) and GetCount ... and separate SetIndex
accessed via public funcs - else one has to override class - which is not needed for many basic uses.
[Updated on: Fri, 05 June 2020 21:53] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Nov 01 01:36:50 CET 2024
Total time taken to generate the page: 0.00809 seconds
|
|
|