Changeset - r10180:4b784f7e933a
[Not reviewed]
master
0 10 0
rubidium - 16 years ago 2008-09-23 15:24:15
rubidium@openttd.org
(svn r14390) -Codechange: replace magic constants with symbolic constants.
10 files changed with 19 insertions and 18 deletions:
0 comments (0 inline, 0 general)
src/cheat_gui.cpp
Show inline comments
 
@@ -216,7 +216,7 @@ struct CheatWindow : Window {
 

	
 
		if (value != oldvalue) WriteValue(ce->variable, ce->type, (int64)value);
 

	
 
		flags4 |= 5 << WF_TIMEOUT_SHL;
 
		this->flags4 |= WF_TIMEOUT_BEGIN;
 

	
 
		SetDirty();
 
	}
src/genworld_gui.cpp
Show inline comments
 
@@ -403,7 +403,7 @@ struct GenerateLandscapeWindow : public 
 
			case GLAND_START_DATE_DOWN:
 
			case GLAND_START_DATE_UP: // Year buttons
 
				/* Don't allow too fast scrolling */
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 

	
 
@@ -421,7 +421,7 @@ struct GenerateLandscapeWindow : public 
 
			case GLAND_SNOW_LEVEL_DOWN:
 
			case GLAND_SNOW_LEVEL_UP: // Snow line buttons
 
				/* Don't allow too fast scrolling */
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 

	
 
@@ -697,7 +697,7 @@ struct CreateScenarioWindow : public Win
 
			case CSCEN_START_DATE_DOWN:
 
			case CSCEN_START_DATE_UP: // Year buttons
 
				/* Don't allow too fast scrolling */
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 

	
 
