From aa29eefaef2f3813ff86ffe2072ed83de5002fcc Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 16 Feb 2005 22:08:57 +0000 Subject: [PATCH] Fixed windows not displaying on SmartPhone git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toplevel.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 6cd98fe487..58438ba15f 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -159,8 +159,11 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const (style & ~wxBORDER_MASK) | wxBORDER_NONE, exflags ) & ~WS_CHILD & ~WS_VISIBLE; -#if defined(__WXWINCE__) && _WIN32_WCE < 400 + // For some reason, WS_VISIBLE needs to be defined on creation for + // SmartPhone 2003. The title can fail to be displayed otherwise. +#if defined(__SMARTPHONE__) || (defined(__WXWINCE__) && _WIN32_WCE < 400) msflags |= WS_VISIBLE; + ((wxTopLevelWindowMSW*)this)->wxWindowBase::Show(true); #endif // first select the kind of window being created @@ -402,6 +405,11 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, } SubclassWin(m_hWnd); + +#ifdef __SMARTPHONE__ + // Work around title non-display glitch + Show(false); +#endif return true; #endif // __WXMICROWIN__/!__WXMICROWIN__ @@ -424,7 +432,13 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title, wxSize sz(size); #endif - return MSWCreate(wxCanvasClassName, title, pos, sz, flags, exflags); + bool result = MSWCreate(wxCanvasClassName, title, pos, sz, flags, exflags); + +#ifdef __SMARTPHONE__ + // Work around title non-display glitch + Show(false); +#endif + return result; } bool wxTopLevelWindowMSW::Create(wxWindow *parent, @@ -574,7 +588,7 @@ bool wxTopLevelWindowMSW::Show(bool show) nShowCmd = SW_MAXIMIZE; // This is necessary, or no window appears -#ifdef __WINCE_STANDARDSDK__ +#if defined( __WINCE_STANDARDSDK__) || defined(__SMARTPHONE__) DoShowWindow(SW_SHOW); #endif -- 2.45.2