diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-16 14:22:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-16 15:19:51 +0300 |
commit | 8406b00588070266ae8af2bf25776f2fa716af69 (patch) | |
tree | f3515975feaf7dad0a7fa6ee33f6c88d1c6579b3 /src/gui/widgets | |
parent | f880384018ee23efdc5cc072789e176208956a06 (diff) | |
download | plus-8406b00588070266ae8af2bf25776f2fa716af69.tar.gz plus-8406b00588070266ae8af2bf25776f2fa716af69.tar.bz2 plus-8406b00588070266ae8af2bf25776f2fa716af69.tar.xz plus-8406b00588070266ae8af2bf25776f2fa716af69.zip |
move mouseevent into events directory.
Diffstat (limited to 'src/gui/widgets')
57 files changed, 216 insertions, 265 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 9a1aa40ab..8e4d9e483 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -310,7 +310,7 @@ void AvatarListBox::draw(Graphics *graphics) BLOCK_END("AvatarListBox::draw") } -void AvatarListBox::mousePressed(gcn::MouseEvent &event) +void AvatarListBox::mousePressed(MouseEvent &event) { if (!actorManager || !player_node || !viewport || !getFont()->getHeight()) @@ -334,7 +334,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) return; const unsigned int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { if (ava->getType() == AVATAR_PLAYER) { @@ -348,7 +348,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) player_node->navigateTo(ava->getX(), ava->getY()); } } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { switch (ava->getType()) { @@ -407,7 +407,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) } } } - else if (eventButton == gcn::MouseEvent::MIDDLE) + else if (eventButton == MouseEvent::MIDDLE) { if (ava->getType() == AVATAR_PLAYER && chatWindow) { @@ -419,7 +419,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) } } -void AvatarListBox::mouseReleased(gcn::MouseEvent &event A_UNUSED) +void AvatarListBox::mouseReleased(MouseEvent &event A_UNUSED) { } diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index ec384368c..d0449231b 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -55,9 +55,9 @@ public: */ void draw(Graphics *gcnGraphics) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event A_UNUSED) override final; + void mouseReleased(MouseEvent &event A_UNUSED) override final; void optionChanged(const std::string &value) override final; diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index cfbc0ec41..c158171c0 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -423,7 +423,7 @@ struct MouseOverLink int mX, mY; }; -void BrowserBox::mousePressed(gcn::MouseEvent &event) +void BrowserBox::mousePressed(MouseEvent &event) { if (!mLinkHandler) return; @@ -438,7 +438,7 @@ void BrowserBox::mousePressed(gcn::MouseEvent &event) } } -void BrowserBox::mouseMoved(gcn::MouseEvent &event) +void BrowserBox::mouseMoved(MouseEvent &event) { const LinkIterator i = std::find_if(mLinks.begin(), mLinks.end(), MouseOverLink(event.getX(), event.getY())); diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index fa3b90963..f1c1aa1f6 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -158,9 +158,9 @@ class BrowserBox final : public gcn::Widget, /** * Handles mouse actions. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; /** * Draws the browser box. diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index fecf551b2..8bc3d7540 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -525,9 +525,9 @@ void Button::draw(Graphics *graphics) BLOCK_END("Button::draw") } -void Button::mouseReleased(gcn::MouseEvent& mouseEvent) +void Button::mouseReleased(MouseEvent& mouseEvent) { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { if (mStick) mPressed = !mPressed; diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 5dc89ea4d..a9722f6a2 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -109,7 +109,7 @@ class Button final : public gcn::Button, */ static void updateAlpha(); - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; void setDescription(std::string text) { mDescription = text; } diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp index 3f4a672f0..bdd740874 100644 --- a/src/gui/widgets/characterdisplay.cpp +++ b/src/gui/widgets/characterdisplay.cpp @@ -115,12 +115,12 @@ void CharacterDisplay::widgetHidden(const Event &event A_UNUSED) mPopup->setVisible(false); } -void CharacterDisplay::mouseExited(gcn::MouseEvent &event A_UNUSED) +void CharacterDisplay::mouseExited(MouseEvent &event A_UNUSED) { mPopup->setVisible(false); } -void CharacterDisplay::mouseMoved(gcn::MouseEvent &event A_UNUSED) +void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED) { if (!gui) return; @@ -142,7 +142,7 @@ void CharacterDisplay::mouseMoved(gcn::MouseEvent &event A_UNUSED) } } -void CharacterDisplay::mousePressed(gcn::MouseEvent &event) +void CharacterDisplay::mousePressed(MouseEvent &event) { if (event.getClickCount() == 2) distributeActionEvent(); diff --git a/src/gui/widgets/characterdisplay.h b/src/gui/widgets/characterdisplay.h index 84a288ab0..8571363c3 100644 --- a/src/gui/widgets/characterdisplay.h +++ b/src/gui/widgets/characterdisplay.h @@ -75,11 +75,11 @@ class CharacterDisplay final : public Container, void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; private: void update(); diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 20310c4bc..9b67b0359 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -172,12 +172,12 @@ void CheckBox::drawBox(Graphics *const graphics) } } -void CheckBox::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void CheckBox::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void CheckBox::mouseExited(gcn::MouseEvent& event A_UNUSED) +void CheckBox::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 2d1502552..3b0830cee 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -74,12 +74,12 @@ class CheckBox final : public gcn::CheckBox, /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 9e3bca2fa..aca82cef4 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -357,10 +357,10 @@ void DropDown::hideDrop(bool event) mPopup->setVisible(false); } -void DropDown::mousePressed(gcn::MouseEvent& mouseEvent) +void DropDown::mousePressed(MouseEvent& mouseEvent) { // If we have a mouse press on the widget. - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT + if (mouseEvent.getButton() == MouseEvent::LEFT && !mDroppedDown && mouseEvent.getSource() == this) { mPushed = true; @@ -374,7 +374,7 @@ void DropDown::mousePressed(gcn::MouseEvent& mouseEvent) } } -void DropDown::mouseReleased(gcn::MouseEvent &mouseEvent) +void DropDown::mouseReleased(MouseEvent &mouseEvent) { if (mIsDragged) mPushed = false; @@ -385,12 +385,12 @@ void DropDown::mouseReleased(gcn::MouseEvent &mouseEvent) // Released outside of widget. Can happen when we have modal // input focus. if ((0 > y || y >= mDimension.height || x < 0 || x >= mDimension.width) - && button == gcn::MouseEvent::LEFT) + && button == MouseEvent::LEFT) { if (mIsDragged) foldUp(); } - else if (button == gcn::MouseEvent::LEFT) + else if (button == MouseEvent::LEFT) { mPushed = false; } @@ -398,19 +398,19 @@ void DropDown::mouseReleased(gcn::MouseEvent &mouseEvent) mIsDragged = false; } -void DropDown::mouseDragged(gcn::MouseEvent &mouseEvent) +void DropDown::mouseDragged(MouseEvent &mouseEvent) { mIsDragged = true; mouseEvent.consume(); } -void DropDown::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) +void DropDown::mouseWheelMovedUp(MouseEvent& mouseEvent) { setSelected(getSelected() - 1); mouseEvent.consume(); } -void DropDown::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) +void DropDown::mouseWheelMovedDown(MouseEvent& mouseEvent) { setSelected(getSelected() + 1); mouseEvent.consume(); diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 58942bdb5..dd38a1730 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -93,15 +93,15 @@ class DropDown final : public ActionListener, // Inherited from MouseListener - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; - void mouseDragged(gcn::MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& mouseEvent) override final; - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; void setSelectedString(const std::string &str); diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 4b991bc34..693245c2f 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -157,12 +157,12 @@ void DropShortcutContainer::draw(Graphics *graphics) BLOCK_END("DropShortcutContainer::draw") } -void DropShortcutContainer::mouseDragged(gcn::MouseEvent &event) +void DropShortcutContainer::mouseDragged(MouseEvent &event) { if (!dropShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mItemClicked) { @@ -196,7 +196,7 @@ void DropShortcutContainer::mouseDragged(gcn::MouseEvent &event) } } -void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) +void DropShortcutContainer::mousePressed(MouseEvent &event) { if (!dropShortcut || !inventoryWindow) return; @@ -207,7 +207,7 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) return; const int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { if (dropShortcut->getItem(index) > 0) { @@ -223,7 +223,7 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) } } } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { const Inventory *const inv = PlayerInfo::getInventory(); if (!inv) @@ -237,12 +237,12 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void DropShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void DropShortcutContainer::mouseReleased(MouseEvent &event) { if (!dropShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dropShortcut->isItemSelected()) dropShortcut->setItemSelected(-1); @@ -269,7 +269,7 @@ void DropShortcutContainer::mouseReleased(gcn::MouseEvent &event) } // Show ItemTooltip -void DropShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void DropShortcutContainer::mouseMoved(MouseEvent &event) { if (!dropShortcut) return; @@ -302,7 +302,7 @@ void DropShortcutContainer::mouseMoved(gcn::MouseEvent &event) } } -void DropShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void DropShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mItemPopup) mItemPopup->setVisible(false); diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 26cbdffa7..9880f526d 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -55,23 +55,23 @@ class DropShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; void setWidget2(const Widget2 *const widget) override final; diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp index e255afc30..6456913a9 100644 --- a/src/gui/widgets/emotepage.cpp +++ b/src/gui/widgets/emotepage.cpp @@ -116,7 +116,7 @@ void EmotePage::draw(Graphics *graphics) BLOCK_END("EmotePage::draw") } -void EmotePage::mousePressed(gcn::MouseEvent &mouseEvent) +void EmotePage::mousePressed(MouseEvent &mouseEvent) { mSelectedIndex = getIndexFromGrid(mouseEvent.getX(), mouseEvent.getY()); distributeActionEvent(); diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h index cb6fd8711..74f93e8d3 100644 --- a/src/gui/widgets/emotepage.h +++ b/src/gui/widgets/emotepage.h @@ -44,7 +44,7 @@ class EmotePage final : public gcn::Widget, void draw(Graphics *graphics) override final; - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; int getIndexFromGrid(const int x, const int y) const; diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index d00f01495..38c76060b 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -148,11 +148,11 @@ void EmoteShortcutContainer::draw(Graphics *graphics) BLOCK_END("EmoteShortcutContainer::draw") } -void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event A_UNUSED) +void EmoteShortcutContainer::mouseDragged(MouseEvent &event A_UNUSED) { } -void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) +void EmoteShortcutContainer::mousePressed(MouseEvent &event) { if (!emoteShortcut) return; @@ -174,12 +174,12 @@ void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void EmoteShortcutContainer::mouseReleased(MouseEvent &event) { if (!emoteShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const int index = getIndexFromGrid(event.getX(), event.getY()); @@ -206,7 +206,7 @@ void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } -void EmoteShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void EmoteShortcutContainer::mouseMoved(MouseEvent &event) { if (!emoteShortcut || !mEmotePopup) return; @@ -226,7 +226,7 @@ void EmoteShortcutContainer::mouseMoved(gcn::MouseEvent &event) } } -void EmoteShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void EmoteShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mEmotePopup) mEmotePopup->setVisible(false); diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 37ebe0cf9..ed6b4c8b3 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -58,21 +58,21 @@ class EmoteShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index bca93e7c2..5873ef4ce 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -463,12 +463,12 @@ void GuiTable::keyPressed(KeyEvent& keyEvent) } // -- MouseListener notifications -void GuiTable::mousePressed(gcn::MouseEvent& mouseEvent) +void GuiTable::mousePressed(MouseEvent& mouseEvent) { if (!mModel || !mSelectable) return; - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { const int row = getRowForY(mouseEvent.getY()); const int column = getColumnForX(mouseEvent.getX()); @@ -484,7 +484,7 @@ void GuiTable::mousePressed(gcn::MouseEvent& mouseEvent) } } -void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) +void GuiTable::mouseWheelMovedUp(MouseEvent& mouseEvent) { if (isFocused()) { @@ -495,7 +495,7 @@ void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) } } -void GuiTable::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) +void GuiTable::mouseWheelMovedDown(MouseEvent& mouseEvent) { if (isFocused()) { @@ -504,9 +504,9 @@ void GuiTable::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) } } -void GuiTable::mouseDragged(gcn::MouseEvent& mouseEvent) +void GuiTable::mouseDragged(MouseEvent& mouseEvent) { - if (mouseEvent.getButton() != gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() != MouseEvent::LEFT) return; // Make table selection update on drag diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 766f7a3de..da367dd94 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -146,13 +146,13 @@ public: { return mOpaque; } // Inherited from MouseListener - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; - void mouseDragged(gcn::MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& mouseEvent) override final; // Constraints inherited from TableModelListener void modelUpdated(const bool completed) override final; diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index b2fa6a47e..27a00798e 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -394,7 +394,7 @@ void ItemContainer::keyReleased(KeyEvent &event A_UNUSED) { } -void ItemContainer::mousePressed(gcn::MouseEvent &event) +void ItemContainer::mousePressed(MouseEvent &event) { if (!mInventory) return; @@ -402,7 +402,7 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) const int button = event.getButton(); mClicks = event.getClickCount(); - if (button == gcn::MouseEvent::LEFT || button == gcn::MouseEvent::RIGHT) + if (button == MouseEvent::LEFT || button == MouseEvent::RIGHT) { const int index = getSlotIndex(event.getX(), event.getY()); if (index == Inventory::NO_SLOT_INDEX) @@ -468,13 +468,13 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) } } -void ItemContainer::mouseDragged(gcn::MouseEvent &event A_UNUSED) +void ItemContainer::mouseDragged(MouseEvent &event A_UNUSED) { if (mSelectionStatus != SEL_NONE) mSelectionStatus = SEL_DRAGGING; } -void ItemContainer::mouseReleased(gcn::MouseEvent &event) +void ItemContainer::mouseReleased(MouseEvent &event) { if (mClicks == 2) return; @@ -594,7 +594,7 @@ void ItemContainer::mouseReleased(gcn::MouseEvent &event) } } -void ItemContainer::mouseMoved(gcn::MouseEvent &event) +void ItemContainer::mouseMoved(MouseEvent &event) { if (!mInventory) return; @@ -613,7 +613,7 @@ void ItemContainer::mouseMoved(gcn::MouseEvent &event) } } -void ItemContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void ItemContainer::mouseExited(MouseEvent &event A_UNUSED) { mItemPopup->setVisible(false); } diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index bc1bee695..4f530320d 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -89,11 +89,11 @@ class ItemContainer final : public gcn::Widget, void keyReleased(KeyEvent &event) override final; // MouseListener - void mousePressed(gcn::MouseEvent &event) override final; - void mouseDragged(gcn::MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; // WidgetListener void widgetResized(const Event &event) override final; diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 108444bb0..deb3b4451 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -75,8 +75,7 @@ ItemLinkHandler::~ItemLinkHandler() mItemPopup = nullptr; } -void ItemLinkHandler::handleLink(const std::string &link, - gcn::MouseEvent *event) +void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) { diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 4e55a8f72..39e811721 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -39,7 +39,7 @@ class ItemLinkHandler final : public LinkHandler ~ItemLinkHandler(); void handleLink(const std::string &link, - gcn::MouseEvent *event) override final; + MouseEvent *event) override final; private: ItemPopup *mItemPopup; diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index ef4d8ebfa..984803a99 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -233,13 +233,13 @@ void ItemShortcutContainer::draw(Graphics *graphics) BLOCK_END("ItemShortcutContainer::draw") } -void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) +void ItemShortcutContainer::mouseDragged(MouseEvent &event) { ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mItemClicked) { @@ -321,7 +321,7 @@ void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) } } -void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) +void ItemShortcutContainer::mousePressed(MouseEvent &event) { ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) @@ -332,7 +332,7 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) if (index == -1) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { // Stores the selected item if theirs one. if (selShortcut->isItemSelected() && inventoryWindow && @@ -350,7 +350,7 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) mItemClicked = true; } } - else if (event.getButton() == gcn::MouseEvent::RIGHT) + else if (event.getButton() == MouseEvent::RIGHT) { if (viewport && selShortcut) { @@ -360,13 +360,13 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void ItemShortcutContainer::mouseReleased(MouseEvent &event) { ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (selShortcut->isItemSelected()) selShortcut->setItemSelected(-1); @@ -402,7 +402,7 @@ void ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } -void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void ItemShortcutContainer::mouseMoved(MouseEvent &event) { const ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) @@ -459,7 +459,7 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) } // Hide ItemTooltip -void ItemShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void ItemShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mItemPopup) mItemPopup->setVisible(false); diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 5efda0433..f01c2779c 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -56,23 +56,23 @@ class ItemShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; void setWidget2(const Widget2 *const widget); diff --git a/src/gui/widgets/linkhandler.h b/src/gui/widgets/linkhandler.h index 2f3a6e53f..b373162a3 100644 --- a/src/gui/widgets/linkhandler.h +++ b/src/gui/widgets/linkhandler.h @@ -38,7 +38,7 @@ class LinkHandler { } virtual void handleLink(const std::string &link, - gcn::MouseEvent *event) = 0; + MouseEvent *event) = 0; }; #endif // GUI_WIDGETS_LINKHANDLER_H diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 1e97b6e8a..52ff775be 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -214,20 +214,20 @@ void ListBox::keyPressed(KeyEvent &keyEvent) // Don't do anything on scrollwheel. ScrollArea will deal with that. -void ListBox::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent A_UNUSED) +void ListBox::mouseWheelMovedUp(MouseEvent &mouseEvent A_UNUSED) { } -void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent A_UNUSED) +void ListBox::mouseWheelMovedDown(MouseEvent &mouseEvent A_UNUSED) { } -void ListBox::mousePressed(gcn::MouseEvent &event) +void ListBox::mousePressed(MouseEvent &event) { mPressedIndex = getSelectionByMouse(event.getY()); } -void ListBox::mouseReleased(gcn::MouseEvent &event) +void ListBox::mouseReleased(MouseEvent &event) { if (mPressedIndex != getSelectionByMouse(event.getY())) return; @@ -262,18 +262,18 @@ void ListBox::mouseReleased(gcn::MouseEvent &event) mPressedIndex = -2; } -void ListBox::mouseReleased1(const gcn::MouseEvent &mouseEvent) +void ListBox::mouseReleased1(const MouseEvent &mouseEvent) { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY()))); distributeActionEvent(); } } -void ListBox::mouseDragged(gcn::MouseEvent &event) +void ListBox::mouseDragged(MouseEvent &event) { - if (event.getButton() != gcn::MouseEvent::LEFT || getRowHeight() == 0) + if (event.getButton() != MouseEvent::LEFT || getRowHeight() == 0) return; // Make list selection update on drag, but guard against negative y diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 883814456..adf266f7e 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -71,17 +71,17 @@ class ListBox : public gcn::ListBox, // Inherited from MouseListener - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; - void mousePressed(gcn::MouseEvent &event) override; + void mousePressed(MouseEvent &event) override; - void mouseReleased(gcn::MouseEvent &event) override; + void mouseReleased(MouseEvent &event) override; - void mouseReleased1(const gcn::MouseEvent &event); + void mouseReleased1(const MouseEvent &event); - void mouseDragged(gcn::MouseEvent &event) override; + void mouseDragged(MouseEvent &event) override; void refocus(); diff --git a/src/gui/widgets/mouseevent.h b/src/gui/widgets/mouseevent.h deleted file mode 100644 index d98a70130..000000000 --- a/src/gui/widgets/mouseevent.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef GUI_WIDGETS_MOUSEEVENT_H -#define GUI_WIDGETS_MOUSEEVENT_H - -#include "gui/base/mouseevent.hpp" -#include "gui/base/widget.hpp" - -class MouseEvent final : public gcn::MouseEvent -{ - public: - MouseEvent(gcn::Widget* source, bool shiftPressed, - bool controlPressed, bool altPressed, - bool metaPressed, unsigned int type, unsigned int button, - int x, int y, int clickCount) : - gcn::MouseEvent(source, shiftPressed, controlPressed, - altPressed, metaPressed, type, button, x, y, - clickCount) - { - } - - void setX(int n) - { mX = n; } - - void setY(int n) - { mY = n; } -}; - -#endif // GUI_WIDGETS_MOUSEEVENT_H diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 0639fe1b0..3bcb8476e 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -147,10 +147,10 @@ void PlayerBox::drawFrame(Graphics *graphics) BLOCK_END("PlayerBox::drawFrame") } -void PlayerBox::mouseReleased(gcn::MouseEvent& event) +void PlayerBox::mouseReleased(MouseEvent& event) { ScrollArea::mouseReleased(event); - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (!mActionEventId.empty()) distributeActionEvent(); diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index 9671715b0..30d79ff2f 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -84,7 +84,7 @@ class PlayerBox final : public Widget2, void setSelected(bool b) { mSelected = b; } - void mouseReleased(gcn::MouseEvent& event) override final; + void mouseReleased(MouseEvent& event) override final; private: Being *mBeing; diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 7036968ad..a61ba5275 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -231,7 +231,7 @@ void Popup::position(const int x, const int y) mRedraw = true; } -void Popup::mouseMoved(gcn::MouseEvent &event A_UNUSED) +void Popup::mouseMoved(MouseEvent &event A_UNUSED) { if (viewport) viewport->hideBeingPopup(); diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index e467783ef..d64bc4b3f 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -88,7 +88,7 @@ class Popup : public Container, */ void setLocationRelativeTo(const gcn::Widget *const widget); - void mouseMoved(gcn::MouseEvent &event) override; + void mouseMoved(MouseEvent &event) override; /** * Sets the minimum width of the popup. diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 37dd6b1ec..62bc2f448 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -129,13 +129,13 @@ void PopupList::adjustSize() mListBox->setWidth(width); } -void PopupList::mousePressed(gcn::MouseEvent& mouseEvent) +void PopupList::mousePressed(MouseEvent& mouseEvent) { mPressedIndex = mListBox->getSelectionByMouse( mouseEvent.getY() + mPadding); } -void PopupList::mouseReleased(gcn::MouseEvent& mouseEvent) +void PopupList::mouseReleased(MouseEvent& mouseEvent) { if (mPressedIndex != mListBox->getSelectionByMouse( mouseEvent.getY() + mPadding)) diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h index 31308fff8..45f52d3b3 100644 --- a/src/gui/widgets/popuplist.h +++ b/src/gui/widgets/popuplist.h @@ -66,9 +66,9 @@ class PopupList final : public Popup, void focusLost(const Event& event A_UNUSED) override final; - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; private: gcn::ListModel *mListModel; diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index afcd98d67..2fec7a9f6 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -168,12 +168,12 @@ void RadioButton::draw(Graphics* graphics) BLOCK_END("RadioButton::draw") } -void RadioButton::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void RadioButton::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void RadioButton::mouseExited(gcn::MouseEvent& event A_UNUSED) +void RadioButton::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index 9802fb5fd..6c33447c4 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -67,12 +67,12 @@ class RadioButton final : public gcn::RadioButton, /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 73ff82be0..0ee2c3357 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -651,18 +651,18 @@ void ScrollArea::calcHMarker(Graphics *const graphics) } } -void ScrollArea::mouseMoved(gcn::MouseEvent& event) +void ScrollArea::mouseMoved(MouseEvent& event) { mX = event.getX(); mY = event.getY(); } -void ScrollArea::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void ScrollArea::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void ScrollArea::mouseExited(gcn::MouseEvent& event A_UNUSED) +void ScrollArea::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } @@ -684,7 +684,7 @@ void ScrollArea::widgetMoved(const Event& event A_UNUSED) mRedraw = true; } -void ScrollArea::mousePressed(gcn::MouseEvent& event) +void ScrollArea::mousePressed(MouseEvent& event) { const int x = event.getX(); const int y = event.getY(); @@ -754,16 +754,16 @@ void ScrollArea::mousePressed(gcn::MouseEvent& event) } } - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { mClickX = event.getX(); mClickY = event.getY(); } } -void ScrollArea::mouseReleased(gcn::MouseEvent& event) +void ScrollArea::mouseReleased(MouseEvent& event) { - if (event.getButton() == gcn::MouseEvent::LEFT && mClickX && mClickY) + if (event.getButton() == MouseEvent::LEFT && mClickX && mClickY) { if (!event.isConsumed()) { @@ -822,7 +822,7 @@ void ScrollArea::mouseReleased(gcn::MouseEvent& event) mRedraw = true; } -void ScrollArea::mouseDragged(gcn::MouseEvent &event) +void ScrollArea::mouseDragged(MouseEvent &event) { if (mIsVerticalMarkerDragged) { diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 7bf7e811c..3f6195271 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -106,23 +106,23 @@ class ScrollArea final : public gcn::ScrollArea, /** * Called when the mouse moves in the widget area. */ - void mouseMoved(gcn::MouseEvent& event) override final; + void mouseMoved(MouseEvent& event) override final; /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; - void mousePressed(gcn::MouseEvent& event) override final; + void mousePressed(MouseEvent& event) override final; - void mouseReleased(gcn::MouseEvent& event) override final; + void mouseReleased(MouseEvent& event) override final; - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; void widgetResized(const Event &event) override final; diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 8f45abeb3..f364aaf46 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -189,7 +189,7 @@ void ShopListBox::setPriceCheck(const bool check) mPriceCheck = check; } -void ShopListBox::mouseMoved(gcn::MouseEvent &event) +void ShopListBox::mouseMoved(MouseEvent &event) { if (!mItemPopup || !mRowHeight) return; @@ -221,10 +221,10 @@ void ShopListBox::mouseMoved(gcn::MouseEvent &event) } } -void ShopListBox::mouseReleased(gcn::MouseEvent& mouseEvent) +void ShopListBox::mouseReleased(MouseEvent& mouseEvent) { ListBox::mouseReleased(mouseEvent); - if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT) + if (mouseEvent.getButton() == MouseEvent::RIGHT) { setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY()))); @@ -236,7 +236,7 @@ void ShopListBox::mouseReleased(gcn::MouseEvent& mouseEvent) } } -void ShopListBox::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) +void ShopListBox::mouseExited(MouseEvent& mouseEvent A_UNUSED) { if (!mItemPopup) return; diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 509af8393..1cf628cca 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -74,11 +74,11 @@ class ShopListBox final : public ListBox */ void setPriceCheck(const bool check); - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; - void mouseExited(gcn::MouseEvent& mouseEvent) override final; + void mouseExited(MouseEvent& mouseEvent) override final; void setProtectItems(bool p) { mProtectItems = p; } diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index 2c237f513..e7ec2ff62 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -66,21 +66,21 @@ class ShortcutContainer : public gcn::Widget, /** * Handles mouse when dragged. */ - virtual void mouseDragged(gcn::MouseEvent &event A_UNUSED) override + virtual void mouseDragged(MouseEvent &event A_UNUSED) override { } /** * Handles mouse when pressed. */ - virtual void mousePressed(gcn::MouseEvent &event A_UNUSED) override + virtual void mousePressed(MouseEvent &event A_UNUSED) override { } /** * Handles mouse release. */ - virtual void mouseReleased(gcn::MouseEvent &event A_UNUSED) override + virtual void mouseReleased(MouseEvent &event A_UNUSED) override { } diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 8cc454c10..02ebc2ccb 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -272,21 +272,21 @@ void Slider::draw(Graphics *graphics) BLOCK_END("Slider::draw") } -void Slider::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void Slider::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; mRedraw = true; } -void Slider::mouseExited(gcn::MouseEvent& event A_UNUSED) +void Slider::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; mRedraw = true; } -void Slider::mousePressed(gcn::MouseEvent &mouseEvent) +void Slider::mousePressed(MouseEvent &mouseEvent) { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT + if (mouseEvent.getButton() == MouseEvent::LEFT && mouseEvent.getX() >= 0 && mouseEvent.getX() <= getWidth() && mouseEvent.getY() >= 0 @@ -307,7 +307,7 @@ void Slider::mousePressed(gcn::MouseEvent &mouseEvent) } } -void Slider::mouseDragged(gcn::MouseEvent &mouseEvent) +void Slider::mouseDragged(MouseEvent &mouseEvent) { if (getOrientation() == HORIZONTAL) { @@ -325,7 +325,7 @@ void Slider::mouseDragged(gcn::MouseEvent &mouseEvent) mouseEvent.consume(); } -void Slider::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) +void Slider::mouseWheelMovedUp(MouseEvent &mouseEvent) { setValue2(getValue() + getStepLength()); distributeActionEvent(); @@ -333,7 +333,7 @@ void Slider::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) mouseEvent.consume(); } -void Slider::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent) +void Slider::mouseWheelMovedDown(MouseEvent &mouseEvent) { setValue2(getValue() - getStepLength()); distributeActionEvent(); diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 38c149560..2d4853539 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -70,20 +70,20 @@ class Slider final : public gcn::Slider, /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; - void mouseDragged(gcn::MouseEvent &mouseEvent) override final; + void mouseDragged(MouseEvent &mouseEvent) override final; - void mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent &mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent &mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent &mouseEvent) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp index eee012120..988db85dd 100644 --- a/src/gui/widgets/sliderlist.cpp +++ b/src/gui/widgets/sliderlist.cpp @@ -80,13 +80,13 @@ void SliderList::updateAlpha() Button::updateAlpha(); } -void SliderList::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) +void SliderList::mouseWheelMovedUp(MouseEvent& mouseEvent) { setSelected(mSelectedIndex - 1); mouseEvent.consume(); } -void SliderList::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) +void SliderList::mouseWheelMovedDown(MouseEvent& mouseEvent) { setSelected(mSelectedIndex + 1); mouseEvent.consume(); diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index 952b6c337..785ada74b 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -50,9 +50,9 @@ class SliderList final : public Container, void updateAlpha(); - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; void resize(); diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index ee76ee5dd..511360b91 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -146,9 +146,9 @@ void SpellShortcutContainer::draw(Graphics *graphics) BLOCK_END("SpellShortcutContainer::draw") } -void SpellShortcutContainer::mouseDragged(gcn::MouseEvent &event) +void SpellShortcutContainer::mouseDragged(MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mSpellClicked) { @@ -177,7 +177,7 @@ void SpellShortcutContainer::mouseDragged(gcn::MouseEvent &event) } } -void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event) +void SpellShortcutContainer::mousePressed(MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); @@ -185,16 +185,16 @@ void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event) return; const unsigned int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { const int itemId = getItemByIndex(index); if (itemId > 0) mSpellClicked = true; } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { } - else if (eventButton == gcn::MouseEvent::MIDDLE) + else if (eventButton == MouseEvent::MIDDLE) { if (!spellShortcut || !spellManager) return; @@ -204,7 +204,7 @@ void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void SpellShortcutContainer::mouseReleased(MouseEvent &event) { if (!spellShortcut || !spellManager) return; @@ -220,7 +220,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) const int itemId = getItemByIndex(index); const unsigned int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { mSpellClicked = false; @@ -272,7 +272,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { TextCommand *spell = nullptr; if (itemId >= 0) @@ -284,7 +284,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) } // Show ItemTooltip -void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void SpellShortcutContainer::mouseMoved(MouseEvent &event) { if (!mSpellPopup || !spellShortcut || !spellManager) return; @@ -308,7 +308,7 @@ void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event) } } -void SpellShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void SpellShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mSpellPopup) mSpellPopup->setVisible(false); diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index b5968dfe5..d8f5d22b4 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -55,23 +55,23 @@ class SpellShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; void setWidget2(const Widget2 *const widget) override final; diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 6a5febea6..83df191d1 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -324,12 +324,12 @@ void TabbedArea::logic() BLOCK_END("TabbedArea::logic") } -void TabbedArea::mousePressed(gcn::MouseEvent &mouseEvent) +void TabbedArea::mousePressed(MouseEvent &mouseEvent) { if (mouseEvent.isConsumed()) return; - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { gcn::Widget *const widget = mTabContainer->getWidgetAt( mouseEvent.getX(), mouseEvent.getY()); diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index de470e89d..2fb894f6f 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -155,7 +155,7 @@ class TabbedArea final : public Widget2, // Inherited from MouseListener - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; void enableScrollButtons(const bool enable); diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index db5ddf6b4..a85b7927b 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -327,12 +327,12 @@ const std::string &Tab::getCaption() const return mLabel->getCaption(); } -void Tab::mouseEntered(gcn::MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseEntered(MouseEvent& mouseEvent A_UNUSED) { mHasMouse = true; } -void Tab::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseExited(MouseEvent& mouseEvent A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h index e979c71b8..d22c6bea5 100644 --- a/src/gui/widgets/tabs/tab.h +++ b/src/gui/widgets/tabs/tab.h @@ -149,9 +149,9 @@ class Tab : public gcn::BasicContainer, const std::string &getCaption() const A_WARN_UNUSED; - void mouseEntered(gcn::MouseEvent &mouseEvent) override final; + void mouseEntered(MouseEvent &mouseEvent) override final; - void mouseExited(gcn::MouseEvent &mouseEvent) override final; + void mouseExited(MouseEvent &mouseEvent) override final; void setImage(Image *const image); diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index aa554b30f..0d01df51d 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -726,13 +726,13 @@ void TextField::fontChanged() fixScroll(); } -void TextField::mousePressed(gcn::MouseEvent &mouseEvent) +void TextField::mousePressed(MouseEvent &mouseEvent) { #ifdef ANDROID if (!client->isKeyboardVisible()) inputManager.executeAction(Input::KEY_SHOW_KEYBOARD); #endif - if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT) + if (mouseEvent.getButton() == MouseEvent::RIGHT) { if (viewport) { diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 71285bd64..ed08de2fa 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -118,7 +118,7 @@ class TextField : public gcn::TextField, void setCaretPosition(unsigned int position); - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; void handlePaste(); diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 54c18bd52..e9e1ed71e 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -631,7 +631,7 @@ void Window::setVisible(const bool visible, const bool forceSticky) soundManager.playGuiSound(SOUND_SHOW_WINDOW); if (gui) { - gcn::MouseEvent *const event = reinterpret_cast<gcn::MouseEvent*>( + MouseEvent *const event = reinterpret_cast<MouseEvent*>( gui->createMouseEvent(this)); if (event) { @@ -658,12 +658,12 @@ void Window::scheduleDelete() windowContainer->scheduleDelete(this); } -void Window::mousePressed(gcn::MouseEvent &event) +void Window::mousePressed(MouseEvent &event) { // Let Guichan move window to top and figure out title bar drag gcn::Window::mousePressed(event); - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const int x = event.getX(); const int y = event.getY(); @@ -701,7 +701,7 @@ void Window::close() setVisible(false); } -void Window::mouseReleased(gcn::MouseEvent &event A_UNUSED) +void Window::mouseReleased(MouseEvent &event A_UNUSED) { if (mGrip && mouseResize) { @@ -714,18 +714,18 @@ void Window::mouseReleased(gcn::MouseEvent &event A_UNUSED) mMoved = false; } -void Window::mouseEntered(gcn::MouseEvent &event) +void Window::mouseEntered(MouseEvent &event) { updateResizeHandler(event); } -void Window::mouseExited(gcn::MouseEvent &event A_UNUSED) +void Window::mouseExited(MouseEvent &event A_UNUSED) { if (mGrip && !mouseResize && gui) gui->setCursorType(Cursor::CURSOR_POINTER); } -void Window::updateResizeHandler(gcn::MouseEvent &event) +void Window::updateResizeHandler(MouseEvent &event) { if (!gui) return; @@ -760,7 +760,7 @@ void Window::updateResizeHandler(gcn::MouseEvent &event) } } -void Window::mouseMoved(gcn::MouseEvent &event) +void Window::mouseMoved(MouseEvent &event) { updateResizeHandler(event); if (viewport) @@ -772,7 +772,7 @@ bool Window::canMove() const return !mStickyButtonLock || !mSticky; } -void Window::mouseDragged(gcn::MouseEvent &event) +void Window::mouseDragged(MouseEvent &event) { if (canMove()) { @@ -1088,7 +1088,7 @@ void Window::adjustSizeToScreen() widgetResized(Event(this)); } -int Window::getResizeHandles(const gcn::MouseEvent &event) +int Window::getResizeHandles(const MouseEvent &event) { if (event.getX() < 0 || event.getY() < 0) return 0; @@ -1125,7 +1125,7 @@ int Window::getResizeHandles(const gcn::MouseEvent &event) return resizeHandles; } -bool Window::isResizeAllowed(const gcn::MouseEvent &event) const +bool Window::isResizeAllowed(const MouseEvent &event) const { const int y = event.getY(); diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 0c3b69880..a5b6be83c 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -257,35 +257,35 @@ class Window : public gcn::Window, /** * Starts window resizing when appropriate. */ - void mousePressed(gcn::MouseEvent &event) override; + void mousePressed(MouseEvent &event) override; /** * Implements window resizing and makes sure the window is not * dragged/resized outside of the screen. */ - void mouseDragged(gcn::MouseEvent &event) override; + void mouseDragged(MouseEvent &event) override; /** * Implements custom cursor image changing context, based on mouse * relative position. */ - void mouseMoved(gcn::MouseEvent &event) override; + void mouseMoved(MouseEvent &event) override; /** * When the mouse button has been let go, this ensures that the mouse * custom cursor is restored back to it's standard image. */ - void mouseReleased(gcn::MouseEvent &event) override; + void mouseReleased(MouseEvent &event) override; /** * When the mouse leaves the window this ensures that the custom cursor * is restored back to it's standard image. */ - void mouseExited(gcn::MouseEvent &event) override; + void mouseExited(MouseEvent &event) override; - void mouseEntered(gcn::MouseEvent &event) override; + void mouseEntered(MouseEvent &event) override; - void updateResizeHandler(gcn::MouseEvent &event); + void updateResizeHandler(MouseEvent &event); /** * Sets the name of the window. This is not the window title. @@ -410,7 +410,7 @@ class Window : public gcn::Window, gcn::Rectangle getWindowArea() const A_WARN_UNUSED; - bool isResizeAllowed(const gcn::MouseEvent &event) const A_WARN_UNUSED; + bool isResizeAllowed(const MouseEvent &event) const A_WARN_UNUSED; void setCaptionFont(gcn::Font *font) { mCaptionFont = font; } @@ -474,7 +474,7 @@ class Window : public gcn::Window, * * @see ResizeHandles */ - int getResizeHandles(const gcn::MouseEvent &event) A_WARN_UNUSED; + int getResizeHandles(const MouseEvent &event) A_WARN_UNUSED; Image *mGrip; /**< Resize grip */ Window *mParent; /**< The parent window */ |