git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61005
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
// separator size
curSize = GetToolBar()->GetToolSize();
{
// separator size
curSize = GetToolBar()->GetToolSize();
- if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetToolBar()->GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
curSize.y /= 4;
else
curSize.x /= 4;
curSize.y /= 4;
else
curSize.x /= 4;
if (usesNative && (m_macToolbar == NULL))
return bResult;
if (usesNative && (m_macToolbar == NULL))
return bResult;
- if (usesNative && ((GetWindowStyleFlag() & wxTB_VERTICAL) != 0))
+ if (usesNative && ((GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT|wxTB_BOTTOM)) != 0))
return bResult;
WindowRef tlw = MAC_WXHWND(MacGetTopLevelWindowRef());
return bResult;
WindowRef tlw = MAC_WXHWND(MacGetTopLevelWindowRef());
if ( y + cursize.y > maxHeight )
maxHeight = y + cursize.y;
if ( y + cursize.y > maxHeight )
maxHeight = y + cursize.y;
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
{
int x1 = x + ( maxToolWidth - cursize.x ) / 2;
tool->SetPosition( wxPoint(x1, y) );
{
int x1 = x + ( maxToolWidth - cursize.x ) / 2;
tool->SetPosition( wxPoint(x1, y) );
}
// update the item positioning state
}
// update the item positioning state
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
y += cursize.y + kwxMacToolSpacing;
else
x += cursize.x + kwxMacToolSpacing;
y += cursize.y + kwxMacToolSpacing;
else
x += cursize.x + kwxMacToolSpacing;
if (m_macUsesNativeToolbar)
GetParent()->SetSize( tlw_sz );
if (m_macUsesNativeToolbar)
GetParent()->SetSize( tlw_sz );
- if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
+ if ( GetWindowStyleFlag() & (wxTB_TOP|wxTB_BOTTOM) )
{
// if not set yet, only one row
if ( m_maxRows <= 0 )
SetRows( 1 );
m_minWidth = maxWidth;
{
// if not set yet, only one row
if ( m_maxRows <= 0 )
SetRows( 1 );
m_minWidth = maxWidth;
maxHeight += m_yMargin + kwxMacToolBarTopMargin;
m_minHeight = m_maxHeight = maxHeight;
}
maxHeight += m_yMargin + kwxMacToolBarTopMargin;
m_minHeight = m_maxHeight = maxHeight;
}
SetRows( GetToolsCount() );
m_minHeight = maxHeight;
SetRows( GetToolsCount() );
m_minHeight = maxHeight;
maxWidth += m_xMargin + kwxMacToolBarLeftMargin;
m_minWidth = m_maxWidth = maxWidth;
}
maxWidth += m_xMargin + kwxMacToolBarLeftMargin;
m_minWidth = m_maxWidth = maxWidth;
}
bool wantNativeToolbar, ownToolbarInstalled;
// attempt to install the native toolbar
bool wantNativeToolbar, ownToolbarInstalled;
// attempt to install the native toolbar
- wantNativeToolbar = ((GetWindowStyleFlag() & wxTB_VERTICAL) == 0);
+ wantNativeToolbar = ((GetWindowStyleFlag() & (wxTB_LEFT|wxTB_BOTTOM|wxTB_RIGHT)) == 0);
MacInstallNativeToolbar( wantNativeToolbar );
(void)MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (!ownToolbarInstalled)
MacInstallNativeToolbar( wantNativeToolbar );
(void)MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (!ownToolbarInstalled)
wxASSERT( tool->GetControlHandle() == NULL );
toolSize.x /= 4;
toolSize.y /= 4;
wxASSERT( tool->GetControlHandle() == NULL );
toolSize.x /= 4;
toolSize.y /= 4;
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
toolrect.bottom = toolSize.y;
else
toolrect.right = toolSize.x;
toolrect.bottom = toolSize.y;
else
toolrect.right = toolSize.x;
wxToolBarTool *tool2 = (wxToolBarTool*) node->GetData();
wxPoint pt = tool2->GetPosition();
wxToolBarTool *tool2 = (wxToolBarTool*) node->GetData();
wxPoint pt = tool2->GetPosition();
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
pt.y -= sz.y;
else
pt.x -= sz.x;
pt.y -= sz.y;
else
pt.x -= sz.x;
{
// separator size
curSize = GetToolBar()->GetToolSize();
{
// separator size
curSize = GetToolBar()->GetToolSize();
- if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetToolBar()->GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
curSize.y /= 4;
else
curSize.x /= 4;
curSize.y /= 4;
else
curSize.x /= 4;
if (usesNative && (m_macToolbar == NULL))
return bResult;
if (usesNative && (m_macToolbar == NULL))
return bResult;
- if (usesNative && ((GetWindowStyleFlag() & wxTB_VERTICAL) != 0))
+ if (usesNative && ((GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT|wxTB_BOTTOM)) != 0))
return bResult;
WXWindow tlw = MacGetTopLevelWindowRef();
return bResult;
WXWindow tlw = MacGetTopLevelWindowRef();
if ( y + cursize.y > maxHeight )
maxHeight = y + cursize.y;
if ( y + cursize.y > maxHeight )
maxHeight = y + cursize.y;
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
{
int x1 = x + ( maxToolWidth - cursize.x ) / 2;
tool->SetPosition( wxPoint(x1, y) );
{
int x1 = x + ( maxToolWidth - cursize.x ) / 2;
tool->SetPosition( wxPoint(x1, y) );
}
// update the item positioning state
}
// update the item positioning state
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
y += cursize.y + kwxMacToolSpacing;
else
x += cursize.x + kwxMacToolSpacing;
y += cursize.y + kwxMacToolSpacing;
else
x += cursize.x + kwxMacToolSpacing;
node = node->GetNext();
}
node = node->GetNext();
}
- if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
+ if ( GetWindowStyleFlag() & (wxTB_TOP|wxTB_BOTTOM) )
{
// if not set yet, only one row
if ( m_maxRows <= 0 )
SetRows( 1 );
m_minWidth = maxWidth;
{
// if not set yet, only one row
if ( m_maxRows <= 0 )
SetRows( 1 );
m_minWidth = maxWidth;
maxHeight += m_yMargin + kwxMacToolBarTopMargin;
m_minHeight = m_maxHeight = maxHeight;
}
maxHeight += m_yMargin + kwxMacToolBarTopMargin;
m_minHeight = m_maxHeight = maxHeight;
}
SetRows( GetToolsCount() );
m_minHeight = maxHeight;
SetRows( GetToolsCount() );
m_minHeight = maxHeight;
maxWidth += m_xMargin + kwxMacToolBarLeftMargin;
m_minWidth = m_maxWidth = maxWidth;
}
maxWidth += m_xMargin + kwxMacToolBarLeftMargin;
m_minWidth = m_maxWidth = maxWidth;
}
bool wantNativeToolbar, ownToolbarInstalled;
// attempt to install the native toolbar
bool wantNativeToolbar, ownToolbarInstalled;
// attempt to install the native toolbar
- wantNativeToolbar = ((GetWindowStyleFlag() & wxTB_VERTICAL) == 0);
+ wantNativeToolbar = ((GetWindowStyleFlag() & (wxTB_LEFT|wxTB_BOTTOM|wxTB_RIGHT)) == 0);
MacInstallNativeToolbar( wantNativeToolbar );
(void)MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (!ownToolbarInstalled)
MacInstallNativeToolbar( wantNativeToolbar );
(void)MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (!ownToolbarInstalled)
wxASSERT( tool->GetControlHandle() == NULL );
toolSize.x /= 4;
toolSize.y /= 4;
wxASSERT( tool->GetControlHandle() == NULL );
toolSize.x /= 4;
toolSize.y /= 4;
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
toolrect.size.height = toolSize.y;
else
toolrect.size.width = toolSize.x;
toolrect.size.height = toolSize.y;
else
toolrect.size.width = toolSize.x;
wxToolBarTool *tool2 = (wxToolBarTool*) node->GetData();
wxPoint pt = tool2->GetPosition();
wxToolBarTool *tool2 = (wxToolBarTool*) node->GetData();
wxPoint pt = tool2->GetPosition();
- if ( GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( GetWindowStyleFlag() & (wxTB_LEFT|wxTB_RIGHT) )
pt.y -= sz.y;
else
pt.x -= sz.x;
pt.y -= sz.y;
else
pt.x -= sz.x;