// 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; }
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; }
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") );
// 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))
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 ))
{
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 ))
{
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 ;
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
long lStyle,
const wxString& rsName )
{
+ if ( (lStyle & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+ lStyle |= wxBK_TOP;
//
// Base init
//
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;