Re: wxEuphoria - On hover
- Posted by ghaberek (admin) Jan 15, 2015
- 2073 views
Thanks again Greg. I appreciate your concern and desire to accelerate this implementation.
It is a feature of windows and a lot of application use it for 2-3 level access of lists, without having to click.
My daughter who is not a programmer, but uses a lot of software both on Windows and mac, was not just surprised but horrified when I showed her access to lists and sub-lists based on clicking to open a combobox each time.
I shall continue developing other parts of my software and hope that you will have something available soon.
That seems to me like a behavior exhibited by a series of menus, not comboboxes. I assume you have a hierarchy of values that depend on the level above them, like Car Make/Model/Year, etc.
I think we may be able to accomplish this by "chaining" one combobox into the next. During the wxEVT_COMMAND_COMBOBOX_SELECTED event (i.e. when a combobox value changes), we can jump to the "next" combobox and show its dropdown immediately. This does still require that we implement Popup() in wxEuphoria. But at least with the code below, you get that automatic "jump" when something is selected.
include wxeu/wxeud.e include std/map.e constant NULL = 0 constant wxID_ANY = -1 constant ID_COMBO1 = new_id(), ID_COMBO2 = new_id(), ID_COMBO3 = new_id(), $ atom frame = create( wxFrame, {NULL, wxID_ANY, "ComboBox", -1, -1, 400, 300} ) atom panel = create( wxPanel, {frame} ) atom combo1 = create( wxComboBox, {panel, ID_COMBO1, "", 10, 10, 200, -1} ) atom combo2 = create( wxComboBox, {panel, ID_COMBO2, "", 10, 40, 200, -1} ) atom combo3 = create( wxComboBox, {panel, ID_COMBO3, "", 10, 70, 200, -1} ) map m_next = map:new() map:put( m_next, combo1, combo2 ) map:put( m_next, combo2, combo3 ) sequence items = { "Apples", "Bananas", "Grapes", "Oranges", "Pears" } for i = 1 to length( items ) do add_item( combo1, items[i] ) add_item( combo2, items[i] ) add_item( combo3, items[i] ) end for procedure ComboBox_onChange( atom this, atom event_type, atom id, atom event ) atom next = map:get( m_next, this, NULL ) if next != NULL then set_focus( next ) -- popup( next ) -- not implemented end if end procedure set_event_handler( combo1, -1, wxEVT_COMMAND_COMBOBOX_SELECTED, routine_id("ComboBox_onChange") ) set_event_handler( combo2, -1, wxEVT_COMMAND_COMBOBOX_SELECTED, routine_id("ComboBox_onChange") ) set_event_handler( combo3, -1, wxEVT_COMMAND_COMBOBOX_SELECTED, routine_id("ComboBox_onChange") ) wxMain( frame )
-Greg