From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Fri, 28 Jul 2006 23:46:32 +0000 (+0000)
Subject: added HasMultiplePages()
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e71c530e030e5aee15f6cc925c8cd477aa351d13

added HasMultiplePages()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index 019e5b90b1..f30b18f366 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -1400,6 +1400,18 @@ Returns {\tt true} if this window has the current mouse capture.
 Returns \texttt{true} if the window has the given \arg{flag} bit set.
 
 
+\membersection{wxWindow::HasMultiplePages}\label{wxwindowhasmultiplepages}
+
+\constfunc{virtual bool}{HasMultiplePages}{\void}
+
+This method should be overridden to return \texttt{true} if this window has
+multiple pages. All standard class with multiple pages such as 
+\helpref{wxNotebook}{wxnotebook}, \helpref{wxListbook}{wxlistbook} and 
+\helpref{wxTreebook}{wxtreebook} already override it to return \texttt{true}
+and user-defined classes with similar behaviour should do it as well to allow
+the library to handle such windows appropriately.
+
+
 \membersection{wxWindow::HasScrollbar}\label{wxwindowhasscrollbar}
 
 \constfunc{virtual bool}{HasScrollbar}{\param{int }{orient}}
diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h
index 50b6dcdf13..6d3c80b670 100644
--- a/include/wx/bookctrl.h
+++ b/include/wx/bookctrl.h
@@ -213,6 +213,10 @@ public:
         return wxNOT_FOUND;
     }
 
+
+    // we do have multiple pages
+    virtual bool HasMultiplePages() const { return true; }
+
 protected:
     // Should we accept NULL page pointers in Add/InsertPage()?
     //
diff --git a/include/wx/window.h b/include/wx/window.h
index 9f852eec40..8f76c9e7e7 100644
--- a/include/wx/window.h
+++ b/include/wx/window.h
@@ -865,6 +865,10 @@ public:
         { return DoPopupMenu(menu, x, y); }
 #endif // wxUSE_MENUS
 
+    // override this method to return true for controls having multiple pages
+    virtual bool HasMultiplePages() const { return false; }
+
+
     // scrollbars
     // ----------