Amend gui's to work with touchscreen controls.

This commit is contained in:
Juanjo
2013-06-24 20:32:29 +02:00
committed by pelya
parent d5669bb677
commit 96d3b0695c
5 changed files with 21 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ struct BuildAirToolbarWindow : Window {
~BuildAirToolbarWindow() ~BuildAirToolbarWindow()
{ {
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false); if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
} }
@@ -141,6 +142,8 @@ struct BuildAirToolbarWindow : Window {
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_AIR); DeleteWindowById(WC_BUILD_STATION, TRANSPORT_AIR);
DeleteWindowById(WC_SELECT_STATION, 0); DeleteWindowById(WC_SELECT_STATION, 0);
ResetObjectToPlace();
} }
static HotkeyList hotkeys; static HotkeyList hotkeys;

View File

@@ -279,6 +279,10 @@ public:
this->SetButtons(); this->SetButtons();
} }
~BuildIndustryWindow() {
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
}
virtual void OnInit() virtual void OnInit()
{ {
this->SetupArrays(); this->SetupArrays();

View File

@@ -158,6 +158,7 @@ struct TerraformToolbarWindow : Window {
~TerraformToolbarWindow() ~TerraformToolbarWindow()
{ {
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
} }
virtual void OnInit() virtual void OnInit()
@@ -287,6 +288,7 @@ struct TerraformToolbarWindow : Window {
{ {
DeleteWindowById(WC_BUILD_OBJECT, 0); DeleteWindowById(WC_BUILD_OBJECT, 0);
this->RaiseButtons(); this->RaiseButtons();
ResetObjectToPlace();
} }
static HotkeyList hotkeys; static HotkeyList hotkeys;

View File

@@ -1061,6 +1061,10 @@ public:
this->UpdateButtons(true); this->UpdateButtons(true);
} }
~FoundTownWindow() {
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
}
void RandomTownName() void RandomTownName()
{ {
this->townnamevalid = GenerateTownName(&this->townnameparts); this->townnamevalid = GenerateTownName(&this->townnameparts);

View File

@@ -18,6 +18,7 @@
#include "command_func.h" #include "command_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "tree_map.h" #include "tree_map.h"
#include "window_func.h"
#include "widgets/tree_widget.h" #include "widgets/tree_widget.h"
@@ -58,6 +59,11 @@ public:
ResetObjectToPlace(); ResetObjectToPlace();
} }
~BuildTreesWindow()
{
if (_thd.GetCallbackWnd() == this) this->OnPlaceObjectAbort();
}
/** /**
* Calculate the maximum size of all tree sprites * Calculate the maximum size of all tree sprites
* @return Dimension of the largest tree sprite * @return Dimension of the largest tree sprite
@@ -171,6 +177,8 @@ public:
virtual void OnPlaceObjectAbort() virtual void OnPlaceObjectAbort()
{ {
this->RaiseButtons(); this->RaiseButtons();
ResetObjectToPlace();
} }
}; };