On Fri, Nov 08, 2002 at 04:48:59PM +0100, Philippe Ney wrote:
> > > > 2) How getting out of a text widget (with keyboard input) ?
> > > >
> > > > When you are in a text edit widget, the arrow keys are used to move
> > > > the cursor through the text and the tab key insert a .. tab.
> > > > There is then no way to get out of the widget w/o another input
> > > > device such like a touchpad or a mouse.
> > > > One idea could be the following (based on symbian navigation):
> > > >
> > > > * when the cursor is on the first/last line, the up/down key
> > > > will get out of the widget selecting the following widget
> > > > regarding the key
> > > >
> > > > * for line input widget (textbox PG_WP_MULTILINE=0) this behavior
> > > > could be extended to first/last cursor position with left/right
> > > > keys
> > >
> > > This is a common problem. ;) Most widget sets allow SHIFT+TAB to move
> > > _backwards_ out of a text widget. I think that, yes, a text widget
> > > should allow focus to move when the user moves the cursor past the
> > > start or end of the text, but this is should be optional. Moreover,
> > > the widget should emit a signal that an interested application could
> > > bind to such that focus could be moved explicity.
> >
> > That sounds good.
>
> Hi,
>
> This behavior is already present in the textbox when used in non-multiline
> way. This is provided by the textbox_frontend.c:textbox_ignorekey()
> function, right?
>
> Then we test the following:
> ---------8<-----------
> /* Find keys to ignore */
> int textbox_ignorekey(struct widget *self, int key) {
> /* Ignore some keys in single-line mode: */
> if (!DATA->doc->multiline)
> switch (key) {
> case PGKEY_TAB:
> case PGKEY_UP:
> case PGKEY_DOWN:
> case PGKEY_ESCAPE:
> case PGKEY_RETURN:
> return 1;
> }
>
> /* Ignore up key on the first line */
> else if( (DATA->doc->crsr->par->prev == NULL ) && \
> (DATA->doc->crsr->line->prev == NULL ) ) {
> switch (key) {
> case PGKEY_UP:
> return 1;
> }
> }
>
> /* Ignore down key on the last line */
> else if( (DATA->doc->crsr->par->next == NULL ) && \
> (DATA->doc->crsr->line->next == NULL ) ) {
> switch (key) {
> case PGKEY_DOWN:
> return 1;
> }
> }
>
> return 0;
> }
> ---------8<-----------
>
> Which give good result to enter/get out of a textbox with the up/down
> keyboard keys. The behavior stay if you add chars in the textbox but if
> you make a new paragraphe (hitting return) you cannot get out of the
> widget any more. This certainly due to creation of a new paragraphe
>
> Any tips?
Hmm.. that looks to me like it should work. I'll try it myself soon
and let you know what I find.
>
> TIA,
> -philippe
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: See the NEW Palm
> Tungsten T handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
> _______________________________________________
> Pgui-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/pgui-devel
--
Only you can prevent creeping featurism!
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel