diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-22 00:38:17 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-22 00:38:17 +0200 |
commit | 0ff419560d5a567afaa0294968cc1f5b5e6b597b (patch) | |
tree | 03edeac0b7850348b9b910e0d39dd88a477afd75 /src/ui/editvalue.cpp | |
parent | 15ff1d512b9e103396144bec1cd8004ecf4f7f9c (diff) | |
download | colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.tar.gz colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.tar.bz2 colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.zip |
Event fixes & refactoring
- added new state tracking to Event
- removed old fields from Event
- fixed some issues with Events and fps counter
Diffstat (limited to 'src/ui/editvalue.cpp')
-rw-r--r-- | src/ui/editvalue.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ui/editvalue.cpp b/src/ui/editvalue.cpp index 3b819b3..3cc856d 100644 --- a/src/ui/editvalue.cpp +++ b/src/ui/editvalue.cpp @@ -191,7 +191,7 @@ bool CEditValue::EventProcess(const Event &event) if (event.type == EVENT_MOUSE_WHEEL && event.mouseWheel.dir == WHEEL_UP && - Detect(event.mouseWheel.pos)) + Detect(event.mousePos)) { value = GetValue()+m_stepValue; if ( value > m_maxValue ) value = m_maxValue; @@ -200,7 +200,7 @@ bool CEditValue::EventProcess(const Event &event) } if ( event.type == EVENT_KEY_DOWN && event.mouseWheel.dir == WHEEL_DOWN && - Detect(event.mouseWheel.pos)) + Detect(event.mousePos)) { value = GetValue()-m_stepValue; if ( value < m_minValue ) value = m_minValue; @@ -230,9 +230,8 @@ void CEditValue::HiliteValue(const Event &event) m_edit->SetFocus(true); Event newEvent = event; - newEvent.type = EVENT_ACTIVE; - newEvent.active.gain = true; // TODO not much pretty sure about it - newEvent.param = m_edit->GetEventType(); + newEvent.type = EVENT_FOCUS; + newEvent.customParam = m_edit->GetEventType(); m_event->AddEvent(newEvent); // defocus the other objects } |