home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / CMWINIMO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  1.6 KB  |  70 lines

  1. /*
  2.     cmwinimo.c    12/12/88
  3.  
  4.     % Window Request handler function for use by mouse borders & maybe others.
  5.     By Ted.
  6.  
  7.     OWL 1.1
  8.     Copyright (c) 1988, by Oakland Group, Inc.
  9.     ALL RIGHTS RESERVED.
  10.  
  11.     Revision History:
  12.     -----------------
  13.      5/19/89 jmd    removed static for silly UNIX compiler
  14.      8/11/89 jmd    reconstructed init function
  15. */
  16.  
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19. #include "cmwinod.h"
  20. #include "cmwinobj.h"
  21. #include "bordobj.h"
  22.  
  23. OSTATIC objreq_func (cmwinreq_mouse);
  24.  
  25. /* -------------------------------------------------------------------------- */
  26.  
  27. void cmwin_MouseInit()
  28. /*
  29.     Attach mouse handling function to cmwin_Class
  30. */
  31. {
  32.     cmwinreq_mousefptr = cmwinreq_mouse;
  33.  
  34.     win_MouseInit();
  35. }
  36.  
  37. /* -------------------------------------------------------------------------- */
  38.  
  39. static int cmwinreq_mouse(objdata, msg, indata, outdata)
  40.     VOID *objdata;
  41.     int msg;                /* message */
  42.     VOID *indata;            /* message input data */
  43.     VOID *outdata;            /* message output data */
  44. {
  45.     cmwin_od *cmwd;
  46.     win_type win;
  47.     int nr, nc;
  48.  
  49.     /* outdata not used in this function */ oak_notused(outdata);
  50.  
  51.     cmwd = (cmwin_od *) objdata;
  52.  
  53.     switch(msg) {
  54.     case WINM_SCROLLREQ:
  55.         win = cmwinod_GetSelf(cmwd);
  56.         nr = ((opoint *)indata)->y / win_GetFontHeight(win);
  57.         nc = ((opoint *)indata)->x / win_GetFontWidth(win);
  58.         cmwin_SetRowoffs(win, cmwin_GetRowoffs(win) + nr);
  59.         cmwin_SetColoffs(win, cmwin_GetColoffs(win) + nc);
  60.         
  61.         win_Scroll(win, nr, nc);
  62.  
  63.         bord_SendMsg(win, BDM_SCROLL, NULL, NULL);
  64.         break;
  65.     }
  66.     return(TRUE);
  67. }
  68. /* -------------------------------------------------------------------------- */
  69.  
  70.