delay gripper positioning until the dialog is shown to ensure that it doesn't overwrite other dialog children

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-05-14 00:53:16 +00:00
parent 6662d8c097
commit 952f8d3c7a

View File

@ -359,11 +359,13 @@ void wxDialog::CreateGripper()
{
if ( !m_hGripper )
{
// just create it here, it will be positioned and shown later
m_hGripper = (WXHWND)::CreateWindow
(
wxT("SCROLLBAR"),
wxT(""),
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CHILD |
WS_CLIPSIBLINGS |
SBS_SIZEGRIP |
SBS_SIZEBOX |
SBS_SIZEBOXBOTTOMRIGHTALIGN,
@ -373,9 +375,6 @@ void wxDialog::CreateGripper()
wxGetInstance(),
NULL
);
// position the gripper correctly after creation
ResizeGripper();
}
}
@ -392,6 +391,9 @@ void wxDialog::ShowGripper(bool show)
{
wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") );
if ( show )
ResizeGripper();
::ShowWindow((HWND)m_hGripper, show ? SW_SHOW : SW_HIDE);
}
@ -501,10 +503,6 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
case SIZE_RESTORED:
ShowGripper(true);
// fall through
default:
ResizeGripper();
}
}
@ -522,6 +520,20 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
}
break;
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS * const wp = wx_reinterpret_cast(WINDOWPOS *, lParam);
if ( wp->flags & SWP_SHOWWINDOW )
{
// we should only show it now to ensure that it's really
// positioned underneath under all the other controls in
// the dialog, if we showed it before it could overlap them
if ( m_hGripper )
ShowGripper(true);
}
}
break;
#ifndef __WXMICROWIN__
case WM_SETCURSOR:
// we want to override the busy cursor for modal dialogs: