X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2d5a7ee008faae08694abd039f7da235da8bce5..ee3510132b8b4160f848bd4f502a6f5315f90dbc:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index b05e19decc..4ee8e7b1f3 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -391,8 +391,9 @@ bool wxWindowMSW::Create(wxWindow *parent, DWORD msflags = WS_VISIBLE | MSWGetCreateWindowFlags(&exstyle); #ifdef __WXUNIVERSAL__ - // no 3d effects, we draw them ourselves - exStyle = 0; + // no borders, we draw them ourselves + exstyle = 0; + msflags &= ~WS_BORDER; #endif // wxUniversal if ( style & wxPOPUP_WINDOW ) @@ -998,15 +999,20 @@ bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc) // FIXME: Doesn't handle wnd procs set by SetWindowLong, only these set // with RegisterClass!! - static wxChar buffer[512]; - WNDCLASS cls; + if ( wxUsingUnicowsDll() ) + { + static wxChar buffer[512]; + WNDCLASS cls; - ::GetClassName((HWND)hWnd, buffer, 512); - ::GetClassInfo(wxGetInstance(), buffer, &cls); - return wndProc == (WXFARPROC)cls.lpfnWndProc; -#else - return wndProc == (WXFARPROC)::GetWindowLong((HWND)hWnd, GWL_WNDPROC); + ::GetClassName((HWND)hWnd, buffer, 512); + ::GetClassInfo(wxGetInstance(), buffer, &cls); + return wndProc == (WXFARPROC)cls.lpfnWndProc; + } + else #endif + { + return wndProc == (WXFARPROC)::GetWindowLong((HWND)hWnd, GWL_WNDPROC); + } } // ---------------------------------------------------------------------------- @@ -1022,7 +1028,11 @@ void wxWindowMSW::SetWindowStyleFlag(long flags) // update the internal variable wxWindowBase::SetWindowStyleFlag(flags); - // now update the Windows style as well if needed + // now update the Windows style as well if needed - and if the window had + // been already created + if ( !GetHwnd() ) + return; + WXDWORD exstyle, exstyleOld; long style = MSWGetStyle(flags, &exstyle), styleOld = MSWGetStyle(flagsOld, &exstyleOld); @@ -1074,7 +1084,8 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const if ( flags & wxCLIP_SIBLINGS ) style |= WS_CLIPSIBLINGS; - if ( (flags & wxBORDER_MASK) != wxBORDER_NONE ) + wxBorder border = (wxBorder)(flags & wxBORDER_MASK); + if ( border != wxBORDER_NONE && border != wxBORDER_DEFAULT ) style |= WS_BORDER; // now deal with ext style if the caller wants it @@ -1093,6 +1104,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const case wxBORDER_NONE: case wxBORDER_SIMPLE: + case wxBORDER_DEFAULT: break; case wxBORDER_STATIC: @@ -1103,7 +1115,6 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const *exstyle |= WS_EX_WINDOWEDGE; break; - case wxBORDER_DEFAULT: case wxBORDER_SUNKEN: *exstyle |= WS_EX_CLIENTEDGE; break; @@ -1263,7 +1274,9 @@ void wxWindowMSW::OnIdle(wxIdleEvent& WXUNUSED(event)) // Check if we need to send a LEAVE event if ( m_mouseInWindow ) { - if ( !IsMouseInWindow() && !HasCapture()) + // note that we should generate the leave event whether the window has + // or doesn't have mouse capture + if ( !IsMouseInWindow() ) { // Generate a LEAVE event m_mouseInWindow = FALSE; @@ -1632,15 +1645,6 @@ void wxWindowMSW::DoSetClientSize(int width, int height) break; } - if ( i == 3 ) - { - // how did it happen? maybe OnSize() handler does something really - // strange in this class? - wxFAIL_MSG( _T("logic error in DoSetClientSize") ); - - break; - } - int widthClient = width, heightClient = height; @@ -2699,21 +2703,6 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam } break; #endif // __WIN32__ - - // unfortunately this doesn't really work as then window which - // doesn't accept focus doesn't get any mouse events neither which - // means it can't get any input at all -#if 0 //def __WXUNIVERSAL__ - case WM_NCHITTEST: - // we shouldn't allow the windows which don't want to get focus to - // get it - if ( !AcceptsFocus() ) - { - rc.result = HTTRANSPARENT; - processed = TRUE; - } - break; -#endif // __WXUNIVERSAL__ } if ( !processed ) @@ -5160,6 +5149,7 @@ wxPoint wxGetMousePosition() { POINT pt; GetCursorPos( & pt ); + return wxPoint(pt.x, pt.y); }