RE: [AD] GUI mouse patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RE: [AD] GUI mouse patch

> >This one adds a new flag to tell the GUI manager a widget is
> >not interested in getting the mouse focus.
>
> Vincent, why do we need this flag? Other than making default
> objects not
> respond to mouse input, is there anything I am missing?

I do not use default objects, they are pretty useless for
advanced GUIs. I use update_dialog though.
In my case, I have an object which draws stuff over a dialog
(that's just eye candy) but I want the widgets underneath it
to not be logically obscured by this eye candy widget. Making
it a widget brings advantages, and putting it before makes it
drawn before the other widgets, and constantly redrawing it
makes both slower framerate and occasional flickering (when
the other objects also redraw).

> When changing default objects in this way, I think it would be better
> for the user to write an overloaded function:
>
>   int d_button_proc_nofocus(int msg, DIALOG* d, int c)
>   {
>       if(msg == D_WANTFOCUS) return D_O_K;
>       return d_button_proc(msg, d, c);
>   }

Allegro does ask for input focus, but not for mouse focus, so
this would not work.
I thought of adding a MSG_WANTMOUSE, and let the object return
D_WANTMOUSE or D_O_K, but I was wondering if it would be too
slow, as Allegro would call it more often than MSG_WANTFOCUS.
Probably not too slow, as a second thought. But offer_mouse_focus
would still have to be modified to do that.

BTW, I noticed that in include/allegro/gui.h, some defines are
there twice (MSG_GOTMOUSE and MSG_GOTFOCUS). If it is still the
case in CVS, they'd better get removed.

Cheers

--
Vincent Penquerc'h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/