1. wxRadioBox in Custom Dialog
- Posted by "Brian K. Clark" <bkc02 at health.state.ny.us> Apr 04, 2006
- 533 views
Hello All, Is this strange behavior, or am I doing something stupid? I'm guessing it's me. When I add a wxRadioBox (D1RadioBox) to the custom dialog (Dialog1) in the code below, it affects whether the main frame (MainFrame) is active when I return from Dialog2. If I remove the radio box from dialog 1, both dialogs return to an active main frame. With the radio box in dialog 1, dialog 1 returns to an active main frame and dialog 2 returns to an inactive main frame. Perplexed, Gnu-B
without warning with trace include print.e include wxEuphoria.e include wxButton.e include wxText.e include wxMenu.e include wxSizer.e include wxStatusBar.e include wxScrollBar.e include wxCheckBox.e include wxStatic.e include wxDialog.e atom void constant MainFrame= create( wxFrame, {0, -1, "Main", 10, 10, 300, 200}), StatusBar= create( wxStatusBar, {MainFrame,1,-1}), MenuBar= create( wxMenuBar, MainFrame ), FileMenu= create( wxMenu, { MenuBar, "&File"}), FileExit= create( wxMenuItem, {FileMenu, wxID_EXIT, "&Exit"}), SettingsMenu= create( wxMenu, { MenuBar, "&Settings"}), Dialog1= create( wxMenuItem, {SettingsMenu, 2, "&Dialog 1"}), SettingsMenuSep= create( wxMenuItem,{ SettingsMenu, wxID_SEPARATOR, "-"}), Dialog2 = create( wxMenuItem, {SettingsMenu, 3, "&Dialog2"}), MainPanel= create( wxPanel, {MainFrame, 1, "Main"}), D1Dialog= create( wxDialog, {MainFrame, -1, "Dialog 1", 10, 10, 200, 160}), D1Label= create( wxStaticText, {D1Dialog, -1, "Dialog 1", -1,-1,180,25}), D1RadioBox= create( wxRadioBox, {D1Dialog, -1, "Dialog 1", -1, -1, -1, -1, {"Choice 1", "Choice 2"}, 0, -1 }), D1DoneBtn= create( wxButton, {D1Dialog, -1, "Done"}), D2Dialog= create( wxDialog, {MainFrame, -1, "Dialog 2", 10, 10, 200, 120}), D2Label= create( wxStaticText, {D2Dialog, -1, "Dialog 2", -1,-1,180,25}), D2Text= create( wxTextCtrl, {D2Dialog, -1, "Dialog 2", -1, -1, 180, 20}), D2DoneBtn= create( wxButton, {D2Dialog, -1, "Done"}) procedure init( ) atom vs, hs vs = create( wxBoxSizer, wxVERTICAL ) add_window_to_sizer( vs, D1Label, 0, wxLEFT + wxTOP, 5 ) add_window_to_sizer( vs, D1RadioBox, 0, wxTOP, 5 ) add_window_to_sizer( vs, D1DoneBtn, 0, wxTOP, 5 ) set_sizer(D1Dialog, vs ) vs = create( wxBoxSizer, wxVERTICAL ) add_window_to_sizer( vs, D2Label, 0, wxLEFT + wxTOP, 5 ) add_window_to_sizer( vs, D2Text, 0, wxLEFT + wxTOP, 5 ) hs = create( wxBoxSizer, wxHORIZONTAL ) add_window_to_sizer( hs, D2DoneBtn, 0, wxLEFT + wxTOP, 5 ) add_sizer_to_sizer( vs, hs, 0, wxTOP, 1 ) set_sizer( D2Dialog, vs ) end procedure init() procedure show_dialog1( atom this, atom event_type, atom id, atom event ) void = show_modal( D1Dialog ) end procedure set_event_handler({MainFrame, Dialog1}, 2, wxEVT_COMMAND_MENU_SELECTED, routine_id("show_dialog1")) procedure un_load_dialog1( atom this, atom event_type, atom id, atom event ) end_modal ( D1Dialog, -1 ) end procedure set_event_handler(D1DoneBtn, -1, wxEVT_COMMAND_BUTTON_CLICKED, routine_id( "un_load_dialog1" )) set_event_handler(D1Dialog, get_id(D1Dialog), wxEVT_CLOSE_WINDOW, routine_id( "un_load_dialog1" )) procedure show_data_dir( atom this, atom event_type, atom id, atom event ) void = show_modal( D2Dialog ) end procedure set_event_handler({MainFrame, Dialog2}, 3, wxEVT_COMMAND_MENU_SELECTED, routine_id("show_data_dir")) procedure un_load_data_dir( atom this, atom event_type, atom id, atom event ) end_modal ( D2Dialog, -1 ) end procedure set_event_handler(D2DoneBtn, -1, wxEVT_COMMAND_BUTTON_CLICKED, routine_id( "un_load_data_dir" )) set_event_handler(D2Dialog, get_id(D2Dialog), wxEVT_CLOSE_WINDOW, routine_id( "un_load_data_dir" )) procedure term_opt( atom this, atom event_type, atom id, atom event ) cleanup() abort(0) end procedure set_event_handler({MainFrame, FileMenu}, wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, routine_id("term_opt")) wxMain( MainFrame )
2. Re: wxRadioBox in Custom Dialog
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Apr 04, 2006
- 501 views
Brian K. Clark wrote: > > > Hello All, > Is this strange behavior, or am I doing something stupid? I'm guessing > it's me. When I add a wxRadioBox (D1RadioBox) to the custom dialog > (Dialog1) in the code below, it affects whether the main frame (MainFrame) > is active when I return from Dialog2. If I remove the radio box from > dialog 1, both dialogs return to an active main frame. With the radio box > in dialog 1, dialog 1 returns to an active main frame and dialog 2 returns > to an inactive main frame. > Perplexed, That's really strange. If you create dialog 2 first, you don't get the strange behavior. In fact, as long as you create the radio box after you create dialog 2, it works correctly. I have no idea why this is. Matt Lewis
3. Re: wxRadioBox in Custom Dialog
- Posted by "Brian K. Clark" <bkc02 at health.state.ny.us> Apr 04, 2006
- 520 views
Creating all of the dialogs before the radio box worked. So, I guess I'll just put on my old programmer's blinders and keep moving forward. Thanks Matt Lewis <guest@RapidEupho ria.com> To EUforum at topica.com 04/04/2006 01:51 cc PM Subject Re: wxRadioBox in Custom Dialog Please respond to EUforum at topica.co m Brian K. Clark wrote: > > > Hello All, > Is this strange behavior, or am I doing something stupid? I'm guessing > it's me. When I add a wxRadioBox (D1RadioBox) to the custom dialog > (Dialog1) in the code below, it affects whether the main frame (MainFrame) > is active when I return from Dialog2. If I remove the radio box from > dialog 1, both dialogs return to an active main frame. With the radio box > in dialog 1, dialog 1 returns to an active main frame and dialog 2 returns > to an inactive main frame. > Perplexed, That's really strange. If you create dialog 2 first, you don't get the strange behavior. In fact, as long as you create the radio box after you create dialog 2, it works correctly. I have no idea why this is. Matt Lewis