void LLFocusMgr::releaseFocusIfNeeded( const LLView* view ) { if( childHasMouseCapture( view ) ) { setMouseCapture( NULL ); } if( childHasKeyboardFocus( view )) { if (view == mLockedView) { mLockedView = NULL; setKeyboardFocus( NULL ); } else { setKeyboardFocus( mLockedView ); } } if( childIsTopCtrl( view ) ) { setTopCtrl( NULL ); } }
bool Fortyeight::newCards() { if ( talon->isEmpty() ) { if ( lastdeal ) { return false; } else { lastdeal = true; flipCardsToPile( pile->cards(), talon, DURATION_MOVE ); } } else { flipCardToPile( talon->topCard(), pile, DURATION_MOVE ); setKeyboardFocus( pile->topCard() ); } if ( talon->isEmpty() && lastdeal ) emit newCardsPossible( false ); return true; }
bool iWidget::handleMouseDoubleClick(iKeyCode key) { if (isActive()) { if (_isMouseOver) { vector<iWidget*> widgets = _children; bool result = false; for (auto widget : widgets) { if (widget->handleMouseDoubleClick(key)) { result = true; } } if (result) { return true; } else { if (key == iKeyCode::MouseLeft) { _widgetAppearanceState = iWidgetAppearanceState::DoubleClicked; setKeyboardFocus(); _doubleClick(this); return true; } } } } return false; }
void LLFocusMgr::restoreKeyboardFocus(LLFocusableElement* current_focus) { if (current_focus && mKeyboardFocus == current_focus) { setKeyboardFocus(mLastKeyboardFocus); mLastKeyboardFocus = NULL; } }
/** Call this to distribute a touch down event to the stage. * @param x the x coordinate of the touch in screen coordinates * @param y the y coordinate of the touch in screen coordinates * @param pointer the pointer index * @param button the button that's been pressed * @return whether an {@link Actor} in the scene processed the event or not */ bool Stage::touchDown( int x, int y, int pointer, int button) { setKeyboardFocus( NULL); Actor* actor = touchFocus[pointer]; if( actor == NULL) actor = root; toStageCoordinates( x, y, coords); Group::toChildCoordinates( actor, coords.x, coords.y, point); return actor->touchDown( point.x, point.y, pointer); }
void LLFocusMgr::releaseFocusIfNeeded( LLView* view ) { if( childHasMouseCapture( view ) ) { setMouseCapture( NULL ); } if( childHasKeyboardFocus( view )) { if (view == mLockedView) { mLockedView = NULL; setKeyboardFocus( NULL ); } else { setKeyboardFocus( mLockedView ); } } LLUI::removePopup(view); }
bool iWidget::handleMouseKeyUp(iKeyCode key) { if (isActive()) { if (_isMouseOver) { vector<iWidget*> widgets = _children; bool result = false; for (auto widget : widgets) { if (widget->handleMouseKeyUp(key)) { result = true; } } if (result) { return true; } else { if (key == iKeyCode::MouseLeft || key == iKeyCode::MouseRight) { if (_widgetAppearanceState == iWidgetAppearanceState::Pressed) { _widgetAppearanceState = iWidgetAppearanceState::Clicked; setKeyboardFocus(); _click(this); if (key == iKeyCode::MouseRight) { _contextMenu(this); } return true; } } } } else if (_acceptOutOfBoundsClicks) { _mouseOffClick(this); } } return false; }
bool iWidgetSelectBox::handleMouseKeyUp(iKeyCode key) { if (!isActive()) { return false; } if (_mouseOverButton) { if (key == iKeyCode::MouseLeft) { _buttonAppearanceState = iWidgetAppearanceState::Standby; if (_selectBox == nullptr) { _selectBox = static_cast<iDialogMenu*>(iWidgetManager::getInstance().createDialog("DialogMenu")); } // TODO insuficcient if select box is within a iWidgetScroll _selectBox->setWidth(getActualWidth() - getActualHeight()); _selectBox->setX(getActualPosX() + 2); _selectBox->setY(getActualPosY() + getActualHeight() + 2); vector<iaString> entries; for (auto entry : _entries) { entries.push_back(entry.first); } _selectBox->show(entries, iDialogMenuCloseDelegate(this, &iWidgetSelectBox::onSelectionChanged)); } setKeyboardFocus(); return true; } return iWidget::handleMouseKeyUp(key); }