Hi Friends
Happy 2010!
About combobox, is there a way to Value property get a custom value when we use an array as Items property (instead the normal behavior, ie, Value ger the number of row selected )? Like when Itemsource/Valuesource is used?
My idea is to have another array with values to put into Value property when one item is choose. As if was possible to pass an array to Valuesource.
Something like this:
Define COMBOBOX cbTest;
ITEMS {'Orange','Peach','Apple','Blackberry'};
VALUESOURCE {'14564','23456','87654','76543','14567'}
I was clear??? sorry my awfull english.
Thanks
André
p.s. HMG RULES!
Combobox
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Combobox
Does it mean that, if I select Blackberry, the value returned would be 14567?
Even now we can do that using a small work around. Isn't it?
Even now we can do that using a small work around. Isn't it?
Code: Select all
function definecombo
private aValues := {14564,23456,87654,76543,14567}
define window window1
define combobox cbTest
....
items {'Orange','Peach','Apple','Blackberry'};
end combobox
end window
activate window...
return nil
function findcomboboxvalue
msginfo(str(aValues[window1.cbTest.value]))
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Combobox
Exactly Rathinagiri. I use array in combos that way you show, but i think it will be very nice if its possible to put the "return values array" as a property of control. What do you think about? Its worth to add it to HMG wishlist?
regards
André
regards
André
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Combobox
I don't know about the internals and memory leakage because of this implementation. May be Roberto is the right person.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Combobox
This is not possible right now, but is a nice feature to add in future versions. I've added to my TODO list.andrebit wrote:Hi Friends
Happy 2010!
About combobox, is there a way to Value property get a custom value when we use an array as Items property (instead the normal behavior, ie, Value ger the number of row selected )? Like when Itemsource/Valuesource is used?
My idea is to have another array with values to put into Value property when one item is choose. As if was possible to pass an array to Valuesource.
Meanwhile, you could do something like this:
Code: Select all
aReturenValues := { 'One' , 'Two' , 'Three' }
<...>
MyValue := aReturnValues [ Win1.Combo1.Value ]
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)