fixed wxMaximizeEvent generation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -272,6 +272,7 @@ wxMSW:
|
||||
- fixed flat style for toolbars under XP, Windows Classic style
|
||||
- fixed truncation of transferred data in wxConnection under unicode build
|
||||
- wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei)
|
||||
- fixed wxMaximizeEvent generation in wxFrame
|
||||
|
||||
wxUniv/X11:
|
||||
|
||||
|
@@ -658,6 +658,8 @@ void wxFrame::PositionToolBar()
|
||||
// on the desktop, but are iconized/restored with it
|
||||
void wxFrame::IconizeChildFrames(bool bIconize)
|
||||
{
|
||||
m_iconized = bIconize;
|
||||
|
||||
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
@@ -788,14 +790,13 @@ bool wxFrame::HandlePaint()
|
||||
}
|
||||
}
|
||||
|
||||
bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
||||
bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id)
|
||||
{
|
||||
bool processed = false;
|
||||
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
|
||||
|
||||
switch ( id )
|
||||
{
|
||||
case SIZENORMAL:
|
||||
case SIZE_RESTORED:
|
||||
case SIZE_MAXIMIZED:
|
||||
// only do it it if we were iconized before, otherwise resizing the
|
||||
// parent frame has a curious side effect of bringing it under it's
|
||||
// children
|
||||
@@ -806,23 +807,14 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
||||
IconizeChildFrames(false);
|
||||
|
||||
(void)SendIconizeEvent(false);
|
||||
|
||||
// fall through
|
||||
|
||||
case SIZEFULLSCREEN:
|
||||
m_iconized = FALSE;
|
||||
break;
|
||||
|
||||
case SIZEICONIC:
|
||||
case SIZE_MINIMIZED:
|
||||
// iconize all child frames too
|
||||
IconizeChildFrames(true);
|
||||
|
||||
(void)SendIconizeEvent();
|
||||
|
||||
m_iconized = true;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif // !__WXWINCE__
|
||||
|
||||
if ( !m_iconized )
|
||||
{
|
||||
@@ -848,13 +840,11 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
processed = wxWindow::HandleSize(x, y, id);
|
||||
#endif // WINCE_WITH_COMMANDBAR
|
||||
}
|
||||
|
||||
return processed;
|
||||
// call the base class version to generate the appropriate events
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
|
||||
|
@@ -2285,31 +2285,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
||||
#endif
|
||||
|
||||
case WM_SIZE:
|
||||
switch ( wParam )
|
||||
{
|
||||
case SIZE_MAXHIDE:
|
||||
case SIZE_MAXSHOW:
|
||||
// we're not interested in these messages at all
|
||||
break;
|
||||
|
||||
case SIZE_MINIMIZED:
|
||||
// we shouldn't send sizev events for these messages as the
|
||||
// client size may be negative which breaks existing code
|
||||
//
|
||||
// OTOH we might send another (wxMinimizedEvent?) one or
|
||||
// add an additional parameter to wxSizeEvent if this is
|
||||
// useful to anybody
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
|
||||
// fall through nevertheless
|
||||
|
||||
case SIZE_MAXIMIZED:
|
||||
case SIZE_RESTORED:
|
||||
processed = HandleSize(LOWORD(lParam), HIWORD(lParam),
|
||||
wParam);
|
||||
}
|
||||
processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
|
||||
break;
|
||||
|
||||
#if !defined(__WXWINCE__)
|
||||
@@ -4187,16 +4163,40 @@ bool wxWindowMSW::HandleMoving(wxRect& rect)
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
|
||||
WXUINT WXUNUSED(flag))
|
||||
bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
|
||||
{
|
||||
// don't use w and h parameters as they specify the client size while
|
||||
// according to the docs EVT_SIZE handler is supposed to receive the total
|
||||
// size
|
||||
bool processed = false;
|
||||
|
||||
switch ( wParam )
|
||||
{
|
||||
default:
|
||||
wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
|
||||
// fall through nevertheless
|
||||
|
||||
case SIZE_MAXHIDE:
|
||||
case SIZE_MAXSHOW:
|
||||
// we're not interested in these messages at all
|
||||
break;
|
||||
|
||||
case SIZE_MINIMIZED:
|
||||
processed = HandleMinimize();
|
||||
break;
|
||||
|
||||
case SIZE_MAXIMIZED:
|
||||
processed = HandleMaximize();
|
||||
// fall through to send a normal size event as well
|
||||
|
||||
case SIZE_RESTORED:
|
||||
// don't use w and h parameters as they specify the client size
|
||||
// while according to the docs EVT_SIZE handler is supposed to
|
||||
// receive the total size
|
||||
wxSizeEvent event(GetSize(), m_windowId);
|
||||
event.SetEventObject(this);
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
processed = GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
bool wxWindowMSW::HandleSizing(wxRect& rect)
|
||||
|
Reference in New Issue
Block a user