Use wxWindow instead of wxControl in the widgets sample.

Not all widgets are controls and we don't use any of wxControl-specific
methods in the sample, so don't require RecreateWidget() to return a wxControl
when a simple wxWindow suffices.

No real changes.
This commit is contained in:
Vadim Zeitlin
2015-07-31 17:53:55 +02:00
parent 2509e7927a
commit ce95913319
29 changed files with 30 additions and 30 deletions

View File

@@ -64,7 +64,7 @@ public:
m_sizerIndicator = NULL;
}
virtual wxControl *GetWidget() const wxOVERRIDE { return m_indicator; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_indicator; }
virtual void RecreateWidget() wxOVERRIDE;
// lazy creation of the content

View File

@@ -103,7 +103,7 @@ class BitmapComboBoxWidgetsPage : public ItemContainerWidgetsPage
public:
BitmapComboBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const wxOVERRIDE { return m_combobox; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_combobox; }
virtual wxItemContainer* GetContainer() const wxOVERRIDE { return m_combobox; }
virtual void RecreateWidget() wxOVERRIDE { CreateCombo(); }

View File

@@ -91,7 +91,7 @@ public:
ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~ButtonWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_button; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_button; }
virtual void RecreateWidget() wxOVERRIDE { CreateButton(); }
// lazy creation of the content

View File

@@ -75,7 +75,7 @@ public:
CheckBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~CheckBoxWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_checkbox; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_checkbox; }
virtual void RecreateWidget() wxOVERRIDE { CreateCheckbox(); }
// lazy creation of the content

View File

@@ -77,7 +77,7 @@ class ChoiceWidgetsPage : public ItemContainerWidgetsPage
public:
ChoiceWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const wxOVERRIDE { return m_choice; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_choice; }
virtual wxItemContainer* GetContainer() const wxOVERRIDE { return m_choice; }
virtual void RecreateWidget() wxOVERRIDE { CreateChoice(); }

View File

@@ -65,7 +65,7 @@ public:
ColourPickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~ColourPickerWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_clrPicker; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_clrPicker; }
virtual void RecreateWidget() wxOVERRIDE { RecreatePicker(); }
// lazy creation of the content

View File

@@ -94,7 +94,7 @@ class ComboboxWidgetsPage : public ItemContainerWidgetsPage
public:
ComboboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const wxOVERRIDE { return m_combobox; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_combobox; }
virtual wxTextEntryBase *GetTextEntry() const wxOVERRIDE { return m_combobox; }
virtual wxItemContainer* GetContainer() const wxOVERRIDE { return m_combobox; }
virtual void RecreateWidget() wxOVERRIDE { CreateCombo(); }

View File

@@ -70,7 +70,7 @@ public:
DatePickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~DatePickerWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_datePicker; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_datePicker; }
virtual void RecreateWidget() wxOVERRIDE { CreateDatePicker(); }
// lazy creation of the content

View File

@@ -98,7 +98,7 @@ public:
DirCtrlWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~DirCtrlWidgetsPage() {}
virtual wxControl *GetWidget() const wxOVERRIDE { return m_dirCtrl; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_dirCtrl; }
virtual void RecreateWidget() wxOVERRIDE { CreateDirCtrl(); }
// lazy creation of the content

View File

@@ -67,7 +67,7 @@ public:
DirPickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~DirPickerWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_dirPicker; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_dirPicker; }
virtual void RecreateWidget() wxOVERRIDE { RecreatePicker(); }
// lazy creation of the content

View File

@@ -69,7 +69,7 @@ class EditableListboxWidgetsPage : public WidgetsPage
public:
EditableListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const wxOVERRIDE { return m_lbox->GetListCtrl(); }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_lbox->GetListCtrl(); }
virtual void RecreateWidget() wxOVERRIDE { CreateLbox(); }
// lazy creation of the content

View File

@@ -70,7 +70,7 @@ public:
FileCtrlWidgetsPage( WidgetsBookCtrl *book, wxImageList *imaglist );
virtual ~FileCtrlWidgetsPage() {}
virtual wxControl *GetWidget() const wxOVERRIDE { return m_fileCtrl; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_fileCtrl; }
virtual void RecreateWidget() wxOVERRIDE { CreateFileCtrl(); }
// lazy creation of the content

View File

@@ -74,7 +74,7 @@ public:
FilePickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~FilePickerWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_filePicker; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_filePicker; }
virtual void RecreateWidget() wxOVERRIDE { RecreatePicker(); }
// lazy creation of the content

View File

@@ -65,7 +65,7 @@ public:
FontPickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~FontPickerWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_fontPicker; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_fontPicker; }
virtual void RecreateWidget() wxOVERRIDE { RecreatePicker(); }
// lazy creation of the content

View File

