]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/widgets.h
only check for lib directory for architectures which have multiple ABIs (Solaris...
[wxWidgets.git] / samples / widgets / widgets.h
index 7f36a57134f01086ae14e685e11ef9abd82a1ce4..0fb6e05b58d5a3bc76fcf7569745dcec7b206169 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Program:     wxWindows Widgets Sample
+// Program:     wxWidgets Widgets Sample
 // Name:        widgets.h
 // Purpose:     Common stuff for all widgets project files
 // Author:      Vadim Zeitlin
 // Name:        widgets.h
 // Purpose:     Common stuff for all widgets project files
 // Author:      Vadim Zeitlin
@@ -13,7 +13,7 @@
 #define _WX_SAMPLE_WIDGETS_H_
 
 class WXDLLEXPORT wxCheckBox;
 #define _WX_SAMPLE_WIDGETS_H_
 
 class WXDLLEXPORT wxCheckBox;
-class WXDLLEXPORT wxNotebook;
+class WXDLLEXPORT wxBookCtrlBase;
 class WXDLLEXPORT wxSizer;
 class WXDLLEXPORT wxTextCtrl;
 
 class WXDLLEXPORT wxSizer;
 class WXDLLEXPORT wxTextCtrl;
 
@@ -24,14 +24,26 @@ class WidgetsPageInfo;
 // all source files use wxImageList
 #include "wx/imaglist.h"
 
 // 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:
 // ----------------------------------------------------------------------------
 
 class WidgetsPage : public wxPanel
 {
 public:
-    WidgetsPage(wxNotebook *notebook);
+    WidgetsPage(wxBookCtrlBase *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
 
 protected:
     // several helper functions for page creation
@@ -40,24 +52,24 @@ protected:
     // (pointer to which will be saved in the provided variable if not NULL)
     // with the specified id
     wxSizer *CreateSizerWithText(wxControl *control,
     // (pointer to which will be saved in the provided variable if not NULL)
     // with the specified id
     wxSizer *CreateSizerWithText(wxControl *control,
-                                 wxWindowID id = -1,
+                                 wxWindowID id = wxID_ANY,
                                  wxTextCtrl **ppText = NULL);
 
     // create a sizer containing a label and a text ctrl
     wxSizer *CreateSizerWithTextAndLabel(const wxString& label,
                                  wxTextCtrl **ppText = NULL);
 
     // create a sizer containing a label and a text ctrl
     wxSizer *CreateSizerWithTextAndLabel(const wxString& label,
-                                         wxWindowID id = -1,
+                                         wxWindowID id = wxID_ANY,
                                          wxTextCtrl **ppText = NULL);
 
     // create a sizer containing a button and a text ctrl
     wxSizer *CreateSizerWithTextAndButton(wxWindowID idBtn,
                                           const wxString& labelBtn,
                                          wxTextCtrl **ppText = NULL);
 
     // create a sizer containing a button and a text ctrl
     wxSizer *CreateSizerWithTextAndButton(wxWindowID idBtn,
                                           const wxString& labelBtn,
-                                          wxWindowID id = -1,
+                                          wxWindowID id = wxID_ANY,
                                           wxTextCtrl **ppText = NULL);
 
     // create a checkbox and add it to the sizer
     wxCheckBox *CreateCheckBoxAndAddToSizer(wxSizer *sizer,
                                             const wxString& label,
                                           wxTextCtrl **ppText = NULL);
 
     // create a checkbox and add it to the sizer
     wxCheckBox *CreateCheckBoxAndAddToSizer(wxSizer *sizer,
                                             const wxString& label,
-                                            wxWindowID id = -1);
+                                            wxWindowID id = wxID_ANY);
 
 public:
     // the head of the linked list containinginfo about all pages
 
 public:
     // the head of the linked list containinginfo about all pages
@@ -71,7 +83,7 @@ public:
 class WidgetsPageInfo
 {
 public:
 class WidgetsPageInfo
 {
 public:
-    typedef WidgetsPage *(*Constructor)(wxNotebook *notebook,
+    typedef WidgetsPage *(*Constructor)(wxBookCtrlBase *book,
                                         wxImageList *imaglist);
 
     // our ctor
                                         wxImageList *imaglist);
 
     // our ctor
@@ -82,6 +94,8 @@ public:
     Constructor GetCtor() const { return m_ctor; }
     WidgetsPageInfo *GetNext() const { return m_next; }
 
     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;
 private:
     // the label of the page
     wxString m_label;
@@ -103,9 +117,9 @@ private:
 
 // and this one must be inserted somewhere in the source file
 #define IMPLEMENT_WIDGETS_PAGE(classname, 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(wxBookCtrlBase *book,                 \
                                       wxImageList *imaglist)                \
                                       wxImageList *imaglist)                \
-        { return new classname(notebook, imaglist); }                       \
+        { return new classname(book, imaglist); }                           \
     WidgetsPageInfo classname::                                             \
         ms_info##classname(wxCtorFor##classname, label)
 
     WidgetsPageInfo classname::                                             \
         ms_info##classname(wxCtorFor##classname, label)