summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-16 13:56:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-16 13:56:14 +0300
commitf880384018ee23efdc5cc072789e176208956a06 (patch)
tree78726f9c32da3dbc49875392f769f082bda752e7 /src/gui/widgets
parent9e3f92a3914e28ce01331d7df7d03c31244a843b (diff)
downloadManaVerse-f880384018ee23efdc5cc072789e176208956a06.tar.gz
ManaVerse-f880384018ee23efdc5cc072789e176208956a06.tar.bz2
ManaVerse-f880384018ee23efdc5cc072789e176208956a06.tar.xz
ManaVerse-f880384018ee23efdc5cc072789e176208956a06.zip
Remove useless casts with KeyEvent.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/button.cpp4
-rw-r--r--src/gui/widgets/checkbox.cpp2
-rw-r--r--src/gui/widgets/dropdown.cpp2
-rw-r--r--src/gui/widgets/guitable.cpp2
-rw-r--r--src/gui/widgets/inttextfield.cpp4
-rw-r--r--src/gui/widgets/listbox.cpp2
-rw-r--r--src/gui/widgets/radiobutton.cpp2
-rw-r--r--src/gui/widgets/slider.cpp2
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/gui/widgets/textbox.cpp2
-rw-r--r--src/gui/widgets/textfield.cpp4
11 files changed, 14 insertions, 14 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 10088d5f4..fecf551b2 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -592,7 +592,7 @@ void Button::setCaption(const std::string& caption)
void Button::keyPressed(KeyEvent& keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
@@ -603,7 +603,7 @@ void Button::keyPressed(KeyEvent& keyEvent)
void Button::keyReleased(KeyEvent& keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (action == Input::KEY_GUI_SELECT && mKeyPressed)
{
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index 2514f30d3..20310c4bc 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -184,7 +184,7 @@ void CheckBox::mouseExited(gcn::MouseEvent& event A_UNUSED)
void CheckBox::keyPressed(KeyEvent& keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index db3393b46..9e3bca2fa 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -315,7 +315,7 @@ void DropDown::keyPressed(KeyEvent& keyEvent)
if (keyEvent.isConsumed())
return;
- const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
switch (actionId)
{
case Input::KEY_GUI_SELECT:
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 1d3dc0c55..bca93e7c2 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -421,7 +421,7 @@ gcn::Rectangle GuiTable::getChildrenArea()
// -- KeyListener notifications
void GuiTable::keyPressed(KeyEvent& keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
diff --git a/src/gui/widgets/inttextfield.cpp b/src/gui/widgets/inttextfield.cpp
index 8e3713522..e693526f0 100644
--- a/src/gui/widgets/inttextfield.cpp
+++ b/src/gui/widgets/inttextfield.cpp
@@ -52,7 +52,7 @@ IntTextField::IntTextField(const Widget2 *const widget, const int def,
void IntTextField::keyPressed(KeyEvent &event)
{
- const int action = static_cast<KeyEvent*>(&event)->getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_DELETE || action == Input::KEY_GUI_BACKSPACE)
{
@@ -68,7 +68,7 @@ void IntTextField::keyPressed(KeyEvent &event)
if (val != Key::TEXTINPUT)
return;
- const std::string str = static_cast<KeyEvent*>(&event)->getText();
+ const std::string str = event->getText();
if (str.empty())
return;
const size_t sz = str.size();
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index bd685632f..1e97b6e8a 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -177,7 +177,7 @@ void ListBox::draw(Graphics *graphics)
void ListBox::keyPressed(KeyEvent &keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
distributeActionEvent();
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index 75ea4819a..afcd98d67 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -180,7 +180,7 @@ void RadioButton::mouseExited(gcn::MouseEvent& event A_UNUSED)
void RadioButton::keyPressed(KeyEvent& keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
setSelected(true);
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index 4513ca167..8cc454c10 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -343,7 +343,7 @@ void Slider::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent)
void Slider::keyPressed(KeyEvent& keyEvent)
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (getOrientation() == HORIZONTAL)
{
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index bc41ba824..6a5febea6 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -689,7 +689,7 @@ void TabbedArea::keyPressed(KeyEvent& keyEvent)
if (mBlockSwitching || keyEvent.isConsumed() || !isFocused())
return;
- const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
if (actionId == Input::KEY_GUI_LEFT)
{
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 8130469b7..ecdc0e4d0 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -169,7 +169,7 @@ void TextBox::setTextWrapped(const std::string &text, const int minDimension)
void TextBox::keyPressed(KeyEvent& keyEvent)
{
const gcn::Key &key = keyEvent.getKey();
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
switch (action)
{
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 81a69e472..aa554b30f 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -204,7 +204,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
#ifdef USE_SDL2
if (val == Key::TEXTINPUT)
{
- std::string str = static_cast<KeyEvent*>(&keyEvent)->getText();
+ std::string str = keyEvent->getText();
mText.insert(mCaretPosition, str);
mCaretPosition += str.size();
keyEvent.consume();
@@ -293,7 +293,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
}
else
{
- const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int action = keyEvent.getActionId();
if (!inputManager.isActionActive(static_cast<int>(
Input::KEY_GUI_CTRL)))
{