// control ids
enum
{
- ButtonPage_Reset = 100,
+ ButtonPage_Reset = wxID_HIGHEST,
ButtonPage_ChangeLabel,
ButtonPage_Button
};
class ButtonWidgetsPage : public WidgetsPage
{
public:
- ButtonWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist);
+ ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~ButtonWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_button; }
+ virtual void RecreateWidget() { CreateButton(); }
+
+ // lazy creation of the content
+ virtual void CreateContent();
protected:
// event handlers
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"));
+#if defined(__WXUNIVERSAL__)
+ #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"), FAMILY_CTRLS );
-ButtonWidgetsPage::ButtonWidgetsPage(wxBookCtrlBase *book,
+ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
- : WidgetsPage(book)
+ : WidgetsPage(book, imaglist, button_xpm)
{
- imaglist->Add(wxBitmap(button_xpm));
-
// init everything
m_chkBitmap =
m_chkImage =
m_button = (wxButton *)NULL;
m_sizerButton = (wxSizer *)NULL;
+}
+void ButtonWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
label = m_textLabel->GetValue();
}
- int flags = 0;
+ int flags = ms_defaultFlags;
switch ( m_radioHAlign->GetSelection() )
{
case ButtonHAlign_Left: