summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-14 17:38:46 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-14 17:38:46 (GMT)
commitfcc17ee6522579eb355452a3b99fa902b74cc90a (patch)
tree8474f3cc159963e366ea71b8aff253a1ae0b6e4d /src
parent34e2ec2459a65feda4fb7c2d8b1f2ace648a5b2f (diff)
downloadpowder-fcc17ee6522579eb355452a3b99fa902b74cc90a.zip
powder-fcc17ee6522579eb355452a3b99fa902b74cc90a.tar.gz
Easier okaying/cancelling for Property tool Window
Diffstat (limited to 'src')
-rw-r--r--src/game/PropertyTool.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/PropertyTool.cpp b/src/game/PropertyTool.cpp
index 4a04996..bfb2609 100644
--- a/src/game/PropertyTool.cpp
+++ b/src/game/PropertyTool.cpp
@@ -23,6 +23,7 @@ public:
PropertyWindow(PropertyTool * tool_, Simulation * sim_, ui::Point position_);
void SetProperty();
virtual void OnDraw();
+ virtual void OnTryExit(ExitMethod method);
virtual ~PropertyWindow() {}
class OkayAction: public ui::ButtonAction
{
@@ -59,6 +60,7 @@ position(position_)
okayButton->Appearance.BorderInactive = ui::Colour(200, 200, 200);
okayButton->SetActionCallback(new OkayAction(this));
AddComponent(okayButton);
+ SetOkayButton(okayButton);
property = new ui::DropDown(ui::Point(8, 25), ui::Point(Size.X-16, 17));
AddComponent(property);
@@ -177,6 +179,12 @@ void PropertyWindow::SetProperty()
}
}
+void PropertyWindow::OnTryExit(ExitMethod method)
+{
+ ui::Engine::Ref().CloseWindow();
+ SelfDestruct();
+}
+
void PropertyWindow::OnDraw()
{
Graphics * g = ui::Engine::Ref().g;