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:
Vadim Zeitlin
2004-09-15 22:14:05 +00:00
parent b7ecdec5aa
commit 4bc0f25ed7
3 changed files with 44 additions and 53 deletions

View File

@@ -272,6 +272,7 @@ wxMSW:
- fixed flat style for toolbars under XP, Windows Classic style - fixed flat style for toolbars under XP, Windows Classic style
- fixed truncation of transferred data in wxConnection under unicode build - fixed truncation of transferred data in wxConnection under unicode build
- wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei) - wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei)
- fixed wxMaximizeEvent generation in wxFrame
wxUniv/X11: wxUniv/X11:

View File

@@ -658,6 +658,8 @@ void wxFrame::PositionToolBar()
// on the desktop, but are iconized/restored with it // on the desktop, but are iconized/restored with it
void wxFrame::IconizeChildFrames(bool bIconize) void wxFrame::IconizeChildFrames(bool bIconize)
{ {
m_iconized = bIconize;
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
node; node;
node = node->GetNext() ) 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__) #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
switch ( id ) switch ( id )
{ {
case SIZENORMAL: case SIZE_RESTORED:
case SIZE_MAXIMIZED:
// only do it it if we were iconized before, otherwise resizing the // 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 // parent frame has a curious side effect of bringing it under it's
// children // children
@@ -806,23 +807,14 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
IconizeChildFrames(false); IconizeChildFrames(false);
(void)SendIconizeEvent(false); (void)SendIconizeEvent(false);
// fall through
case SIZEFULLSCREEN:
m_iconized = FALSE;
break; break;
case SIZEICONIC: case SIZE_MINIMIZED:
// iconize all child frames too // iconize all child frames too
IconizeChildFrames(true); IconizeChildFrames(true);
(void)SendIconizeEvent();
m_iconized = true;
break; break;
} }
#endif #endif // !__WXWINCE__
if ( !m_iconized ) if ( !m_iconized )
{ {
@@ -848,13 +840,11 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
} }
} }
#endif #endif // WINCE_WITH_COMMANDBAR
processed = wxWindow::HandleSize(x, y, id);
} }
return processed; // call the base class version to generate the appropriate events
return false;
} }
bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)

View File

@@ -2285,31 +2285,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
#endif #endif
case WM_SIZE: case WM_SIZE:
switch ( wParam ) processed = HandleSize(LOWORD(lParam), HIWORD(lParam), 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);
}
break; break;
#if !defined(__WXWINCE__) #if !defined(__WXWINCE__)
@@ -4187,16 +4163,40 @@ bool wxWindowMSW::HandleMoving(wxRect& rect)
return rc; return rc;
} }
bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
WXUINT WXUNUSED(flag))
{ {
// don't use w and h parameters as they specify the client size while bool processed = false;
// 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); 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);
processed = GetEventHandler()->ProcessEvent(event);
}
return processed;
} }
bool wxWindowMSW::HandleSizing(wxRect& rect) bool wxWindowMSW::HandleSizing(wxRect& rect)