summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-11 16:07:46 +0000
committerfrosch <frosch@openttd.org>2012-11-11 16:07:46 +0000
commitb998cbdff145cd005949b6a005f435a916b0ea06 (patch)
treee94ce652424a290b5feb66067ec8bdf18f9b36d0 /src/terraform_gui.cpp
parentcfccaff6457964db5245ac144e81b581146bfd75 (diff)
downloadopenttd-b998cbdff145cd005949b6a005f435a916b0ea06.tar.xz
(svn r24697) -Codechange: Use WDF_UNCLICK_BUTTONS instead of duplicating the same functionality.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index b288f383d..b89e17e71 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -197,8 +197,6 @@ struct TerraformToolbarWindow : Window {
break;
case WID_TT_PLANT_TREES: // Plant trees button
- /* This button is NOT a place-push-button, so don't treat it as such */
- this->HandleButtonClick(WID_TT_PLANT_TREES);
ShowBuildTreesToolbar();
break;
@@ -220,12 +218,6 @@ struct TerraformToolbarWindow : Window {
}
}
- virtual void OnTimeout()
- {
- this->RaiseWidget(WID_TT_PLANT_TREES);
- this->SetWidgetDirty(WID_TT_PLANT_TREES);
- }
-
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
int num = CheckHotkeyMatch(terraform_hotkeys, keycode, this);
@@ -338,7 +330,7 @@ static const NWidgetPart _nested_terraform_widgets[] = {
SetFill(0, 1), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_BUY_LAND), SetMinimalSize(22, 22),
SetFill(0, 1), SetDataTip(SPR_IMG_BUY_LAND, STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND),
- NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_PLANT_TREES), SetMinimalSize(22, 22),
+ NWidget(WWT_PUSHIMGBTN, COLOUR_DARK_GREEN, WID_TT_PLANT_TREES), SetMinimalSize(22, 22),
SetFill(0, 1), SetDataTip(SPR_IMG_PLANTTREES, STR_SCENEDIT_TOOLBAR_PLANT_TREES),
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_PLACE_SIGN), SetMinimalSize(22, 22),
SetFill(0, 1), SetDataTip(SPR_IMG_SIGN, STR_SCENEDIT_TOOLBAR_PLACE_SIGN),
@@ -352,7 +344,7 @@ static const NWidgetPart _nested_terraform_widgets[] = {
static const WindowDesc _terraform_desc(
WDP_MANUAL, 0, 0,
WC_SCEN_LAND_GEN, WC_NONE,
- WDF_CONSTRUCTION,
+ WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
_nested_terraform_widgets, lengthof(_nested_terraform_widgets)
);