Use GetWidgets() in the widgets samples instead of GetWidget2().

Add a function which can be overridden to return an arbitrary number of
widgets instead of having just GetWidget() and GetWidget2(): spin control page
already uses 3 widgets (and defines GetWidget3() which is never called) and we
could have even more in the future. Just use a generic solution which will
always work.

The practical consequence of this is that the "Enable/Disable" menu item now
also enables and disables the wxSpinCtrlDouble in the spin page, see #12045.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-13 15:31:30 +00:00
parent 2d4a03f8a7
commit ca288f2afe
3 changed files with 61 additions and 36 deletions

View File

@@ -86,8 +86,14 @@ public:
virtual ~SpinBtnWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_spinbtn; }
virtual wxControl *GetWidget2() const { return m_spinctrl; }
virtual wxControl *GetWidget3() const { return m_spinctrldbl; }
virtual Widgets GetWidgets() const
{
Widgets widgets(WidgetsPage::GetWidgets());
widgets.push_back(m_spinctrl);
widgets.push_back(m_spinctrldbl);
return widgets;
}
virtual void RecreateWidget() { CreateSpin(); }
// lazy creation of the content