X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc92adaf0c8d1d8b71b4a4cabe6f42c3a17f62a1..1e255b00ced5114d9b599cd66cd9d737686cec94:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 11b0b43600..58438ba15f 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -145,7 +145,7 @@ void wxTopLevelWindowMSW::Init() m_winLastFocused = (wxWindow *)NULL; -#ifdef __SMARTPHONE__ +#if defined(__SMARTPHONE__) && defined(__WXWINCE__) m_MenuBarHWND = 0; #endif } @@ -159,22 +159,21 @@ 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 // // note that if we don't set WS_POPUP, Windows assumes WS_OVERLAPPED and - // creates a window with both caption and border, hence we also test it - // below in some other cases - if ( style & wxFRAME_TOOL_WINDOW ) - { - msflags |= WS_POPUP; - } - //else: WS_OVERLAPPED is 0 anyhow, so it is on by default + // creates a window with both caption and border, hence we need to use + // WS_POPUP in a few cases just to avoid having caption/border which we + // don't want -#ifndef __SMARTPHONE__ +#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) // border and caption styles if ( style & wxRESIZE_BORDER ) msflags |= WS_THICKFRAME; @@ -406,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__ @@ -428,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, @@ -529,7 +539,7 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent, } #endif -#ifdef __SMARTPHONE__ +#if defined(__SMARTPHONE__) && defined(__WXWINCE__) SetRightMenu(); // to nothing for initialization #endif @@ -578,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 @@ -824,7 +834,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) { #if !defined(__WXMICROWIN__) // get system (a.k.a. window) menu - HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */); + HMENU hmenu = GetSystemMenu(GetHwnd(), FALSE /* get it */); if ( !hmenu ) { // no system menu at all -- ok if we want to remove the close button @@ -904,8 +914,10 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region) void wxTopLevelWindowMSW::RequestUserAttention(int flags) { - // check if we can use FlashWindowEx() -#ifdef FLASHW_STOP + // check if we can use FlashWindowEx(): unfortunately an explicit test for + // FLASHW_STOP, for example, doesn't work because MSVC6 headers do #define + // it but don't provide FlashWindowEx() declaration +#if (WINVER >= 0x0500 && (defined FLASHW_STOP)) // available in the headers, check if it is supported by the system typedef BOOL (WINAPI *FlashWindowEx_t)(FLASHWINFO *pfwi); FlashWindowEx_t s_pfnFlashWindowEx = NULL; @@ -938,11 +950,12 @@ void wxTopLevelWindowMSW::RequestUserAttention(int flags) s_pfnFlashWindowEx(&fwi); } else // FlashWindowEx() not available -#endif // FLASHW_STOP +#endif // FlashWindowEx() defined { wxUnusedVar(flags); - +#ifndef __WXWINCE__ ::FlashWindow(GetHwnd(), TRUE); +#endif // __WXWINCE__ } }