]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/widgets.h
use wxDC::GetMultiLineTextExtent() instead of duplicating its code in wxButton::DoGet...
[wxWidgets.git] / samples / widgets / widgets.h
index 679b8b369a9f8144ba2f6b467b28f7153d8630ca..6c45ee11ff5d1a595f09f22491cd0bbbe5778df1 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
@@ -13,7 +13,7 @@
 #define _WX_SAMPLE_WIDGETS_H_
 
 class WXDLLEXPORT wxCheckBox;
-class WXDLLEXPORT wxNotebook;
+class WXDLLEXPORT wxBookCtrl;
 class WXDLLEXPORT wxSizer;
 class WXDLLEXPORT wxTextCtrl;
 
@@ -24,14 +24,23 @@ class WidgetsPageInfo;
 // 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;
 
 protected:
     // several helper functions for page creation
@@ -71,7 +80,7 @@ public:
 class WidgetsPageInfo
 {
 public:
-    typedef WidgetsPage *(*Constructor)(wxNotebook *notebook,
+    typedef WidgetsPage *(*Constructor)(wxBookCtrl *book,
                                         wxImageList *imaglist);
 
     // our ctor
@@ -105,9 +114,9 @@ private:
 
 // 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)