home *** CD-ROM | disk | FTP | other *** search
- /*
- cmwinimo.c 12/12/88
-
- % Window Request handler function for use by mouse borders & maybe others.
- By Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 5/19/89 jmd removed static for silly UNIX compiler
- 8/11/89 jmd reconstructed init function
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "cmwinod.h"
- #include "cmwinobj.h"
- #include "bordobj.h"
-
- OSTATIC objreq_func (cmwinreq_mouse);
-
- /* -------------------------------------------------------------------------- */
-
- void cmwin_MouseInit()
- /*
- Attach mouse handling function to cmwin_Class
- */
- {
- cmwinreq_mousefptr = cmwinreq_mouse;
-
- win_MouseInit();
- }
-
- /* -------------------------------------------------------------------------- */
-
- static int cmwinreq_mouse(objdata, msg, indata, outdata)
- VOID *objdata;
- int msg; /* message */
- VOID *indata; /* message input data */
- VOID *outdata; /* message output data */
- {
- cmwin_od *cmwd;
- win_type win;
- int nr, nc;
-
- /* outdata not used in this function */ oak_notused(outdata);
-
- cmwd = (cmwin_od *) objdata;
-
- switch(msg) {
- case WINM_SCROLLREQ:
- win = cmwinod_GetSelf(cmwd);
- nr = ((opoint *)indata)->y / win_GetFontHeight(win);
- nc = ((opoint *)indata)->x / win_GetFontWidth(win);
- cmwin_SetRowoffs(win, cmwin_GetRowoffs(win) + nr);
- cmwin_SetColoffs(win, cmwin_GetColoffs(win) + nc);
-
- win_Scroll(win, nr, nc);
-
- bord_SendMsg(win, BDM_SCROLL, NULL, NULL);
- break;
- }
- return(TRUE);
- }
- /* -------------------------------------------------------------------------- */
-
-