Changeset - r12702:8d80b3faf211
[Not reviewed]
master
0 2 0
alberth - 15 years ago 2009-08-14 21:27:08
alberth@openttd.org
(svn r17175) -Codechange: Only auto-raise push buttons.
2 files changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -194,13 +194,14 @@ void CDECL Window::SetWidgetsLoweredStat
 
}
 

	
 
/**
 
 * 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);
 
		}
 
	}
 
}
src/window_gui.h
Show inline comments
 
@@ -502,7 +502,7 @@ public:
 
	void HandleButtonClick(byte widget);
 
	const Widget *GetWidgetOfType(WidgetType widget_type) const;
 

	
 
	void RaiseButtons();
 
	void RaiseButtons(bool autoraise = false);
 
	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
 
	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
 
	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
0 comments (0 inline, 0 general)