@@ -75,7 +75,7 @@ public:
GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~GaugeWidgetsPage();
virtual wxControl *GetWidget() const wxOVERRIDE { return m_gauge; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_gauge; }
virtual void RecreateWidget() wxOVERRIDE { CreateGauge(); }
// lazy creation of the content

View File

@@ -79,7 +79,7 @@ public:
HyperlinkWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~HyperlinkWidgetsPage() {}
virtual wxControl *GetWidget() const wxOVERRIDE { return m_hyperlink; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_hyperlink; }
virtual void RecreateWidget() wxOVERRIDE { CreateHyperlink(); }
// lazy creation of the content

View File

@@ -81,7 +81,7 @@ class ListboxWidgetsPage : public ItemContainerWidgetsPage
public:
ListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const wxOVERRIDE { return m_lbox; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_lbox; }
virtual wxItemContainer* GetContainer() const wxOVERRIDE { return m_lbox; }
virtual void RecreateWidget() wxOVERRIDE { CreateLbox(); }

View File

@@ -88,7 +88,7 @@ public:
BookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist, const char *const icon[]);
virtual ~BookWidgetsPage();
virtual wxControl *GetWidget() const wxOVERRIDE { return m_book; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_book; }
virtual void RecreateWidget() wxOVERRIDE { RecreateBook(); }
// lazy creation of the content

View File

@@ -90,7 +90,7 @@ class ODComboboxWidgetsPage : public ItemContainerWidgetsPage
public:
ODComboboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual wxControl *GetWidget() const wxOVERRIDE { return m_combobox; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_combobox; }
virtual wxTextEntryBase *GetTextEntry() const wxOVERRIDE
{ return m_combobox ? m_combobox->GetTextCtrl() : NULL; }
virtual wxItemContainer* GetContainer() const wxOVERRIDE { return m_combobox; }

View File

@@ -85,7 +85,7 @@ public:
RadioWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~RadioWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_radio; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_radio; }
virtual void RecreateWidget() wxOVERRIDE { CreateRadio(); }
// lazy creation of the content

View File

@@ -70,7 +70,7 @@ public:
SearchCtrlWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~SearchCtrlWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_srchCtrl; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_srchCtrl; }
virtual wxTextEntryBase *GetTextEntry() const wxOVERRIDE { return m_srchCtrl; }
virtual void RecreateWidget() wxOVERRIDE;

View File

@@ -96,7 +96,7 @@ public:
SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~SliderWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_slider; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_slider; }
virtual void RecreateWidget() wxOVERRIDE { CreateSlider(); }
// lazy creation of the content

View File

@@ -86,7 +86,7 @@ public:
SpinBtnWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~SpinBtnWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_spinbtn; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_spinbtn; }
virtual Widgets GetWidgets() const wxOVERRIDE
{
Widgets widgets(WidgetsPage::GetWidgets());

View File

@@ -52,7 +52,7 @@ public:
: WidgetsPage(book, imaglist, statbmp_xpm) {}
virtual void CreateContent() wxOVERRIDE;
virtual wxControl *GetWidget() const wxOVERRIDE { return m_statbmp; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_statbmp; }
virtual void RecreateWidget() wxOVERRIDE;
private:

View File

@@ -93,7 +93,7 @@ public:
StaticWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~StaticWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_statText; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_statText; }
virtual Widgets GetWidgets() const wxOVERRIDE
{
Widgets widgets;

View File

@@ -138,7 +138,7 @@ public:
TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~TextWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_text; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_text; }
virtual wxTextEntryBase *GetTextEntry() const wxOVERRIDE { return m_text; }
virtual void RecreateWidget() wxOVERRIDE { CreateText(); }

View File

@@ -66,7 +66,7 @@ public:
TimePickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~TimePickerWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_timePicker; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_timePicker; }
virtual void RecreateWidget() wxOVERRIDE { CreateTimePicker(); }
// lazy creation of the content

View File

@@ -89,7 +89,7 @@ public:
ToggleWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~ToggleWidgetsPage(){};
virtual wxControl *GetWidget() const wxOVERRIDE { return m_toggle; }
virtual wxWindow *GetWidget() const wxOVERRIDE { return m_toggle; }
virtual void RecreateWidget() wxOVERRIDE { CreateToggle(); }
// lazy creation of the content

View File

@@ -83,7 +83,7 @@ enum
ALL_CTRLS = 1 << ALL_PAGE
};
typedef wxVector<wxControl *> Widgets;
typedef wxVector<wxWindow *> Widgets;
// ----------------------------------------------------------------------------
// WidgetsPage: a book page demonstrating some widget
@@ -131,7 +131,7 @@ public:
const char *const icon[]);
// return the control shown by this page
virtual wxControl *GetWidget() const = 0;
virtual wxWindow *GetWidget() const = 0;
// return the control shown by this page, if it supports text entry interface
virtual wxTextEntryBase *GetTextEntry() const { return NULL; }