Re: XForms: Question : Multiple Select List ??

Didier Verkindt (verkindt@lapp.in2p3.fr)
Fri, 5 Mar 1999 18:13:19 +0100 (MET)

# To subscribers of the xforms list from Didier Verkindt <verkindt@lapp.in2p3.fr> :

Hi,
I think that in the next version of Xform, instead of Multiple Browser
and Hold Browser, we could have only on type of Browser, where selection
of several lines could be done by using the Shift key while selecting
the lines. It seems
to be a quite standard way on many machines. And it would simplify the
multiple selection in a browser.

Am I right?
Didier

On Wed, 3 Mar 1999, Steve Lamont wrote:

> # To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
>
> > How can I select a field in the Multiple Select List and then
> > select a second one, then I want to automatically select all fields
> > inbetween the two fields I already selected included the two fields.
> >
> > I believe you can do this on Windows by hitting the Shift Key, can you
> > do this in Xforms ?
>
> You can emulate this with a little creative coding. For example:
>
> void multi_browser_cb(FL_OBJECT *ob, long data)
>
> {
>
> FL_Coord x;
> FL_Coord y;
> unsigned keymask;
> static int last_line = 0;
> int this_line = fl_get_browser( ob );
>
> fl_get_mouse( &x, &y, &keymask );
>
> if ( ( keymask & ShiftMask ) &&
> fl_isselected_browser_line( ob, this_line ) ) {
>
> if ( last_line ) {
>
> int a = this_line;
> int b = last_line;
>
> if ( a > b ) {
>
> int swap = b;
>
> b = a;
> a = swap;
>
> }
> for ( ++a ; a < b; a++ )
> fl_select_browser_line( ob, a );
>
> } else
> last_line = this_line;
>
> } else if ( fl_isselected_browser_line( ob, this_line ) )
> last_line = this_line;
> else
> last_line = 0;
>
> }
>
> Use fl_get_mouse() to get the current keymask, which will tell you
> whether the Shift key is pressed.
>
> There are probably several special cases which I haven't bothered to
> code for but this should get you started.
>
> spl
>
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuhs.mil or see
> http://bob.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuhs.mil/mailserv/list-archives/
>
>

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/