home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Documentation / Engineering Notes / Miscellaneous / About Box next >
Encoding:
Text File  |  1996-08-16  |  2.2 KB  |  63 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                      
  5. About Box 
  6. ODF Release 1                                                                                                                                                             
  7.  
  8.  
  9.  
  10. ODF provides a standard About box following OpenDoc guidelines. Using a simple resource (defined in FWPart:Include:FWAbout.fr) the About box can be customized to contain your own information.
  11.  
  12. resource FW_RAbout(kAbout)
  13. {
  14.                     // ----- Icon ID
  15.                     141,                                                        
  16.                     // ----- Part Name
  17.                     FW_RStyledText
  18.                     (
  19.                                         FW_FIX(18),             // Font size
  20.                                         FW_kBold,                  // Font style
  21.                                         "times",                         // Font name
  22.                                         "ODFBitmap"
  23.                     ),
  24.                     // ----- Version Number
  25.                     FW_RStyledText
  26.                     (
  27.                                         FW_FIX(9),                             // Font size
  28.                                         FW_kPlain,                             // Font style
  29.                                         "geneva",                                 // Font name    
  30.                                         "Version 1.0d12"
  31.                     ),
  32.                     // ----- Credits
  33.                     FW_RStyledText
  34.                     (
  35.                                         FW_FIX(9),                             // Font size
  36.                                         FW_kPlain,                             // Font style
  37.                                         "geneva",                                 // Font name    
  38.                                         "ODFBitmap....\r\r\r\r\r\r"                                    // note there is no ',' on this line. It will be 
  39.                                         "Written by the ODF Team.\r"                                // concatenated will this one
  40.                     )
  41. };
  42.  
  43. If you use 9-point geneva there is room for up to 12 lines of credits.
  44.  
  45. To display the About box in response to a kODCommandAbout command, call the global method FW_About and pass it your part and the id of your About resource.
  46.  
  47. FW_Boolean CBitmapPart::DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent)
  48. {
  49.                     FW_Boolean result = TRUE;
  50.     
  51.                     if (theMenuEvent.GetCommandID(ev) == kODCommandAbout)
  52.                                         ::FW_About(ev, this, kAbout);
  53.                     else
  54.                                         result = FALSE;
  55.         
  56.                     return result;
  57. }
  58.  
  59. Note that the About item in the Apple Menu is automatically set by ODF to contain your part's name. You do not need to set it up in DoAdjustMenus.
  60.  
  61.  
  62. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  63. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.