[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon, 2004-07-05 at 07:29 -0500, allegrovp@xxxxxxxxxx wrote:
> > > - mouse_object.for-pristine-a13.diff adds a flag
> >
> > I don't see what the flag does. There can only be one object below the
> > mouse, and it always gets the mouse focus anyway.. what am I missing?
>
> It allows an object to say "I don't want the mouse focus unless you really want to", so others can get the mouse in priority.
>
Hm, can I get an example? Like, I have two dialogs A and B:
___ ___
| | | |
| A | | B |
|___| |___|
Now, mouse focus is given to A if the mouse is over A, and to B when
over B, unless one is hidden or disabled:
- for (c=0; d[c].proc; c++)
+ for (c=0; d[c].proc; c++) {
if ((gui_mouse_x() >= d[c].x) && (gui_mouse_y() >= d[c].y) &&
(gui_mouse_x() < d[c].x + d[c].w) && (gui_mouse_y() < d[c].y + d
[c].h) &&
- (!(d[c].flags & (D_HIDDEN | D_DISABLED))))
- mouse_object = c;
+ (!(d[c].flags & (D_HIDDEN | D_DISABLED)))) {
+ /* check if this object wants the mouse */
+ res = object_message(d+c, MSG_WANTMOUSE, 0);
+ if (res & D_WANTMOUSE) {
+ mouse_wanted = 1;
+ mouse_object = c;
+ }
+ else {
+ if (!mouse_wanted)
+ mouse_object = c;
+ }
+ }
+ }
Hm, ok, now I start seeing. You have the case where A and B overlap.
Currently, always the last overlapping dialog would get focus. With that
flag, you can make a dialog further on top in the dialog array retain
the focus, even if a later dialog also overlaps. Did I get it right? I
can still see no use for it - when would you want the obscured dialog
get the focus, and not the visible one?
>
> > people like you or Henrik Stokseth who are in the "lots of other stuff"
> > category in the thanks.txt and still seem to be hacking on Allegro from
> > time to time should be given CVS access, so they can deal with all the
> > CVS and applying-patches stuff themselves? :)
>
> I have a history of letting things through in my patches that break stuff though :)
>
Heh, well, looking at how I handle the web translation - first
committing, then doing spell checking later - I shouldn't have write
access to the code as well :P
--
Elias Pschernig