Restored part of the default positioning code for dialogs that I

removed a few days ago.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-03-18 19:02:01 +00:00
parent 86c5779a6f
commit 2626810054

View File

@@ -394,6 +394,15 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
int x, y, w, h;
(void)MSWGetCreateWindowCoords(pos, size, x, y, w, h);
if ( x == (int)CW_USEDEFAULT )
{
// centre it on the screen - what else can we do?
wxSize sizeDpy = wxGetDisplaySize();
x = (sizeDpy.x - w) / 2;
y = (sizeDpy.y - h) / 2;
}
if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) )
{
wxLogLastError(wxT("MoveWindow"));