diff options
Diffstat (limited to 'src/gui')
46 files changed, 199 insertions, 199 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 5998f1321..2814de4bb 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -849,7 +849,7 @@ void Gui::distributeMouseEvent(Widget *const source, } } - MouseEvent mouseEvent(source, + MouseEvent event(source, type, button, x, y, mClickCount); @@ -869,13 +869,13 @@ void Gui::distributeMouseEvent(Widget *const source, int widgetY; widget->getAbsolutePosition(widgetX, widgetY); - mouseEvent.setX(x - widgetX); - mouseEvent.setY(y - widgetY); + event.setX(x - widgetX); + event.setY(y - widgetY); std::list<MouseListener*> mouseListeners = widget->_getMouseListeners(); - unsigned int mouseType = mouseEvent.getType(); + unsigned int mouseType = event.getType(); // Send the event to all mouse listeners of the widget. FOR_EACH (std::list<MouseListener*>::const_iterator, it, mouseListeners) @@ -883,32 +883,32 @@ void Gui::distributeMouseEvent(Widget *const source, switch (mouseType) { case MouseEvent::ENTERED: - (*it)->mouseEntered(mouseEvent); + (*it)->mouseEntered(event); break; case MouseEvent::EXITED: - (*it)->mouseExited(mouseEvent); + (*it)->mouseExited(event); break; case MouseEvent::MOVED: - (*it)->mouseMoved(mouseEvent); + (*it)->mouseMoved(event); break; case MouseEvent::PRESSED: - (*it)->mousePressed(mouseEvent); + (*it)->mousePressed(event); break; case MouseEvent::RELEASED: case 100: // manual hack for release on target after drag - (*it)->mouseReleased(mouseEvent); + (*it)->mouseReleased(event); break; case MouseEvent::WHEEL_MOVED_UP: - (*it)->mouseWheelMovedUp(mouseEvent); + (*it)->mouseWheelMovedUp(event); break; case MouseEvent::WHEEL_MOVED_DOWN: - (*it)->mouseWheelMovedDown(mouseEvent); + (*it)->mouseWheelMovedDown(event); break; case MouseEvent::DRAGGED: - (*it)->mouseDragged(mouseEvent); + (*it)->mouseDragged(event); break; case MouseEvent::CLICKED: - (*it)->mouseClicked(mouseEvent); + (*it)->mouseClicked(event); break; default: break; diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h index f1cedf046..73129eaea 100644 --- a/src/gui/popups/itempopup.h +++ b/src/gui/popups/itempopup.h @@ -61,7 +61,7 @@ class ItemPopup final : public Popup void setItem(const Item *const item, const bool showImage = false); - void mouseMoved(MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &event) override final; private: Label *mItemName; diff --git a/src/gui/popups/spellpopup.h b/src/gui/popups/spellpopup.h index cbbd53703..0352161fc 100644 --- a/src/gui/popups/spellpopup.h +++ b/src/gui/popups/spellpopup.h @@ -59,7 +59,7 @@ class SpellPopup final : public Popup */ void view(const int x, const int y); - void mouseMoved(MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &event) override final; private: Label *mItemName; diff --git a/src/gui/popups/textpopup.h b/src/gui/popups/textpopup.h index eb29cba61..e1dcb95b8 100644 --- a/src/gui/popups/textpopup.h +++ b/src/gui/popups/textpopup.h @@ -72,7 +72,7 @@ class TextPopup final : public Popup void show(const int x, const int y, const std::string &str1, const std::string &str2, const std::string &str3); - void mouseMoved(MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &event) override final; private: Label *mText[TEXTPOPUPCOUNT]; diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 1a28511ed..16112fef6 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -285,14 +285,14 @@ void Viewport::followMouse() if (mPlayerFollowMouse && (button & SDL_BUTTON(1))) { // We create a mouse event and send it to mouseDragged. - MouseEvent mouseEvent(nullptr, + MouseEvent event(nullptr, MouseEvent::DRAGGED, MouseEvent::LEFT, mMouseX, mMouseY, 0); - walkByMouse(mouseEvent); + walkByMouse(event); } } diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index a718fe70c..778d74b41 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -613,9 +613,9 @@ void Button::draw(Graphics *graphics) BLOCK_END("Button::draw") } -void Button::mouseReleased(MouseEvent& mouseEvent) +void Button::mouseReleased(MouseEvent& event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (mStick) mPressed = !mPressed; @@ -623,7 +623,7 @@ void Button::mouseReleased(MouseEvent& mouseEvent) if (mMousePressed && mHasMouse) { mMousePressed = false; - mClickCount = mouseEvent.getClickCount(); + mClickCount = event.getClickCount(); distributeActionEvent(); } else @@ -631,7 +631,7 @@ void Button::mouseReleased(MouseEvent& mouseEvent) mMousePressed = false; mClickCount = 0; } - mouseEvent.consume(); + event.consume(); } } @@ -717,26 +717,26 @@ void Button::focusLost(const Event& event A_UNUSED) mKeyPressed = false; } -void Button::mousePressed(MouseEvent& mouseEvent) +void Button::mousePressed(MouseEvent& event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { mMousePressed = true; - mouseEvent.consume(); + event.consume(); } } -void Button::mouseEntered(MouseEvent& mouseEvent A_UNUSED) +void Button::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void Button::mouseExited(MouseEvent& mouseEvent A_UNUSED) +void Button::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } -void Button::mouseDragged(MouseEvent& mouseEvent) +void Button::mouseDragged(MouseEvent& event) { - mouseEvent.consume(); + event.consume(); } diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 6eba9b3c0..200418172 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -156,7 +156,7 @@ class Button final : public Widget, */ static void updateAlpha(); - void mouseReleased(MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& event) override final; void setDescription(std::string text) { mDescription = text; } @@ -254,13 +254,13 @@ class Button final : public Widget, void focusLost(const Event& event) override final; - void mousePressed(MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& event) override final; - void mouseEntered(MouseEvent& mouseEvent) override final; + void mouseEntered(MouseEvent& event) override final; - void mouseExited(MouseEvent& mouseEvent) override final; + void mouseExited(MouseEvent& event) override final; - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; enum { diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 0cba673b5..fb639753f 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -253,18 +253,18 @@ void CheckBox::adjustSize() + getFont()->getWidth(mCaption) + mPadding); } -void CheckBox::mouseClicked(MouseEvent& mouseEvent) +void CheckBox::mouseClicked(MouseEvent& event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { toggleSelected(); - mouseEvent.consume(); + event.consume(); } } -void CheckBox::mouseDragged(MouseEvent& mouseEvent) +void CheckBox::mouseDragged(MouseEvent& event) { - mouseEvent.consume(); + event.consume(); } void CheckBox::toggleSelected() diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 5711e766f..9882284b0 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -168,9 +168,9 @@ class CheckBox final : public Widget, void setCaption(const std::string& caption) { mCaption = caption; } - void mouseClicked(MouseEvent& mouseEvent) override final; + void mouseClicked(MouseEvent& event) override final; - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; private: void toggleSelected(); diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index a4580f596..ba2ffe58d 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -354,12 +354,12 @@ void DropDown::hideDrop(bool event) mPopup->setVisible(false); } -void DropDown::mousePressed(MouseEvent& mouseEvent) +void DropDown::mousePressed(MouseEvent& event) { - mouseEvent.consume(); + event.consume(); // If we have a mouse press on the widget. - if (mouseEvent.getButton() == MouseEvent::LEFT - && !mDroppedDown && mouseEvent.getSource() == this) + if (event.getButton() == MouseEvent::LEFT + && !mDroppedDown && event.getSource() == this) { mPushed = true; dropDown(); @@ -372,14 +372,14 @@ void DropDown::mousePressed(MouseEvent& mouseEvent) } } -void DropDown::mouseReleased(MouseEvent &mouseEvent) +void DropDown::mouseReleased(MouseEvent &event) { if (mIsDragged) mPushed = false; - const int button = mouseEvent.getButton(); - const int x = mouseEvent.getX(); - const int y = mouseEvent.getY(); + const int button = event.getButton(); + const int x = event.getX(); + const int y = event.getY(); // Released outside of widget. Can happen when we have modal // input focus. if ((0 > y || y >= mDimension.height || x < 0 || x >= mDimension.width) @@ -396,22 +396,22 @@ void DropDown::mouseReleased(MouseEvent &mouseEvent) mIsDragged = false; } -void DropDown::mouseDragged(MouseEvent &mouseEvent) +void DropDown::mouseDragged(MouseEvent &event) { mIsDragged = true; - mouseEvent.consume(); + event.consume(); } -void DropDown::mouseWheelMovedUp(MouseEvent& mouseEvent) +void DropDown::mouseWheelMovedUp(MouseEvent& event) { setSelected(getSelected() - 1); - mouseEvent.consume(); + event.consume(); } -void DropDown::mouseWheelMovedDown(MouseEvent& mouseEvent) +void DropDown::mouseWheelMovedDown(MouseEvent& event) { setSelected(getSelected() + 1); - mouseEvent.consume(); + event.consume(); } void DropDown::setSelectedString(const std::string &str) diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 2208880b3..a4d1fde1e 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -87,15 +87,15 @@ class DropDown final : public ActionListener, // Inherited from MouseListener - void mousePressed(MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& event) override final; - void mouseReleased(MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& event) override final; - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; - void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& event) override final; - void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& event) override final; void setSelectedString(const std::string &str); diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp index ebf504f54..c0fcb8ecf 100644 --- a/src/gui/widgets/emotepage.cpp +++ b/src/gui/widgets/emotepage.cpp @@ -116,10 +116,10 @@ void EmotePage::draw(Graphics *graphics) BLOCK_END("EmotePage::draw") } -void EmotePage::mousePressed(MouseEvent &mouseEvent) +void EmotePage::mousePressed(MouseEvent &event) { - mSelectedIndex = getIndexFromGrid(mouseEvent.getX(), mouseEvent.getY()); - mouseEvent.consume(); + mSelectedIndex = getIndexFromGrid(event.getX(), event.getY()); + event.consume(); distributeActionEvent(); } diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h index 2ce50f1fc..769e004bc 100644 --- a/src/gui/widgets/emotepage.h +++ b/src/gui/widgets/emotepage.h @@ -41,7 +41,7 @@ class EmotePage final : public Widget, void draw(Graphics *graphics) override final; - void mousePressed(MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &event) override final; int getIndexFromGrid(const int x, const int y) const; diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 08da80322..44248037c 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -465,56 +465,56 @@ void GuiTable::keyPressed(KeyEvent& keyEvent) } // -- MouseListener notifications -void GuiTable::mousePressed(MouseEvent& mouseEvent) +void GuiTable::mousePressed(MouseEvent& event) { if (!mModel || !mSelectable) return; - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { - const int row = getRowForY(mouseEvent.getY()); - const int column = getColumnForX(mouseEvent.getX()); + const int row = getRowForY(event.getY()); + const int column = getColumnForX(event.getX()); if (row > -1 && column > -1 && row < mModel->getRows() && column < mModel->getColumns()) { mSelectedColumn = column; mSelectedRow = row; - mouseEvent.consume(); + event.consume(); } distributeActionEvent(); } } -void GuiTable::mouseWheelMovedUp(MouseEvent& mouseEvent) +void GuiTable::mouseWheelMovedUp(MouseEvent& event) { if (isFocused()) { const int selRow = getSelectedRow(); if (selRow > 0 || (selRow == 0 && mWrappingEnabled)) setSelectedRow(selRow - 1); - mouseEvent.consume(); + event.consume(); } } -void GuiTable::mouseWheelMovedDown(MouseEvent& mouseEvent) +void GuiTable::mouseWheelMovedDown(MouseEvent& event) { if (isFocused()) { setSelectedRow(getSelectedRow() + 1); - mouseEvent.consume(); + event.consume(); } } -void GuiTable::mouseDragged(MouseEvent& mouseEvent) +void GuiTable::mouseDragged(MouseEvent& event) { - if (mouseEvent.getButton() != MouseEvent::LEFT) + if (event.getButton() != MouseEvent::LEFT) return; // Make table selection update on drag - const int x = std::max(0, mouseEvent.getX()); - const int y = std::max(0, mouseEvent.getY()); + const int x = std::max(0, event.getX()); + const int y = std::max(0, event.getY()); setSelectedRow(getRowForY(y)); setSelectedColumn(getColumnForX(x)); diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 42664fd77..9beb866cf 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -144,13 +144,13 @@ public: { return mOpaque; } // Inherited from MouseListener - void mousePressed(MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& event) override final; - void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& event) override final; - void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& event) override final; - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; // Constraints inherited from TableModelListener void modelUpdated(const bool completed) override final; diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 27cc29ed1..1df21af20 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -264,11 +264,11 @@ void ListBox::keyPressed(KeyEvent &keyEvent) // Don't do anything on scrollwheel. ScrollArea will deal with that. -void ListBox::mouseWheelMovedUp(MouseEvent &mouseEvent A_UNUSED) +void ListBox::mouseWheelMovedUp(MouseEvent &event A_UNUSED) { } -void ListBox::mouseWheelMovedDown(MouseEvent &mouseEvent A_UNUSED) +void ListBox::mouseWheelMovedDown(MouseEvent &event A_UNUSED) { } @@ -314,11 +314,11 @@ void ListBox::mouseReleased(MouseEvent &event) mPressedIndex = -2; } -void ListBox::mouseReleased1(const MouseEvent &mouseEvent) +void ListBox::mouseReleased1(const MouseEvent &event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { - setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY()))); + setSelected(std::max(0, getSelectionByMouse(event.getY()))); distributeActionEvent(); } } diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index f784b3237..9a398dfa2 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -123,9 +123,9 @@ class ListBox : public Widget, // Inherited from MouseListener - void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& event) override final; - void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& event) override final; void mousePressed(MouseEvent &event) override; diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index c657cdde5..fa0616fd2 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -129,24 +129,24 @@ void PopupList::adjustSize() mListBox->setWidth(width); } -void PopupList::mousePressed(MouseEvent& mouseEvent) +void PopupList::mousePressed(MouseEvent& event) { mPressedIndex = mListBox->getSelectionByMouse( - mouseEvent.getY() + mPadding); - mouseEvent.consume(); + event.getY() + mPadding); + event.consume(); } -void PopupList::mouseReleased(MouseEvent& mouseEvent) +void PopupList::mouseReleased(MouseEvent& event) { if (mPressedIndex != mListBox->getSelectionByMouse( - mouseEvent.getY() + mPadding)) + event.getY() + mPadding)) { mPressedIndex = -2; return; } mPressedIndex = -2; - if (mouseEvent.getSource() == mScrollArea) + if (event.getSource() == mScrollArea) return; if (mDropDown) mDropDown->updateSelection(); diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h index 32a9dfc47..b60e93b7f 100644 --- a/src/gui/widgets/popuplist.h +++ b/src/gui/widgets/popuplist.h @@ -65,9 +65,9 @@ class PopupList final : public Popup, void focusLost(const Event& event A_UNUSED) override final; - void mousePressed(MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& event) override final; - void mouseReleased(MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& event) override final; private: ListModel *mListModel; diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index e83e9229a..549e8823e 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -271,19 +271,19 @@ void RadioButton::setSelected(const bool selected) mSelected = selected; } -void RadioButton::mouseClicked(MouseEvent& mouseEvent) +void RadioButton::mouseClicked(MouseEvent& event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { setSelected(true); - mouseEvent.consume(); + event.consume(); distributeActionEvent(); } } -void RadioButton::mouseDragged(MouseEvent& mouseEvent) +void RadioButton::mouseDragged(MouseEvent& event) { - mouseEvent.consume(); + event.consume(); } void RadioButton::setGroup(const std::string &group) diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index 5aa0d9289..a0d32dd9d 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -164,9 +164,9 @@ class RadioButton final : public Widget, void setCaption(const std::string &caption) { mCaption = caption; } - void mouseClicked(MouseEvent& mouseEvent) override final; + void mouseClicked(MouseEvent& event) override final; - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; /** * Sets the group the radio button should belong to. Note that diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 4aeef8efb..95323a170 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -1309,26 +1309,26 @@ void ScrollArea::setDimension(const Rect& dimension) checkPolicies(); } -void ScrollArea::mouseWheelMovedUp(MouseEvent& mouseEvent) +void ScrollArea::mouseWheelMovedUp(MouseEvent& event) { - if (mouseEvent.isConsumed()) + if (event.isConsumed()) return; setVerticalScrollAmount(getVerticalScrollAmount() - getChildrenArea().height / 8); - mouseEvent.consume(); + event.consume(); } -void ScrollArea::mouseWheelMovedDown(MouseEvent& mouseEvent) +void ScrollArea::mouseWheelMovedDown(MouseEvent& event) { - if (mouseEvent.isConsumed()) + if (event.isConsumed()) return; setVerticalScrollAmount(getVerticalScrollAmount() + getChildrenArea().height / 8); - mouseEvent.consume(); + event.consume(); } void ScrollArea::checkPolicies() diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 0b0cae2c3..d3d71b65a 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -420,9 +420,9 @@ class ScrollArea final : public BasicContainer, void setDimension(const Rect& dimension); - void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& event) override final; - void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& event) override final; protected: enum BUTTON_DIR diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 007dc6442..ce2aa5aae 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -221,12 +221,12 @@ void ShopListBox::mouseMoved(MouseEvent &event) } } -void ShopListBox::mouseReleased(MouseEvent& mouseEvent) +void ShopListBox::mouseReleased(MouseEvent& event) { - ListBox::mouseReleased(mouseEvent); - if (mouseEvent.getButton() == MouseEvent::RIGHT) + ListBox::mouseReleased(event); + if (event.getButton() == MouseEvent::RIGHT) { - setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY()))); + setSelected(std::max(0, getSelectionByMouse(event.getY()))); if (mSelected < 0 || mSelected >= mShopItems->getNumberOfElements()) return; @@ -236,7 +236,7 @@ void ShopListBox::mouseReleased(MouseEvent& mouseEvent) } } -void ShopListBox::mouseExited(MouseEvent& mouseEvent A_UNUSED) +void ShopListBox::mouseExited(MouseEvent& event A_UNUSED) { if (!mItemPopup) return; diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 17c1ed4d5..ddb4407c7 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -76,9 +76,9 @@ class ShopListBox final : public ListBox void mouseMoved(MouseEvent &event) override final; - void mouseReleased(MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& event) override final; - void mouseExited(MouseEvent& mouseEvent) override final; + void mouseExited(MouseEvent& event) override final; void setProtectItems(bool p) { mProtectItems = p; } diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index e7f046422..c4ff2d2bc 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -352,17 +352,17 @@ void Slider::mouseExited(MouseEvent& event A_UNUSED) mRedraw = true; } -void Slider::mousePressed(MouseEvent &mouseEvent) +void Slider::mousePressed(MouseEvent &event) { - const int x = mouseEvent.getX(); - const int y = mouseEvent.getY(); + const int x = event.getX(); + const int y = event.getY(); const int width = mDimension.width; const int height = mDimension.height; - if (mouseEvent.getButton() == MouseEvent::LEFT + if (event.getButton() == MouseEvent::LEFT && x >= 0 && x <= width && y >= 0 && y <= height) { - mouseEvent.consume(); + event.consume(); if (mOrientation == HORIZONTAL) setValue(markerPositionToValue(x - mMarkerLength / 2)); else @@ -372,35 +372,35 @@ void Slider::mousePressed(MouseEvent &mouseEvent) } } -void Slider::mouseDragged(MouseEvent &mouseEvent) +void Slider::mouseDragged(MouseEvent &event) { if (mOrientation == HORIZONTAL) { - setValue(markerPositionToValue(mouseEvent.getX() - mMarkerLength / 2)); + setValue(markerPositionToValue(event.getX() - mMarkerLength / 2)); } else { setValue(markerPositionToValue( - mDimension.height - mouseEvent.getY() - mMarkerLength / 2)); + mDimension.height - event.getY() - mMarkerLength / 2)); } distributeActionEvent(); - mouseEvent.consume(); + event.consume(); } -void Slider::mouseWheelMovedUp(MouseEvent &mouseEvent) +void Slider::mouseWheelMovedUp(MouseEvent &event) { setValue(mValue + mStepLength); distributeActionEvent(); - mouseEvent.consume(); + event.consume(); } -void Slider::mouseWheelMovedDown(MouseEvent &mouseEvent) +void Slider::mouseWheelMovedDown(MouseEvent &event) { setValue(mValue - mStepLength); distributeActionEvent(); - mouseEvent.consume(); + event.consume(); } void Slider::keyPressed(KeyEvent& keyEvent) diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 23d06de48..5ee81dd10 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -135,13 +135,13 @@ class Slider final : public Widget, */ void mouseExited(MouseEvent& event) override final; - void mousePressed(MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &event) override final; - void mouseDragged(MouseEvent &mouseEvent) override final; + void mouseDragged(MouseEvent &event) override final; - void mouseWheelMovedUp(MouseEvent &mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent &event) override final; - void mouseWheelMovedDown(MouseEvent &mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent &event) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp index 6782e789c..76e6b54c3 100644 --- a/src/gui/widgets/sliderlist.cpp +++ b/src/gui/widgets/sliderlist.cpp @@ -82,16 +82,16 @@ void SliderList::updateAlpha() Button::updateAlpha(); } -void SliderList::mouseWheelMovedUp(MouseEvent& mouseEvent) +void SliderList::mouseWheelMovedUp(MouseEvent& event) { setSelected(mSelectedIndex - 1); - mouseEvent.consume(); + event.consume(); } -void SliderList::mouseWheelMovedDown(MouseEvent& mouseEvent) +void SliderList::mouseWheelMovedDown(MouseEvent& event) { setSelected(mSelectedIndex + 1); - mouseEvent.consume(); + event.consume(); } void SliderList::resize() diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index 84f96ebe4..dac7beabd 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -49,9 +49,9 @@ class SliderList final : public Container, void updateAlpha(); - void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& event) override final; - void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& event) override final; void resize(); diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 554bdfc66..410112c55 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -366,20 +366,20 @@ void TabbedArea::logic() BLOCK_END("TabbedArea::logic") } -void TabbedArea::mousePressed(MouseEvent &mouseEvent) +void TabbedArea::mousePressed(MouseEvent &event) { - if (mouseEvent.isConsumed()) + if (event.isConsumed()) return; - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { Widget *const widget = mTabContainer->getWidgetAt( - mouseEvent.getX(), mouseEvent.getY()); + event.getX(), event.getY()); Tab *const tab = dynamic_cast<Tab *const>(widget); if (tab) { - mouseEvent.consume(); + event.consume(); setSelectedTab(tab); requestFocus(); } diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 0e7a032f0..710db31f2 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -195,7 +195,7 @@ class TabbedArea final : public ActionListener, // Inherited from MouseListener - void mousePressed(MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &event) override final; void enableScrollButtons(const bool enable); diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index 1e5733a2b..32d0cf2a6 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -371,12 +371,12 @@ const std::string &Tab::getCaption() const return mLabel->getCaption(); } -void Tab::mouseEntered(MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void Tab::mouseExited(MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h index 246d90650..a0afa6fcd 100644 --- a/src/gui/widgets/tabs/tab.h +++ b/src/gui/widgets/tabs/tab.h @@ -189,9 +189,9 @@ class Tab : public BasicContainer, const std::string &getCaption() const A_WARN_UNUSED; - void mouseEntered(MouseEvent &mouseEvent) override final; + void mouseEntered(MouseEvent &event) override final; - void mouseExited(MouseEvent &mouseEvent) override final; + void mouseExited(MouseEvent &event) override final; void setImage(Image *const image); diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index 50e423de8..39e585279 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -582,29 +582,29 @@ void TextBox::addRow(const std::string &row) adjustSize(); } -void TextBox::mousePressed(MouseEvent& mouseEvent) +void TextBox::mousePressed(MouseEvent& event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const int height = getFont()->getHeight(); if (!height) return; - mouseEvent.consume(); - mCaretRow = mouseEvent.getY() / height; + event.consume(); + mCaretRow = event.getY() / height; const int sz = static_cast<int>(mTextRows.size()); if (mCaretRow >= sz) mCaretRow = sz - 1; mCaretColumn = getFont()->getStringIndexAt( - mTextRows[mCaretRow], mouseEvent.getX()); + mTextRows[mCaretRow], event.getX()); } } -void TextBox::mouseDragged(MouseEvent& mouseEvent) +void TextBox::mouseDragged(MouseEvent& event) { - mouseEvent.consume(); + event.consume(); } void TextBox::drawCaret(Graphics *const graphics, const int x, const int y) diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h index e5cfbc7c9..056f6a0d3 100644 --- a/src/gui/widgets/textbox.h +++ b/src/gui/widgets/textbox.h @@ -272,9 +272,9 @@ class TextBox final : public Widget, void fontChanged() override final { adjustSize(); } - void mousePressed(MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& event) override final; - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; private: /** diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index b822996a4..d7d73f78a 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -693,14 +693,14 @@ void TextField::fontChanged() fixScroll(); } -void TextField::mousePressed(MouseEvent &mouseEvent) +void TextField::mousePressed(MouseEvent &event) { #ifdef ANDROID if (!client->isKeyboardVisible()) inputManager.executeAction(Input::KEY_SHOW_KEYBOARD); #endif - mouseEvent.consume(); - if (mouseEvent.getButton() == MouseEvent::RIGHT) + event.consume(); + if (event.getButton() == MouseEvent::RIGHT) { if (viewport) { @@ -722,10 +722,10 @@ void TextField::mousePressed(MouseEvent &mouseEvent) } } } - else if (mouseEvent.getButton() == MouseEvent::LEFT) + else if (event.getButton() == MouseEvent::LEFT) { mCaretPosition = getFont()->getStringIndexAt( - mText, mouseEvent.getX() + mXScroll); + mText, event.getX() + mXScroll); fixScroll(); } } @@ -750,7 +750,7 @@ void TextField::setText(const std::string& text) mText = text; } -void TextField::mouseDragged(MouseEvent& mouseEvent) +void TextField::mouseDragged(MouseEvent& event) { - mouseEvent.consume(); + event.consume(); } diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 93ae155be..2b0762e86 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -162,7 +162,7 @@ class TextField : public Widget, void setCaretPosition(unsigned int position); - void mousePressed(MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &event) override final; void handlePaste(); @@ -219,7 +219,7 @@ class TextField : public Widget, unsigned int getCaretPosition() const { return mCaretPosition; } - void mouseDragged(MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& event) override final; protected: void drawCaret(Graphics* graphics, int x); diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 868455de5..2431a35ea 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -295,7 +295,7 @@ void WindowMenu::mouseMoved(MouseEvent &event) } } -void WindowMenu::mouseExited(MouseEvent& mouseEvent A_UNUSED) +void WindowMenu::mouseExited(MouseEvent& event A_UNUSED) { mHaveMouse = false; if (!mTextPopup) diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index a1ed66a7d..9eb520bff 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -94,7 +94,7 @@ class WindowMenu final : public Container, void mouseMoved(MouseEvent &event) override final; - void mouseExited(MouseEvent& mouseEvent A_UNUSED) override final; + void mouseExited(MouseEvent& event A_UNUSED) override final; std::map <std::string, ButtonInfo*> &getButtonNames() A_WARN_UNUSED { return mButtonNames; } diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index c6e4182d8..0a5480520 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -1858,16 +1858,16 @@ void ChatWindow::mouseMoved(MouseEvent &event) Window::mouseMoved(event); } -void ChatWindow::mouseEntered(MouseEvent& mouseEvent) +void ChatWindow::mouseEntered(MouseEvent& event) { mHaveMouse = true; - Window::mouseEntered(mouseEvent); + Window::mouseEntered(event); } -void ChatWindow::mouseExited(MouseEvent& mouseEvent) +void ChatWindow::mouseExited(MouseEvent& event) { updateVisibility(); - Window::mouseExited(mouseEvent); + Window::mouseExited(event); } void ChatWindow::draw(Graphics* graphics) diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index bd5374c56..e755e43f2 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -274,11 +274,11 @@ class ChatWindow final : public Window, void optionChanged(const std::string &name) override final; - void mouseEntered(MouseEvent& mouseEvent) override final; + void mouseEntered(MouseEvent& event) override final; void mouseMoved(MouseEvent &event) override final; - void mouseExited(MouseEvent& mouseEvent A_UNUSED) override final; + void mouseExited(MouseEvent& event A_UNUSED) override final; void draw(Graphics* graphics) override final; diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index b8b693fc1..47e7e8b7d 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -295,22 +295,22 @@ Item *EquipmentWindow::getItem(const int x, const int y) const return nullptr; } -void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) +void EquipmentWindow::mousePressed(MouseEvent& event) { if (!mEquipment) { - Window::mousePressed(mouseEvent); + Window::mousePressed(event); return; } - const int x = mouseEvent.getX(); - const int y = mouseEvent.getY(); + const int x = event.getX(); + const int y = event.getY(); - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (mForing) { - Window::mousePressed(mouseEvent); + Window::mousePressed(event); return; } // Checks if any of the presses were in the equip boxes. @@ -332,7 +332,7 @@ void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) inBox = true; if (item) { - mouseEvent.consume(); + event.consume(); setSelected(i); dragDrop.dragItem(item, DRAGDROP_SOURCE_EQUIPMENT); return; @@ -342,7 +342,7 @@ void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) return; } } - else if (mouseEvent.getButton() == MouseEvent::RIGHT) + else if (event.getButton() == MouseEvent::RIGHT) { if (Item *const item = getItem(x, y)) { @@ -356,7 +356,7 @@ void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) const int my = y + getY(); if (viewport) { - mouseEvent.consume(); + event.consume(); if (mForing) viewport->showUndressPopup(mx, my, mBeing, item); else @@ -365,12 +365,12 @@ void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) } } } - Window::mousePressed(mouseEvent); + Window::mousePressed(event); } -void EquipmentWindow::mouseReleased(MouseEvent &mouseEvent) +void EquipmentWindow::mouseReleased(MouseEvent &event) { - Window::mouseReleased(mouseEvent); + Window::mouseReleased(event); const DragDropSource src = dragDrop.getSource(); if (dragDrop.isEmpty() || (src != DRAGDROP_SOURCE_INVENTORY && src != DRAGDROP_SOURCE_EQUIPMENT)) @@ -399,8 +399,8 @@ void EquipmentWindow::mouseReleased(MouseEvent &mouseEvent) { if (item->isEquipment()) { - const int x = mouseEvent.getX(); - const int y = mouseEvent.getY(); + const int x = event.getX(); + const int y = event.getY(); for (std::vector<EquipmentBox*>::const_iterator it = mBoxes.begin(), it_end = mBoxes.end(); it != it_end; ++ it) diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 245328b8e..45d4246e3 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -86,7 +86,7 @@ class EquipmentWindow final : public Window, void action(const ActionEvent &event) override final; - void mousePressed(MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& event) override final; const Item* getEquipment(const int i) const A_WARN_UNUSED { return mEquipment ? mEquipment->getEquipment(i) : nullptr; } diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index ee20ef69b..feabb82d0 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -71,7 +71,7 @@ class MiniStatusWindow final : public Popup, void draw(Graphics *graphics) override final; - void mouseMoved(MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &event) override final; void mousePressed(MouseEvent &event) override final; diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 5b0b557dc..ec4bbebbb 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -450,13 +450,13 @@ void ServerDialog::valueChanged(const SelectionEvent &) mDeleteButton->setEnabled(true); } -void ServerDialog::mouseClicked(MouseEvent &mouseEvent) +void ServerDialog::mouseClicked(MouseEvent &event) { - if (mouseEvent.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { - mouseEvent.consume(); - if (mouseEvent.getClickCount() == 2 && - mouseEvent.getSource() == mServersList) + event.consume(); + if (event.getClickCount() == 2 && + event.getSource() == mServersList) { action(ActionEvent(mConnectButton, mConnectButton->getActionEventId())); diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index 7c3a05ab3..60b84f089 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -81,7 +81,7 @@ class ServerDialog final : public Window, */ void valueChanged(const SelectionEvent &event) override final; - void mouseClicked(MouseEvent &mouseEvent) override final; + void mouseClicked(MouseEvent &event) override final; void logic() override final; |