X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/206d3a16caa7a4e626395ae52cc8f7e0225e202d..4301e38a459edc366aba62fbbaf8f7b4ed8effb6:/samples/widgets/static.cpp diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index b841ed19f8..63cfb0d583 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Program: wxWindows Widgets Sample +// Program: wxWidgets Widgets Sample // Name: static.cpp // Purpose: Part of the widgets sample showing various static controls // Author: Vadim Zeitlin @@ -139,8 +139,10 @@ END_EVENT_TABLE() class StaticWidgetsPage : public WidgetsPage { public: - StaticWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); - virtual ~StaticWidgetsPage(); + StaticWidgetsPage(wxBookCtrl *book, wxImageList *imaglist); + virtual ~StaticWidgetsPage(){}; + + virtual wxControl *GetWidget() const { return m_statText; } protected: // event handlers @@ -170,7 +172,9 @@ protected: wxStaticBox *m_staticBox; wxStaticBoxSizer *m_sizerStatBox; wxStaticText *m_statText; +#if wxUSE_STATLINE wxStaticLine *m_statLine; +#endif // wxUSE_STATLINE wxSizer *m_sizerStatic; // the text entries for command parameters @@ -201,9 +205,9 @@ END_EVENT_TABLE() IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static")); -StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook, - wxImageList *imaglist) - : WidgetsPage(notebook) +StaticWidgetsPage::StaticWidgetsPage(wxBookCtrl *book, + wxImageList *imaglist) + : WidgetsPage(book) { imaglist->Add(wxBitmap(statbox_xpm)); @@ -214,7 +218,9 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook, m_radioHAlign = m_radioVAlign = (wxRadioBox *)NULL; +#if wxUSE_STATLINE m_statLine = (wxStaticLine *)NULL; +#endif // wxUSE_STATLINE m_statText = (wxStaticText *)NULL; m_staticBox = (wxStaticBox *)NULL; @@ -298,10 +304,6 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook, sizerTop->Fit(this); } -StaticWidgetsPage::~StaticWidgetsPage() -{ -} - // ---------------------------------------------------------------------------- // operations // ---------------------------------------------------------------------------- @@ -325,7 +327,9 @@ void StaticWidgetsPage::CreateStatic() // delete m_sizerStatBox; -- deleted by Remove() m_sizerStatic->Remove(m_sizerStatBox); delete m_statText; +#if wxUSE_STATLINE delete m_statLine; +#endif // wxUSE_STATLINE } int flagsBox = 0, @@ -388,12 +392,16 @@ void StaticWidgetsPage::CreateStatic() wxDefaultPosition, wxDefaultSize, flagsText); +#if wxUSE_STATLINE m_statLine = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, isVert ? wxLI_VERTICAL : wxLI_HORIZONTAL); +#endif // wxUSE_STATLINE m_sizerStatBox->Add(m_statText, 1, wxGROW | wxALL, 5); +#if wxUSE_STATLINE m_sizerStatBox->Add(m_statLine, 0, wxGROW | wxALL, 5); +#endif // wxUSE_STATLINE m_sizerStatBox->Add(0, 0, 1); m_sizerStatic->Add(m_sizerStatBox, 1, wxGROW);