- 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)
// 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();
#endif
#define USE_DEFERRED_SIZING 1
+#define USE_DEFER_BUG_WORKAROUND 0
// ----------------------------------------------------------------------------
// constants
#include <limits.h> // for INT_MIN
#define USE_DEFERRED_SIZING 1
+#define USE_DEFER_BUG_WORKAROUND 0
// ----------------------------------------------------------------------------
// macros
// 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)
{
*y = extraData->m_size.y;
return;
}
+#endif
RECT spinrect, textrect, ctrlrect;
GetWindowRect(GetHwnd(), &spinrect);
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)
{
*y = extraData->m_pos.y;
return;
}
+#endif
// hack: pretend that our HWND is the text control just for a moment
WXHWND hWnd = GetHWND();
#endif // everything needed for TrackMouseEvent()
#define USE_DEFERRED_SIZING 1
+#define USE_DEFER_BUG_WORKAROUND 0
// ---------------------------------------------------------------------------
// global variables
// 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)
{
*y = extraData->m_size.y;
return;
}
+#endif
RECT rect = wxGetWindowRect(GetHwnd());
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)
{
*y = extraData->m_pos.y;
return;
}
+#endif
RECT rect = wxGetWindowRect(GetHwnd());
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.
extraData->m_deferring = false;
}
}
+#endif
}
#endif