Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[XForms] cursor position in the input field

0 views
Skip to first unread message

Michal Szymanski

unread,
Jul 10, 2016, 2:09:09 AM7/10/16
to XForms
Hi,

At some point in the 1.2.x series, the behaviour of input objects has
changed. As stated in the manual, the cursor in the input field should
be by default (unless changed by fl_set_input_mode()) placed at the
end of the string upon showing the form.

It seems, however, that this is true only for the first time the form
is shown. If it is then hidden and shown again, the cursor is set at
the beginning of the string set by "fl_set_input".

It was not like that in older versions. The cursor was always placed
at the end of the "default" string. Now, in 1.2.4 and 1.2.5pre1, I can
even notice that, when "closing" the window with the input field
(hiding the form), the cursor moves to the beginning of the field just
before the form disappears.

Surely one can fix that by adding fl_set_input_cursorpos() but still,
I think this behaviour is sort of a bug.

I tried to debug, placing fl_get_input_cursorpos() in the code showing
the form, first after the input is set (but before the form is shown)
and second, after the form is shown. With single-char string, it shows
the xpos/ypos values:

Initial showing of the form:
1 1
1 1
Second and all next showings:
-1 -3149608
0 1

but, looking into input.c source, I could not find where it might happen.
I only checked that putting the fl_set_input() after the
fl_show_form() does not change anything.

regards, Michal.

--
Michal Szymanski (msz at astrouw dot edu dot pl)
Warsaw University Observatory, Warszawa, POLAND

Jens Thoms Toerring

unread,
Jul 29, 2016, 8:11:13 AM7/29/16
to Development with and of XForms
Hi Michal,

sorry for the long delay - I only now got around to
dealing with the backlog of messages in my inbox...

On Sun, Jul 10, 2016 at 08:08:38AM +0200, Michal Szymanski wrote:
> At some point in the 1.2.x series, the behaviour of input objects has
> changed. As stated in the manual, the cursor in the input field should
> be by default (unless changed by fl_set_input_mode()) placed at the
> end of the string upon showing the form.

When you switch to an input field via <TAB> the cursor should
appear at the position it was when the input field was left.
The default of "end of text" is for the cases where you set
the field using fl_set_input() and then go there.
>
> It seems, however, that this is true only for the first time the form
> is shown. If it is then hidden and shown again, the cursor is set at
> the beginning of the string set by "fl_set_input".

Yes, that's a bug and I hope to have fixed it. It's in
the git repository for know. Thank you!

Best regards, Jens
--
\ Jens Thoms Toerring ________ j...@toerring.de
\_______________________________ http://toerring.de

0 new messages