summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-28 16:14:15 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-28 16:14:15 +0300
commit226202ff807dc860991af0d6665ef9e9b48c1bed (patch)
treede0be738585f3ab2556865c206981d2d2842ac69 /src/gui/widgets
parenteb62e14c838788ae7691567a90bf7fe4940d5687 (diff)
downloadplus-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.gz
plus-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.bz2
plus-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.xz
plus-226202ff807dc860991af0d6665ef9e9b48c1bed.zip
Move direct SDL_GetMouseState calls into method in gui class.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/characterdisplay.cpp5
-rw-r--r--src/gui/widgets/textfield.cpp11
2 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index 52f56ae69..bd3f042f9 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -122,9 +122,12 @@ void CharacterDisplay::mouseExited(gcn::MouseEvent &event A_UNUSED)
void CharacterDisplay::mouseMoved(gcn::MouseEvent &event A_UNUSED)
{
+ if (!gui)
+ return;
+
int mouseX = 0;
int mouseY = 0;
- SDL_GetMouseState(&mouseX, &mouseY);
+ gui->getMouseState(&mouseX, &mouseY);
const std::string &name = mName->getCaption();
if (!name.empty())
{
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 07fde23cd..41084c867 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -741,10 +741,13 @@ void TextField::mousePressed(gcn::MouseEvent &mouseEvent)
mPopupMenu = new PopupMenu();
mPopupMenu->postInit();
}
- int x = 0;
- int y = 0;
- SDL_GetMouseState(&x, &y);
- mPopupMenu->showTextFieldPopup(x, y, this);
+ if (gui)
+ {
+ int x = 0;
+ int y = 0;
+ gui->getMouseState(&x, &y);
+ mPopupMenu->showTextFieldPopup(x, y, this);
+ }
}
}
else