X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72a1118475822244357d487fc937c15331654148..c5fc899bf29ca7d9c4e2a070e28228b430a68dd3:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 7246affec8..0296aac6ce 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -139,9 +139,6 @@ void wxTopLevelWindowMSW::Init() m_iconized = m_maximizeOnShow = FALSE; - // unlike (almost?) all other windows, frames are created hidden - m_isShown = FALSE; - // Data to save/restore when calling ShowFullScreen m_fsStyle = 0; m_fsOldWindowStyle = 0; @@ -225,7 +222,6 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const if ( exflags ) { -#if !defined(__WIN16__) if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ) { if ( style & wxFRAME_TOOL_WINDOW ) @@ -258,7 +254,6 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const #endif //else: nothing to do [here] } -#endif // !Win16 if ( style & wxSTAY_ON_TOP ) *exflags |= WS_EX_TOPMOST; @@ -394,6 +389,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"));