home *** CD-ROM | disk | FTP | other *** search
- /*
- bdmouse.c 11/21/88
-
- % box border with scroll lights and mouse support.
-
- OWL 1.1
- Copyright (c) 1988, 1989 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 12/09/88 ted Fixed pixel coordinate bugs in sizing functions.
- 12/18/88 jdc made it a subclass of bdsidebar
-
- 5/23/89 jmd added "border features"
- 06/03/89 jdc fixed TITLE and PROMPT messages
- 7/06/89 ted Made RESIZE message go through to both parents
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "strdecl.h"
-
- #include "bordobj.h"
- #include "bordod.h"
- #include "bdmousod.h"
-
- /* -------------------------------------------------------------------------- */
-
- int bd_mouse(objdata, msg, indata, outdata)
- VOID *objdata;
- int msg;
- VOID *indata; /* message input data */
- VOID *outdata; /* message output data */
- /*
- This is a simple single lined border.
- With an overwritten title and scroll lights on the bottom.
- The title is pointed to by the border data pointer.
- Example:
- +-----Title-----+
- | <--- Scroll Lights
- | I
- | X <--- Elevator
- | I
- | <--- Scroll Lights
- +Prompt---------+
-
- Clicking the mouse on the scroll lights scrolls the border's contents.
- Dragging the mouse on an edge moves the window.
- Dragging the mouse on a corner resizes the window.
-
- */
- {
- bdmouse_od *bdmousod;
-
- bdmousod = (bdmouse_od *)objdata;
-
- switch(msg) {
- case OBJM_GETDATASIZE:
- ((ogds_struct *) outdata)->odsize = sizeof(bdmouse_od);
- ((ogds_struct *) outdata)->xdsize = sizeof(border_xd);
- ((ogds_struct *) outdata)->id = ID_BDMOUSE;
- break;
-
- case OBJM_OPEN:
- /* because this class inherits two od's and obj_Open only inits the */
- /* self ptr of one of them, init the other one here */
- bdpromod_GetSelf(&bdmousod->prompt) = bdsideod_GetSelf(&bdmousod->sidebar);
-
- if (!bdsidebar_DoRaw(&bdmousod->sidebar, msg, indata, outdata)) {
- return(FALSE);
- }
- if (!bdprompt_DoRaw(&bdmousod->prompt, msg, indata, outdata)) {
- bdsidebar_DoRaw(&bdmousod->sidebar, OBJM_CLOSE, NULL, NULL);
- return(FALSE);
- }
- bdmousod->sidebar.back = '\263';
-
- /* turn on mouse features */
- bdmousod->sidebar.bdd.resize = 1; /* mouse resize flag */
- bdmousod->sidebar.bdd.move = 1; /* mouse move flag */
-
- break;
-
- /* Messages that go to sidebar parent */
- case BDM_STARTMOUSE:
- case BDM_ENDMOUSE: /* Mouse left the border. */
- case BDM_MOUSE:
- bdsidebar_DoRaw(&bdmousod->sidebar, msg, indata, outdata);
- break;
-
- /* only bdprompt has a title and prompt */
- case BDM_SETTITLE:
- case BDM_GETTITLE:
- case BDM_PROMPT:
- bdprompt_DoRaw(&bdmousod->prompt, msg, indata, outdata);
- break;
-
- /* Messages that go to both prompt and sidebar parents */
- default:
- /* Note that bd_prompt must paint first */
- bdprompt_DoRaw(&bdmousod->prompt, msg, indata, outdata);
- bdsidebar_DoRaw(&bdmousod->sidebar, msg, indata, outdata);
- break;
- }
- return(1);
- }
- /* -------------------------------------------------------------------------- */
-
-