home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Text / Digest-Browser-1.6 Folder / Document / CBrowserEditText.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-01  |  1.6 KB  |  65 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CBrowserEditText.c
  3.      Parent class:    CEditText
  4.  
  5.     Methods to adapt CEditText to support resizeable panes.
  6.     
  7.       Copyright © 1992 J. Robert Boonstra, II.  All rights reserved.
  8.  ******************************************************************************/
  9.  
  10.  
  11. #include "CBrowserEditText.h"
  12.  
  13.  
  14. /******************************************************************************
  15.  IBrowserEditText
  16.  ******************************************************************************/
  17.  
  18. void    CBrowserEditText::IBrowserEditText(
  19.     CView            *anEnclosure,
  20.     CBureaucrat        *aSupervisor,
  21.     short            aWidth,
  22.     short            aHeight,
  23.     short            aHEncl,
  24.     short            aVEncl,
  25.     SizingOption    aHSizing,
  26.     SizingOption    aVSizing,
  27.     short            aLineWidth)
  28. {
  29.     inherited::IEditText(anEnclosure,aSupervisor,aWidth,aHeight,
  30.             aHEncl,aVEncl,aHSizing,aVSizing,aLineWidth);    
  31. }
  32.  
  33. void    CBrowserEditText::CalcTERects()
  34. {
  35.     LongRect    interior;    
  36.     short        hDelta;
  37.     short        vDelta;
  38.     
  39.     GetInterior( &interior);
  40.  
  41.     hDelta = position.h * hScale - interior.left + (**macTE).destRect.left;
  42.     vDelta = position.v * vScale - interior.top + (**macTE).destRect.top;
  43.     
  44.     frame.left += hDelta;
  45.     frame.right += hDelta;
  46.     frame.top += vDelta;
  47. // JRB - why isn't the following line in CEditText?
  48.     frame.bottom += vDelta;        
  49.         
  50.     hOrigin += hDelta;
  51.     vOrigin += vDelta;
  52.  
  53.  
  54.     (**macTE).destRect.right = (lineWidth > 0) ?
  55.                                     (**macTE).destRect.left + lineWidth :
  56.                                     interior.right;
  57.     
  58. // JRB - the itsMessage pane was incorrectly offset without this change.
  59.     OffsetLongRect(&interior, (long)hDelta, (long)vDelta);    
  60.     
  61.     LongToQDRect( &interior, &(**macTE).viewRect);
  62.  
  63.     TECalText( macTE);
  64. }
  65.