Selecting text in single-line entry fields - small UI issue

Roland Huettmann roland.huettmann at gmail.com
Thu Jan 28 07:07:51 EST 2016


This is a small issue, not critical. Nevertheless, I am curious to know if
there is a solution.

In almost all cases, tabbing from single-line entry field to single-line
entry field, I prefer selecting the whole text instead of having the
pointer mark after the text. It allows to quickly enter new values and
overwriting existing ones.

Maybe I am missing something, but I need to script this with "on
tabkey"-event handlers, "on textchanged" handlers, " on deletekey" handlers
and go with "select the text of..." or "select line 1 of...". Otherwise the
cursor is always placed behind the text - and I do not want that except for
multi-line fields. Could there not be a built-in attribute how selection
should occur?

Now, for visually appealing reasons, I like to not just have the text
selected, but indicate that the field as such is highlighted.

Using the standard blue selection color, and tabbing into a field, I have
set the background color of that field to the selection color, and when
leaving the field, I reset the color to what it as before.

The problem:

As long as the text in the field is selected, the text is hidden, but it is
actually white and should show on the blue field. Clicking into the field
will also show it as desired. Using a yellow or other color is possible,
but it does not do what I want to achieve.For strange reasons, selecting
the text and setting the background color accordingly makes the text
disappear.

Well, ideally I like the single-line field control to fully show this type
of selection, the text showing white (or black) depending on the selection
color, and even the field control with a white outline of 1 to 3 pixels
around the colored inside of the field. That the text itself is selected
does not have to be visual in this case.

It simply looks better and I find it also in most other programs.

(Maybe the new widgets technology will give us more fine-tuning.even on
"simple" entry fields..Will there be new field controls ?)

Roland


P.S.
And if there were an easy way of formatting the field (numbers, dates,
etc:) without having to resort to front scripts and all that, just setting
inbuilt attributes, it would just make me too happy. Because most of the
time I am spending with such UI issues. (I know there are formatting field
packages and I am also doing that. Just it is such a common and basic task
that it would really be a big advantage to have it supported)



More information about the use-livecode mailing list