bool CUIMMShniaga::OnKeyboard(int dik, EUIMessages keyboard_action){ if (WINDOW_KEY_PRESSED == keyboard_action){ switch (dik){ case DIK_UP: if (m_selected_btn > 0) SelectBtn(m_selected_btn - 1); return true; case DIK_DOWN: if (m_selected_btn < BtnCount() - 1) SelectBtn(m_selected_btn + 1); return true; case DIK_RETURN: OnBtnClick(); return true; case DIK_ESCAPE: if (1 == m_page) ShowMain(); return true; } } return CUIWindow::OnKeyboard(dik, keyboard_action); }
void CEnEdit::OnLButtonUp(UINT nFlags, CPoint point) { CMaskEdit::OnLButtonUp(nFlags, point); if (m_nButtonDown == -1) return; ClientToScreen(&point); int nBtnDown = m_nButtonDown; int nBtnUp = ButtonHitTest(point); // update UI ReleaseCapture(); m_nButtonDown = -1; SendMessage(WM_NCPAINT); // process if (nBtnDown == nBtnUp) { // call derived class first OnBtnClick(m_aButtons[nBtnUp].nID); // then parent GetParent()->SendMessage(WM_EE_BTNCLICK, GetDlgCtrlID(), m_aButtons[nBtnUp].nID); } SendMessage(WM_NCPAINT); }
bool CUIMMShniaga::OnMouse(float x, float y, EUIMessages mouse_action){ Fvector2 pos = UI()->GetUICursor()->GetCursorPosition(); Frect r; m_magnifier->GetAbsoluteRect(r); if (WINDOW_LBUTTON_DOWN == mouse_action && r.in(pos.x, pos.y)) { OnBtnClick(); } return CUIWindow::OnMouse(x,y,mouse_action); }