projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support for custom controls, first attempt
[wxWidgets.git]
/
samples
/
widgets
/
button.cpp
diff --git
a/samples/widgets/button.cpp
b/samples/widgets/button.cpp
index 7c4dd08266772b523ebb9e58cb85ec108d818678..914fa1a08b347d7eb210c85dcb5ed7d41d34b660 100644
(file)
--- a/
samples/widgets/button.cpp
+++ b/
samples/widgets/button.cpp
@@
-85,6
+85,9
@@
public:
virtual wxControl *GetWidget() const { return m_button; }
virtual void RecreateWidget() { CreateButton(); }
virtual wxControl *GetWidget() const { return m_button; }
virtual void RecreateWidget() { CreateButton(); }
+ // lazy creation of the content
+ virtual void CreateContent();
+
protected:
// event handlers
void OnCheckOrRadioBox(wxCommandEvent& event);
protected:
// event handlers
void OnCheckOrRadioBox(wxCommandEvent& event);
@@
-183,7
+186,10
@@
ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
m_button = (wxButton *)NULL;
m_sizerButton = (wxSizer *)NULL;
m_button = (wxButton *)NULL;
m_sizerButton = (wxSizer *)NULL;
+}
+void ButtonWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
@@
-269,8
+275,6
@@
ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
CreateButton();
SetSizer(sizerTop);
CreateButton();
SetSizer(sizerTop);
-
- sizerTop->Fit(this);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------