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 MgCmdDrawLines::click(const MgMotion* sender) { return (m_step == 0 ? _click(sender) : touchBegan(sender) && touchEnded(sender)); }