home *** CD-ROM | disk | FTP | other *** search
- /*
- sdwinimo.c 12/12/88
-
- % Sed mouse request handler function
- By Ted.
-
- C-scape 3.2
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 2/07/89 jmd Removed bordobj.h
- 2/08/89 jmd Removed void from function definition
- 8/08/89 jmd moved most everything to sdwin
-
- 10/25/89 jmd added static to definition
- 3/28/90 jmd ansi-fied
- 11/01/90 ted put (void) in arg list of sedwin_MouseInit.
- */
-
- #include "sed.h"
- #include "sedwinod.h"
- #include "winobj.h"
-
- OSTATIC objreq_func (sdwinreq_mouse);
-
- void sedwin_MouseInit(void)
- {
- sdwinreq_mousefptr = sdwinreq_mouse;
- win_MouseInit();
- }
-
- static int sdwinreq_mouse(VOID *objdata, int msg, VOID *indata, VOID *outdata)
- /*
- mouse request handler for sed window class
- handles scrolling requests
- */
- {
- int row, col;
- sed_type sed;
-
- oak_notused(outdata);
-
- switch(msg) {
- case WINM_SCROLLREQ:
- /* A request to scroll the sed */
- sed = sedod_GetSelf(((sedwin_od *)objdata));
- row = ((opoint *)indata)->y / win_GetFontHeight(sed);
- col = ((opoint *)indata)->x / win_GetFontWidth(sed);
-
- if (row < 0) {
- sed_ScrollUp(sed, -row);
- }
- else if (row > 0) {
- sed_ScrollDown(sed, row);
- }
-
- if (col < 0) {
- sed_ScrollLeft(sed, -col);
- }
- else if (col > 0) {
- sed_ScrollRight(sed, col);
- }
- return(TRUE);
- }
- return(FALSE);
- }
-
-