src/settings_gui.cpp
changeset 10180 a99cf854c6d0
parent 10145 849ba8b8626b
child 10199 3bb560dd3cf6
equal deleted inserted replaced
10179:8d79cda44991 10180:a99cf854c6d0
   888 							* unless specified otherwise in the 'interval' variable
   888 							* unless specified otherwise in the 'interval' variable
   889 							* of the current patch. */
   889 							* of the current patch. */
   890 						uint32 step = (sdb->interval == 0) ? ((sdb->max - sdb->min) / 50) : sdb->interval;
   890 						uint32 step = (sdb->interval == 0) ? ((sdb->max - sdb->min) / 50) : sdb->interval;
   891 						if (step == 0) step = 1;
   891 						if (step == 0) step = 1;
   892 
   892 
   893 						// don't allow too fast scrolling
   893 						/* don't allow too fast scrolling */
   894 						if ((this->flags4 & WF_TIMEOUT_MASK) > 2 << WF_TIMEOUT_SHL) {
   894 						if ((this->flags4 & WF_TIMEOUT_MASK) > WF_TIMEOUT_TRIGGER) {
   895 							_left_button_clicked = false;
   895 							_left_button_clicked = false;
   896 							return;
   896 							return;
   897 						}
   897 						}
   898 
   898 
   899 						/* Increase or decrease the value and clamp it to extremes */
   899 						/* Increase or decrease the value and clamp it to extremes */
   906 						}
   906 						}
   907 
   907 
   908 						/* Set up scroller timeout for numeric values */
   908 						/* Set up scroller timeout for numeric values */
   909 						if (value != oldvalue && !(sd->desc.flags & SGF_MULTISTRING)) {
   909 						if (value != oldvalue && !(sd->desc.flags & SGF_MULTISTRING)) {
   910 							this->click = btn * 2 + 1 + ((x >= 10) ? 1 : 0);
   910 							this->click = btn * 2 + 1 + ((x >= 10) ? 1 : 0);
   911 							this->flags4 |= 5 << WF_TIMEOUT_SHL;
   911 							this->flags4 |= WF_TIMEOUT_BEGIN;
   912 							_left_button_clicked = false;
   912 							_left_button_clicked = false;
   913 						}
   913 						}
   914 					} break;
   914 					} break;
   915 					default: NOT_REACHED();
   915 					default: NOT_REACHED();
   916 					}
   916 					}
  1166 		if (len != 0) {
  1166 		if (len != 0) {
  1167 			this->query_widget = line;
  1167 			this->query_widget = line;
  1168 			ShowQueryString(str, STR_CURRENCY_CHANGE_PARAMETER, len + 1, 250, this, afilter, QSF_NONE);
  1168 			ShowQueryString(str, STR_CURRENCY_CHANGE_PARAMETER, len + 1, 250, this, afilter, QSF_NONE);
  1169 		}
  1169 		}
  1170 
  1170 
  1171 		this->flags4 |= 5 << WF_TIMEOUT_SHL;
  1171 		this->flags4 |= WF_TIMEOUT_BEGIN;
  1172 		this->SetDirty();
  1172 		this->SetDirty();
  1173 	}
  1173 	}
  1174 
  1174 
  1175 	virtual void OnQueryTextFinished(char *str)
  1175 	virtual void OnQueryTextFinished(char *str)
  1176 	{
  1176 	{