]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/static.cpp
1552971 ] Add flag for wxODComboBox::OnDrawItem to indicate selection
[wxWidgets.git] / samples / widgets / static.cpp
index 8905378377e2c1462344d58af4eb3ff8c3936dc2..fe33e6667cab7b31b650bea5838380c3e0234d77 100644 (file)
@@ -51,7 +51,7 @@
 // control ids
 enum
 {
-    StaticPage_Reset = 100,
+    StaticPage_Reset = wxID_HIGHEST,
     StaticPage_BoxText,
     StaticPage_LabelText
 };
@@ -139,9 +139,15 @@ END_EVENT_TABLE()
 class StaticWidgetsPage : public WidgetsPage
 {
 public:
-    StaticWidgetsPage(wxNotebook *notebook, wxImageList *imaglist);
+    StaticWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
     virtual ~StaticWidgetsPage(){};
 
+    virtual wxControl *GetWidget() const { return m_statText; }
+    virtual void RecreateWidget() { CreateStatic(); }
+
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnCheckOrRadioBox(wxCommandEvent& event);
@@ -201,14 +207,14 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"));
+IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"),
+                       (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS)
+                       );
 
-StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
-                                       wxImageList *imaglist)
-                  : WidgetsPage(notebook)
+StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book,
+                                     wxImageList *imaglist)
+                  : WidgetsPage(book, imaglist, statbox_xpm)
 {
-    imaglist->Add(wxBitmap(statbox_xpm));
-
     // init everything
     m_chkVert =
     m_chkAutoResize = (wxCheckBox *)NULL;
@@ -224,7 +230,10 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook,
     m_staticBox = (wxStaticBox *)NULL;
     m_sizerStatBox = (wxStaticBoxSizer *)NULL;
     m_sizerStatic = (wxSizer *)NULL;
+}
 
+void StaticWidgetsPage::CreateContent()
+{
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
     // left pane
@@ -331,7 +340,7 @@ void StaticWidgetsPage::CreateStatic()
     }
 
     int flagsBox = 0,
-        flagsText = 0;
+        flagsText = ms_defaultFlags;
 
     if ( !m_chkAutoResize->GetValue() )
     {