EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
END_EVENT_TABLE()
-IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
-
#define WX_MAC_STATUSBAR_HEIGHT 18
// ----------------------------------------------------------------------------
long style,
const wxString& name)
{
-
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
return false;
{
pt.x += w;
}
- else if ( HasFlag(wxTB_TOP) )
+ else if ( toolbar->HasFlag(wxTB_TOP) )
{
#if !wxOSX_USE_NATIVE_TOOLBAR
pt.y += h;
}
}
-void wxFrame::HandleResized( double timestampsec )
-{
- // according to the other ports we handle this within the OS level
- // resize event, not within a wxSizeEvent
-
- PositionBars();
-
- wxNonOwnedWindow::HandleResized( timestampsec );
-}
-
#if wxUSE_MENUS
void wxFrame::DetachMenuBar()
{
- if ( m_frameMenuBar )
- m_frameMenuBar->UnsetInvokingWindow();
-
wxFrameBase::DetachMenuBar();
}
{
#if wxOSX_USE_CARBON
wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( (WXWindow) FrontNonFloatingWindow() ) , wxFrame );
+#elif wxOSX_USE_COCOA
+ wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( wxOSXGetMainWindow() ) , wxFrame );
#else
- wxFrame* tlf = (wxFrame*) wxTheApp->GetTopWindow();
+ wxFrame* tlf = wxDynamicCast( wxTheApp->GetTopWindow(), wxFrame );
#endif
bool makeCurrent = false;
if (m_frameMenuBar)
{
- m_frameMenuBar->SetInvokingWindow( this );
if (makeCurrent)
m_frameMenuBar->MacInstallMenuBar();
}
int w, h;
toolbar->GetSize(&w, &h);
- if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL )
+ if ( toolbar->IsVertical() )
{
if ( x )
*x -= w;
}
+ else if ( toolbar->HasFlag( wxTB_BOTTOM ) )
+ {
+ if ( y )
+ *y -= h;
+ }
else
{
#if !wxOSX_USE_NATIVE_TOOLBAR
{
int cw, ch;
- GetSize( &cw , &ch ) ;
+ wxTopLevelWindow::DoGetClientSize( &cw , &ch );
int statusX = 0 ;
int statusY = 0 ;
#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown())
{
- GetStatusBar()->GetClientSize(&statusX, &statusY);
+ GetStatusBar()->GetSize(&statusX, &statusY);
ch -= statusY;
}
#endif
tx = ty = 0 ;
GetToolBar()->GetSize(&tw, &th);
- if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
+ if (GetToolBar()->HasFlag(wxTB_LEFT))
+ {
+ // Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
+ // means, pretend we don't have toolbar/status bar, so we
+ // have the original client size.
+ GetToolBar()->SetSize(tx , ty , tw, ch , wxSIZE_NO_ADJUSTMENTS );
+ }
+ else if (GetToolBar()->HasFlag(wxTB_RIGHT))
{
// Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
// means, pretend we don't have toolbar/status bar, so we
// have the original client size.
+ tx = cw - tw;
GetToolBar()->SetSize(tx , ty , tw, ch , wxSIZE_NO_ADJUSTMENTS );
}
- else if (GetToolBar()->GetWindowStyleFlag() & wxTB_BOTTOM)
+ else if (GetToolBar()->HasFlag(wxTB_BOTTOM))
{
- //FIXME: this positions the tool bar almost correctly, but still it doesn't work right yet,
- //as 1) the space for the 'old' top toolbar is still taken up, and 2) the toolbar
- //doesn't extend it's width to the width of the frame.
tx = 0;
- ty = ch - (th + statusY);
+ ty = ch - th;
GetToolBar()->SetSize(tx, ty, cw, th, wxSIZE_NO_ADJUSTMENTS );
}
else