/////////////////////////////////////////////////////////////////////////////
-// Program: wxWindows Widgets Sample
+// Program: wxWidgets Widgets Sample
// Name: widgets.h
// Purpose: Common stuff for all widgets project files
// Author: Vadim Zeitlin
#define _WX_SAMPLE_WIDGETS_H_
class WXDLLEXPORT wxCheckBox;
-class WXDLLEXPORT wxNotebook;
+class WXDLLEXPORT wxBookCtrl;
class WXDLLEXPORT wxSizer;
class WXDLLEXPORT wxTextCtrl;
// all source files use wxImageList
#include "wx/imaglist.h"
+#if wxUSE_LOG && !defined(__SMARTPHONE__)
+ #define USE_LOG 1
+#else
+ #define USE_LOG 0
+#endif
+
// ----------------------------------------------------------------------------
-// WidgetsPage: a notebook page demonstrating some widget
+// WidgetsPage: a book page demonstrating some widget
// ----------------------------------------------------------------------------
class WidgetsPage : public wxPanel
{
public:
- WidgetsPage(wxNotebook *notebook);
+ WidgetsPage(wxBookCtrl *book);
+
+ // return the control shown by this page
+ virtual wxControl *GetWidget() const = 0;
+
+ // some pages show 2 controls, in this case override this one as well
+ virtual wxControl *GetWidget2() const { return NULL; }
protected:
// several helper functions for page creation
class WidgetsPageInfo
{
public:
- typedef WidgetsPage *(*Constructor)(wxNotebook *notebook,
+ typedef WidgetsPage *(*Constructor)(wxBookCtrl *book,
wxImageList *imaglist);
// our ctor
Constructor GetCtor() const { return m_ctor; }
WidgetsPageInfo *GetNext() const { return m_next; }
+ void SetNext(WidgetsPageInfo *next) { m_next = next; }
+
private:
// the label of the page
wxString m_label;
// and this one must be inserted somewhere in the source file
#define IMPLEMENT_WIDGETS_PAGE(classname, label) \
- WidgetsPage *wxCtorFor##classname(wxNotebook *notebook, \
+ WidgetsPage *wxCtorFor##classname(wxBookCtrl *book, \
wxImageList *imaglist) \
- { return new classname(notebook, imaglist); } \
+ { return new classname(book, imaglist); } \
WidgetsPageInfo classname:: \
ms_info##classname(wxCtorFor##classname, label)