The patch provides a new gui element, gui_intinput. It can be used for the input of numbers. It is heavily used in the 'new world' dialogue.
Features of the gui-input:
-- input by keyboard (numbers only)
-- cursor movement as for textinputs (arrows, home, end, mouse clicks)
-- buttons for increasing / decreasing like it was implemented in the new-world-dialogue.
-- uses mouse-wheel for faster increasing / decreasing
-- min and max values can be specified
It depends on this patch: http://forum.simutrans.com/index.php?topic=897 (http://forum.simutrans.com/index.php?topic=897)
I was not sure, which min and max values should be prescribed in the world-dialogue. Any suggestions are welcome.
The climates-dialogue should also be changed using this gui-element. Here, I was not sure how to implement min/max-valus. Should the min-value of the 2nd climate depend on the actual value for the 1st climate etc?
Is it possible to add "clear field" key ? For example, press space key to clear field.
My eyes are not very good, and clicked place and cursor position don't match.
It is hard for me to see where the cursor is.
Or, clicking field always set cursor to the same position (end position) is better.
This patch will fix it (in collaboration with Dwachs).
:-*
Thank you.
Another request.
When I hit "delete" or "backspace" key, cursor always move to the end position.
I must move cursor again. It is very annoying.
Is it possible to keep cursor position after hitting "delete" or "backspace" key ?
This patch will fix the wrong positioning of the cursor. It also requests the focus for the textinput if a button was pressed or the mousewheel was used.
This patch is brought to you by Dwachs and gerw.
You make so much patches .. can you write witch version do you test the patch?
Have a look at the patch file:
Index: gui/components/gui_numberinput.cc
===================================================================
--- gui/components/gui_numberinput.cc (revision 2153)
+++ gui/components/gui_numberinput.cc (working copy)
I do not understand the purpose of keeping cursor position, but added anyway
The problem was the following: If you pressed the delete or backspace key in the input field, the cursor always jumped to the end of the string. This was a very confusing behaviour.
It works well in r2156.
Thank you for your many works. :)