home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / PMWINIMO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-22  |  1.6 KB  |  69 lines

  1. /*
  2.     pmwinimo.c    12/12/88
  3.  
  4.     % Window Request handler function for use by mouse borders & maybe others.
  5.     By Ted.
  6.  
  7.     OWL 1.2
  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.      3/28/90 jmd    ansi-fied
  17.      6/21/90 ted    Moved x and y offsets to pmwin_xd.
  18.      6/22/90 ted    added "void" to no-parameter function per ansii.
  19. */
  20.  
  21. #include "oakhead.h"
  22. #include "disppriv.h"
  23. #include "pmwinod.h"
  24. #include "pmwinobj.h"
  25. #include "bordobj.h"
  26.  
  27. OSTATIC objreq_func (pmwinreq_mouse);
  28.  
  29. /* -------------------------------------------------------------------------- */
  30.  
  31. void pmwin_MouseInit(void)
  32. /*
  33.     Attach mouse handling function to pmwin_Class
  34. */
  35. {
  36.     pmwinreq_mousefptr = pmwinreq_mouse;
  37.  
  38.     win_MouseInit();
  39. }
  40.  
  41. /* -------------------------------------------------------------------------- */
  42.  
  43. static int pmwinreq_mouse(VOID *objdata, int msg, VOID *indata, VOID *outdata)
  44. {
  45.     pmwin_od *pmwd;
  46.     win_type win;
  47.     opcoord nx, ny;
  48.  
  49.     /* outdata not used in this function */ oak_notused(outdata);
  50.  
  51.     pmwd = (pmwin_od *) objdata;
  52.  
  53.     switch(msg) {
  54.     case WINM_SCROLLREQ:
  55.         win = pmwinod_GetSelf(pmwd);
  56.         nx = ((opoint *)indata)->x;
  57.         ny = ((opoint *)indata)->y;
  58.         pmwin_setxyoffs(win, pmwin_GetXoffs(win) + nx, pmwin_GetYoffs(win) + ny);
  59.         
  60.         win_ScrollPix(win, nx, ny);
  61.  
  62.         bord_SendMsg(win, BDM_SCROLL, NULL, NULL);
  63.         break;
  64.     }
  65.     return(TRUE);
  66. }
  67. /* -------------------------------------------------------------------------- */
  68.  
  69.