void GetPosition(int *x, int *y) const ;
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
+ // Toolbar: if made known to the frame, the frame will manage it automatically.
+ virtual inline void SetToolBar(wxWindow *toolbar) { m_frameToolBar = toolbar; }
+ virtual inline wxWindow *GetToolBar(void) const { return m_frameToolBar; }
+
virtual bool OnClose(void);
void OnSize(wxSizeEvent& event);
bool m_iconized;
WXHICON m_defaultIcon;
static bool m_useNativeStatusBar;
+ wxWindow * m_frameToolBar ;
DECLARE_EVENT_TABLE()
};
void OnSize(wxSizeEvent& event);
void OnActivate(wxActivateEvent& event);
- // Toolbar (currently, for use by Windows MDI parent frames ONLY)
- virtual inline void SetToolBar(wxWindow *toolbar) { m_frameToolBar = toolbar; }
- virtual inline wxWindow *GetToolBar(void) const { return m_frameToolBar; }
-
void SetMenuBar(wxMenuBar *menu_bar);
// Gets the size available for subwindows after menu size, toolbar size
WXHMENU m_windowMenu;
bool m_parentFrameActive; // TRUE if MDI Frame is intercepting
// commands, not child
- wxWindow * m_frameToolBar ;
DECLARE_EVENT_TABLE()
};
wxFrame::wxFrame(void)
{
+ m_frameToolBar = NULL ;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
// m_modalShowing = FALSE;
m_windowStyle = style;
m_frameMenuBar = NULL;
+ m_frameToolBar = NULL ;
m_frameStatusBar = NULL;
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
wxWindow *win = (wxWindow *)node->Data();
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
!win->IsKindOf(CLASSINFO(wxDialog)) &&
- (win != GetStatusBar()) )
+ (win != GetStatusBar()) &&
+ (win != GetToolBar()) )
{
if ( child )
return; // it's our second subwindow - nothing to do
if ( child ) {
// we have exactly one child - set it's size to fill the whole frame
- int client_x, client_y;
+ int clientW, clientH;
+ GetClientSize(&clientW, &clientH);
- GetClientSize(&client_x, &client_y);
- child->SetSize(0, 0, client_x, client_y);
+ int x = 0;
+ int y = 0;
+
+ // Manage the toolbar if there is one
+ if ( GetToolBar() )
+ {
+ int wt, ht;
+ GetToolBar()->GetSize(&wt, &ht);
+ clientH -= ht;
+ y += ht;
+ GetToolBar()->SetSize(0, 0, clientW, ht);
+ }
+
+ child->SetSize(x, y, clientW, clientH);
}
}
m_currentChild = NULL;
m_windowMenu = 0;
m_parentFrameActive = TRUE;
- m_frameToolBar = NULL ;
}
bool wxMDIParentFrame::Create(wxWindow *parent,
{
m_defaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON : wxDEFAULT_MDIPARENTFRAME_ICON);
- m_frameToolBar = NULL ;
m_clientWindow = NULL;
m_currentChild = NULL;
m_windowMenu = 0;