-// button->SetForegroundColour( "red" );
- m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
- m_checkbox->SetValue(FALSE);
- m_notebook->AddPage(panel, "wxList", TRUE, Image_List);
-
- panel = new wxPanel(m_notebook);
-// panel->SetBackgroundColour("cadet blue");
-// panel->SetForegroundColour("blue");
- m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices );
-// m_choice->SetBackgroundColour("wheat");
- (void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
- (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
- m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
-
- panel = new wxPanel(m_notebook);
-// panel->SetBackgroundColour("cadet blue");
-// panel->SetForegroundColour("blue");
- m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
-// m_combo->SetBackgroundColour("wheat");
- (void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
- (void)new wxCheckBox( panel, ID_COMBO_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
- m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
-
- panel = new wxPanel(m_notebook);
-// panel->SetBackgroundColour("cadet blue");
-// panel->SetForegroundColour("blue");
- wxTextCtrl *tc = new wxTextCtrl( panel, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(320,28));
- (*tc) << " More text.";
-// tc->SetBackgroundColour("wheat");
- m_multitext = new wxTextCtrl( panel, ID_TEXT, "And here.", wxPoint(10,50), wxSize(320,160), wxTE_MULTILINE );
- (*m_multitext) << " More text.";
- m_multitext->SetBackgroundColour("wheat");
- (void)new wxStaticBox( panel, -1, "wxClipboard", wxPoint(345,50), wxSize(160,145) );
- (void)new wxButton( panel, ID_COPY_TEXT, "Copy line 1", wxPoint(370,80), wxSize(110,30) );
- (void)new wxButton( panel, ID_PASTE_TEXT, "Paste text", wxPoint(370,140), wxSize(110,30) );
- m_notebook->AddPage(panel, "wxTextCtrl" , FALSE, Image_Text);
-
- wxString choices2[] =
- {
- "Wonderful",
- "examples.",
- };
-
- panel = new wxPanel(m_notebook);
-// panel->SetBackgroundColour("cadet blue");
-// panel->SetForegroundColour("blue");
- m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_SPECIFY_ROWS );
-// m_radio->SetBackgroundColour("wheat");
- m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_SPECIFY_COLS );
-// m_radio->SetBackgroundColour("wheat");
- (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
- m_fontButton = new wxButton( panel, ID_SET_FONT, "Set more Italic font", wxPoint(340,30), wxSize(140,30) );
-// m_fontButton->SetForegroundColour("blue");
- (void)new wxButton( panel, ID_RADIOBOX_FONT, "Set Italic font", wxPoint(340,80), wxSize(140,30) );
- (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, "Disable", wxPoint(340,130), wxSize(140,30) );
- wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, "Radiobutton1", wxPoint(210,170), wxSize(110,30) );
- rb->SetValue( FALSE );
- (void)new wxRadioButton( panel, ID_RADIOBUTTON_2, "Radiobutton2", wxPoint(340,170), wxSize(110,30) );
- m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
-
- panel = new wxPanel(m_notebook);
-// panel->SetBackgroundColour("cadet blue");
-// panel->SetForegroundColour("blue");
- (void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
- m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155, 30) );
-// m_gauge->SetBackgroundColour("wheat");
- m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
-// m_slider->SetBackgroundColour("wheat");
- (void)new wxStaticBox( panel, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
+
+ // ------------------------------------------------------------------------
+ // listbox page
+ // ------------------------------------------------------------------------
+ wxPanel *panel = new wxPanel(m_book);
+ m_listbox = new wxListBox( panel, ID_LISTBOX,
+ wxPoint(10,10), wxSize(120,70),
+ 5, choices, wxLB_MULTIPLE | wxLB_ALWAYS_SB | wxHSCROLL );
+ m_listboxSorted = new wxListBox( panel, ID_LISTBOX_SORTED,
+ wxPoint(10,90), wxSize(120,70),
+ 3, choices, wxLB_SORT );
+
+ SetListboxClientData(wxT("listbox"), m_listbox);
+ SetListboxClientData(wxT("listbox"), m_listboxSorted);
+
+ m_listbox->SetCursor(*wxCROSS_CURSOR);
+
+ m_lbSelectNum = new wxButton( panel, ID_LISTBOX_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ m_lbSelectThis = new wxButton( panel, ID_LISTBOX_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_LISTBOX_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) );
+ (void)new MyButton( panel, ID_LISTBOX_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_LISTBOX_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
+ wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+
+ button->SetDefault();
+
+ m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, wxT("&Disable"), wxPoint(20,170) );
+ m_checkbox->SetValue(false);
+ button->MoveAfterInTabOrder(m_checkbox);
+ (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, wxT("&Toggle colour"),
+ wxPoint(110,170) );
+ panel->SetCursor(wxCursor(wxCURSOR_HAND));
+ m_book->AddPage(panel, wxT("wxListBox"), true, Image_List);
+
+ // ------------------------------------------------------------------------
+ // choice page
+ // ------------------------------------------------------------------------
+#if wxUSE_CHOICE
+ panel = new wxPanel(m_book);
+ m_choice = new MyChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,wxDefaultCoord), 5, choices );
+ m_choiceSorted = new MyChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,wxDefaultCoord),
+ 5, choices, wxCB_SORT );
+
+ SetChoiceClientData(wxT("choice"), m_choice);
+ SetChoiceClientData(wxT("choice"), m_choiceSorted);
+
+ m_choice->SetSelection(2);
+ (void)new wxButton( panel, ID_CHOICE_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+ (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, wxT("&Disable"), wxPoint(20,130), wxSize(140,30) );
+
+ m_book->AddPage(panel, wxT("wxChoice"), false, Image_Choice);
+#endif // wxUSE_CHOICE
+
+ // ------------------------------------------------------------------------
+ // combo page
+ // ------------------------------------------------------------------------
+ panel = new wxPanel(m_book);
+ (void)new wxStaticBox( panel, wxID_ANY, wxT("&Box around combobox"),
+ wxPoint(5, 5), wxSize(150, 100));
+ m_combo = new MyComboBox( panel, ID_COMBO, wxT("This"),
+ wxPoint(20,25), wxSize(120, wxDefaultCoord),
+ 5, choices,
+ wxTE_PROCESS_ENTER);
+
+ (void)new wxButton( panel, ID_COMBO_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_SET_TEXT, wxT("Set 'Hi!' at #2"), wxPoint(340,180), wxSize(140,30) );
+ (void)new wxCheckBox( panel, ID_COMBO_ENABLE, wxT("&Disable"), wxPoint(20,130), wxSize(140,30) );
+ m_book->AddPage(panel, wxT("wxComboBox"), false, Image_Combo);
+
+ // ------------------------------------------------------------------------
+ // radio box
+ // ------------------------------------------------------------------------
+ wxString choices2[] =
+ {
+ wxT("First"), wxT("Second"),
+ /* "Third",
+ "Fourth", "Fifth", "Sixth",
+ "Seventh", "Eighth", "Nineth", "Tenth" */
+ };
+
+ panel = new wxPanel(m_book);
+ wxGridBagSizer* radio_page_sizer = new wxGridBagSizer(5, 5);
+
+ m_radio = new wxRadioBox(panel, ID_RADIOBOX, wxT("T&his"),
+ wxPoint(10,10), wxDefaultSize,
+ WXSIZEOF(choices), choices,
+ 1, wxRA_SPECIFY_COLS );
+ MyRadioBox* mybox = new MyRadioBox(panel, ID_RADIOBOX2, wxT("&That"),
+ wxPoint(10,160), wxDefaultSize,
+ WXSIZEOF(choices2), choices2,
+ 1, wxRA_SPECIFY_ROWS );
+
+ radio_page_sizer->Add( m_radio, wxGBPosition(0,0), wxGBSpan(2,1) );
+ radio_page_sizer->Add( mybox, wxGBPosition(2,0), wxGBSpan(2,1) );
+
+#if wxUSE_HELP
+ for (unsigned int item = 0; item < WXSIZEOF(choices); ++item)
+ m_radio->SetItemHelpText( item, wxString::Format( wxT("Help text for \"%s\""),
+ choices[item].c_str() ) );
+
+ // erase help text for the second item
+ m_radio->SetItemHelpText( 1, wxT("") );
+ // set default help text for control
+ m_radio->SetHelpText( wxT("Default helptext for wxRadioBox") );
+#endif // wxUSE_HELP
+
+ wxButton* select_two = new wxButton ( panel, ID_RADIOBOX_SEL_NUM, wxT("Select #&2") );
+ wxButton* select_this = new wxButton ( panel, ID_RADIOBOX_SEL_STR, wxT("&Select 'This'") );
+ m_fontButton = new wxButton ( panel, ID_SET_FONT, wxT("Set &more Italic font") );
+ wxButton* set_italic = new wxButton ( panel, ID_RADIOBOX_FONT, wxT("Set &Italic font") );
+ wxCheckBox* disable_cb = new wxCheckBox( panel, ID_RADIOBOX_ENABLE, wxT("&Disable") );
+ wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, wxT("Radiobutton1"),
+ wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
+ wxRadioButton *rb2 = new wxRadioButton( panel, ID_RADIOBUTTON_2, wxT("&Radiobutton2"),
+ wxDefaultPosition, wxDefaultSize );
+ rb->SetValue( false );
+
+ radio_page_sizer->Add( select_two, wxGBPosition(0, 1), wxDefaultSpan, wxALL , 10 );
+ radio_page_sizer->Add( select_this, wxGBPosition(1, 1), wxDefaultSpan, wxALL , 10 );
+ radio_page_sizer->Add( m_fontButton, wxGBPosition(0, 2), wxDefaultSpan, wxALL , 10 );
+ radio_page_sizer->Add( set_italic, wxGBPosition(1, 2), wxDefaultSpan, wxALL , 10 );
+ radio_page_sizer->Add( disable_cb, wxGBPosition(2, 2), wxDefaultSpan, wxLEFT | wxRIGHT, 10 );
+ radio_page_sizer->Add( rb, wxGBPosition(3, 1), wxDefaultSpan, wxLEFT | wxRIGHT, 10 );
+ radio_page_sizer->Add( rb2, wxGBPosition(3, 2), wxDefaultSpan, wxLEFT | wxRIGHT, 10 );
+
+ panel->SetSizer( radio_page_sizer );
+
+ m_book->AddPage(panel, wxT("wxRadioBox"), false, Image_Radio);
+
+ // ------------------------------------------------------------------------
+ // gauge and slider
+ // ------------------------------------------------------------------------
+
+#if wxUSE_SLIDER && wxUSE_GAUGE
+ panel = new wxPanel(m_book);
+
+ wxBoxSizer *gauge_page_vsizer = new wxBoxSizer( wxVERTICAL );
+
+ wxBoxSizer *gauge_page_first_row_sizer = new wxBoxSizer( wxHORIZONTAL );
+
+ wxStaticBoxSizer *gauge_sizer = new wxStaticBoxSizer( wxHORIZONTAL, panel, wxT("&wxGauge and wxSlider") );
+ gauge_page_first_row_sizer->Add( gauge_sizer, 0, wxALL, 5 );
+ wxBoxSizer *sz = new wxBoxSizer( wxVERTICAL );
+ gauge_sizer->Add( sz );
+ m_gauge = new wxGauge( panel, wxID_ANY, 200, wxDefaultPosition, wxSize(155, 30), wxGA_HORIZONTAL|wxNO_BORDER );
+ sz->Add( m_gauge, 0, wxALL, 10 );
+ m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200,
+ wxDefaultPosition, wxSize(155,wxDefaultCoord),
+ wxSL_AUTOTICKS | wxSL_LABELS);
+ m_slider->SetTickFreq(40);
+ sz->Add( m_slider, 0, wxALL, 10 );
+
+ m_gaugeVert = new wxGauge( panel, wxID_ANY, 100,
+ wxDefaultPosition, wxSize(wxDefaultCoord, 90),
+ wxGA_VERTICAL | wxGA_SMOOTH | wxNO_BORDER );
+ gauge_sizer->Add( m_gaugeVert, 0, wxALL, 10 );
+
+
+
+ wxStaticBox *sb = new wxStaticBox( panel, wxID_ANY, wxT("&Explanation"),
+ wxDefaultPosition, wxDefaultSize ); //, wxALIGN_CENTER );
+ wxStaticBoxSizer *wrapping_sizer = new wxStaticBoxSizer( sb, wxVERTICAL );
+ gauge_page_first_row_sizer->Add( wrapping_sizer, 0, wxALL, 5 );
+