X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c50f1fb9226d9260454ccb9c8a67d0be23c2827f..2356708db31b737c6eae53c2316b642aa5a2e68d:/src/msw/frame.cpp?ds=sidebyside diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 82d435e254..3549546754 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -175,8 +175,10 @@ void wxFrame::DoGetClientSize(int *x, int *y) const rect.bottom -= pt.y; rect.right -= pt.x; - *x = rect.right; - *y = rect.bottom; + if ( x ) + *x = rect.right; + if ( y ) + *y = rect.bottom; } // Set the client size (i.e. leave the calculation of borders etc. @@ -241,28 +243,11 @@ void wxFrame::DoGetPosition(int *x, int *y) const void wxFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags) { - int currentX, currentY; - int x1 = x; - int y1 = y; - int w1 = width; - int h1 = height; + wxWindow::DoSetSize(x, y, width, height, sizeFlags); - GetPosition(¤tX, ¤tY); - if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - x1 = currentX; - if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - y1 = currentY; - - int ww,hh ; - GetSize(&ww,&hh) ; - if (width == -1) w1 = ww ; - if (height==-1) h1 = hh ; - - MoveWindow(GetHwnd(), x1, y1, w1, h1, (BOOL)TRUE); - - wxSizeEvent event(wxSize(width, height), m_windowId); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); + wxSizeEvent event(wxSize(width, height), m_windowId); + event.SetEventObject( this ); + GetEventHandler()->ProcessEvent(event); } bool wxFrame::Show(bool show) @@ -653,18 +638,21 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event) { if (GetStatusBar()) { + wxString help; int menuId = event.GetMenuId(); if ( menuId != -1 ) { wxMenuBar *menuBar = GetMenuBar(); if (menuBar && menuBar->FindItem(menuId)) { - // set status text even if the string is empty - this will at - // least remove the string from the item which was previously - // selected - SetStatusText(menuBar->GetHelpString(menuId)); + help = menuBar->GetHelpString(menuId); } } + + // set status text even if the string is empty - this will at + // least remove the string from the item which was previously + // selected + SetStatusText(help); } } @@ -892,10 +880,7 @@ bool wxFrame::HandlePaint() } else { - wxPaintEvent event(m_windowId); - event.m_eventObject = this; - - return GetEventHandler()->ProcessEvent(event); + return wxWindow::HandlePaint(); } } else @@ -989,20 +974,22 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) return FALSE; } -bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu) +bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) { int item; - if ( nFlags == 0xFFFF && hMenu == 0 ) + if ( flags == 0xFFFF && hMenu == 0 ) { - // FIXME: what does this do? does it ever happen? + // menu was removed from screen item = -1; } - else if ((nFlags != MF_SEPARATOR) && (nItem != 0) && (nItem != 65535)) + else if ( !(flags & MF_POPUP) && !(flags & MF_SEPARATOR) ) { item = nItem; } else { + // don't give hints for separators (doesn't make sense) nor for the + // items opening popup menus (they don't have them anyhow) return FALSE; }