X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe62518e7c989b18653b9d07e19ba8a187f24cf1..911219b2abc5ab610481fe8d4fcc3674d74e637e:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 909d29bb87..8378923a5c 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -445,6 +445,13 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, } #endif // !__WXWINCE__ + if ( !title.empty() ) + { + ::SetWindowText(GetHwnd(), title.wx_str()); + } + + SubclassWin(m_hWnd); + #if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__) // move the dialog to its initial position without forcing repainting int x, y, w, h; @@ -466,13 +473,6 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, } #endif // !__WXWINCE__ - if ( !title.empty() ) - { - ::SetWindowText(GetHwnd(), title.wx_str()); - } - - SubclassWin(m_hWnd); - #ifdef __SMARTPHONE__ // Work around title non-display glitch Show(false); @@ -1170,54 +1170,6 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) return true; } -#ifndef __WXWINCE__ - -bool wxTopLevelWindowMSW::SetShape(const wxRegion& region) -{ - wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); - - // The empty region signifies that the shape should be removed from the - // window. - if ( region.IsEmpty() ) - { - if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0) - { - wxLogLastError(wxT("SetWindowRgn")); - return false; - } - return true; - } - - // Windows takes ownership of the region, so - // we'll have to make a copy of the region to give to it. - DWORD noBytes = ::GetRegionData(GetHrgnOf(region), 0, NULL); - RGNDATA *rgnData = (RGNDATA*) new char[noBytes]; - ::GetRegionData(GetHrgnOf(region), noBytes, rgnData); - HRGN hrgn = ::ExtCreateRegion(NULL, noBytes, rgnData); - delete[] (char*) rgnData; - - // SetWindowRgn expects the region to be in coordinants - // relative to the window, not the client area. Figure - // out the offset, if any. - RECT rect; - DWORD dwStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE); - DWORD dwExStyle = ::GetWindowLong(GetHwnd(), GWL_EXSTYLE); - ::GetClientRect(GetHwnd(), &rect); - ::AdjustWindowRectEx(&rect, dwStyle, ::GetMenu(GetHwnd()) != NULL, dwExStyle); - ::OffsetRgn(hrgn, -rect.left, -rect.top); - - // Now call the shape API with the new region. - if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0) - { - wxLogLastError(wxT("SetWindowRgn")); - return false; - } - return true; -} - -#endif // !__WXWINCE__ - void wxTopLevelWindowMSW::RequestUserAttention(int flags) { // check if we can use FlashWindowEx(): unfortunately a simple test for