]> git.saurik.com Git - wxWidgets.git/commitdiff
Reverted last wxBookCtrl change and added alignment check to notebook
authorJulian Smart <julian@anthemion.co.uk>
Tue, 6 Jun 2006 12:53:31 +0000 (12:53 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 6 Jun 2006 12:53:31 +0000 (12:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/bookctrl.h
src/common/bookctrl.cpp
src/generic/notebook.cpp
src/gtk/notebook.cpp
src/gtk1/notebook.cpp
src/mac/classic/notebmac.cpp
src/msw/notebook.cpp
src/os2/notebook.cpp
src/univ/notebook.cpp

index d1dfe04f5022779e39e30b428ba65b919b7eb9c8..4cea68ba31230c34f62e8833596c8277466017e6 100644 (file)
@@ -118,9 +118,6 @@ public:
     // calculate the size of the control from the size of its page
     virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const = 0;
 
-    // get the default alignment
-    virtual int GetDefaultAlignment() const { return wxBK_TOP; }
-
     // get/set size of area between book control area and page area
     unsigned int GetInternalBorder() const { return m_internalBorder; }
     void SetInternalBorder(unsigned int border) { m_internalBorder = border; }
@@ -130,7 +127,7 @@ public:
     int GetControlMargin() const { return m_controlMargin; }
 
     // returns true if we have wxBK_TOP or wxBK_BOTTOM style
-    bool IsVertical() const { return HasFlag(wxBK_ALIGN_MASK) ? HasFlag(wxBK_BOTTOM | wxBK_TOP) : (0 != (GetDefaultAlignment() & (wxBK_BOTTOM | wxBK_TOP))); }
+    bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); }
 
     // set/get option to shrink to fit current page
     void SetFitToCurrentPage(bool fit) { m_fitToCurrentPage = fit; }
index e8539c12f482089aee95e4951f411161f915422b..2ee818f20c7758147355ff7cbdd497a11b1d98ef 100644 (file)
@@ -268,11 +268,8 @@ wxRect wxBookCtrlBase::GetPageRect() const
 
     wxPoint pt;
     wxRect rectPage(pt, GetClientSize());
-    long style = GetWindowStyle();
-    if ( !HasFlag(wxBK_ALIGN_MASK) )
-        style = GetDefaultAlignment();
 
-    switch ( style )
+    switch ( GetWindowStyle() & wxBK_ALIGN_MASK )
     {
         default:
             wxFAIL_MSG( _T("unexpected alignment") );
index c3e7cb4821d0364773a3b878550abfa111146167..df0e5240659a41636de8736782a345c0fd11a6dc 100644 (file)
@@ -150,6 +150,9 @@ bool wxNotebook::Create(wxWindow *parent,
     // base init
     SetName(name);
 
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+    
     m_windowId = id == wxID_ANY ? NewControlId() : id;
 
     if (!wxControl::Create(parent, id, pos, size, style|wxNO_BORDER, wxDefaultValidator, name))
index c074dcb480ba713f21abbdc538802a8f067823a6..8c22e6af9e96ffe8aa94b8bc40268b825e692e48 100644 (file)
@@ -324,6 +324,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
index 6d647cc323073a3cc1ccb0a5936f5a259b27c07d..8acf3f1fd9f1ced142cc9100debbb1c2c7496f80 100644 (file)
@@ -324,6 +324,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
index 9bd1c414775c92cd6de5f2d1cfd347f3965c0a1e..4ef04c7b47ce5c80da203e95f28c732c8c3fb8c3 100644 (file)
@@ -187,6 +187,9 @@ bool wxNotebook::Create(wxWindow *parent,
     Rect bounds ;
     Str255 title ;
 
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+    
     MacPreControlCreate( parent , id ,  wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
 
     int tabstyle = kControlTabSmallNorthProc ;
index 193bd61d6c8ae47ef199cd4602afeba72dff7b19..e92244917aa1946d6ff8c3b05c974dffa3ff7575 100644 (file)
@@ -274,6 +274,8 @@ bool wxNotebook::Create(wxWindow *parent,
     if (style & wxNB_FLAT)
         style |= wxBORDER_SUNKEN;
 #endif
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
 
 #if !wxUSE_UXTHEME
     // ComCtl32 notebook tabs simply don't work unless they're on top if we have uxtheme, we can
index 7605b4d78faac87670358715fdf568273df7c71a..26f5212468d4ef390b9c00fc2c39f0d21883b91b 100644 (file)
@@ -124,6 +124,8 @@ bool wxNotebook::Create( wxWindow*       pParent,
                          long            lStyle,
                          const wxString& rsName )
 {
+    if ( (lStyle & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        lStyle |= wxBK_TOP;
     //
     // Base init
     //
index 1255a2fe5ce6836a15e8aeb8611ffcf6feb43228..407dc958ae3aee1c60cfaeefb4d53f8d4bc9094c 100644 (file)
@@ -121,6 +121,9 @@ bool wxNotebook::Create(wxWindow *parent,
                         long style,
                         const wxString& name)
 {
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+
     if ( !wxControl::Create(parent, id, pos, size, style,
                             wxDefaultValidator, name) )
         return false;