Made widgets sample take up less space

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-04-09 10:31:37 +00:00
parent d3bfec747d
commit 7b12790064
11 changed files with 50 additions and 39 deletions

View File

@@ -39,7 +39,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/button.xpm" #include "icons/button.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -220,7 +220,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
sizerRight->Add(0, 0, 1, wxCENTRE); sizerRight->Add(0, 0, 1, wxCENTRE);
sizerRight->Add(m_button, 1, wxCENTRE); sizerRight->Add(m_button, 1, wxCENTRE);
sizerRight->Add(0, 0, 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 m_sizerButton = sizerRight; // save it to modify it later
// the 3 panes panes compose the window // the 3 panes panes compose the window
@@ -370,3 +370,4 @@ void ButtonWidgetsPage::OnButton(wxCommandEvent& event)
wxLogMessage(_T("Test button clicked.")); wxLogMessage(_T("Test button clicked."));
} }
#endif

View File

@@ -41,7 +41,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/combobox.xpm" #include "icons/combobox.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -277,7 +277,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook,
0, NULL, 0, NULL,
0); 0);
sizerRight->Add(m_combobox, 1, wxGROW | wxALL, 5); 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 m_sizerCombo = sizerRight; // save it to modify it later
// the 3 panes panes compose the window // the 3 panes panes compose the window
@@ -507,3 +507,4 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
#endif //wxUSE_COMBOBOX #endif //wxUSE_COMBOBOX
#endif

View File

@@ -41,7 +41,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/gauge.xpm" #include "icons/gauge.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -222,7 +222,7 @@ GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook,
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
m_gauge = new wxGauge(this, GaugePage_Gauge, m_range); m_gauge = new wxGauge(this, GaugePage_Gauge, m_range);
sizerRight->Add(m_gauge, 1, wxCENTRE | wxALL, 5); 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 m_sizerGauge = sizerRight; // save it to modify it later
// the 3 panes panes compose the window // the 3 panes panes compose the window
@@ -400,3 +400,4 @@ void GaugeWidgetsPage::StopTimer()
wxLogMessage(_T("Progress finished.")); wxLogMessage(_T("Progress finished."));
} }
#endif

View File

@@ -42,7 +42,7 @@
#include "wx/checklst.h" #include "wx/checklst.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/listbox.xpm" #include "icons/listbox.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -292,7 +292,7 @@ ListboxWidgetsPage::ListboxWidgetsPage(wxNotebook *notebook,
0, NULL, 0, NULL,
wxLB_HSCROLL); wxLB_HSCROLL);
sizerRight->Add(m_lbox, 1, wxGROW | wxALL, 5); 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 m_sizerLbox = sizerRight; // save it to modify it later
// the 3 panes panes compose the window // the 3 panes panes compose the window
@@ -512,3 +512,4 @@ void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
CreateLbox(); CreateLbox();
} }
#endif

View File

@@ -44,7 +44,7 @@
#include "wx/artprov.h" #include "wx/artprov.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/notebook.xpm" #include "icons/notebook.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -280,7 +280,7 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook,
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
m_notebook = new wxNotebook(this, NotebookPage_Notebook); m_notebook = new wxNotebook(this, NotebookPage_Notebook);
sizerRight->Add(m_notebook, 1, wxGROW | wxALL, 5); 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 m_sizerNotebook = sizerRight; // save it to modify it later
// the 3 panes panes compose the window // the 3 panes panes compose the window
@@ -543,3 +543,4 @@ void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event)
event.Skip(); event.Skip();
} }
#endif

View File

@@ -38,7 +38,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/radiobox.xpm" #include "icons/radiobox.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -66,7 +66,7 @@ enum
// default values for the number of radiobox items // default values for the number of radiobox items
static const size_t DEFAULT_NUM_ENTRIES = 12; 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 // RadioWidgetsPage
@@ -186,7 +186,8 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
m_radioDir = new wxRadioBox(this, -1, _T("Numbering:"), m_radioDir = new wxRadioBox(this, -1, _T("Numbering:"),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
WXSIZEOF(layoutDir), layoutDir); WXSIZEOF(layoutDir), layoutDir,
1, wxRA_SPECIFY_COLS);
sizerLeft->Add(m_radioDir, 0, wxGROW | wxALL, 5); sizerLeft->Add(m_radioDir, 0, wxGROW | wxALL, 5);
// if it's not defined, we can't change the radiobox direction // if it's not defined, we can't change the radiobox direction
@@ -195,12 +196,12 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
#endif // wxRA_LEFTTORIGHT #endif // wxRA_LEFTTORIGHT
wxSizer *sizerRow; wxSizer *sizerRow;
sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension"), sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension:"),
-1, -1,
&m_textMajorDim); &m_textMajorDim);
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons"), sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons:"),
-1, -1,
&m_textNumBtns); &m_textNumBtns);
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
@@ -218,32 +219,32 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change parameters")); wxStaticBox *box2 = new wxStaticBox(this, -1, _T("&Change parameters"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
sizerRow = CreateSizerWithTextAndLabel(_T("Current selection"), sizerRow = CreateSizerWithTextAndLabel(_T("Current selection:"),
-1, -1,
&m_textCurSel); &m_textCurSel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection, sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection,
_T("&Change selection"), _T("&Change selection:"),
-1, -1,
&m_textSel); &m_textSel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_Label, sizerRow = CreateSizerWithTextAndButton(RadioPage_Label,
_T("&Label for box"), _T("&Label for box:"),
-1, -1,
&m_textLabel); &m_textLabel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn, sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn,
_T("&Label for buttons"), _T("&Label for buttons:"),
-1, -1,
&m_textLabelBtns); &m_textLabelBtns);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
// right pane // right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
sizerRight->SetMinSize(250, 0); sizerRight->SetMinSize(150, 0);
m_sizerRadio = sizerRight; // save it to modify it later m_sizerRadio = sizerRight; // save it to modify it later
Reset(); Reset();
@@ -252,7 +253,7 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
// the 3 panes panes compose the window // the 3 panes panes compose the window
sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10);
sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 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 // final initializations
SetAutoLayout(TRUE); SetAutoLayout(TRUE);
@@ -453,3 +454,4 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event)
event.Enable(enable); event.Enable(enable);
} }
#endif

