home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Lightspeed C SKEL fldr / Skel resize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-06-17  |  1.2 KB  |  45 lines  |  [TEXT/KAHL]

  1. #include <WindowMgr.h>        
  2. #include <MenuMgr.h>
  3. #include <EventMgr.h>
  4. #include "Skel defines.h"
  5. #include "Skel globals.h"
  6.  
  7. /*
  8.  
  9. Change the size of the given window
  10. ############################   ReSize   ###############################
  11.   
  12.   Called on a mouse-down in the grow box, this allows the user to change
  13.   the size of the window.  We change the size, then
  14.   claim that the whole of the window contents is no longer validly drawn,
  15.   because we're too lazy to do so for just the scroll bar regions
  16.   that are actually subject to change.  See the Window Manager.
  17. */
  18.  
  19. resize (a_window, downpt)
  20. WindowPtr a_window;
  21. Point downpt;
  22. {
  23.     int     w,
  24.             h;            /* new width and height of the sized
  25.                            window */
  26.     long    newsize;        /* the new size */
  27.  
  28.     newsize = GrowWindow (a_window, downpt, &growrect);
  29.  /* find new size */
  30.     w = LoWord (newsize);    /* find the width */
  31.     h = HiWord (newsize);    /* find the height */
  32.  
  33.     SizeWindow (a_window, w, h, 1);/* change to the new window size */
  34.  
  35. /* 
  36.   place whole window into update Region to be sure it all gets
  37.   updated. This is more than is strictly necessary, but a lot
  38.   easier than just invalidating the regions that actually may have
  39.   changed.
  40. */
  41.     InvalRect (&a_window -> portRect);
  42.  
  43. }                /* ReSize */
  44.  
  45.