Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 4 - Window Manager / Window Manager Reference
Resources


The Window Resource

You typically define a window resource for each type of window that your application creates. Figure 4-24 illustrates a compiled 'WIND' resource.

Figure 4-24 Structure of a compiled window ('WIND') resource

A compiled version of a window resource contains the vollowing elements:

   CONST
   documentProc      = 0;  {movable, sizable window, }
                           { no zoom box}
   dBoxProc          = 1;  {alert box or modal dialog box}
   plainDBox         = 2;  {plain box}
   altDBoxProc       = 3;  {plain box with shadow}
   noGrowDocProc     = 4;  {movable window, no size box or }
                           { zoom box}
   movableDBoxProc   = 5;  {movable modal dialog box}
   zoomDocProc       = 8;  {standard document window}
   zoomNoGrow        = 12; {zoomable, nonresizable window}
   rDocProc          = 16; {rounded-corner window}
You can also add a zoom box to a movable modal dialog box by specifying the sum
of two constants: movableDBoxProc + zoomDocProc, but a zoom box is not recommended on any dialog box.

You can control the angle of curvature on a rounded-corner window (window type rDocProc) by adding one of these integers:
Window definition IDDiameters of curvature
rDocProc16, 16
rDocProc + 24, 4
rDocProc + 46, 6
rDocProc + 610, 10

   CONST noAutoCenter            = 0x0000;{use initial }
                                          { location}
         centerMainScreen        = 0x280A;{center on main }
                                          { screen}
         alertPositionMainScreen = 0x300A;{place in alert }
                                          { position on main }
                                          { screen}
         staggerMainScreen       = 0x380A;{stagger on main }
                                          { screen} 
         centerParentWindow      = 0xA80A;{center on parent }
                                          { window}

         alertPositionParentWindow  = 0xB00A;{place in alert }
                                             { position on }
                                             { parent window}
         staggerParentWindow        = 0xB80A;{stagger relative }
                                             { to parent window}
         centerParentWindowScreen   = 0x680A;{center on parent }
                                             { window screen}
         alertPositionParentWindowScreen
                                    = 0x700A;{place in alert }
                                             { position on }
                                             { parent window }
                                             { screen}
         staggerParentWindowScreen  = 0x780A;{stagger on parent }
                                             { window screen}
The positioning constants are convenient when the user is creating new documents or when you are handling your own dialog boxes and alert boxes. When you are creating a new window to display a previously saved document, however, you should display the new window in the same rectangle as the previous window (that is, the window the document occupied when it was last saved). For more information, see "Positioning a Document Window on the Desktop" beginning on page 4-30.

Use the GetNewCWindow or GetNewWindow function to read a 'WIND' resource. Both functions create a new window record and fill it in according to the values specified in a 'WIND' resource.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996