From 7b1279006496ba3251a755bcef91301ad107bb78 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 9 Apr 2002 10:31:37 +0000 Subject: [PATCH] Made widgets sample take up less space git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/widgets/button.cpp | 5 +++-- samples/widgets/combobox.cpp | 5 +++-- samples/widgets/gauge.cpp | 5 +++-- samples/widgets/listbox.cpp | 5 +++-- samples/widgets/notebook.cpp | 5 +++-- samples/widgets/radiobox.cpp | 24 +++++++++++++----------- samples/widgets/slider.cpp | 7 ++++--- samples/widgets/spinbtn.cpp | 7 ++++--- samples/widgets/static.cpp | 7 ++++--- samples/widgets/textctrl.cpp | 17 +++++++++-------- samples/widgets/widgets.cpp | 2 +- 11 files changed, 50 insertions(+), 39 deletions(-) diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index c5c3dcac65..29e80d1b92 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -39,7 +39,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/button.xpm" // ---------------------------------------------------------------------------- @@ -220,7 +220,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook, sizerRight->Add(0, 0, 1, wxCENTRE); sizerRight->Add(m_button, 1, wxCENTRE); sizerRight->Add(0, 0, 1, wxCENTRE); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerButton = sizerRight; // save it to modify it later // the 3 panes panes compose the window @@ -370,3 +370,4 @@ void ButtonWidgetsPage::OnButton(wxCommandEvent& event) wxLogMessage(_T("Test button clicked.")); } +#endif \ No newline at end of file diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index e79c7e7d89..5570f43f1f 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -41,7 +41,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/combobox.xpm" // ---------------------------------------------------------------------------- @@ -277,7 +277,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook, 0, NULL, 0); sizerRight->Add(m_combobox, 1, wxGROW | wxALL, 5); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerCombo = sizerRight; // save it to modify it later // the 3 panes panes compose the window @@ -507,3 +507,4 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) #endif //wxUSE_COMBOBOX +#endif diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index bdf8a18240..353dd228a4 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -41,7 +41,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/gauge.xpm" // ---------------------------------------------------------------------------- @@ -222,7 +222,7 @@ GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook, wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); m_gauge = new wxGauge(this, GaugePage_Gauge, m_range); sizerRight->Add(m_gauge, 1, wxCENTRE | wxALL, 5); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerGauge = sizerRight; // save it to modify it later // the 3 panes panes compose the window @@ -400,3 +400,4 @@ void GaugeWidgetsPage::StopTimer() wxLogMessage(_T("Progress finished.")); } +#endif \ No newline at end of file diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index 43cb38118d..dc145a7757 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -42,7 +42,7 @@ #include "wx/checklst.h" #include "widgets.h" - +#if 1 #include "icons/listbox.xpm" // ---------------------------------------------------------------------------- @@ -292,7 +292,7 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook, 0, NULL, wxLB_HSCROLL); sizerRight->Add(m_lbox, 1, wxGROW | wxALL, 5); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerLbox = sizerRight; // save it to modify it later // the 3 panes panes compose the window @@ -512,3 +512,4 @@ void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) CreateLbox(); } +#endif \ No newline at end of file diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index 170e535864..4491785d2f 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -44,7 +44,7 @@ #include "wx/artprov.h" #include "widgets.h" - +#if 1 #include "icons/notebook.xpm" // ---------------------------------------------------------------------------- @@ -280,7 +280,7 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook, wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); m_notebook = new wxNotebook(this, NotebookPage_Notebook); sizerRight->Add(m_notebook, 1, wxGROW | wxALL, 5); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerNotebook = sizerRight; // save it to modify it later // the 3 panes panes compose the window @@ -543,3 +543,4 @@ void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event) event.Skip(); } +#endif \ No newline at end of file diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 3f5fc02e39..4e08f4b937 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -38,7 +38,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/radiobox.xpm" // ---------------------------------------------------------------------------- @@ -66,7 +66,7 @@ enum // default values for the number of radiobox items static const size_t DEFAULT_NUM_ENTRIES = 12; -static const size_t DEFAULT_MAJOR_DIM = 4; +static const size_t DEFAULT_MAJOR_DIM = 3; // ---------------------------------------------------------------------------- // RadioWidgetsPage @@ -186,7 +186,8 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook, m_radioDir = new wxRadioBox(this, -1, _T("Numbering:"), wxDefaultPosition, wxDefaultSize, - WXSIZEOF(layoutDir), layoutDir); + WXSIZEOF(layoutDir), layoutDir, + 1, wxRA_SPECIFY_COLS); sizerLeft->Add(m_radioDir, 0, wxGROW | wxALL, 5); // if it's not defined, we can't change the radiobox direction @@ -195,12 +196,12 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook, #endif // wxRA_LEFTTORIGHT wxSizer *sizerRow; - sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension"), + sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension:"), -1, &m_textMajorDim); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons"), + sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons:"), -1, &m_textNumBtns); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); @@ -218,32 +219,32 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook, wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change parameters")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(_T("Current selection"), + sizerRow = CreateSizerWithTextAndLabel(_T("Current selection:"), -1, &m_textCurSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection, - _T("&Change selection"), + _T("&Change selection:"), -1, &m_textSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Label, - _T("&Label for box"), + _T("&Label for box:"), -1, &m_textLabel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn, - _T("&Label for buttons"), + _T("&Label for buttons:"), -1, &m_textLabelBtns); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerRadio = sizerRight; // save it to modify it later Reset(); @@ -252,7 +253,7 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook, // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); - sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10); + sizerTop->Add(sizerRight, 0, wxGROW | (wxALL & ~wxRIGHT), 10); // final initializations SetAutoLayout(TRUE); @@ -453,3 +454,4 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event) event.Enable(enable); } +#endif \ No newline at end of file diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index 7c51fdf16c..2aa0e4027b 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -39,7 +39,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/slider.xpm" // ---------------------------------------------------------------------------- @@ -248,7 +248,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook, // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerSlider = sizerRight; // save it to modify it later Reset(); @@ -256,7 +256,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook, // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); - sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); + sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10); sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10); // final initializations @@ -468,3 +468,4 @@ void SliderWidgetsPage::OnSlider(wxCommandEvent& event) wxLogMessage(_T("Slider value changed, now %d"), value); } +#endif \ No newline at end of file diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index f63898e586..62b68b0916 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -41,7 +41,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/spinbtn.xpm" // ---------------------------------------------------------------------------- @@ -224,7 +224,7 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook, // right pane wxSizer *sizerRight = new wxBoxSizer(wxVERTICAL); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerSpin = sizerRight; // save it to modify it later Reset(); @@ -232,7 +232,7 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook, // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); - sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); + sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10); sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10); // final initializations @@ -417,3 +417,4 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxCommandEvent& event) wxLogMessage(_T("Spin control value changed, now %d"), value); } +#endif \ No newline at end of file diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 0802ff2454..991f823d19 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -41,7 +41,7 @@ #include "wx/statline.h" #include "widgets.h" - +#if 1 #include "icons/statbox.xpm" // ---------------------------------------------------------------------------- @@ -219,14 +219,14 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook, // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerStatic = sizerRight; CreateStatic(); // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); - sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); + sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10); sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10); // final initializations @@ -367,3 +367,4 @@ void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& event) m_statText->SetLabel(m_textLabel->GetValue()); } +#endif \ No newline at end of file diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 16751dc7de..29dcea6c95 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -41,6 +41,7 @@ #include "widgets.h" +#if 1 #include "icons/text.xpm" // ---------------------------------------------------------------------------- @@ -322,7 +323,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist) #endif // __WXMSW__ wxButton *btn = new wxButton(this, TextPage_Reset, _T("&Reset")); - sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer + sizerLeft->Add(2, 2, 0, wxGROW | wxALL, 1); // spacer sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane @@ -330,19 +331,19 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist) wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL); btn = new wxButton(this, TextPage_Set, _T("&Set text value")); - sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 5); + sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); btn = new wxButton(this, TextPage_Add, _T("&Append text")); - sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 5); + sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); btn = new wxButton(this, TextPage_Insert, _T("&Insert text")); - sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 5); + sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); btn = new wxButton(this, TextPage_Load, _T("&Load file")); - sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 5); + sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); btn = new wxButton(this, TextPage_Clear, _T("&Clear")); - sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 5); + sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); wxStaticBox *box4 = new wxStaticBox(this, -1, _T("&Info:")); wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL); @@ -422,7 +423,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist) m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL); Reset(); CreateText(); - m_sizerText->SetMinSize(250, 0); + m_sizerText->SetMinSize(150, 0); // the 3 panes panes compose the upper part of the window wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); @@ -755,4 +756,4 @@ void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) { CreateText(); } - +#endif diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index c6069c0bb6..af1bb21272 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -255,7 +255,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title) ); m_lboxLog = new wxListBox(m_panel, -1); sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5); - sizerDown->SetMinSize(100, 200); + sizerDown->SetMinSize(100, 150); wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL); wxButton *btn = new wxButton(m_panel, Widgets_ClearLog, _T("Clear &log")); -- 2.45.2