#include "wx/msgdlg.h"
#endif
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include "wx/msw/ole/droptgt.h"
#endif
m_lastEvent = -1;
m_returnCode = 0;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
}
// Have to delete constraints/sizer FIRST otherwise
// sizers may try to look at deleted windows as they
// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
DeleteRelatedConstraints();
if (m_constraints)
{
m_sizerParent = NULL;
m_autoLayout = FALSE;
m_windowValidator = NULL;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
return NULL;
}
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
{
wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
#endif
// delete our drop target if we've got one
- #if USE_DRAG_AND_DROP
+ #if wxUSE_DRAG_AND_DROP
if ( m_pDropTarget != NULL ) {
m_pDropTarget->Revoke(m_hWnd);
bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
{
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( id == 0 ) { // is it a menu item?
DRAWITEMSTRUCT *pDrawStruct = (DRAWITEMSTRUCT *)itemStruct;
wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
#endif // owner-drawn menus
wxWindow *item = FindItem(id);
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
if (item && item->IsKindOf(CLASSINFO(wxControl)))
{
return ((wxControl *)item)->MSWOnDraw(itemStruct);
bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
{
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( id == 0 ) { // is it a menu item?
MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct;
wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
#endif // owner-drawn menus
wxWindow *item = FindItem(id);
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
if (item && item->IsKindOf(CLASSINFO(wxControl)))
{
return ((wxControl *)item)->MSWOnMeasure(itemStruct);
// WM_GETDLGCODE: if the control wants it for itself, don't process it
// (except for Ctrl-Tab combination which is always processed)
- LONG lDlgCode;
+ LONG lDlgCode = 0;
if ( bProcess && !bCtrlDown ) {
lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
}
if ( bProcess ) {
switch ( msg->wParam ) {
case VK_TAB:
- if ( lDlgCode & DLGC_WANTTAB )
+ if ( lDlgCode & DLGC_WANTTAB ) // this is FALSE for Ctrl-Tab
bProcess = FALSE;
else
bForward = !(::GetKeyState(VK_SHIFT) & 0x100);
{
// Generate a LEAVE event
m_mouseInWindow = FALSE;
- MSWOnMouseLeave(pt.x, pt.y, 0);
+
+ int state = 0;
+ if (::GetKeyState(VK_SHIFT) != 0)
+ state |= MK_SHIFT;
+ if (::GetKeyState(VK_CONTROL) != 0)
+ state |= MK_CONTROL;
+
+ // Unfortunately the mouse button and keyboard state may have changed
+ // by the time the OnIdle function is called, so 'state' may be
+ // meaningless.
+
+ MSWOnMouseLeave(pt.x, pt.y, state);
}
}
UpdateWindowUI();