#pragma hdrstop
#endif
-#if wxUSE_MDI_ARCHITECTURE && !defined(__WXUNIVERSAL__)
+#if wxUSE_MDI && !defined(__WXUNIVERSAL__)
#ifndef WX_PRECOMP
#include "wx/setup.h"
if ( parent )
parent->AddChild(this);
- if ( id > -1 )
+ if ( id != wxID_ANY )
m_windowId = id;
else
m_windowId = NewControlId();
#if wxUSE_TOOLBAR
m_frameToolBar = NULL;
#endif
+#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
+#endif // wxUSE_STATUSBAR
DestroyChildren();
}
}
+void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
+{
+ wxMDIChildFrame *child = GetActiveChild();
+ if ( child )
+ {
+ wxEvtHandler* source = child->GetEventHandler();
+ wxMenuBar* bar = child->GetMenuBar();
+
+ if (menu)
+ {
+ menu->UpdateUI(source);
+ }
+ else
+ {
+ if ( bar != NULL )
+ {
+ int nCount = bar->GetMenuCount();
+ for (int n = 0; n < nCount; n++)
+ bar->GetMenu(n)->UpdateUI(source);
+ }
+ }
+ }
+ else
+ {
+ wxFrameBase::DoMenuUpdates(menu);
+ }
+}
+
void wxMDIParentFrame::OnSize(wxSizeEvent&)
{
if ( GetClientWindow() )
SetName(name);
wxWindowBase::Show(true); // MDI child frame starts off shown
- if ( id > -1 )
+ if ( id != wxID_ANY )
m_windowId = id;
else
m_windowId = (int)NewControlId();
: wxMDIChildFrameClassNameNoRedraw;
mcs.szTitle = title;
mcs.hOwner = wxGetInstance();
- if (x > -1)
+ if (x != wxDefaultCoord)
mcs.x = x;
else
mcs.x = CW_USEDEFAULT;
- if (y > -1)
+ if (y != wxDefaultCoord)
mcs.y = y;
else
mcs.y = CW_USEDEFAULT;
- if (width > -1)
+ if (width != wxDefaultCoord)
mcs.cx = width;
else
mcs.cx = CW_USEDEFAULT;
- if (height > -1)
+ if (height != wxDefaultCoord)
mcs.cy = height;
else
mcs.cy = CW_USEDEFAULT;
#if wxUSE_TOOLBAR
m_frameToolBar = NULL;
#endif
+#if wxUSE_STATUSBAR
m_frameStatusBar = NULL;
+#endif // wxUSE_STATUSBAR
DestroyChildren();
}
// Set the client size (i.e. leave the calculation of borders etc.
-// to wxWindows)
+// to wxWidgets)
void wxMDIChildFrame::DoSetClientSize(int width, int height)
{
HWND hWnd = GetHwnd();
int actual_width = rect2.right - rect2.left - rect.right + width;
int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
+#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown())
{
int sx, sy;
GetStatusBar()->GetSize(&sx, &sy);
actual_height += sy;
}
+#endif // wxUSE_STATUSBAR
POINT point;
point.x = rect2.left;
*hwndDeact = (WXHWND)wParam;
}
-#endif
-// wxUSE_MDI_ARCHITECTURE && !defined(__WXUNIVERSAL__)
+#endif // wxUSE_MDI && !defined(__WXUNIVERSAL__)