home *** CD-ROM | disk | FTP | other *** search
- /*
- winmev.c 1/04/90
-
- % winmev_grantrequest
-
- Extracted by Joe from the file that Ted extracted
- from the sed mouse handlers that Joe wrote.
-
- Standard function for handling the tricky business of accepting
- mouse request messages.
-
- OWL 1.2
- Copyright (c) 1990 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 1/04/90 jmd re-vised, removed jump window
- 3/28/90 jmd ansi-fied
- 8/27/90 ted Added code to set next child for mev win instead of letting
- the accept_offer code do it.
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- /* -------------------------------------------------------------------------- */
-
- void winmev_grantrequest(win_type win, mev_struct *mev)
- /*
- Grants a mouse request message, giving up control and setting up for the
- mouse event window which issued the request to become the new current
- window.
-
- 'win' is the current window
- 'mev' is the mouse event
- */
- {
- win_type newwin, tmp, ancestor;
- int childno;
-
- /* Set up the new window so that when we pass control
- to its ancestor window, control is passed on down to it.
-
- Check if we are in an embedded window, if so
- get our owner, then check if our owner is an embedded
- window, etc. As we move up the chain of ownership,
- we call SETCURRCHILD (GotoField) so that when our owner is activated
- control will fall right into our lap.
- We must set the current window's ancestor's nextwin to point to
- our owner so that the current can jump to our owner
- instead of directly jumping to us.
- */
-
- newwin = mev_GetWin(mev);
-
- childno = win_nextchild(newwin);
- if (childno != -1) {
- win_Do(newwin, WINM_SETCURRCHILD, &childno, NULL);
- }
- while ((tmp = bob_GetOwner(newwin, &childno)) != NULL) {
- newwin = tmp;
- win_Do(newwin, WINM_SETCURRCHILD, &childno, NULL);
- }
-
- /* Now, find our ancestor window (we may be embedded)
- and set its nextwin to jump to newwin.
- */
- ancestor = bob_GetAncestor(win);
-
- win_SetNextWin(ancestor, newwin);
- }
- /* -------------------------------------------------------------------------- */
-