]> git.saurik.com Git - wxWidgets.git/commitdiff
Made widgets sample take up less space
authorJulian Smart <julian@anthemion.co.uk>
Tue, 9 Apr 2002 10:31:37 +0000 (10:31 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 9 Apr 2002 10:31:37 +0000 (10:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/widgets/button.cpp
samples/widgets/combobox.cpp
samples/widgets/gauge.cpp
samples/widgets/listbox.cpp
samples/widgets/notebook.cpp
samples/widgets/radiobox.cpp
samples/widgets/slider.cpp
samples/widgets/spinbtn.cpp
samples/widgets/static.cpp
samples/widgets/textctrl.cpp
samples/widgets/widgets.cpp

index c5c3dcac65e04072ae3854a7428964a75c0e0f8b..29e80d1b9257e99a1da10cce44ceaac955ac92be 100644 (file)
@@ -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
index e79c7e7d894e3a2af5d422ecb6d348938b6aac63..5570f43f1f4cfb7ed4422f3c8d791c6a0e55582c 100644 (file)
@@ -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
index bdf8a1824063bbeb4f879a21bcdf627f88f70878..353dd228a4d1a5c53d6614065d7e63d0eac01f5c 100644 (file)
@@ -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
index 43cb38118d018241ace6f736dff5ab45ca1c965d..dc145a775710b177e14d1c1ed9321b6a6d94ef7d 100644 (file)
@@ -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
index 170e535864971cf74af2171824307bff0cf02411..4491785d2f73c1bf02f9f4ca2d64a8f1d77e210f 100644 (file)
@@ -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
index 3f5fc02e39ee65a207306c43f205ccf86072ea9d..4e08f4b93728635ed46e9ad854ad55e319967eb1 100644 (file)
@@ -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
index 7c51fdf16c936187b6cc85ddb2b610c0705374f3..2aa0e4027b92a442f40f2f08c839d63fc8e9da28 100644 (file)
@@ -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
index f63898e586de79aa3510bab06f530f1542a67049..62b68b09169d4df0235d4a22f8fadcba10e64ada 100644 (file)
@@ -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
index 0802ff24548448ef5550acde2d2a38f10625ee42..991f823d1916d758bdd2ac898fc52449ed42dd8c 100644 (file)
@@ -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
index 16751dc7de5ebd1e2893d768a48da28a212a6d55..29dcea6c959eadca126dfcddaad55498db5b1842 100644 (file)
@@ -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
index c6069c0bb63504cc2ecfe148340ae92f27d66795..af1bb212723d5ebab60747f5258901748b0a45e9 100644 (file)
@@ -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"));