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:
@@ -184,7 +184,7 @@ bool wxDialog::Create(wxWindow *parent,
|
|||||||
CreateToolBar();
|
CreateToolBar();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( HasFlag(wxRESIZE_BORDER) )
|
if ( HasFlag(wxRESIZE_BORDER) )
|
||||||
CreateGripper();
|
CreateGripper();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -349,7 +349,7 @@ void wxDialog::SetWindowStyleFlag(long style)
|
|||||||
{
|
{
|
||||||
wxDialogBase::SetWindowStyleFlag(style);
|
wxDialogBase::SetWindowStyleFlag(style);
|
||||||
|
|
||||||
if( HasFlag(wxRESIZE_BORDER) )
|
if ( HasFlag(wxRESIZE_BORDER) )
|
||||||
CreateGripper();
|
CreateGripper();
|
||||||
else
|
else
|
||||||
DestroyGripper();
|
DestroyGripper();
|
||||||
@@ -357,13 +357,15 @@ void wxDialog::SetWindowStyleFlag(long style)
|
|||||||
|
|
||||||
void wxDialog::CreateGripper()
|
void wxDialog::CreateGripper()
|
||||||
{
|
{
|
||||||
if( !m_hGripper )
|
if ( !m_hGripper )
|
||||||
{
|
{
|
||||||
|
// just create it here, it will be positioned and shown later
|
||||||
m_hGripper = (WXHWND)::CreateWindow
|
m_hGripper = (WXHWND)::CreateWindow
|
||||||
(
|
(
|
||||||
wxT("SCROLLBAR"),
|
wxT("SCROLLBAR"),
|
||||||
wxT(""),
|
wxT(""),
|
||||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
WS_CHILD |
|
||||||
|
WS_CLIPSIBLINGS |
|
||||||
SBS_SIZEGRIP |
|
SBS_SIZEGRIP |
|
||||||
SBS_SIZEBOX |
|
SBS_SIZEBOX |
|
||||||
SBS_SIZEBOXBOTTOMRIGHTALIGN,
|
SBS_SIZEBOXBOTTOMRIGHTALIGN,
|
||||||
@@ -373,9 +375,6 @@ void wxDialog::CreateGripper()
|
|||||||
wxGetInstance(),
|
wxGetInstance(),
|
||||||
NULL
|
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") );
|
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);
|
::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:
|
case SIZE_RESTORED:
|
||||||
ShowGripper(true);
|
ShowGripper(true);
|
||||||
// fall through
|
|
||||||
|
|
||||||
default:
|
|
||||||
ResizeGripper();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,6 +520,20 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
|
|||||||
}
|
}
|
||||||
break;
|
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__
|
#ifndef __WXMICROWIN__
|
||||||
case WM_SETCURSOR:
|
case WM_SETCURSOR:
|
||||||
// we want to override the busy cursor for modal dialogs:
|
// we want to override the busy cursor for modal dialogs:
|
||||||
|
Reference in New Issue
Block a user