]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
UnixWare compilation fix (include sys/filio.h)
[wxWidgets.git] / src / msw / notebook.cpp
index f2920163e9a8b308c776d548431f7dee76b8d4e3..05b4f2c0b5d0f8c56bce953b7c97820a635dc1c3 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     11.06.98
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -142,12 +142,11 @@ bool wxNotebook::Create(wxWindow *parent,
                         const wxString& name)
 {
     // base init
-    if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
+    if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL,
+                        wxDefaultValidator, name) )
         return FALSE;
 
-    // notebook, so explicitly specify 0 as last parameter
-    if ( !MSWCreateControl(WC_TABCONTROL, _T(""), pos, size,
-                style | wxTAB_TRAVERSAL) )
+    if ( !MSWCreateControl(WC_TABCONTROL, _T(""), pos, size) )
         return FALSE;
 
     SetBackgroundColour(wxColour(::GetSysColor(COLOR_BTNFACE)));
@@ -386,15 +385,6 @@ bool wxNotebook::DeleteAllPages()
   return TRUE;
 }
 
-// add a page to the notebook
-bool wxNotebook::AddPage(wxNotebookPage *pPage,
-                         const wxString& strText,
-                         bool bSelect,
-                         int imageId)
-{
-  return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
-}
-
 // same as AddPage() but does it at given position
 bool wxNotebook::InsertPage(int nPage,
                             wxNotebookPage *pPage,
@@ -406,6 +396,8 @@ bool wxNotebook::InsertPage(int nPage,
     wxCHECK_MSG( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE,
                  _T("invalid index in wxNotebook::InsertPage") );
 
+    wxASSERT_MSG( pPage->GetParent() == this,
+                    _T("notebook pages must have notebook as parent") );
 
     // add a new tab to the control
     // ----------------------------
@@ -604,6 +596,8 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
 // wxNotebook base class virtuals
 // ----------------------------------------------------------------------------
 
+#if wxUSE_CONSTRAINTS
+
 // override these 2 functions to do nothing: everything is done in OnSize
 
 void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
@@ -617,6 +611,8 @@ bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
   return TRUE;
 }
 
+#endif // wxUSE_CONSTRAINTS
+
 // ----------------------------------------------------------------------------
 // wxNotebook Windows message handlers
 // ----------------------------------------------------------------------------