summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:56 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:56 +0000
commit5e8238c75c66845da7b942abd1c124f51b5520af (patch)
tree56bbc5298ac5c5e9a622e3b78f8c348020e5b381 /src/window.cpp
parent545b6de90067cb27013d2d823fc8967dd49b0902 (diff)
downloadopenttd-5e8238c75c66845da7b942abd1c124f51b5520af.tar.xz
(svn r24748) -Add: Clear button to all editboxes.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 62109e82c..9705de0df 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -367,8 +367,10 @@ void CDECL Window::SetWidgetsLoweredState(bool lowered_stat, int widgets, ...)
void Window::RaiseButtons(bool autoraise)
{
for (uint i = 0; i < this->nested_array_size; i++) {
- if (this->nested_array[i] != NULL && ((this->nested_array[i]->type & ~WWB_PUSHBUTTON) < WWT_LAST || this->nested_array[i]->type == NWID_PUSHBUTTON_DROPDOWN) &&
- (!autoraise || (this->nested_array[i]->type & WWB_PUSHBUTTON)) && this->IsWidgetLowered(i)) {
+ if (this->nested_array[i] == NULL) continue;
+ WidgetType type = this->nested_array[i]->type;
+ if (((type & ~WWB_PUSHBUTTON) < WWT_LAST || type == NWID_PUSHBUTTON_DROPDOWN) &&
+ (!autoraise || (type & WWB_PUSHBUTTON) || type == WWT_EDITBOX) && this->IsWidgetLowered(i)) {
this->RaiseWidget(i);
this->SetWidgetDirty(i);
}