summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-08-14 21:27:08 +0000
committeralberth <alberth@openttd.org>2009-08-14 21:27:08 +0000
commite6a1da11a377bdd28e530695ec0fb5e4957e1923 (patch)
tree218ab80594ed407934dcc87ee681a1f54d6cb3f1 /src/window.cpp
parentfe74c526d88f4bcea7e5666a454aad1eb1284b7b (diff)
downloadopenttd-e6a1da11a377bdd28e530695ec0fb5e4957e1923.tar.xz
(svn r17175) -Codechange: Only auto-raise push buttons.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/window.cpp b/src/window.cpp
index c9c43aab6..97c762fca 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -194,13 +194,14 @@ void CDECL Window::SetWidgetsLoweredState(bool lowered_stat, int widgets, ...)
}
/**
- * Raise all buttons of the window
+ * Raise the buttons of the window.
+ * @param autoraise Raise only the push buttons of the window.
*/
-void Window::RaiseButtons()
+void Window::RaiseButtons(bool autoraise)
{
if (this->widget != NULL) {
for (uint i = 0; i < this->widget_count; i++) {
- if (this->IsWidgetLowered(i)) {
+ if ((!autoraise || (this->widget[i].type & WWB_PUSHBUTTON)) && this->IsWidgetLowered(i)) {
this->RaiseWidget(i);
this->InvalidateWidget(i);
}
@@ -208,7 +209,7 @@ void Window::RaiseButtons()
}
if (this->nested_array != NULL) {
for (uint i = 0; i < this->nested_array_size; i++) {
- if (this->nested_array[i] != NULL && this->IsWidgetLowered(i)) {
+ if (this->nested_array[i] != NULL && (!autoraise || (this->nested_array[i]->type & WWB_PUSHBUTTON)) && this->IsWidgetLowered(i)) {
this->RaiseWidget(i);
this->InvalidateWidget(i);
}
@@ -1422,7 +1423,7 @@ static void DecreaseWindowCounters()
FOR_ALL_WINDOWS_FROM_FRONT(w) {
if ((w->flags4 & WF_TIMEOUT_MASK) && !(--w->flags4 & WF_TIMEOUT_MASK)) {
w->OnTimeout();
- if (w->desc_flags & WDF_UNCLICK_BUTTONS) w->RaiseButtons();
+ if (w->desc_flags & WDF_UNCLICK_BUTTONS) w->RaiseButtons(true);
}
}
}