X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20bdddadd5659e9fd150477384a4852ee24f37ff..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/msw/treectrl.cpp?ds=sidebyside diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 20d027fbcd..8c48543587 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1665,7 +1665,7 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) : IDX_COLLAPSE] [IDX_DONE], this, item); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } //else: change didn't took place, so do nothing at all } @@ -1727,7 +1727,7 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select) _T("SelectItem(false) works only for multiselect") ); wxTreeEvent event(wxEVT_COMMAND_TREE_SEL_CHANGING, this, item); - if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() ) + if ( !HandleWindowEvent(event) || event.IsAllowed() ) { if ( HasFlag(wxTR_MULTIPLE) ) { @@ -1748,7 +1748,7 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select) } event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } //else: program vetoed the change } @@ -1948,11 +1948,9 @@ bool wxTreeCtrl::MSWShouldPreProcessMessage(WXMSG* msg) { if ( msg->message == WM_KEYDOWN ) { - const bool isAltDown = ::GetKeyState(VK_MENU) < 0; - - // Only eat VK_RETURN if not being used by the application in conjunction with - // modifiers - if ( msg->wParam == VK_RETURN && !wxIsCtrlDown() && !wxIsShiftDown() && !isAltDown) + // Only eat VK_RETURN if not being used by the application in + // conjunction with modifiers + if ( (msg->wParam == VK_RETURN) && !wxIsAnyModifierDown() ) { // we need VK_RETURN to generate wxEVT_COMMAND_TREE_ITEM_ACTIVATED return false; @@ -2043,7 +2041,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara event.m_pointDrag = pt; - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) processed = true; //else: continue with generating wxEVT_CONTEXT_MENU in base class code } @@ -2282,7 +2280,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, this, htItem); event.m_pointDrag = wxPoint(x, y); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); // if we don't do it, the tree seems to think that 2 items // are selected simultaneously which is quite weird @@ -2607,8 +2605,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // fabricate the lParam and wParam parameters sufficiently // similar to the ones from a "real" WM_KEYDOWN so that // CreateKeyEvent() works correctly - const bool isAltDown = ::GetKeyState(VK_MENU) < 0; - WXLPARAM lParam = (isAltDown ? KF_ALTDOWN : 0) << 16; + WXLPARAM lParam = (wxIsAltDown() ? KF_ALTDOWN : 0) << 16; WXWPARAM wParam = info->wVKey; @@ -2626,7 +2623,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wParam); // a separate event for Space/Return - if ( !wxIsCtrlDown() && !wxIsShiftDown() && !isAltDown && + if ( !wxIsAnyModifierDown() && ((info->wVKey == VK_SPACE) || (info->wVKey == VK_RETURN)) ) { wxTreeItemId item; @@ -2635,7 +2632,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxTreeEvent event2(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, this, item); - (void)GetEventHandler()->ProcessEvent(event2); + (void)HandleWindowEvent(event2); } } break; @@ -2852,7 +2849,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( event.m_item.IsOk() ) event.SetClientObject(GetItemData(event.m_item)); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); // post processing switch ( hdr->code )