From fcc17ee6522579eb355452a3b99fa902b74cc90a Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 14 Aug 2012 18:38:46 +0100 Subject: [PATCH] Easier okaying/cancelling for Property tool Window --- src/game/PropertyTool.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/PropertyTool.cpp b/src/game/PropertyTool.cpp index 4a0499673..bfb260955 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;