Re: Creating a new selection box.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Greg: I needed two levels of depth of display.
I have modified your program posted above, (which incidentally works perfectly) to get a further level of classification.
There is still some problems with display, particularly after displaying the items and then starting from Main level.
Thanks for your help

-- Program testcombo.exw 
-- 
include "wxeu/wxeud.e"  
without warning  
sequence listsize = {24 , 60 , 75 } 
integer mainwd = 500 , mainht = 300 , xposlbl = 10 , yposlbl =14 , lblwd = 60 , lblht= 60  
integer xposbox = 80 , yposbox=10 , boxwd = 120 , boxht = 20, goodht = 120 
constant   
    frmMain     = create( wxFrame, {0, -1, "Combo Demo", -1, -1, mainwd, mainht} ),  
    pnlMain     = create( wxPanel, {frmMain} ),  
    lblMain1    = create( wxStaticText, {pnlMain, -1, "Furniture:", xposlbl, yposlbl, lblwd, lblht} ),  
    mainBox    = create( wxComboBox, {pnlMain, -1, "Fbox", xposbox, yposbox, boxwd, boxht } ),  
    lblType = create( wxStaticText, {pnlMain, -1, "Type:", xposlbl, yposlbl+60, lblwd, lblht} ),  
    typeBox      = create( wxComboBox, {pnlMain, -1,"Ibox", xposbox, yposbox+50, boxwd, goodht} ),  
    lblItems  = create( wxStaticText, {pnlMain, -1, "Items:", xposlbl+160+boxwd, yposbox, lblwd, lblht} ),  
    itemList    = create( wxListBox, {pnlMain, -1, xposbox+20+boxwd, yposbox+25, boxwd+80, goodht} ),  
    $  
  
-- populate the combobox  
for i = 1 to listsize[1] do  
    add_item( mainBox, sprintf("Group %d", i) )  
end for  
  
-- hide the details  
-- show_window( lblType , wxFalse )  
show_window( typeBox  , wxFalse )  
-- show_window( lblItems  , wxFalse )  
show_window( itemList, wxFalse )  
 
procedure mainbox_handler( atom this, atom event_type, atom id, atom event )  
      
    integer index = get_selection( this )  
    sequence item = get_combo_item_string( this, index )  
      
    -- clear any existing details  
    clear_list( typeBox   )  
    clear_list( itemList )  
   
    -- populate the details  
    for i = 1 to listsize[2]  do  
        add_item( typeBox  , sprintf("%s Type %d", {item, i}) )  
    end for  
      
    -- show the details  
    show_window( lblType , wxTrue )  
    show_window( typeBox  , wxTrue )  
  
end procedure  
set_event_handler( mainBox, -1, wxEVT_COMMAND_COMBOBOX_SELECTED, routine_id("mainbox_handler") )  
  
procedure typebox_handler( atom this, atom event_type, atom id, atom event )  
      
    integer index = get_selection( this )  
    sequence item = get_combo_item_string( this, index )  
      
    -- clear any existing details  
    clear_list( typeBox   )  
    clear_list( itemList )  
   
    -- populate the details  
    for i = 1 to listsize[3]  do  
        add_item( itemList, sprintf("%s Item %d", {item, i}) )  
    end for  
      
    -- show the details  
    show_window( lblItems , wxTrue )  
    show_window( itemList, wxTrue )  
  
end procedure  
set_event_handler( typeBox  , -1, wxEVT_COMMAND_COMBOBOX_SELECTED, routine_id("typebox_handler") )  
  
wxMain( frmMain )  
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu