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 » WithDropChoice simple proposal
WithDropChoice simple proposal [message #53911] Thu, 14 May 2020 21:48 Go to next message
luoganda is currently offline  luoganda
Messages: 204
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 #53943 is a reply to message #53911] Sat, 16 May 2020 16:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
IDK, this is LAST selected value. What is the context where you need this?
Re: WithDropChoice simple proposal [message #53944 is a reply to message #53911] Sat, 16 May 2020 19:51 Go to previous messageGo to next message
luoganda is currently offline  luoganda
Messages: 204
Registered: November 2016
Experienced Member
yes, it's the last Edited selected value and it can be used almost everywhere.
Eg to select some value from list, edit it - and use that for next data processing.
It's something like DropList - which can be edited - although i didn't find that feature in it, that's why proposal for last selected value.
Most gui toolkits have it - win32 native also has it.

It's a must for quite many apps.

Besides this - i didn't find a way how to get/set specified index value, that's why 1st proposal 'GetDropChoice'.
If there is - you can give me a hint about it.
Re: WithDropChoice simple proposal [message #53950 is a reply to message #53911] Sun, 17 May 2020 12:28 Go to previous messageGo to next message
luoganda is currently offline  luoganda
Messages: 204
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 #53978 is a reply to message #53950] Tue, 19 May 2020 00:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
I still find it confusing. The last value that user selected is IMO meaningless as he can edit it at his will. That is why I am not quite happy adding IMO misleading methods to WithDropChoice interface.

Would not adding action to WhenSelect help? That should allow you to get the selected value at the moment it is selected...
Re: WithDropChoice simple proposal [message #53987 is a reply to message #53911] Tue, 19 May 2020 23:54 Go to previous messageGo to next message
luoganda is currently offline  luoganda
Messages: 204
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 Go to previous message
luoganda is currently offline  luoganda
Messages: 204
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

Previous Topic: SMTP library error?
Next Topic: Clipboard Append() function for images is missing in VirtualGui/TURTLE /LinuxFrameBuffer?
Goto Forum:
  


Current Time: Fri Jun 21 23:04:20 CEST 2024

Total time taken to generate the page: 0.01315 seconds