// control ids
enum
{
- CheckboxPage_Reset = 100,
+ CheckboxPage_Reset = wxID_HIGHEST,
CheckboxPage_ChangeLabel,
CheckboxPage_Check,
CheckboxPage_Uncheck,
class CheckBoxWidgetsPage : public WidgetsPage
{
public:
- CheckBoxWidgetsPage(wxNotebook *notebook, wxImageList *imaglist);
+ CheckBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~CheckBoxWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_checkbox; }
+ virtual void RecreateWidget() { CreateCheckbox(); }
+
+ // lazy creation of the content
+ virtual void CreateContent();
protected:
// event handlers
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"));
+#if defined(__WXUNIVERSAL__)
+ #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), FAMILY_CTRLS );
-CheckBoxWidgetsPage::CheckBoxWidgetsPage(wxNotebook *notebook,
- wxImageList *imaglist)
- : WidgetsPage(notebook)
+CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book,
+ wxImageList *imaglist)
+ : WidgetsPage(book, imaglist, checkbox_xpm)
{
- imaglist->Add(wxBitmap(checkbox_xpm));
+}
+void CheckBoxWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
Reset();
SetSizer(sizerTop);
-
- sizerTop->Fit(this);
}
void CheckBoxWidgetsPage::Reset()
delete m_checkbox;
- int flags = 0;
+ int flags = ms_defaultFlags;
if ( m_chkRight->IsChecked() )
flags |= wxALIGN_RIGHT;