int ListBox::OnKeyDown(int vk, int flags) { if (selcount == 1 && list_index >= 0 && list_index < items.size()) { ListBoxItem* item = items[list_index]; if (vk == VK_DOWN) { if (list_index < items.size() - 1) { item->selected = false; list_index++; item = items[list_index]; item->selected = true; OnClick(); return ActiveWindow::OnKeyDown(vk, flags); } } else if (vk == VK_UP) { if (list_index > 0) { item->selected = false; list_index--; item = items[list_index]; item->selected = true; OnClick(); return ActiveWindow::OnKeyDown(vk, flags); } } } return ScrollWindow::OnKeyDown(vk, flags); }
TSharedRef<SWidget> UJavascriptListView::RebuildWidget() { MyListView = SNew(SListView< UObject* >) .SelectionMode(SelectionMode) .ListItemsSource(&Items) .ItemHeight(ItemHeight) .OnGenerateRow(BIND_UOBJECT_DELEGATE(SListView< UObject* >::FOnGenerateRow, HandleOnGenerateRow)) .OnSelectionChanged_Lambda([this](UObject* Object, ESelectInfo::Type SelectInfo){ OnSelectionChanged(Object, SelectInfo); }) .OnMouseButtonClick_Lambda([this](UObject* Object){ OnClick(Object); }) .OnMouseButtonDoubleClick_Lambda([this](UObject* Object){ OnDoubleClick(Object); }) //.OnContextMenuOpening(this, &SSocketManager::OnContextMenuOpening) //.OnItemScrolledIntoView(this, &SSocketManager::OnItemScrolledIntoView) // .HeaderRow // ( // SNew(SHeaderRow) // .Visibility(EVisibility::Collapsed) // + SHeaderRow::Column(TEXT("Socket")) // ); ; return BuildDesignTimeWidget(MyListView.ToSharedRef()); }
void YAddingSong::Notify(TNotifyUI& msg) { if (msg.sType.Compare(kClick)==0) OnClick(msg); else if(msg.sType.Compare(kWindowInit)==0) OnInit(msg); }
void CXTPPopupControl::OnLButtonUp(UINT /*nFlags*/, CPoint point) { //if there is pressed control if (m_pPressed) { //store popup pointer CXTPPopupItem* pPressed = m_pPressed; m_pPressed = NULL; //free mouse event ReleaseCapture(); RedrawControl(); //if selected pointer equal pressed pointer - it is clik on item if (pPressed == m_pSelected) { //redraw all valid items OnClick(pPressed); } else { OnMouseMove(0, point); } } }
void PropertyWin::Notify(TNotifyUI& msg) { if (msg.sType.Compare(kClick)==0) { OnClick(msg); } }
bool CGUIDialogVisualisationSettings::OnMessage(CGUIMessage &message) { switch (message.GetMessage()) { case GUI_MSG_CLICKED: { unsigned int iControl = message.GetSenderId(); if (iControl >= CONTROL_START && iControl < CONTROL_PAGE) OnClick(iControl); return true; } break; case GUI_MSG_WINDOW_DEINIT: case GUI_MSG_VISUALISATION_UNLOADING: { FreeControls(); m_pVisualisation = NULL; m_pSettings = NULL; } break; case GUI_MSG_VISUALISATION_LOADED: { SetVisualisation((CVisualisation *)message.GetLPVOID()); SetupPage(); SET_CONTROL_FOCUS(CONTROL_START, 0); } } return CGUIDialog::OnMessage(message); }
Palindroma::Palindroma(QWidget *parent) : QWidget(parent), ui(new Ui::Palindroma) { ui->setupUi(this); connect( ui->pushButton , SIGNAL(clicked()) , this , SLOT(OnClick())) ; }
bool cVNSIChannelScan::OnAction(int actionId) { if (actionId == ADDON_ACTION_CLOSE_DIALOG || actionId == ADDON_ACTION_PREVIOUS_MENU) OnClick(BUTTON_BACK); return true; }
void ButtonComponent::CheckMouseCollision() { m_wasPressed = false; Vector2f diff = g_input->GetMousePosition() - m_object->GetGlobalPos(); float alpha = -m_object->GetGlobalRotation() * (float)PI / 180.f; Vector2f rotatedDiff = Vector2f(diff.x * cos(alpha) - diff.y * sin(alpha), diff.x * sin(alpha) + diff.y * cos(alpha)); if (rotatedDiff.x >= 0 && rotatedDiff.y >= 0 && rotatedDiff.x <= m_size.x && rotatedDiff.y <= m_size.y) { OnFocus(); if (g_input->WasPressedThisTurn(MOUSE_LEFT)) { OnClick(); } } else { OnUnfocus(); } }
/** *********************************************************************** ** ** OnInputAction ** ************************************************************************ */ BOOL OpNumberEdit::OnInputAction(OpInputAction* action) { #if defined OP_KEY_UP_ENABLED && defined OP_KEY_DOWN_ENABLED switch (action->GetAction()) { case OpInputAction::ACTION_LOWLEVEL_PREFILTER_ACTION: { switch (action->GetChildAction()->GetAction()) { case OpInputAction::ACTION_LOWLEVEL_KEY_PRESSED: { OpKey::Code key = action->GetChildAction()->GetActionKeyCode(); switch (key) { case OP_KEY_UP: case OP_KEY_DOWN: // Simulate click on the up or down button OnClick(m_spinner, key == OP_KEY_DOWN ? 1 : 0); return TRUE; } } } return FALSE; } } #endif // defined OP_KEY_UP_ENABLED && defined OP_KEY_DOWN_ENABLED return FALSE; }
bool CGUIDialogFavourites::OnMessage(CGUIMessage &message) { if (message.GetMessage() == GUI_MSG_CLICKED) { if (message.GetSenderId() == FAVOURITES_LIST) { int item = GetSelectedItem(); int action = message.GetParam1(); if (action == ACTION_SELECT_ITEM || action == ACTION_MOUSE_LEFT_CLICK) OnClick(item); else if (action == ACTION_MOVE_ITEM_UP) OnMoveItem(item, -1); else if (action == ACTION_MOVE_ITEM_DOWN) OnMoveItem(item, 1); else if (action == ACTION_CONTEXT_MENU || action == ACTION_MOUSE_RIGHT_CLICK) OnPopupMenu(item); else if (action == ACTION_DELETE_ITEM) OnDelete(item); else return false; return true; } } else if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT) { CGUIDialog::OnMessage(message); // clear our favourites CGUIMessage message(GUI_MSG_LABEL_RESET, GetID(), FAVOURITES_LIST); OnMessage(message); m_favourites->Clear(); return true; } return CGUIDialog::OnMessage(message); }
bool CDialogRecordPref::OnAction(int actionId) { if (actionId == ADDON_ACTION_CLOSE_DIALOG || actionId == ADDON_ACTION_PREVIOUS_MENU || actionId == 92/*back*/) return OnClick(BUTTON_CANCEL); else return false; }
void Gui::OnAi(void) { ui->buttonBox->setEnabled(false); if(model->solver.isSolved() == false) this->OnSolve(); if(model->solver.isSolved() == false) return; QElapsedTimer timer; timer.start(); for( long y = 0 ; y < model->rowCount() ; y++) { for( long x = 0 ; x < model->columnCount() ; x++) { if(model->solver.get(x, y)) { OnClick(model->index(y, x)); qApp->processEvents(); //yieldCurrentThread(); //msleep(10); } } } double elapsed = static_cast<long>(timer.elapsed()) / 1000.0; statusBar()->showMessage(QString("Autoplay in %1 ms").arg(elapsed)); ui->buttonBox->setEnabled(true); }
void __stdcall ExOptions::m_OnEnter(StormMsg * Msg) // 28.12 -> resolved { OnClick(Msg); Msg->_2 = 1; Msg->_3 = 0; D2Funcs.STORM_ResetMsgQuene(Msg); }
bool Button::HandleEvents(const SDL_Event &Event) { if(Event.type==SDL_EventType::SDL_MOUSEMOTION) { if(PointInside(Event.motion.x, Event.motion.y)) { Selected=true; } else { Selected=false; } } else if(Event.type==SDL_EventType::SDL_MOUSEBUTTONDOWN) { if(Event.button.button==SDL_BUTTON_LEFT) { if(PointInside(Event.button.x, Event.button.y)) { OnClick(); } } } return true; }
// We have to dispatch our own notify messages because the multiple inheritance of CCSHDialog prevents // the message map from compiling properly for ON_NOTIFY messages. BOOL CFailingRulesDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult ) { LPNMHDR pHdr=(LPNMHDR)lParam; bool bHandled=false; switch(pHdr->idFrom){ case IDC_LIST1: switch (pHdr->code) { case LVN_ITEMCHANGED: bHandled=OnItemChanged(wParam, (LPNMLISTVIEW)lParam, pResult); break; case NM_CLICK: bHandled=OnClick(wParam, (LPNMLISTVIEW)lParam, pResult); break; case NM_RCLICK: bHandled=OnRClick(wParam, (LPNMITEMACTIVATE)lParam, pResult); break; default: break; } break; case IDC_LIST2: switch (pHdr->code) { case LVN_ITEMCHANGED: bHandled=OnSolutionItemChanged(wParam,(LPNMLISTVIEW)lParam, pResult); break; default: break; } break; } return bHandled || CeCosDialog::OnNotify(wParam,lParam,pResult); }
eMsgStatus ScrubBarComponent::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr, VRMenuObject * self, VRMenuEvent const & event ) { switch( event.EventType ) { case VRMENU_EVENT_FOCUS_GAINED: HasFocus = true; return MSG_STATUS_ALIVE; case VRMENU_EVENT_FOCUS_LOST: HasFocus = false; return MSG_STATUS_ALIVE; case VRMENU_EVENT_TOUCH_DOWN: TouchDown = true; OnClick( app, vrFrame, event ); return MSG_STATUS_ALIVE; case VRMENU_EVENT_FRAME_UPDATE: return OnFrame( app, vrFrame, menuMgr, self, event ); default: OVR_ASSERT( !"Event flags mismatch!" ); return MSG_STATUS_ALIVE; } }
EVENT_RESULT CGUIBaseContainer::OnMouseEvent(const CPoint &point, const CMouseEvent &event) { if (event.m_id >= ACTION_MOUSE_LEFT_CLICK && event.m_id <= ACTION_MOUSE_DOUBLE_CLICK) { if (SelectItemFromPoint(point - CPoint(m_posX, m_posY))) { OnClick(event.m_id); return EVENT_RESULT_HANDLED; } } else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { Scroll(-1); return EVENT_RESULT_HANDLED; } else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) { Scroll(1); return EVENT_RESULT_HANDLED; } else if (event.m_id == ACTION_GESTURE_NOTIFY) { return (m_orientation == HORIZONTAL) ? EVENT_RESULT_PAN_HORIZONTAL : EVENT_RESULT_PAN_VERTICAL; } else if (event.m_id == ACTION_GESTURE_BEGIN) { // grab exclusive access CGUIMessage msg(GUI_MSG_EXCLUSIVE_MOUSE, GetID(), GetParentID()); SendWindowMessage(msg); return EVENT_RESULT_HANDLED; } else if (event.m_id == ACTION_GESTURE_PAN) { // do the drag and validate our offset (corrects for end of scroll) m_scroller.SetValue(m_scroller.GetValue() - ((m_orientation == HORIZONTAL) ? event.m_offsetX : event.m_offsetY)); float size = (m_layout) ? m_layout->Size(m_orientation) : 10.0f; int offset = (int)MathUtils::round_int(m_scroller.GetValue() / size); m_lastScrollStartTimer.Stop(); m_scrollTimer.Start(); SetOffset(offset); ValidateOffset(); return EVENT_RESULT_HANDLED; } else if (event.m_id == ACTION_GESTURE_END) { // release exclusive access CGUIMessage msg(GUI_MSG_EXCLUSIVE_MOUSE, 0, GetParentID()); SendWindowMessage(msg); m_scrollTimer.Stop(); // and compute the nearest offset from this and scroll there float size = (m_layout) ? m_layout->Size(m_orientation) : 10.0f; float offset = m_scroller.GetValue() / size; int toOffset = (int)MathUtils::round_int(offset); if (toOffset < offset) SetOffset(toOffset+1); else SetOffset(toOffset-1); ScrollToOffset(toOffset); return EVENT_RESULT_HANDLED; } return EVENT_RESULT_UNHANDLED; }
void CMediaWin::Notify(TNotifyUI& msg) { YTrace_(_T("class:%s,id:%s,msg:%s"),msg.pSender->GetClass(),msg.pSender->GetName().GetData(),msg.sType.GetData()); if(0 == msg.sType.Compare(kClick)) return OnClick(msg); else if( 0 == msg.sType.Compare(kDBClick)) FullScreen(! m_bFullScreenMode); }
bool CGUIDialogTranscode::OnAction(int actionId) { if (actionId == ADDON_ACTION_CLOSE_DIALOG || actionId == ADDON_ACTION_PREVIOUS_MENU) return OnClick(BUTTON_CANCEL); else return false; }
bool CGUIDialogFreeSurround::OnAction(int actionId) { if (actionId == ACTION_PREVIOUS_MENU || actionId == ACTION_NAV_BACK) return OnClick(BUTTON_CANCEL); else return false; }
void Menu::HandleEvent(const SDL_Event& evnt) { if (evnt.type == SDL_QUIT) { #if defined MAEMO || defined __SYMBIAN32__ AppWarmux::EmergencyExit(); #else key_cancel(); #endif } else if (evnt.type == SDL_KEYDOWN) { // Drop key events that are purely modifiers if (Keyboard::IsModifier(evnt.key.keysym.sym)) return; // Allow widgets to interpret any key they want, // and do not reserve esc/return/delete/backspace bool used_by_widget = widgets.SendKey(evnt.key.keysym); if (!used_by_widget) { switch (evnt.key.keysym.sym) { case SDLK_ESCAPE: key_cancel(); break; case SDLK_RETURN: case SDLK_KP_ENTER: key_ok(); break; case SDLK_UP: key_up(); break; case SDLK_DOWN: key_down(); break; case SDLK_LEFT: key_left(); break; case SDLK_RIGHT: key_right(); break; case SDLK_TAB: key_tab(); break; default: // should have been handle upper! break; } } } else if (evnt.type == SDL_MOUSEBUTTONUP) { Point2i mousePosition(evnt.button.x, evnt.button.y); if (!BasicOnClickUp(mousePosition)) { OnClickUp(mousePosition, evnt.button.button); } } else if (evnt.type == SDL_MOUSEBUTTONDOWN) { Point2i mousePosition(evnt.button.x, evnt.button.y); OnClick(mousePosition, evnt.button.button); } }
bool CGUIButtonControl::OnAction(const CAction &action) { if (action.GetID() == ACTION_SELECT_ITEM) { OnClick(); return true; } return CGUIControl::OnAction(action); }
void Button::OnEvent(SDL_Event& event) { // Save whether or not there was mouse movement. if (event.type == SDL_MOUSEMOTION) m_mouseMovement = true; // The button is clicked if it's a mouseDown event, and the mouse is over this button if ((event.type == SDL_MOUSEBUTTONDOWN) && m_mouseIsOver) OnClick(); }
DLGPROC Button::Command(unsigned short nCode) { switch (nCode) { case BN_CLICKED: if (OnClick) { return (DLGPROC) OnClick(); } } return FALSE; }
BOOL CCtrlScriptList::OnNotify(int idCtrl, NMHDR *pnmh) { if (pnmh->code == NM_CLICK) { TEventInfo evt = { this, pnmh }; OnClick(&evt); return TRUE; } return CCtrlListView::OnNotify(idCtrl, pnmh); }
bool CGUIWindowBoxeeMediaMain::OnAction(const CAction& action) { if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) { g_windowManager.PreviousWindow(); return true; } else if (action.id == ACTION_PLAYER_PLAY) { if (GetFocusedControl()) return OnClick(GetFocusedControl()->GetID(), ACTION_PLAYER_PLAY); } else if (action.id == ACTION_SHOW_INFO) { if (GetFocusedControl()) return OnClick(GetFocusedControl()->GetID(), ACTION_SHOW_INFO); } return CGUIWindow::OnAction(action); }
// ---------------------------------------------------------------------------------------------------------------------- bool cgILoveShootingGame::OnUIEvent( cgUIWidgetPtr spComponent, cgUIEvent enmEvent, unsigned wparam, unsigned lparam ) { switch (enmEvent) { case cgUIEvent_OnClick: return OnClick(spComponent, wparam, lparam); break; } return false; }
void Widget::OnBtnReleased() { EvtFunc *func = funcs[EVT_BTNPRESSED].func; void *data = funcs[EVT_BTNPRESSED].data; if (func) func(this, data); if (current == PRESSED) { OnClick(); setCurrentState(PRELIGHT); } }
void SelectState::Update(float dt) { if (InputManager::GetInstance().KeyPress(ESCAPE_KEY) || InputManager::GetInstance().QuitRequested()) { popRequested = true; } sombra_anim.Update(dt); timer.Update(dt); MoveCortina(6); OnClick(); UpdateUIArray(dt); }