summaryrefslogtreecommitdiff
path: root/src/interface/Button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/Button.cpp')
-rw-r--r--src/interface/Button.cpp43
1 files changed, 18 insertions, 25 deletions
diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp
index 95de0e8..a2ecf8f 100644
--- a/src/interface/Button.cpp
+++ b/src/interface/Button.cpp
@@ -1,10 +1,3 @@
-/*
- * Button.cpp
- *
- * Created on: Jan 8, 2012
- * Author: Simon
- */
-
#include <iostream>
#include "interface/Button.h"
#include "graphics/Graphics.h"
@@ -156,21 +149,21 @@ void Button::Draw(const Point& screenPos)
void Button::OnMouseUnclick(int x, int y, unsigned int button)
{
- if(button == 1)
- {
- if(isButtonDown)
+ if(button == 1)
+ {
+ if(isButtonDown)
{
- isButtonDown = false;
+ isButtonDown = false;
DoAction();
}
- }
- else if(button == 3)
- {
- if(isAltButtonDown)
- {
- isAltButtonDown = false;
- DoAltAction();
- }
+ }
+ else if(button == 3)
+ {
+ if(isAltButtonDown)
+ {
+ isAltButtonDown = false;
+ DoAltAction();
+ }
}
}
@@ -178,8 +171,8 @@ void Button::OnMouseClick(int x, int y, unsigned int button)
{
if(!Enabled)
return;
- if(button == 1)
- {
+ if(button == 1)
+ {
if(isTogglable)
{
toggle = !toggle;
@@ -187,14 +180,14 @@ void Button::OnMouseClick(int x, int y, unsigned int button)
isButtonDown = true;
}
else if(button == 3)
- {
+ {
isAltButtonDown = true;
}
}
void Button::OnMouseEnter(int x, int y)
{
- isMouseInside = true;
+ isMouseInside = true;
if(!Enabled)
return;
if(actionCallback)
@@ -208,8 +201,8 @@ void Button::OnMouseEnter(int x, int y)
void Button::OnMouseLeave(int x, int y)
{
- isMouseInside = false;
- isButtonDown = false;
+ isMouseInside = false;
+ isButtonDown = false;
}
void Button::DoAction()