home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CADSP 1.0 / Demo / CATalkPane.c < prev    next >
Encoding:
Text File  |  1994-11-30  |  1.4 KB  |  44 lines  |  [TEXT/KAHL]

  1.                         short aHEncl, short aVEncl,
  2.                             SizingOption aHSizing, SizingOption aVSizing)
  3. {
  4.     CPane::IPane(anEnclosure, aSupervisor, aWidth, aHeight,
  5.                             aHEncl, aVEncl, aHSizing, aVSizing);
  6.     
  7.     topPane = bottomPane = nil;
  8. }
  9.  
  10.  
  11. void CATalkPane::SetSubPanes(CPane *top, CPane *bottom)
  12. {
  13.     topPane = top;
  14.     bottomPane = bottom;
  15. }
  16.  
  17. /***
  18.  * ChangeSize
  19.  *
  20.  *        change the sizes of the two inner panes accordingly
  21.  ***/
  22. void CATalkPane::ChangeSize(Rect *delta, Boolean redraw)
  23. {
  24.     long vdif = delta->bottom - delta->top;
  25.     long halfv = vdif / 2;
  26.     Rect topdelta = *delta;
  27.     Rect bottomdelta = *delta;
  28.     
  29.     inherited::ChangeSize(delta, redraw);
  30.     
  31.     // these were taken care of in inherited::
  32.     topdelta.right = topdelta.left = 0;
  33.     bottomdelta.right = bottomdelta.left = 0;
  34.  
  35.     if (topPane && bottomPane)
  36.         {
  37.         topdelta.bottom = halfv;
  38.         bottomdelta.top = halfv;
  39.         bottomdelta.bottom = vdif;
  40.     
  41.         topPane->ChangeSize(&topdelta, redraw);
  42.         bottomPane->ChangeSize(&bottomdelta, redraw);
  43.         }
  44. }