#define HAVE_TRACKMOUSEEVENT
#endif // everything needed for TrackMouseEvent()
-// if this is set to 1, we use deferred window sizing to reduce flicker when
-// resizing complicated window hierarchies, but this can in theory result in
-// different behaviour than the old code so we keep the possibility to use it
-// by setting this to 0 (in the future this should be removed completely)
-#ifdef __WXWINCE__
-#define USE_DEFERRED_SIZING 0
-#else
-#define USE_DEFERRED_SIZING 1
-#endif
-
// set this to 1 to filter out duplicate mouse events, e.g. mouse move events
// when mouse position didnd't change
#ifdef __WXWINCE__
m_lastKeydownProcessed = false;
m_hWnd = 0;
- m_hDWP = 0;
m_xThumbSize = 0;
m_yThumbSize = 0;
+#if wxUSE_DEFERRED_SIZING
+ m_hDWP = 0;
m_pendingPosition = wxDefaultPosition;
m_pendingSize = wxDefaultSize;
+#endif // wxUSE_DEFERRED_SIZING
#ifdef __POCKETPC__
m_contextMenuEnabled = false;
bool wxWindowMSW::IsSizeDeferred() const
{
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
if ( m_pendingPosition != wxDefaultPosition ||
m_pendingSize != wxDefaultSize )
return true;
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
return false;
}
// Get total size
void wxWindowMSW::DoGetSize(int *x, int *y) const
{
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
// if SetSize() had been called at wx level but not realized at Windows
// level yet (i.e. EndDeferWindowPos() not called), we still should return
// the new and not the old position to the other wx code
*y = m_pendingSize.y;
}
else // use current size
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
{
RECT rect = wxGetWindowRect(GetHwnd());
// Get size *available for subwindows* i.e. excluding menu bar etc.
void wxWindowMSW::DoGetClientSize(int *x, int *y) const
{
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
if ( m_pendingSize != wxDefaultSize )
{
// we need to calculate the client size corresponding to pending size
*y = rect.bottom - rect.top;
}
else
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
{
RECT rect = wxGetClientRect(GetHwnd());
bool
wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height)
{
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
// if our parent had prepared a defer window handle for us, use it (unless
// we are a top level window)
wxWindowMSW * const parent = IsTopLevel() ? NULL : GetParent();
}
// otherwise (or if deferring failed) move the window in place immediately
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
if ( !::MoveWindow((HWND)hwnd, x, y, width, height, IsShown()) )
{
wxLogLastError(wxT("MoveWindow"));
}
- // if USE_DEFERRED_SIZING, indicates that we didn't use deferred move,
+ // if wxUSE_DEFERRED_SIZING, indicates that we didn't use deferred move,
// ignored otherwise
return false;
}
if ( DoMoveSibling(m_hWnd, x, y, width, height) )
{
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
m_pendingPosition = wxPoint(x, y);
m_pendingSize = wxSize(width, height);
}
{
m_pendingPosition = wxDefaultPosition;
m_pendingSize = wxDefaultSize;
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
}
}
bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
{
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
// when we resize this window, its children are probably going to be
// repositioned as well, prepare to use DeferWindowPos() for them
int numChildren = 0;
useDefer = true;
}
}
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
// update this window size
bool processed = false;
processed = HandleWindowEvent(event);
}
-#if USE_DEFERRED_SIZING
+#if wxUSE_DEFERRED_SIZING
// and finally change the positions of all child windows at once
if ( useDefer && m_hDWP )
{
node;
node = node->GetNext() )
{
- wxWindowMSW *child = node->GetData();
- child->m_pendingPosition = wxDefaultPosition;
- child->m_pendingSize = wxDefaultSize;
+ wxWindowMSW * const child = node->GetData();
+ child->MSWEndDeferWindowPos();
}
}
-#endif // USE_DEFERRED_SIZING
+#endif // wxUSE_DEFERRED_SIZING
return processed;
}
#endif // !__WXMICROWIN__
-#if wxDEBUG_LEVEL > =2
+#if wxDEBUG_LEVEL >= 2
const wxChar *wxGetMessageName(int message)
{
switch ( message )
case 0x0120: return wxT("WM_MENUCHAR");
case 0x0121: return wxT("WM_ENTERIDLE");
+ case 0x0127: return wxT("WM_CHANGEUISTATE");
+ case 0x0128: return wxT("WM_UPDATEUISTATE");
+ case 0x0129: return wxT("WM_QUERYUISTATE");
+
case 0x0132: return wxT("WM_CTLCOLORMSGBOX");
case 0x0133: return wxT("WM_CTLCOLOREDIT");
case 0x0134: return wxT("WM_CTLCOLORLISTBOX");