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

  1. /*
  2.     bordssds.c
  3.  
  4.     % bord_SetSides
  5.  
  6.     2/87 by jmd
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1987, 1988, 1989 by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.     10/31/88 Ted    Removed linking.
  15.      5/28/89 jmd    added Shadow support
  16.      8/10/89 ted    Moved Shadow support to winexpos.
  17. */
  18.  
  19. #include "oakhead.h"
  20. #include "disppriv.h"
  21. #include "bordobj.h"
  22. /* -------------------------------------------------------------------------- */
  23.  
  24. void bord_SetSides(win, topoffs, leftoffs, botoffs, rightoffs)
  25.     win_type win;
  26.     int topoffs, leftoffs, botoffs, rightoffs;
  27. /*
  28.     Sets the relative sides of the border.
  29.  
  30.     Should be called when border is opened and when
  31.     a SETSIZE message is received.
  32. */
  33. {
  34.     opcoord fw, fh;
  35.  
  36.     fw = win_GetFontWidth(win);
  37.     fh = win_GetFontHeight(win);
  38.  
  39.     bord_SetPixSides(win, (opcoord) leftoffs*fw, (opcoord) topoffs*fh,
  40.                           (opcoord) rightoffs*fw, (opcoord) botoffs*fh);
  41. }
  42. /* -------------------------------------------------------------------------- */
  43.  
  44. void bord_SetPixSides(win, xminoffs, yminoffs, xmaxoffs, ymaxoffs)
  45.     win_type win;
  46.     opcoord xminoffs, yminoffs, xmaxoffs, ymaxoffs;
  47. /*
  48.     Sets the relative sides of the border.
  49.     Should be called when border is opened and when SETSIZE message is received.
  50. */
  51. {
  52.     opcoord winx, winy, winw, winh;
  53.  
  54.     winx = win_GetXmin(win);
  55.     winy = win_GetYmin(win);
  56.  
  57.     winw = win_GetPixWidth(win);
  58.     winh = win_GetPixHeight(win);
  59.  
  60.     win_inboxp(win)->xmin = -xminoffs;
  61.     win_inboxp(win)->ymin = -yminoffs;
  62.  
  63.     win_ReallySetPixPosition(win, winx, winy);
  64.  
  65.     win_inboxp(win)->xmax = opbox_GetWidth(win_pixboxp(win)) - xmaxoffs;
  66.     win_inboxp(win)->ymax = opbox_GetHeight(win_pixboxp(win)) - ymaxoffs;
  67.  
  68.     win_ReallySetPixSize(win, winw, winh);
  69. }
  70. /* -------------------------------------------------------------------------- */
  71.  
  72.