void SpellShortcutContainer::mousePressed(MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); if (index == -1) return; const MouseButtonT eventButton = event.getButton(); if (eventButton == MouseButton::LEFT) { const int itemId = getItemByIndex(index); if (itemId > 0) mSpellClicked = true; event.consume(); } else if (eventButton == MouseButton::MIDDLE) { if ((spellShortcut == nullptr) || (spellManager == nullptr)) return; event.consume(); const int itemId = getItemByIndex(index); spellManager->invoke(itemId); } }
void OutfitWindow::mousePressed(MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); if (event.getButton() == MouseButton::RIGHT && popupMenu) { popupMenu->showOutfitsWindowPopup(viewport->mMouseX, viewport->mMouseY); event.consume(); return; } else if (index == -1) { Window::mousePressed(event); return; } mMoved = false; event.consume(); if (mItems[mCurrentOutfit][index] > 0) { mItemClicked = true; } else { if (dragDrop.isSelected()) { mItems[mCurrentOutfit][index] = dragDrop.getSelected(); mItemColors[mCurrentOutfit][index] = dragDrop.getSelectedColor(); dragDrop.deselect(); save(); } } Window::mousePressed(event); }
void ClickLabel::mouseReleased(MouseEvent& mouseEvent) { if (mouseEvent.getButton() == MouseEvent::LEFT && mMousePressed && mHasMouse) { mMousePressed = false; distributeActionEvent(); mouseEvent.consume(); } else if (mouseEvent.getButton() == MouseEvent::LEFT) { mMousePressed = false; mouseEvent.consume(); } }
void HScrollBar::mouseUpCB( MouseEvent &mouseArgs ) { if (mouseArgs.getSourceWidget() == pChildLeftArrow) { leftArrowDown = false; mouseArgs.consume(); } if (mouseArgs.getSourceWidget() == pChildRightArrow) { rightArrowDown = false; mouseArgs.consume(); } }
void OutfitWindow::mouseReleased(MouseEvent &event) { if (event.getButton() == MouseButton::LEFT) { if (mCurrentOutfit < 0 || mCurrentOutfit >= static_cast<signed int>(OUTFITS_COUNT)) { return; } const int index = getIndexFromGrid(event.getX(), event.getY()); if (index == -1) { dragDrop.clear(); Window::mouseReleased(event); return; } mMoved = false; event.consume(); if (!dragDrop.isEmpty()) { if (dragDrop.isSourceItemContainer()) { mItems[mCurrentOutfit][index] = dragDrop.getItem(); mItemColors[mCurrentOutfit][index] = dragDrop.getItemColor(); dragDrop.clear(); dragDrop.deselect(); save(); } } if (mItemClicked) mItemClicked = false; } Window::mouseReleased(event); }
void Slider::mouseWheelMovedDown(MouseEvent& mouseEvent) { setValue(getValue() - getStepLength()); distributeActionEvent(); mouseEvent.consume(); }
void SpellShortcutContainer::mouseDragged(MouseEvent &event) { if (event.getButton() == MouseButton::LEFT) { if (dragDrop.isEmpty() && mSpellClicked) { mSpellClicked = false; const int index = getIndexFromGrid(event.getX(), event.getY()); if (index == -1) return; const int itemId = getItemByIndex(index); if (itemId < 0) return; event.consume(); TextCommand *const spell = spellManager->getSpell(itemId); if (spell != nullptr) { dragDrop.dragCommand(spell, DragDropSource::Spells, index); dragDrop.setItem(spell->getId() + SPELL_MIN_ID); } else { dragDrop.clear(); mSpellClicked = false; } } } }
void Button::mouseLeave( MouseEvent &mouseEvent ) { mouseIsInside = false; modifyButtonState(); mouseEvent.consume(); }
void ScrollPane::mouseWheelUp( MouseEvent &mouseEvent ) { pChildVScroll->setValue(pChildVScroll->getValue() - getWheelScrollRate() - mouseEvent.getMouseWheelChange()); mouseEvent.consume(); }
void ClickLabel::mousePressed(MouseEvent& mouseEvent) { if (mouseEvent.getButton() == MouseEvent::LEFT) { mMousePressed = true; mouseEvent.consume(); } }
void Button::mouseReleased(MouseEvent& mouseEvent) { if (mouseEvent.getButton() == MouseEvent::LEFT && mMousePressed && mHasMouse) { mMousePressed = false; generateAction(); mouseEvent.consume(); } else if (mouseEvent.getButton() == MouseEvent::LEFT) { mMousePressed = false; mouseEvent.consume(); } }
void GuiTable::mouseWheelMovedDown(MouseEvent& event) { if (isFocused()) { setSelectedRow(getSelectedRow() + 1); event.consume(); } }
void RadioButton::mouseClick( MouseEvent &mouseEvent ) { if(mouseEvent.getButton() == MOUSE_BUTTON_LEFT) { nextCheckState(); mouseEvent.consume(); } }
void Button::mousePressed(MouseEvent& mouseEvent) { if (mouseEvent.GetButton() == MouseEvent::LEFT) { mMousePressed = true; mouseEvent.consume(); } }
void TextBox::mousePressed(MouseEvent& mouseEvent) { if (mouseEvent.getButton() == MouseEvent::Left) { mText->setCaretPosition(mouseEvent.getX(), mouseEvent.getY(), getFont()); mouseEvent.consume(); } }
void DropDown::mouseWheelMovedDown(MouseEvent& mouseEvent) { if (isFocused() && mouseEvent.getSource() == this) { mouseEvent.consume(); mListBox->setSelected(mListBox->getSelected() + 1); } }
void ListBox::mouseWheelMovedDown(MouseEvent& mouseEvent) { if (isFocused()) { setSelected(getSelected() + 1); mouseEvent.consume(); } }
void RadioButton::mouseUp( MouseEvent &mouseEvent ) { if(mouseEvent.getButton() == MOUSE_BUTTON_LEFT) { mouseIsDown = false; mouseEvent.consume(); } modifyRadioButtonState(); }
virtual void onDoubleClick(MouseEvent& ev) { if (ev.getButton() == MouseButton::Right) { m_console->println(L"onDoubleClick() consumed"); ev.consume(); } else m_console->println(L"onDoubleClick() not consumed (use right-button to consume it)"); Widget::onDoubleClick(ev); }
void Button::mouseDown( MouseEvent &mouseEvent ) { if(mouseEvent.getButton() == MOUSE_BUTTON_LEFT) { mouseIsDown = true; mouseEvent.consume(); } modifyButtonState(); }
void HScrollBar::mouseDragCB( MouseEvent &mouseArgs ) { if(mouseArgs.getSourceWidget() == pChildThumb) { int mouseChange = mouseArgs.getX() + pChildThumb->getLocation().getX() - downMousePos; int thumbChange = downThumbPos + mouseChange; setValue(getValueFromPosition(thumbChange)); mouseArgs.consume(); } }
void GuiTable::mouseWheelMovedUp(MouseEvent& event) { if (isFocused()) { const int selRow = getSelectedRow(); if (selRow > 0 || (selRow == 0 && mWrappingEnabled)) setSelectedRow(selRow - 1); event.consume(); } }
void ScrollArea::mouseReleased(MouseEvent& mouseEvent) { mUpButtonPressed = false; mDownButtonPressed = false; mLeftButtonPressed = false; mRightButtonPressed = false; mIsHorizontalMarkerDragged = false; mIsVerticalMarkerDragged = false; mouseEvent.consume(); }
void Button::mouseClick( MouseEvent &mouseEvent ) { if(isToggleButton() && mouseEvent.getButton() == MOUSE_BUTTON_LEFT) { handleToggleClick(); mouseEvent.consume(); } if(mouseEvent.getButton() == MOUSE_BUTTON_LEFT) dispatchActionEvent(ActionEvent(this)); }
void ScrollArea::mouseWheelMovedDown(MouseEvent& mouseEvent) { if (mouseEvent.isConsumed()) { return; } setVerticalScrollAmount(getVerticalScrollAmount() + getChildrenArea().height / 8); mouseEvent.consume(); }
void ListBox::mouseWheelMovedUp(MouseEvent& mouseEvent) { if (isFocused()) { if (getSelected() > 0 ) { setSelected(getSelected() - 1); } mouseEvent.consume(); } }
void ServerDialog::mouseClicked(MouseEvent &event) { if (event.getButton() == MouseButton::LEFT) { event.consume(); if (event.getClickCount() == 2 && event.getSource() == mServersList) { action(ActionEvent(mConnectButton, mConnectButton->getActionEventId())); } } }
void TextField::mouseDown( MouseEvent &mouseEvent ) { if(mouseEvent.getButton() != MOUSE_BUTTON_LEFT) { return; } dragged = false; int x = mouseEvent.getX() - getTextOffset() - getMargin(SIDE_LEFT); positionCaret(getFont()->getStringIndexFromPosition(getText(),x)); internalSelStart = getCaretPosition(); setSelection(0,0); mouseEvent.consume(); }
void Window::mouseDragged(MouseEvent& mouseEvent) { if (mouseEvent.isConsumed() || mouseEvent.getSource() != this) { return; } if (isMovable() && mMoved) { setPosition(mouseEvent.getX() - mDragOffsetX + getX(), mouseEvent.getY() - mDragOffsetY + getY()); } mouseEvent.consume(); }
void Slider::mouseDragged(MouseEvent& mouseEvent) { if (getOrientation() == HORIZONTAL) { setValue(markerPositionToValue(mouseEvent.getX() - getMarkerLength() / 2)); } else { setValue(markerPositionToValue(getHeight() - mouseEvent.getY() - getMarkerLength() / 2)); } distributeActionEvent(); mouseEvent.consume(); }