@@ -715,7 +715,7 @@ struct CreateScenarioWindow : public Win
 
			case CSCEN_FLAT_LAND_HEIGHT_DOWN:
 
			case CSCEN_FLAT_LAND_HEIGHT_UP: // Height level buttons
 
				/* Don't allow too fast scrolling */
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -598,7 +598,7 @@ public:
 

	
 
						UpdateIndustryProduction(i);
 
						this->SetDirty();
 
						this->flags4 |= 5 << WF_TIMEOUT_SHL;
 
						this->flags4 |= WF_TIMEOUT_BEGIN;
 
						this->clicked_line = line + 1;
 
						this->clicked_button = (x < 15 ? 1 : 2);
 
					} else if (IsInsideMM(x, 34, 160)) {
src/network/network_gui.cpp
Show inline comments
 
@@ -855,7 +855,7 @@ struct NetworkStartServerWindow : public
 
			case NSSW_COMPANIES_BTND:  case NSSW_COMPANIES_BTNU:  // Click on up/down button for number of companies
 
			case NSSW_SPECTATORS_BTND: case NSSW_SPECTATORS_BTNU: // Click on up/down button for number of spectators
 
				/* Don't allow too fast scrolling */
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
				if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 
					switch (widget) {
src/settings_gui.cpp
Show inline comments
 
@@ -890,8 +890,8 @@ struct PatchesSelectionWindow : Window {
 
						uint32 step = (sdb->interval == 0) ? ((sdb->max - sdb->min) / 50) : sdb->interval;
 
						if (step == 0) step = 1;
 

	
 
						// don't allow too fast scrolling
 
						if ((this->flags4 & WF_TIMEOUT_MASK) > 2 << WF_TIMEOUT_SHL) {
 
						/* don't allow too fast scrolling */
 
						if ((this->flags4 & WF_TIMEOUT_MASK) > WF_TIMEOUT_TRIGGER) {
 
							_left_button_clicked = false;
 
							return;
 
						}
 
@@ -908,7 +908,7 @@ struct PatchesSelectionWindow : Window {
 
						/* Set up scroller timeout for numeric values */
 
						if (value != oldvalue && !(sd->desc.flags & SGF_MULTISTRING)) {
 
							this->click = btn * 2 + 1 + ((x >= 10) ? 1 : 0);
 
							this->flags4 |= 5 << WF_TIMEOUT_SHL;
 
							this->flags4 |= WF_TIMEOUT_BEGIN;
 
							_left_button_clicked = false;
 
						}
 
					} break;
 
@@ -1168,7 +1168,7 @@ struct CustomCurrencyWindow : Window {
 
			ShowQueryString(str, STR_CURRENCY_CHANGE_PARAMETER, len + 1, 250, this, afilter, QSF_NONE);
 
		}
 

	
 
		this->flags4 |= 5 << WF_TIMEOUT_SHL;
 
		this->flags4 |= WF_TIMEOUT_BEGIN;
 
		this->SetDirty();
 
	}
 

	
src/station_gui.cpp
Show inline comments
 
@@ -434,7 +434,7 @@ public:
 

	
 
			case SLW_SORTBY: // flip sorting method asc/desc
 
				this->stations.ToggleSortOrder();
 
				this->flags4 |= 5 << WF_TIMEOUT_SHL;
 
				this->flags4 |= WF_TIMEOUT_BEGIN;
 
				this->LowerWidget(SLW_SORTBY);
 
				this->SetDirty();
 
				break;
src/toolbar_gui.cpp
Show inline comments
 
@@ -747,7 +747,7 @@ static void ToolbarSwitchClick(Window *w
 
static void ToolbarScenDateBackward(Window *w)
 
{
 
	/* don't allow too fast scrolling */
 
	if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
	if ((w->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
		w->HandleButtonClick(TBSE_DATEBACKWARD);
 
		w->SetDirty();
 

	
 
@@ -760,7 +760,7 @@ static void ToolbarScenDateBackward(Wind
 
static void ToolbarScenDateForward(Window *w)
 
{
 
	/* don't allow too fast scrolling */
 
	if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
 
	if ((w->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
 
		w->HandleButtonClick(TBSE_DATEFORWARD);
 
		w->SetDirty();
 

	
src/tree_gui.cpp
Show inline comments
 
@@ -111,7 +111,7 @@ public:
 

	
 
			case BTW_MANY_RANDOM: // place trees randomly over the landscape
 
				this->LowerWidget(BTW_MANY_RANDOM);
 
				this->flags4 |= 5 << WF_TIMEOUT_SHL;
 
				this->flags4 |= WF_TIMEOUT_BEGIN;
 
				SndPlayFx(SND_15_BEEP);
 
				PlaceTreesRandomly();
 
				MarkWholeScreenDirty();
src/window.cpp
Show inline comments
 
@@ -116,7 +116,7 @@ void Window::InvalidateWidget(byte widge
 
void Window::HandleButtonClick(byte widget)
 
{
 
	this->LowerWidget(widget);
 
	this->flags4 |= 5 << WF_TIMEOUT_SHL;
 
	this->flags4 |= WF_TIMEOUT_BEGIN;
 
	this->InvalidateWidget(widget);
 
}
 

	
src/window_gui.h
Show inline comments
 
@@ -487,8 +487,9 @@ enum WindowWidgetTypes {
 
 * Window flags
 
 */
 
enum WindowFlags {
 
	WF_TIMEOUT_SHL       = 0,       ///< Window timeout counter shift
 
	WF_TIMEOUT_MASK      = 7,       ///< Window timeout counter bit mask (3 bits), @see WF_TIMEOUT_SHL
 
	WF_TIMEOUT_TRIGGER   = 2,       ///< When the timeout should start triggering
 
	WF_TIMEOUT_BEGIN     = 5,       ///< The initial value for the timeout
 
	WF_TIMEOUT_MASK      = 7,       ///< Window timeout counter bit mask (3 bits)
 
	WF_DRAGGING          = 1 <<  3, ///< Window is being dragged
 
	WF_SCROLL_UP         = 1 <<  4, ///< Upper scroll button has been pressed, @see ScrollbarClickHandler()
 
	WF_SCROLL_DOWN       = 1 <<  5, ///< Lower scroll button has been pressed, @see ScrollbarClickHandler()
0 comments (0 inline, 0 general)