View File

@@ -39,7 +39,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/slider.xpm" #include "icons/slider.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -248,7 +248,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
// right pane // right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
sizerRight->SetMinSize(250, 0); sizerRight->SetMinSize(150, 0);
m_sizerSlider = sizerRight; // save it to modify it later m_sizerSlider = sizerRight; // save it to modify it later
Reset(); Reset();
@@ -256,7 +256,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
// the 3 panes panes compose the window // the 3 panes panes compose the window
sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); 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); sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
// final initializations // final initializations
@@ -468,3 +468,4 @@ void SliderWidgetsPage::OnSlider(wxCommandEvent& event)
wxLogMessage(_T("Slider value changed, now %d"), value); wxLogMessage(_T("Slider value changed, now %d"), value);
} }
#endif

View File

@@ -41,7 +41,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/spinbtn.xpm" #include "icons/spinbtn.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -224,7 +224,7 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
// right pane // right pane
wxSizer *sizerRight = new wxBoxSizer(wxVERTICAL); wxSizer *sizerRight = new wxBoxSizer(wxVERTICAL);
sizerRight->SetMinSize(250, 0); sizerRight->SetMinSize(150, 0);
m_sizerSpin = sizerRight; // save it to modify it later m_sizerSpin = sizerRight; // save it to modify it later
Reset(); Reset();
@@ -232,7 +232,7 @@ SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook,
// the 3 panes panes compose the window // the 3 panes panes compose the window
sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); 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); sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
// final initializations // final initializations
@@ -417,3 +417,4 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxCommandEvent& event)
wxLogMessage(_T("Spin control value changed, now %d"), value); wxLogMessage(_T("Spin control value changed, now %d"), value);
} }
#endif

View File

@@ -41,7 +41,7 @@
#include "wx/statline.h" #include "wx/statline.h"
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/statbox.xpm" #include "icons/statbox.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -219,14 +219,14 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
// right pane // right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
sizerRight->SetMinSize(250, 0); sizerRight->SetMinSize(150, 0);
m_sizerStatic = sizerRight; m_sizerStatic = sizerRight;
CreateStatic(); CreateStatic();
// the 3 panes panes compose the window // the 3 panes panes compose the window
sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); 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); sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
// final initializations // final initializations
@@ -367,3 +367,4 @@ void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& event)
m_statText->SetLabel(m_textLabel->GetValue()); m_statText->SetLabel(m_textLabel->GetValue());
} }
#endif

View File

@@ -41,6 +41,7 @@
#include "widgets.h" #include "widgets.h"
#if 1
#include "icons/text.xpm" #include "icons/text.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -322,7 +323,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
#endif // __WXMSW__ #endif // __WXMSW__
wxButton *btn = new wxButton(this, TextPage_Reset, _T("&Reset")); 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); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane // middle pane
@@ -330,19 +331,19 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL);
btn = new wxButton(this, TextPage_Set, _T("&Set text value")); 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")); 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")); 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")); 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")); 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:")); wxStaticBox *box4 = new wxStaticBox(this, -1, _T("&Info:"));
wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL); wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL);
@@ -422,7 +423,7 @@ TextWidgetsPage::TextWidgetsPage(wxNotebook *notebook, wxImageList *imaglist)
m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL); m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL);
Reset(); Reset();
CreateText(); CreateText();
m_sizerText->SetMinSize(250, 0); m_sizerText->SetMinSize(150, 0);
// the 3 panes panes compose the upper part of the window // the 3 panes panes compose the upper part of the window
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
@@ -755,4 +756,4 @@ void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
{ {
CreateText(); CreateText();
} }
#endif

View File

@@ -255,7 +255,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
); );
m_lboxLog = new wxListBox(m_panel, -1); m_lboxLog = new wxListBox(m_panel, -1);
sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5); sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5);
sizerDown->SetMinSize(100, 200); sizerDown->SetMinSize(100, 150);
wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL);
wxButton *btn = new wxButton(m_panel, Widgets_ClearLog, _T("Clear &log")); wxButton *btn = new wxButton(m_panel, Widgets_ClearLog, _T("Clear &log"));