src/signs_gui.cpp
changeset 9285 235e5e2d7f55
parent 9273 35e0224ea8f1
child 9305 d6694e58c36b
equal deleted inserted replaced
9284:e2987a51f382 9285:235e5e2d7f55
   253 				delete this;
   253 				delete this;
   254 				break;
   254 				break;
   255 		}
   255 		}
   256 	}
   256 	}
   257 
   257 
   258 	virtual bool OnKeyPress(uint16 key, uint16 keycode)
   258 	virtual EventState OnKeyPress(uint16 key, uint16 keycode)
   259 	{
   259 	{
   260 		bool cont = true;
   260 		EventState state = ES_NOT_HANDLED;
   261 		switch (this->HandleEditBoxKey(QUERY_EDIT_SIGN_WIDGET_TEXT, key, keycode, cont)) {
   261 		switch (this->HandleEditBoxKey(QUERY_EDIT_SIGN_WIDGET_TEXT, key, keycode, state)) {
   262 			case 1: // Enter pressed, confirms change
   262 			case 1: // Enter pressed, confirms change
   263 				RenameSign(this->cur_sign, this->text.buf);
   263 				RenameSign(this->cur_sign, this->text.buf);
   264 				/* FALL THROUGH */
   264 				/* FALL THROUGH */
   265 
   265 
   266 			case 2: // ESC pressed, closes window, abandons changes
   266 			case 2: // ESC pressed, closes window, abandons changes
   267 				delete this;
   267 				delete this;
   268 				break;
   268 				break;
   269 		}
   269 		}
   270 		return cont;
   270 		return state;
   271 	}
   271 	}
   272 
   272 
   273 	virtual void OnMouseLoop()
   273 	virtual void OnMouseLoop()
   274 	{
   274 	{
   275 		this->HandleEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
   275 		this->HandleEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);