summaryrefslogtreecommitdiffstats
path: root/src/ui/window.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-22 00:38:17 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-22 00:38:17 +0200
commit0ff419560d5a567afaa0294968cc1f5b5e6b597b (patch)
tree03edeac0b7850348b9b910e0d39dd88a477afd75 /src/ui/window.cpp
parent15ff1d512b9e103396144bec1cd8004ecf4f7f9c (diff)
downloadcolobot-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/window.cpp')
-rw-r--r--src/ui/window.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index 4967795..97daf94 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -949,9 +949,9 @@ bool CWindow::EventProcess(const Event &event)
m_pressMouse = Gfx::ENG_MOUSE_NORM;
if ( m_name.length() > 0 && m_bMovable && // title bar?
- Detect(event.pos) )
+ Detect(event.mousePos) )
{
- flags = BorderDetect(event.pos);
+ flags = BorderDetect(event.mousePos);
if ( flags == -1 )
{
m_pressMouse = Gfx::ENG_MOUSE_MOVE; // +
@@ -1011,17 +1011,17 @@ bool CWindow::EventProcess(const Event &event)
}
if ( m_bTrashEvent && event.type == EVENT_MOUSE_BUTTON_DOWN &&
- event.mouseButton.button == 1)
+ event.mouseButton.button == MOUSE_BUTTON_LEFT)
{
- if ( Detect(event.pos) )
+ if ( Detect(event.mousePos) )
{
if ( m_name.length() > 0 && m_bMovable ) // title bar?
{
- m_pressFlags = BorderDetect(event.pos);
+ m_pressFlags = BorderDetect(event.mousePos);
if ( m_pressFlags != 0 )
{
m_bCapture = true;
- m_pressPos = event.pos;
+ m_pressPos = event.mousePos;
}
}
return false;
@@ -1030,7 +1030,7 @@ bool CWindow::EventProcess(const Event &event)
if ( event.type == EVENT_MOUSE_MOVE && m_bCapture )
{
- pos = event.pos;
+ pos = event.mousePos;
if ( m_pressFlags == -1 ) // all moves?
{
m_pos.x += pos.x-m_pressPos.x;
@@ -1081,7 +1081,7 @@ bool CWindow::EventProcess(const Event &event)
m_event->AddEvent(newEvent);
}
- if ( event.type == EVENT_MOUSE_BUTTON_UP && event.mouseButton.button == 1 && m_bCapture )
+ if ( event.type == EVENT_MOUSE_BUTTON_UP && event.mouseButton.button == MOUSE_BUTTON_LEFT && m_bCapture )
{
m_bCapture = false;
}