News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Making textinput using an internal string and call_listener with all changes.

Started by prissi, March 08, 2012, 12:04:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prissi

This is an ongoing effort, as it needs changes with many dialoges. But in the end a much more consistent scheme will be obtained, and the many intermediate strings to compare will be hopefully all gone.

Dwachs

In your patch it seems that the city info window will send a rename-command every time a letter is inserted / deleted?

Also their is the possibility for unexpected results:

1) open city window "Berlin"
2) accidentally delete last letter: "Berli", rename command is send to server
3) undo this change: "Berlin" - as the rename command has not arrived yet at the client, no rename command is sent
4) now the rename command arrives: "Berli"


I do not see, why it is necessary to call listeners on every letter change?
Parsley, sage, rosemary, and maggikraut.

prissi

Direct showing the changes was the behaviour until last year. It gave also very direct feedback to the user (especially for filtering for instance, try the convoi filter or the line window) and avoid the hassle with the many temperary old/current content strings. With a server the update in the map will lag.

In your case it will just issue two rename commands, "Berli" and "Berlin". Those will be executed one after each other, and in the end you will have Berlin.

But of course the three dialogues (stadt, convoi, haltinfo) with the update_data() calls on could simply refrain from updating the content of the name field if it has currently the focus.

VS

When I played with renaming stops with cities, the change-while-typing was a very frustrating behaviour, too...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

prissi


VS

The problems were specific to that situation, really. Still... there's an expected difference between typing and some "accepting" of what was typed. I think the same applies here. Programmer wants a "rename" operation to be atomic, not a series of changes that can pass through some nexus where everything is possible (empty string).

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Fabio

IMHO it's important to distinguish between name text field, where the change must be applied only pressing enter or leaving the field (and maybe ctrl-z undoes last change) and filter fields, where real time changes in text field might be useful (e.g. Google's search fields).

prissi

The only field, where I personally would expect to wait for explicit is a password entry. Other than that for the programming both is not too difficult. The few extra messages are not very important.

Especially what was exactly the problem of renaming stops and seeing the output immediately?

Anyway, if you rather see changes only by closing dialoges or hitting Enter, I can live with that. There was just a rule of UI design to provide immediate feedback, which I tried to follow again more closely.

Ashley

The immediate feedback comes from the box you're typing the text into. IMO changes should only be applied upon hitting enter in the text box, or closing the dialog.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Carl

Perhaps non-programmers would feel differently about this. When I started playing Simutrans, it came as a surprise to me that I had to press enter in order to get a stop-name to save, and I found this counter-intuitive.

prissi

Even currently, city names are immediately changed. So there is already inconsistency around.

Fabio

Would it be possible to have both systems, selectable by simuconf.tab or game settings?

prissi


VS

IMO making this switchable makes little sense. I think the problems are mostly on the level of programming... Anyway, at least current implementation is consistent, so everyone knows what to expect :)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

prissi

Current implementation is not consistent. Cities are renamed instantaniously. That brought me working on that ... I will try to use a macro, so we can decide later.