]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/toggle.cpp
Split wxTextCompleter into a base class and wxTextCompleterSimple.
[wxWidgets.git] / samples / widgets / toggle.cpp
index 214474f7ade23e565e24397ee4e3b6764f905119..b568226580024495cd286ff56392346630efa039 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     27 Sep 2003
 // Id:          $Id$
 // Copyright:   (c) 2006 Wlodzmierz Skiba
 // Created:     27 Sep 2003
 // Id:          $Id$
 // Copyright:   (c) 2006 Wlodzmierz Skiba
-// License:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -64,6 +64,9 @@ public:
     virtual wxControl *GetWidget() const { return m_toggle; }
     virtual void RecreateWidget() { CreateToggle(); }
 
     virtual wxControl *GetWidget() const { return m_toggle; }
     virtual void RecreateWidget() { CreateToggle(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnButtonReset(wxCommandEvent& event);
 protected:
     // event handlers
     void OnButtonReset(wxCommandEvent& event);
@@ -116,6 +119,10 @@ IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, wxT("ToggleButton"),
 ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
                                      wxImageList *imaglist)
                       :WidgetsPage(book, imaglist, toggle_xpm)
 ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
                                      wxImageList *imaglist)
                       :WidgetsPage(book, imaglist, toggle_xpm)
+{
+}
+
+void ToggleWidgetsPage::CreateContent()
 {
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
 {
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
@@ -125,14 +132,14 @@ ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
 //    wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
 
     // middle pane
 //    wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
 
     // middle pane
-    wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations"));
+    wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
     wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
 
     wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel,
     wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
 
     wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel,
-                                                     _T("Change label"),
+                                                     wxT("Change label"),
                                                      wxID_ANY,
                                                      &m_textLabel);
                                                      wxID_ANY,
                                                      &m_textLabel);
-    m_textLabel->SetValue(_T("&Toggle me!"));
+    m_textLabel->SetValue(wxT("&Toggle me!"));
 
     sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
 
 
     sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
 
@@ -156,8 +163,6 @@ ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
     Reset();
 
     SetSizer(sizerTop);
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void ToggleWidgetsPage::Reset()
 }
 
 void ToggleWidgetsPage::Reset()