X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/10816efb2cb6561a227a87de6d5f8b5750c2705d..00b20999de57eee2567f8e20962d34417840fdd0:/src/msw/mdi.cpp diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 881f48fce9..25ff340af8 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -199,7 +199,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, msflags &= ~WS_HSCROLL; if ( !wxWindow::MSWCreate(wxMDIFrameClassName, - title, + title.wx_str(), pos, size, msflags, exflags) ) @@ -515,7 +515,7 @@ bool wxMDIParentFrame::HandleActivate(int state, bool minimized, WXHWND activate { wxActivateEvent event(wxEVT_ACTIVATE, true, m_currentChild->GetId()); event.SetEventObject( m_currentChild ); - if ( m_currentChild->GetEventHandler()->ProcessEvent(event) ) + if ( m_currentChild->HandleWindowEvent(event) ) processed = true; } @@ -601,8 +601,8 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd) wxWindow *child = node->GetData(); if ( child->GetHWND() ) { - long childId = wxGetWindowId(child->GetHWND()); - if (childId == (long)id) + int childId = wxGetWindowId(child->GetHWND()); + if ( childId == (signed short)id ) { ::SendMessage( GetWinHwnd(GetClientWindow()), WM_MDIACTIVATE, @@ -694,7 +694,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, if ( id != wxID_ANY ) m_windowId = id; else - m_windowId = (int)NewControlId(); + m_windowId = NewControlId(); if ( parent ) { @@ -711,7 +711,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE ? wxMDIChildFrameClassName : wxMDIChildFrameClassNameNoRedraw; - mcs.szTitle = title; + mcs.szTitle = title.wx_str(); mcs.hOwner = wxGetInstance(); if (x != wxDefaultCoord) mcs.x = x; @@ -806,7 +806,7 @@ bool wxMDIChildFrame::Show(bool show) // we need to refresh the MDI frame window menu to include (or exclude if // we've been hidden) this frame - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); MDISetMenu(parent->GetClientWindow(), NULL, NULL); return true; @@ -845,7 +845,7 @@ void wxMDIChildFrame::DoSetClientSize(int width, int height) // If there's an MDI parent, must subtract the parent's top left corner // since MoveWindow moves relative to the parent - wxMDIParentFrame *mdiParent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *mdiParent = GetMDIParent(); ::ScreenToClient((HWND) mdiParent->GetClientWindow()->GetHWND(), &point); MoveWindow(hWnd, point.x, point.y, actual_width, actual_height, (BOOL)true); @@ -853,7 +853,7 @@ void wxMDIChildFrame::DoSetClientSize(int width, int height) wxSize size(width, height); wxSizeEvent event(size, m_windowId); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } // Unlike other wxTopLevelWindowBase, the mdi child's "GetPosition" is not the @@ -881,7 +881,7 @@ void wxMDIChildFrame::DoGetPosition(int *x, int *y) const // Since we now have the absolute screen coords, // if there's a parent we must subtract its top left corner - wxMDIParentFrame *mdiParent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *mdiParent = GetMDIParent(); ::ScreenToClient((HWND) mdiParent->GetClientWindow()->GetHWND(), &point); if (x) @@ -892,7 +892,7 @@ void wxMDIChildFrame::DoGetPosition(int *x, int *y) const void wxMDIChildFrame::InternalSetMenuBar() { - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); InsertWindowMenu(parent->GetClientWindow(), m_hMenu, GetMDIWindowMenu(parent)); @@ -918,7 +918,7 @@ WXHICON wxMDIChildFrame::GetDefaultIcon() const void wxMDIChildFrame::Maximize(bool maximize) { - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); if ( parent && parent->GetClientWindow() ) { ::SendMessage(GetWinHwnd(parent->GetClientWindow()), @@ -929,7 +929,7 @@ void wxMDIChildFrame::Maximize(bool maximize) void wxMDIChildFrame::Restore() { - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); if ( parent && parent->GetClientWindow() ) { ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIRESTORE, @@ -939,7 +939,7 @@ void wxMDIChildFrame::Restore() void wxMDIChildFrame::Activate() { - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); if ( parent && parent->GetClientWindow() ) { ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE, @@ -1048,7 +1048,7 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), WXHWND hwndAct, WXHWND hwndDeact) { - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); HMENU menuToSet = 0; @@ -1103,7 +1103,7 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), ResetWindowStyle((void *)NULL); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxMDIChildFrame::HandleWindowPosChanging(void *pos) @@ -1172,7 +1172,7 @@ bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg) { // we must pass the parent frame to ::TranslateAccelerator(), otherwise it // doesn't do its job correctly for MDI child menus - return MSWDoTranslateMessage((wxMDIChildFrame *)GetParent(), msg); + return MSWDoTranslateMessage(GetMDIParent(), msg); } // --------------------------------------------------------------------------- @@ -1181,7 +1181,7 @@ bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg) void wxMDIChildFrame::MSWDestroyWindow() { - wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame *parent = GetMDIParent(); // Must make sure this handle is invalidated (set to NULL) since all sorts // of things could happen after the child client is destroyed, but before @@ -1208,7 +1208,7 @@ void wxMDIChildFrame::MSWDestroyWindow() bool wxMDIChildFrame::ResetWindowStyle(void *vrect) { RECT *rect = (RECT *)vrect; - wxMDIParentFrame* pFrameWnd = (wxMDIParentFrame *)GetParent(); + wxMDIParentFrame* pFrameWnd = GetMDIParent(); wxMDIChildFrame* pChild = pFrameWnd->GetActiveChild(); if (!pChild || (pChild == this)) @@ -1430,14 +1430,14 @@ static void InsertWindowMenu(wxWindow *win, WXHMENU menu, HMENU subMenu) { success = true; ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING, - (UINT)subMenu, _("&Window")); + (UINT)subMenu, _("&Window").wx_str()); break; } } if ( !success ) { - ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window")); + ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window").wx_str()); } }