X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80d83cbcc27c3415acc662e61c856f7b9d164a0d..5268c5a32bbe68b834abeaa89c8cfb2099d50d2e:/src/os2/mdi.cpp diff --git a/src/os2/mdi.cpp b/src/os2/mdi.cpp index 0a21118334..1fccebacb2 100644 --- a/src/os2/mdi.cpp +++ b/src/os2/mdi.cpp @@ -37,8 +37,6 @@ 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); @@ -82,9 +80,17 @@ inline bool IsMdiCommandId(int id) 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 // =========================================================================== @@ -138,6 +144,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, wxTopLevelWindows.Append(this); SetName(name); + wxWindowBase::Show(TRUE); // MDI child frame starts off shown m_windowStyle = style; if (parent) parent->AddChild(this); @@ -247,7 +254,7 @@ void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { if ( m_clientWindow ) { - m_clientWindow->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); + m_clientWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); m_clientWindow->Refresh(); } @@ -288,8 +295,7 @@ void wxMDIParentFrame::ActivatePrevious() // the MDI parent frame window proc // --------------------------------------------------------------------------- -MRESULT wxMDIParentFrame::OS2WindowProc(HWND hwnd, - WXUINT message, +MRESULT wxMDIParentFrame::OS2WindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { @@ -504,8 +510,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd) return FALSE; } -MRESULT wxMDIParentFrame::OS2DefWindowProc(HWND hwnd, - WXUINT message, +MRESULT wxMDIParentFrame::OS2DefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { @@ -774,8 +779,7 @@ void wxMDIChildFrame::Activate() // MDI window proc and message handlers // --------------------------------------------------------------------------- -MRESULT wxMDIChildFrame::OS2WindowProc(HWND hwnd, - WXUINT message, +MRESULT wxMDIChildFrame::OS2WindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { @@ -987,7 +991,7 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos) // 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 /* @@ -999,7 +1003,12 @@ MRESULT wxMDIChildFrame::OS2DefWindowProc(HWND hwnd, WXUINT message, WXWPARAM wP 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 + } // --------------------------------------------------------------------------- @@ -1044,7 +1053,7 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect) bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) { - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE); + m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); // TODO: /*