]> git.saurik.com Git - wxWidgets.git/commitdiff
deprecated wxBookCtrlSizer and wxNotebookSizer, they are no longer needed
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 24 Jun 2004 11:58:06 +0000 (11:58 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 24 Jun 2004 11:58:06 +0000 (11:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/xrc/xh_notbk.cpp
docs/changes.txt
include/wx/sizer.h
samples/display/display.cpp
samples/layout/layout.cpp
samples/widgets/widgets.cpp
src/common/sizer.cpp
src/html/helpfrm.cpp
src/xrc/xh_notbk.cpp

index e97598a22515d8c6d91d472c6945940e2bb4fdb3..1a0c7b14b4d834d7c3c0b0a924bcc40e1d43d9fd 100644 (file)
@@ -88,10 +88,7 @@ wxObject *wxNotebookXmlHandler::DoCreateResource()
         m_isInside = old_ins;
         m_notebook = old_par;
 
-        if (GetBool(wxT("usenotebooksizer"), false))
-            return new wxNotebookSizer(nb);
-        else
-            return nb;
+        return nb;
     }
 }
 
index d6efbf31c2c651966e11ee336992bf12f7504807..35cb4de59db34cc9f082f589a45983db8f3494e9 100644 (file)
@@ -59,6 +59,9 @@ INCOMPATIBLE CHANGES SINCE 2.4.x
 - Identical functionality of wxFileDialog::ParseWildcard,
   wxGenericDirCtrl::ParseFilter, Motif and MSW parsing native dialogs
   is now accessible in ::wxParseCommonDialogsFilter
+- wxNotebookSizer and wxBookCtrlSizer are now deprecated -- the are no longer
+  needed, you can treat wxNotebook as any other control and put it directly
+  into the sizer that was wxNotebookSizer's parent sizer in old code.
 
 
 
index ce907346bba9fdbd62b39d0547b6f66c884e4e30..804c618dbd8701a2ef5518421c40936e7ca7dac0 100644 (file)
@@ -518,6 +518,11 @@ private:
 
 #endif // wxUSE_STATBOX
 
+
+#if WXWIN_COMPATIBILITY_2_4
+// NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
+//     don't do anything. wxBookCtrl::DoGetBestSize does the job now.
+
 // ----------------------------------------------------------------------------
 // wxBookCtrlSizer
 // ----------------------------------------------------------------------------
@@ -531,14 +536,18 @@ class WXDLLEXPORT wxBookCtrl;
 class WXDLLEXPORT wxBookCtrlSizer : public wxSizer
 {
 public:
-    wxBookCtrlSizer(wxBookCtrl *bookctrl);
+    wxDEPRECATED( wxBookCtrlSizer(wxBookCtrl *bookctrl) );
 
+    wxBookCtrl *GetControl() const { return m_bookctrl; }
+    
     virtual void RecalcSizes();
     virtual wxSize CalcMin();
 
-    wxBookCtrl *GetControl() const { return m_bookctrl; }
-
 protected:
+    // this protected ctor lets us mark the real one above as deprecated
+    // and still has warning-free build of the library itself:
+    wxBookCtrlSizer() {}
+    
     wxBookCtrl *m_bookctrl;
 
 private:
@@ -556,7 +565,7 @@ class WXDLLEXPORT wxNotebook;
 class WXDLLEXPORT wxNotebookSizer : public wxBookCtrlSizer
 {
 public:
-    wxNotebookSizer(wxNotebook *nb);
+    wxDEPRECATED( wxNotebookSizer(wxNotebook *nb) );
 
     wxNotebook *GetNotebook() const { return (wxNotebook *)m_bookctrl; }
 
@@ -569,5 +578,8 @@ private:
 
 #endif // wxUSE_BOOKCTRL
 
+#endif // WXWIN_COMPATIBILITY_2_4
+
+
 #endif // __WXSIZER_H__
 
index 47fe984393cd3b6b4a5ddf63704a90b77b83a7a0..22a94cf0b689c96fcbb060ae82f22ce76e90cd7c 100644 (file)
@@ -293,10 +293,11 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
                                              (unsigned long)nDpy));
     }
 
-    wxNotebookSizer *notebookSizer = new wxNotebookSizer(m_notebook);
-    panel->SetSizer(notebookSizer);
-    notebookSizer->Fit(this);
-    notebookSizer->SetSizeHints(this);
+    wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
+    sizer->Add(m_notebook, 1, wxEXPAND);
+    panel->SetSizer(sizer);
+    sizer->Fit(this);
+    sizer->SetSizeHints(this);
 }
 
 wxString MyFrame::VideoModeToText(const wxVideoMode& mode)
index ad7d19a860ff4a7d484b78ffed221934b8f440c0..5a7e7a8c5943774c64922185bddea3bf42a6c29b 100644 (file)
@@ -326,8 +326,7 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxChar *title)
     wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
 
     wxNotebook *notebook = new wxNotebook( this, wxID_ANY );
-    wxNotebookSizer *nbs = new wxNotebookSizer( notebook );
-    topsizer->Add( nbs, 1, wxGROW );
+    topsizer->Add( notebook, 1, wxGROW );
 
     wxButton *button = new wxButton( this, wxID_OK, _T("OK") );
     topsizer->Add( button, 0, wxALIGN_RIGHT | wxALL, 10 );
