diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-21 19:45:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-21 19:45:48 +0300 |
commit | 60b40c0c68e9cffbc5f48d4f672d99009488f8b1 (patch) | |
tree | 7d2efefb965c0ae928eb80313f2f37fa34cf42b4 /src/gui/widgets | |
parent | 3ed0b5f6edce152fa2eca9c84d64cbeec8ac0173 (diff) | |
download | plus-60b40c0c68e9cffbc5f48d4f672d99009488f8b1.tar.gz plus-60b40c0c68e9cffbc5f48d4f672d99009488f8b1.tar.bz2 plus-60b40c0c68e9cffbc5f48d4f672d99009488f8b1.tar.xz plus-60b40c0c68e9cffbc5f48d4f672d99009488f8b1.zip |
Rename mouseEvent variables into event.
Diffstat (limited to 'src/gui/widgets')
32 files changed, 151 insertions, 151 deletions
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); |