summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/button.cpp12
-rw-r--r--src/gui/widgets/button.h4
-rw-r--r--src/gui/widgets/checkbox.cpp6
-rw-r--r--src/gui/widgets/checkbox.h2
-rw-r--r--src/gui/widgets/dropdown.cpp8
-rw-r--r--src/gui/widgets/dropdown.h2
-rw-r--r--src/gui/widgets/guitable.cpp18
-rw-r--r--src/gui/widgets/guitable.h2
-rw-r--r--src/gui/widgets/listbox.cpp14
-rw-r--r--src/gui/widgets/listbox.h2
-rw-r--r--src/gui/widgets/radiobutton.cpp6
-rw-r--r--src/gui/widgets/radiobutton.h2
-rw-r--r--src/gui/widgets/slider.cpp12
-rw-r--r--src/gui/widgets/slider.h2
-rw-r--r--src/gui/widgets/tabbedarea.cpp10
-rw-r--r--src/gui/widgets/tabbedarea.h2
-rw-r--r--src/gui/widgets/textbox.cpp8
-rw-r--r--src/gui/widgets/textbox.h2
-rw-r--r--src/gui/widgets/textfield.cpp18
-rw-r--r--src/gui/widgets/textfield.h2
20 files changed, 67 insertions, 67 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 778d74b41..dffcc7814 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -673,20 +673,20 @@ void Button::adjustSize()
}
}
-void Button::keyPressed(KeyEvent& keyEvent)
+void Button::keyPressed(KeyEvent& event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
mKeyPressed = true;
- keyEvent.consume();
+ event.consume();
}
}
-void Button::keyReleased(KeyEvent& keyEvent)
+void Button::keyReleased(KeyEvent& event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_SELECT && mKeyPressed)
{
@@ -694,7 +694,7 @@ void Button::keyReleased(KeyEvent& keyEvent)
if (mStick)
mPressed = !mPressed;
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
}
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 200418172..57a024195 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -189,9 +189,9 @@ class Button final : public Widget,
void adjustSize();
- void keyPressed(KeyEvent &keyEvent) override final;
+ void keyPressed(KeyEvent &event) override final;
- void keyReleased(KeyEvent &keyEvent) override final;
+ void keyReleased(KeyEvent &event) override final;
bool isPressed2() const A_WARN_UNUSED;
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index fb639753f..06dcecab0 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -235,14 +235,14 @@ void CheckBox::mouseExited(MouseEvent& event A_UNUSED)
mHasMouse = false;
}
-void CheckBox::keyPressed(KeyEvent& keyEvent)
+void CheckBox::keyPressed(KeyEvent& event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
toggleSelected();
- keyEvent.consume();
+ event.consume();
}
}
diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h
index 9882284b0..41f168048 100644
--- a/src/gui/widgets/checkbox.h
+++ b/src/gui/widgets/checkbox.h
@@ -126,7 +126,7 @@ class CheckBox final : public Widget,
*/
void mouseExited(MouseEvent& event) override final;
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
void adjustSize();
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index ba2ffe58d..8b636c04d 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -307,12 +307,12 @@ void DropDown::drawButton(Graphics *graphics)
}
}
-void DropDown::keyPressed(KeyEvent& keyEvent)
+void DropDown::keyPressed(KeyEvent& event)
{
- if (keyEvent.isConsumed())
+ if (event.isConsumed())
return;
- const int actionId = keyEvent.getActionId();
+ const int actionId = event.getActionId();
switch (actionId)
{
case Input::KEY_GUI_SELECT:
@@ -344,7 +344,7 @@ void DropDown::keyPressed(KeyEvent& keyEvent)
return;
}
- keyEvent.consume();
+ event.consume();
}
void DropDown::hideDrop(bool event)
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index a4d1fde1e..cf42cce11 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -83,7 +83,7 @@ class DropDown final : public ActionListener,
// Inherited from KeyListener
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
// Inherited from MouseListener
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 44248037c..35e09ce93 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -421,46 +421,46 @@ Rect GuiTable::getChildrenArea()
}
// -- KeyListener notifications
-void GuiTable::keyPressed(KeyEvent& keyEvent)
+void GuiTable::keyPressed(KeyEvent& event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_UP)
{
setSelectedRow(mSelectedRow - 1);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_DOWN)
{
setSelectedRow(mSelectedRow + 1);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_LEFT)
{
setSelectedColumn(mSelectedColumn - 1);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_RIGHT)
{
setSelectedColumn(mSelectedColumn + 1);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_HOME)
{
setSelectedRow(0);
setSelectedColumn(0);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_END && mModel)
{
setSelectedRow(mModel->getRows() - 1);
setSelectedColumn(mModel->getColumns() - 1);
- keyEvent.consume();
+ event.consume();
}
}
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index 9beb866cf..ec3bab728 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -123,7 +123,7 @@ public:
void _setFocusHandler(FocusHandler *const focusHandler) override final;
// Inherited from KeyListener
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
/**
* Sets the table to be opaque, that is sets the table
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 1df21af20..c41e32854 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -225,13 +225,13 @@ void ListBox::draw(Graphics *graphics)
BLOCK_END("ListBox::draw")
}
-void ListBox::keyPressed(KeyEvent &keyEvent)
+void ListBox::keyPressed(KeyEvent &event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_UP)
{
@@ -239,7 +239,7 @@ void ListBox::keyPressed(KeyEvent &keyEvent)
setSelected(mSelected - 1);
else if (mSelected == 0 && mWrappingEnabled && getListModel())
setSelected(getListModel()->getNumberOfElements() - 1);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_DOWN)
{
@@ -248,17 +248,17 @@ void ListBox::keyPressed(KeyEvent &keyEvent)
setSelected(mSelected + 1);
else if (mSelected == num && mWrappingEnabled)
setSelected(0);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_HOME)
{
setSelected(0);
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_END && getListModel())
{
setSelected(getListModel()->getNumberOfElements() - 1);
- keyEvent.consume();
+ event.consume();
}
}
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index 9a398dfa2..e425b48ca 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -119,7 +119,7 @@ class ListBox : public Widget,
// Inherited from KeyListener
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
// Inherited from MouseListener
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index 549e8823e..643517f77 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -235,14 +235,14 @@ void RadioButton::mouseExited(MouseEvent& event A_UNUSED)
mHasMouse = false;
}
-void RadioButton::keyPressed(KeyEvent& keyEvent)
+void RadioButton::keyPressed(KeyEvent& event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (action == Input::KEY_GUI_SELECT)
{
setSelected(true);
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
}
diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h
index a0d32dd9d..ec1450f66 100644
--- a/src/gui/widgets/radiobutton.h
+++ b/src/gui/widgets/radiobutton.h
@@ -120,7 +120,7 @@ class RadioButton final : public Widget,
*/
void mouseExited(MouseEvent& event) override final;
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
void updateAlpha();
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index c4ff2d2bc..cf9aad03d 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -403,9 +403,9 @@ void Slider::mouseWheelMovedDown(MouseEvent &event)
event.consume();
}
-void Slider::keyPressed(KeyEvent& keyEvent)
+void Slider::keyPressed(KeyEvent& event)
{
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (mOrientation == HORIZONTAL)
{
@@ -413,13 +413,13 @@ void Slider::keyPressed(KeyEvent& keyEvent)
{
setValue(mValue + mStepLength);
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_LEFT)
{
setValue(mValue - mStepLength);
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
}
else
@@ -428,13 +428,13 @@ void Slider::keyPressed(KeyEvent& keyEvent)
{
setValue(mValue + mStepLength);
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
else if (action == Input::KEY_GUI_DOWN)
{
setValue(mValue - mStepLength);
distributeActionEvent();
- keyEvent.consume();
+ event.consume();
}
}
}
diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h
index 5ee81dd10..164048020 100644
--- a/src/gui/widgets/slider.h
+++ b/src/gui/widgets/slider.h
@@ -143,7 +143,7 @@ class Slider final : public Widget,
void mouseWheelMovedDown(MouseEvent &event) override final;
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
/**
* Sets the scale of the slider.
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 410112c55..3cb6cb302 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -727,12 +727,12 @@ void TabbedArea::setDimension(const Rect &dimension)
adjustSize();
}
-void TabbedArea::keyPressed(KeyEvent& keyEvent)
+void TabbedArea::keyPressed(KeyEvent& event)
{
- if (mBlockSwitching || keyEvent.isConsumed() || !isFocused())
+ if (mBlockSwitching || event.isConsumed() || !isFocused())
return;
- const int actionId = keyEvent.getActionId();
+ const int actionId = event.getActionId();
if (actionId == Input::KEY_GUI_LEFT)
{
@@ -744,7 +744,7 @@ void TabbedArea::keyPressed(KeyEvent& keyEvent)
else
setSelectedTab(mTabs[index].first);
- keyEvent.consume();
+ event.consume();
}
else if (actionId == Input::KEY_GUI_RIGHT)
{
@@ -756,7 +756,7 @@ void TabbedArea::keyPressed(KeyEvent& keyEvent)
else
setSelectedTab(mTabs[index].first);
- keyEvent.consume();
+ event.consume();
}
}
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index 710db31f2..578128abf 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -211,7 +211,7 @@ class TabbedArea final : public ActionListener,
bool getFollowDownScroll() const A_WARN_UNUSED
{ return mFollowDownScroll; }
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
void setBlockSwitching(const bool b)
{ mBlockSwitching = b; }
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 39e585279..b1849e801 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -248,10 +248,10 @@ void TextBox::setText(const std::string& text)
adjustSize();
}
-void TextBox::keyPressed(KeyEvent& keyEvent)
+void TextBox::keyPressed(KeyEvent& event)
{
- const Key &key = keyEvent.getKey();
- const int action = keyEvent.getActionId();
+ const Key &key = event.getKey();
+ const int action = event.getActionId();
switch (action)
{
@@ -430,7 +430,7 @@ void TextBox::keyPressed(KeyEvent& keyEvent)
adjustSize();
scrollToCaret();
- keyEvent.consume();
+ event.consume();
}
void TextBox::draw(Graphics* graphics)
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index 056f6a0d3..e8c1d3840 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -105,7 +105,7 @@ class TextBox final : public Widget,
int getMinWidth() const A_WARN_UNUSED
{ return mMinWidth; }
- void keyPressed(KeyEvent& keyEvent) override final;
+ void keyPressed(KeyEvent& event) override final;
void draw(Graphics* graphics) override final;
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index d7d73f78a..d1f19785f 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -245,16 +245,16 @@ int TextField::getValue() const
return value;
}
-void TextField::keyPressed(KeyEvent &keyEvent)
+void TextField::keyPressed(KeyEvent &event)
{
- const int val = keyEvent.getKey().getValue();
+ const int val = event.getKey().getValue();
#ifdef USE_SDL2
if (val == Key::TEXTINPUT)
{
- std::string str = keyEvent.getText();
+ std::string str = event.getText();
mText.insert(mCaretPosition, str);
mCaretPosition += str.size();
- keyEvent.consume();
+ event.consume();
fixScroll();
if (mSendAlwaysEvents)
distributeActionEvent();
@@ -273,7 +273,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
buf[1] = 0;
mText.insert(mCaretPosition, std::string(buf));
mCaretPosition += 1;
- keyEvent.consume();
+ event.consume();
fixScroll();
if (mSendAlwaysEvents)
distributeActionEvent();
@@ -305,7 +305,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
mText.insert(mCaretPosition, std::string(buf, buf + len));
mCaretPosition += len;
- keyEvent.consume();
+ event.consume();
fixScroll();
if (mSendAlwaysEvents)
distributeActionEvent();
@@ -323,14 +323,14 @@ void TextField::keyPressed(KeyEvent &keyEvent)
bool consumed(false);
#endif
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (!inputManager.isActionActive(static_cast<int>(
Input::KEY_GUI_CTRL)))
{
if (!handleNormalKeys(action, consumed))
{
if (consumed)
- keyEvent.consume();
+ event.consume();
return;
}
}
@@ -343,7 +343,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
distributeActionEvent();
if (consumed)
- keyEvent.consume();
+ event.consume();
fixScroll();
}
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index 2b0762e86..1af5978b1 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -134,7 +134,7 @@ class TextField : public Widget,
/**
* Processes one keypress.
*/
- void keyPressed(KeyEvent &keyEvent) override;
+ void keyPressed(KeyEvent &event) override;
/**
* Set the minimum value for a range