index 27ff78f92c4429e85697164fd20a667d4ae7d223..c31cd567c34b7ec2eecfcb4f45c15adb895f8b31 100644 (file)
@@ -253,7 +253,6 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
     m_notebook = new wxNotebook(m_panel, wxID_ANY, wxDefaultPosition,
         wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
     InitNotebook();
-    wxSizer *sizerUp = new wxNotebookSizer(m_notebook);
 
     // the lower one only has the log listbox and a button to clear it
     wxSizer *sizerDown = new wxStaticBoxSizer(
@@ -273,7 +272,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
     sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5);
 
     // put everything together
-    sizerTop->Add(sizerUp, 1, wxGROW | (wxALL & ~(wxTOP | wxBOTTOM)), 10);
+    sizerTop->Add(m_notebook, 1, wxGROW | (wxALL & ~(wxTOP | wxBOTTOM)), 10);
     sizerTop->Add(0, 5, 0, wxGROW); // spacer in between
     sizerTop->Add(sizerDown, 0,  wxGROW | (wxALL & ~wxTOP), 10);
 
index 7123f19c6a62a97926ef7082a6ea123758389bc1..de1f1c21641b40c352e84ed8d7f9c0b97145ce55 100644 (file)
 #include "wx/sizer.h"
 #include "wx/utils.h"
 #include "wx/statbox.h"
-#include "wx/notebook.h"
 #include "wx/listimpl.cpp"
+#if WXWIN_COMPATIBILITY_2_4
+    #include "wx/notebook.h"
+#endif
 
 #ifdef __WXMAC__
 #   include "wx/mac/uma.h"
@@ -41,12 +43,6 @@ IMPLEMENT_CLASS(wxBoxSizer, wxSizer)
 #if wxUSE_STATBOX
 IMPLEMENT_CLASS(wxStaticBoxSizer, wxBoxSizer)
 #endif
-#if wxUSE_BOOKCTRL
-IMPLEMENT_CLASS(wxBookCtrlSizer, wxSizer)
-#if wxUSE_NOTEBOOK
-IMPLEMENT_CLASS(wxNotebookSizer, wxBookCtrlSizer)
-#endif // wxUSE_NOTEBOOK
-#endif // wxUSE_BOOKCTRL
 
 WX_DEFINE_EXPORTED_LIST( wxSizerItemList );
 
@@ -1643,10 +1639,20 @@ void wxStaticBoxSizer::ShowItems( bool show )
 
 #endif // wxUSE_STATBOX
 
+
+#if WXWIN_COMPATIBILITY_2_4
+
 // ----------------------------------------------------------------------------
 // wxNotebookSizer
 // ----------------------------------------------------------------------------
 
+#if wxUSE_BOOKCTRL
+IMPLEMENT_CLASS(wxBookCtrlSizer, wxSizer)
+#if wxUSE_NOTEBOOK
+IMPLEMENT_CLASS(wxNotebookSizer, wxBookCtrlSizer)
+#endif // wxUSE_NOTEBOOK
+#endif // wxUSE_BOOKCTRL
+
 #if wxUSE_BOOKCTRL
 
 wxBookCtrlSizer::wxBookCtrlSizer(wxBookCtrl *bookctrl)
@@ -1698,14 +1704,15 @@ wxSize wxBookCtrlSizer::CalcMin()
     return wxSize( maxX, maxY ) + sizeBorder;
 }
 
-
 #if wxUSE_NOTEBOOK
 
 wxNotebookSizer::wxNotebookSizer(wxNotebook *nb)
-    : wxBookCtrlSizer(nb)
 {
+    wxASSERT_MSG( nb, wxT("wxNotebookSizer needs a control") );
+    m_bookctrl = nb;
 }
 
 #endif // wxUSE_NOTEBOOOK
 #endif // wxUSE_BOOKCTRL
 
+#endif // WXWIN_COMPATIBILITY_2_4
index 83991409d8b6546db2430cc890c83e07233d564c..6cb88dfe1bd10e389ffaeb3a955891e9113adef8 100644 (file)
@@ -307,10 +307,9 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
         m_NavigPan = new wxPanel(m_Splitter, wxID_ANY);
         m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
                                          wxDefaultPosition, wxDefaultSize);
-        wxNotebookSizer *nbs = new wxNotebookSizer(m_NavigNotebook);
 
         navigSizer = new wxBoxSizer(wxVERTICAL);
-        navigSizer->Add(nbs, 1, wxEXPAND);
+        navigSizer->Add(m_NavigNotebook, 1, wxEXPAND);
 
         m_NavigPan->SetSizer(navigSizer);
     }
index e97598a22515d8c6d91d472c6945940e2bb4fdb3..1a0c7b14b4d834d7c3c0b0a924bcc40e1d43d9fd 100644 (file)
@@ -88,10 +88,7 @@ wxObject *wxNotebookXmlHandler::DoCreateResource()
         m_isInside = old_ins;
         m_notebook = old_par;
 
-        if (GetBool(wxT("usenotebooksizer"), false))
-            return new wxNotebookSizer(nb);
-        else
-            return nb;
+        return nb;
     }
 }