void CDxMonthPicker::ProcessButtons(CPoint point) { BOOL bHighlight = m_btnToday->m_rcButton.PtInRect(point); if (m_btnCaptured == m_btnToday) { if (bHighlight != m_btnToday->m_bPressed) { m_btnToday->m_bPressed = bHighlight; NotifyInvalidate(); } } else if (m_btnToday->m_bPressed) { m_btnToday->m_bPressed = FALSE; if (bHighlight) OnButtonClick(m_btnToday->m_nID); NotifyInvalidate(); } bHighlight = m_btnToday->m_bHighlight; m_btnToday->m_bHighlight = ((m_btnCaptured == m_btnToday) || (!m_btnCaptured && m_btnToday->m_rcButton.PtInRect(point))); if (m_btnToday->m_bHighlight != bHighlight) { NotifyInvalidate(); } }
/** Used to intercept Escape key presses, then interprets them as cancel */ virtual FReply OnKeyDown( const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent ) { // Pressing escape returns as if the user canceled if ( InKeyEvent.GetKey() == EKeys::Escape ) { return OnButtonClick(FDlgDeltaTransform::Cancel); } return FReply::Unhandled(); }
/** * Handles enter key in combo box * * @param event command event originated by the control */ void FindReplaceDialog::OnComboBoxEnter(wxCommandEvent& event) { if (event.GetEventObject() == mFindComboBox || event.GetEventObject() == mReplaceComboBox) { #ifdef DEBUG_FIND_REPLACE MessageInterface::ShowMessage ("FindReplaceDialog::OnComboBoxEnter() Find entered\n"); #endif wxCommandEvent tempEvent; tempEvent.SetEventObject(mFindNextButton); OnButtonClick(tempEvent); } }
void ButtonListDialog::SendMessage(CUIWindow* wnd, s16 msg, void* data /*= nullptr */) { if (BUTTON_CLICKED == msg) { if (CancelButton == wnd) OnCancel(); for (u32 i = 0; i < buttons.size(); i++) { if (buttons[i].Button == wnd) { OnButtonClick(i); return; } } } }
BOOL ZDForm::handle_event (HELEMENT he, BEHAVIOR_EVENT_PARAMS& params ) { switch( params.cmd ) { case BUTTON_CLICK: OnButtonClick(he, params); break;// click on button case BUTTON_PRESS: break;// mouse down or key down in button case BUTTON_STATE_CHANGED: break; case EDIT_VALUE_CHANGING: break;// before text change case EDIT_VALUE_CHANGED: break;//after text change case SELECT_SELECTION_CHANGED: break;// selection in <select> changed case SELECT_STATE_CHANGED: break;// node in select expanded/collapsed, heTarget is the node case POPUP_REQUEST: break;// request to show popup just received, // here DOM of popup element can be modifed. case POPUP_READY: break;// popup element has been measured and ready to be shown on screen, // here you can use functions like ScrollToView. case POPUP_DISMISSED: break;// popup element is closed, // here DOM of popup element can be modifed again - e.g. some items can be removed // to free memory. case MENU_ITEM_ACTIVE: // menu item activated by mouse hover or by keyboard break; case MENU_ITEM_CLICK: // menu item click break; // "grey" event codes - notfications from behaviors from this SDK case HYPERLINK_CLICK: break;// hyperlink click case TABLE_HEADER_CLICK: break;// click on some cell in table header, // target = the cell, // reason = index of the cell (column number, 0..n) case TABLE_ROW_CLICK: break;// click on data row in the table, target is the row // target = the row, // reason = index of the row (fixed_rows..n) case TABLE_ROW_DBL_CLICK: break;// mouse dbl click on data row in the table, target is the row // target = the row, // reason = index of the row (fixed_rows..n) case ELEMENT_COLLAPSED: break;// element was collapsed, so far only behavior:tabs is sending these two to the panels case ELEMENT_EXPANDED: break;// element was expanded, } return FALSE; }
bool ButtonListDialog::OnKeyboardAction(int dik, EUIMessages keyboardAction) { CUIDialogWnd::OnKeyboardAction(dik, keyboardAction); if (WINDOW_KEY_PRESSED == keyboardAction) { if (DIK_ESCAPE == dik) { OnCancel(); return true; } int btnCount = buttons.size(); if (dik >= DIK_1 && dik <= DIK_1-1+btnCount && btnCount <= 9) // handle 1..9 keys only { OnButtonClick(dik-DIK_1); return true; } } return false; }