extern wxWindowList wxModelessWindows; // from dialog.cpp
extern wxMenu *wxCurrentPopupMenu;
-extern wxChar wxMDIFrameClassName[];
-extern wxChar wxMDIChildFrameClassName[];
extern wxWindow *wxWndHook; // from window.cpp
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
return (id >= wxFIRST_MDI_CHILD) && (id <= wxLAST_MDI_CHILD);
}
+// unpack the parameters of WM_MDIACTIVATE message
static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *activate, WXHWND *hwndAct, WXHWND *hwndDeact);
+// return the HMENU of the MDI menu
+static inline HMENU GetMDIWindowMenu(wxMDIParentFrame *frame)
+{
+ wxMenu *menu = frame->GetWindowMenu();
+ return menu ? GetHmenuOf(menu) : 0;
+}
+
// ===========================================================================
// implementation
// ===========================================================================
// wxWin macros
// ---------------------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
-#endif // USE_SHARED_LIBRARY
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
EVT_SIZE(wxMDIParentFrame::OnSize)
long style,
const wxString& name)
{
- m_defaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON : wxDEFAULT_MDIPARENTFRAME_ICON);
+ m_hDefaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON : wxDEFAULT_MDIPARENTFRAME_ICON);
m_clientWindow = NULL;
m_currentChild = NULL;
wxTopLevelWindows.Append(this);
SetName(name);
+ wxWindowBase::Show(TRUE); // MDI child frame starts off shown
m_windowStyle = style;
if (parent) parent->AddChild(this);
{
if ( m_clientWindow )
{
- m_clientWindow->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+ m_clientWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
m_clientWindow->Refresh();
}
// the MDI parent frame window proc
// ---------------------------------------------------------------------------
-MRESULT wxMDIParentFrame::OS2WindowProc(HWND hwnd,
- WXUINT message,
+MRESULT wxMDIParentFrame::OS2WindowProc(WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam)
{
}
*/
if ( !processed )
- rc = wxFrame::OS2WindowProc(hwnd, message, wParam, lParam);
+ rc = wxFrame::OS2WindowProc(message, wParam, lParam);
return rc;
}
// is it one of standard MDI commands?
WXWPARAM wParam = 0;
- int msg;
+ int msg = 0;
// TODO:
/*
return FALSE;
}
-MRESULT wxMDIParentFrame::OS2DefWindowProc(HWND hwnd,
- WXUINT message,
+MRESULT wxMDIParentFrame::OS2DefWindowProc(WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam)
{
long style,
const wxString& name)
{
- m_defaultIcon = (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
- : wxDEFAULT_MDICHILDFRAME_ICON);
+ m_hDefaultIcon = (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
+ : wxDEFAULT_MDICHILDFRAME_ICON);
SetName(name);
// MDI window proc and message handlers
// ---------------------------------------------------------------------------
-MRESULT wxMDIChildFrame::OS2WindowProc(HWND hwnd,
- WXUINT message,
+MRESULT wxMDIChildFrame::OS2WindowProc(WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam)
{
}
*/
if ( !processed )
- rc = wxFrame::OS2WindowProc(hwnd, message, wParam, lParam);
+ rc = wxFrame::OS2WindowProc(message, wParam, lParam);
return rc;
}
// MDI specific message translation/preprocessing
// ---------------------------------------------------------------------------
-MRESULT wxMDIChildFrame::OS2DefWindowProc(HWND hwnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+MRESULT wxMDIChildFrame::OS2DefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
// TODO
/*
bool wxMDIChildFrame::OS2TranslateMessage(WXMSG* msg)
{
- return m_acceleratorTable.Translate(GetParent(), msg);
+#if wxUSE_ACCEL
+ return m_acceleratorTable.Translate(GetParent()->GetHWND(), msg);
+#else
+ return FALSE;
+#endif //wxUSE_ACCEL
+
}
// ---------------------------------------------------------------------------
bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
{
- m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE);
+ m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
// TODO:
/*