From: Julian Smart Date: Thu, 28 Apr 2005 18:21:03 +0000 (+0000) Subject: Reverted/commented out unsuccessful defer fix X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/283587a491a718c8f568f70a143c9b1b2992306b?hp=83c8bcfde6906e141051345fdb6c6eb3ca4ec0a2 Reverted/commented out unsuccessful defer fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 0ca9f953bb..1cc442e053 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -13,8 +13,6 @@ wxMSW: - Fixed erroneous selection of content in wxComboBox when within a wxStaticBox (checking for selection caused by WM_STYLECHANGED). -- Worked around an apparent bug in Windows whereby some deferred positioning - failed: specifically when changing a position from x, to y, to x again. - Added deferred positioning to wxRadioBox, wxSlider and wxSpinCtrl and thereby eliminated some refresh glitches when resizing. - Eliminated further refresh glitches caused by wxRadioBox (to nearby controls) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 82c3471b21..dcbbe09151 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -719,7 +719,7 @@ wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) // in a dynamic layout. Refreshing causes flicker, but it's better than // leaving droppings. Note that for some reason, wxStaticBox doesn't need // this (perhaps because it has no real children?) - else if (nMsg == WM_MOVE && IsKindOf(CLASSINFO(wxRadioBox))) + else if (nMsg == WM_MOVE) { WXLRESULT res = wxControl::MSWWindowProc(nMsg, wParam, lParam); wxRect rect = GetRect(); diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 7efe6d803d..35380bd868 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -43,6 +43,7 @@ #endif #define USE_DEFERRED_SIZING 1 +#define USE_DEFER_BUG_WORKAROUND 0 // ---------------------------------------------------------------------------- // constants diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 907fb9f882..b33dee669b 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -46,6 +46,7 @@ #include // for INT_MIN #define USE_DEFERRED_SIZING 1 +#define USE_DEFER_BUG_WORKAROUND 0 // ---------------------------------------------------------------------------- // macros @@ -610,6 +611,7 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height) // get total size of the control void wxSpinCtrl::DoGetSize(int *x, int *y) const { +#if USE_DEFER_BUG_WORKAROUND wxExtraWindowData* extraData = (wxExtraWindowData*) m_windowReserved; if (extraData && extraData->m_deferring && GetParent() && GetParent()->m_hDWP) { @@ -617,6 +619,7 @@ void wxSpinCtrl::DoGetSize(int *x, int *y) const *y = extraData->m_size.y; return; } +#endif RECT spinrect, textrect, ctrlrect; GetWindowRect(GetHwnd(), &spinrect); @@ -631,6 +634,7 @@ void wxSpinCtrl::DoGetSize(int *x, int *y) const void wxSpinCtrl::DoGetPosition(int *x, int *y) const { +#if USE_DEFER_BUG_WORKAROUND wxExtraWindowData* extraData = (wxExtraWindowData*) m_windowReserved; if (extraData && extraData->m_deferring && GetParent() && GetParent()->m_hDWP) { @@ -638,6 +642,7 @@ void wxSpinCtrl::DoGetPosition(int *x, int *y) const *y = extraData->m_pos.y; return; } +#endif // hack: pretend that our HWND is the text control just for a moment WXHWND hWnd = GetHWND(); diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a0f4fe6255..c2a83c0347 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -120,6 +120,7 @@ #endif // everything needed for TrackMouseEvent() #define USE_DEFERRED_SIZING 1 +#define USE_DEFER_BUG_WORKAROUND 0 // --------------------------------------------------------------------------- // global variables @@ -1451,6 +1452,7 @@ void wxWindowMSW::DoSetToolTip(wxToolTip *tooltip) // Get total size void wxWindowMSW::DoGetSize(int *x, int *y) const { +#if USE_DEFER_BUG_WORKAROUND wxExtraWindowData* extraData = (wxExtraWindowData*) m_windowReserved; if (extraData && extraData->m_deferring && GetParent() && GetParent()->m_hDWP) { @@ -1458,6 +1460,7 @@ void wxWindowMSW::DoGetSize(int *x, int *y) const *y = extraData->m_size.y; return; } +#endif RECT rect = wxGetWindowRect(GetHwnd()); @@ -1480,6 +1483,7 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const void wxWindowMSW::DoGetPosition(int *x, int *y) const { +#if USE_DEFER_BUG_WORKAROUND wxExtraWindowData* extraData = (wxExtraWindowData*) m_windowReserved; if (extraData && extraData->m_deferring && GetParent() && GetParent()->m_hDWP) { @@ -1487,6 +1491,7 @@ void wxWindowMSW::DoGetPosition(int *x, int *y) const *y = extraData->m_pos.y; return; } +#endif RECT rect = wxGetWindowRect(GetHwnd()); @@ -4241,6 +4246,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) wxLogLastError(_T("EndDeferWindowPos")); } +#if USE_DEFER_BUG_WORKAROUND // Seems to be a bug in DeferWindowPos such that going from (a) to (b) to (a) // doesn't work (omits last position/size). So check if there's a disparity, // and correct. @@ -4260,6 +4266,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) extraData->m_deferring = false; } } +#endif } #endif