summaryrefslogtreecommitdiff
path: root/src/interface/Window.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-09-16 16:09:23 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-16 16:09:23 (GMT)
commitbd02c36426f0ee9196ac971f8f9b7e03eb35dbd3 (patch)
treebfe72a315c3204c7ff857dad89b8b6cfc17803d6 /src/interface/Window.cpp
parentcd7fe454b213f77d5048357c99595ed167918ff8 (diff)
downloadpowder-bd02c36426f0ee9196ac971f8f9b7e03eb35dbd3.zip
powder-bd02c36426f0ee9196ac971f8f9b7e03eb35dbd3.tar.gz
Right click menu to go to history and user info for save buttons
Diffstat (limited to 'src/interface/Window.cpp')
-rw-r--r--src/interface/Window.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/interface/Window.cpp b/src/interface/Window.cpp
index 7a376d8..013ec1a 100644
--- a/src/interface/Window.cpp
+++ b/src/interface/Window.cpp
@@ -14,6 +14,7 @@ Window::Window(Point _position, Point _size):
AllowExclusiveDrawing(true),
halt(false),
destruct(false),
+ stop(false),
cancelButton(NULL),
okayButton(NULL)
#ifdef DEBUG
@@ -232,6 +233,7 @@ void Window::DoTick(float dt)
}
halt = false;
+ stop = false;
OnTick(dt);
@@ -292,7 +294,8 @@ void Window::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool a
focusedComponent_->OnKeyPress(key, character, shift, ctrl, alt);
}
- OnKeyPress(key, character, shift, ctrl, alt);
+ if(!stop)
+ OnKeyPress(key, character, shift, ctrl, alt);
if(key == KEY_ESCAPE)
OnTryExit(Escape);
@@ -317,7 +320,8 @@ void Window::DoKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool
focusedComponent_->OnKeyRelease(key, character, shift, ctrl, alt);
}
- OnKeyRelease(key, character, shift, ctrl, alt);
+ if(!stop)
+ OnKeyRelease(key, character, shift, ctrl, alt);
if(destruct)
finalise();
}
@@ -360,7 +364,8 @@ void Window::DoMouseDown(int x_, int y_, unsigned button)
Components[i]->OnMouseDown(x, y, button);
}
- OnMouseDown(x_, y_, button);
+ if(!stop)
+ OnMouseDown(x_, y_, button);
if(x_ < Position.X || y_ < Position.Y || x_ > Position.X+Size.X || y_ > Position.Y+Size.Y)
OnTryExit(MouseOutside);
@@ -419,7 +424,8 @@ void Window::DoMouseMove(int x_, int y_, int dx, int dy)
}
}
- OnMouseMove(x_, y_, dx, dy);
+ if(!stop)
+ OnMouseMove(x_, y_, dx, dy);
if(destruct)
finalise();
}
@@ -452,7 +458,8 @@ void Window::DoMouseUp(int x_, int y_, unsigned button)
Components[i]->OnMouseUp(x, y, button);
}
- OnMouseUp(x_, y_, button);
+ if(!stop)
+ OnMouseUp(x_, y_, button);
if(destruct)
finalise();
}
@@ -483,7 +490,8 @@ void Window::DoMouseWheel(int x_, int y_, int d)
Components[i]->OnMouseWheel(x - Components[i]->Position.X, y - Components[i]->Position.Y, d);
}
- OnMouseWheel(x_, y_, d);
+ if(!stop)
+ OnMouseWheel(x_, y_, d);
if(destruct)
finalise();
@@ -498,5 +506,12 @@ void Window::SelfDestruct()
{
destruct = true;
halt = true;
+ stop = true;
+}
+
+void Window::Halt()
+{
+ stop = true;
+ halt = true;
}