Fix restricting both min and max size of MDI children in wxMSW.
Calling SetMinSize() on wxMDIChildFrame in wxMSW prevented SetMaxSize() from working as wxMDIChildFrame::HandleGetMinMaxInfo() didn't take the max size into account and prevented the execution of the base class version of the same method from taking place if min size was set. Fix this simply by always delegating to the base class version after using DefMDIChildProc() to compute the default max size values. Closes #17029.
This commit is contained in:
@@ -1241,32 +1241,13 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos)
|
|||||||
|
|
||||||
bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo)
|
bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo)
|
||||||
{
|
{
|
||||||
MINMAXINFO *info = (MINMAXINFO *)mmInfo;
|
// Get the window max size from DefMDIChildProc() as it calculates it
|
||||||
|
// correctly from the size of the MDI parent frame.
|
||||||
|
MSWDefWindowProc(WM_GETMINMAXINFO, 0, (LPARAM)mmInfo);
|
||||||
|
|
||||||
// let the default window proc calculate the size of MDI children
|
// But then handle the message as usual at the base class level to allow
|
||||||
// frames because it is based on the size of the MDI client window,
|
// overriding min/max frame size as for the normal frames.
|
||||||
// not on the values specified in wxWindow m_max variables
|
return false;
|
||||||
bool processed = MSWDefWindowProc(WM_GETMINMAXINFO, 0, (LPARAM)mmInfo) != 0;
|
|
||||||
|
|
||||||
int minWidth = GetMinWidth(),
|
|
||||||
minHeight = GetMinHeight();
|
|
||||||
|
|
||||||
// but allow GetSizeHints() to set the min size
|
|
||||||
if ( minWidth != wxDefaultCoord )
|
|
||||||
{
|
|
||||||
info->ptMinTrackSize.x = minWidth;
|
|
||||||
|
|
||||||
processed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( minHeight != wxDefaultCoord )
|
|
||||||
{
|
|
||||||
info->ptMinTrackSize.y = minHeight;
|
|
||||||
|
|
||||||
processed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return processed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user