home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / VIDEO / WMSCROLL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  733 b   |  31 lines

  1. /* wmscroll.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <string.h>
  4. #include <sys/winmgr.h>
  5. #include "winmgr2.h"
  6.  
  7. void wm_scroll (wm_handle wh, int count)
  8. {
  9.   int y;
  10.   char *p1, *p2;
  11.  
  12.   if (wh->used != WM_USED)
  13.     return;
  14.   if (count > wh->height)
  15.     count = wh->height;
  16.   for (y = 0; y < wh->height - count; ++y)
  17.     {
  18.       p1 = &DATA (wh, wh->ax, y + wh->ay);
  19.       p2 = p1 + 2 * count * wh->bwidth;
  20.       memmove (p1, p2, 2 * wh->width);
  21.     }
  22.   for (y = wh->height-count; y < wh->height; ++y)
  23.     _wm_clrline1 (wh, y + wh->ay, wh->ax,
  24.                   wh->width - 1 + wh->ax);
  25.   if (wh->display)
  26.     _wm_put1 (wh);
  27.   else
  28.     wh->update_req = TRUE;
  29.   _wm_cursor1 ();
  30. }
  31.