nX = (vSizeDpy.x - nWidth) / 2;
nY = (vSizeDpy.y - nHeight) / 2;
}
+ m_backgroundColour.Set(wxString("LIGHT GREY"));
+
+ LONG lColor = (LONG)m_backgroundColour.GetPixel();
+
+ if (!::WinSetPresParam( m_hWnd
+ ,PP_BACKGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ ))
+ {
+ return FALSE;
+ }
+
::WinSetWindowPos( GetHwnd()
,HWND_TOP
,nX
,nHeight
,SWP_MOVE | SWP_SIZE | SWP_ZORDER | SWP_SHOW
);
+ m_hFrame = m_hWnd;
SubclassWin(m_hWnd);
return TRUE;
} // end of wxTopLevelWindowOS2::CreateDialog
)
{
::WinShowWindow(m_hFrame, (BOOL)(nShowCmd & SWP_SHOW));
+
+ //
+ // Need to artificially send a size event as wxApps often expect to do some
+ // final child control sizing
+ SendSizeEvent();
m_bIconized = nShowCmd == SWP_MINIMIZE;
} // end of wxTopLevelWindowOS2::DoShowWindow
DoShowWindow(SWP_RESTORE);
} // end of wxTopLevelWindowOS2::Restore
+// generate an artificial resize event
+void wxTopLevelWindowOS2::SendSizeEvent()
+{
+ if (!m_bIconized)
+ {
+ RECTL vRect = wxGetWindowRect(GetHwnd());
+
+ (void)::WinPostMsg( m_hFrame
+ ,WM_SIZE
+ ,MPFROM2SHORT(vRect.xRight - vRect.xLeft, vRect.yTop - vRect.yBottom)
+ ,MPFROM2SHORT(vRect.xRight - vRect.xLeft, vRect.yTop - vRect.yBottom)
+ );
+ }
+} // end of wxTopLevelWindowOS2::SendSizeEvent
+
// ----------------------------------------------------------------------------
// wxTopLevelWindowOS2 fullscreen
// ----------------------------------------------------------------------------