home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Toolbox / AddResMenu7.1 / AddResMenu7.1.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-12  |  3.3 KB  |  122 lines  |  [TEXT/MPS ]

  1. #pragma load "ram disk:DumpHeaders" 
  2.  
  3. /*
  4. #include <Types.h>
  5. #include <memory.h>
  6. #include <Packages.h>
  7. #include <Errors.h>
  8. #include <quickdraw.h>
  9. #include <fonts.h>
  10. #include <dialogs.h>
  11. #include <windows.h>
  12. #include <menus.h>
  13. #include <events.h>
  14. #include <OSEvents.h>
  15. #include <Desk.h>
  16. #include <diskinit.h>
  17. #include <OSUtils.h>
  18. #include <resources.h>
  19. #include <toolutils.h>
  20. #include <AppleEvents.h>
  21. #include <EPPC.h>
  22. #include <GestaltEqu.h>
  23. #include <PPCToolbox.h> 
  24. #include <Processes.h>
  25. #include <Balloons.h>
  26. #include <aliases.h>
  27. */
  28. /* windowControl is the structure attached to every window I create (in the refCon */
  29. /* field) that contains all the information I need to know about the window. */
  30. /* data, procedure pointers for controlling, and anything else gets put in this */
  31. /* struct.  That makes my windows autonomous */
  32. struct windowControl {
  33.     unsigned long windowID;                                 /* master ID number  */
  34.     ProcPtr drawMe;                                         /* content drawing procedure pointer */
  35.     ProcPtr clickMe;                                        /* content click routine */
  36.     ProcPtr closeMe;                                        /* document close procedure pointer */
  37.     ProcPtr sizeMe;                                            /* size procedure */
  38.     AliasHandle fileAliasHandle;                            /* alias for this document */
  39.     Boolean windowDirty;
  40.     Handle generalData;                                        /* cast to whatever you need as you need it */
  41. };
  42. typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
  43.  
  44. struct AEinstalls {
  45.     AEEventClass theClass;
  46.     AEEventID theEvent;
  47.     EventHandlerProcPtr theProc;
  48. };
  49. typedef struct AEinstalls AEinstalls;
  50.  
  51. enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
  52. /* menu enums */
  53. enum {kMBarID = 128};
  54. enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
  55.  
  56. /* file menu enums */
  57. enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
  58.  
  59. /* general purpose enums */
  60. enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130,kNoneOfThatType=132};
  61. enum {kResTypeDialog = 131,kResTypeEditLine=4};
  62. enum {kTestMenuChooseType = 1,kTestMenuDivider};
  63.  
  64. enum {kMinHeight = 200};
  65. enum {kGenStrings = 128,kUnnamedString=1};
  66.  
  67. enum  {
  68.     kEnterKey = 0x03, 
  69.     kTabKey = 9, 
  70.     kReturnKey = 0x0D, 
  71.     kBackSpace = 8, 
  72.     kEscKey = 0x1B, 
  73.     kLeftArrow = 0x1C, 
  74.     kRightArrow, 
  75.     kUpArrow,
  76.     kDownArrow, 
  77.     kDeleteKey = 0x7F
  78. };
  79.  
  80.  
  81.  
  82.  
  83.  
  84. /* These are the new Dialog Manager calls described in Tech note #304 */
  85. /* ONLY used if System 7 or later, of course */
  86. pascal OSErr GetStdFilterProc(ModalFilterProcPtr *theProc) = 
  87. {
  88.     0x303C, 0x0203, 0xAA68
  89. };
  90.  
  91.  
  92.  
  93.  
  94. /* Indicates to the dialog manager which item is default.  Will then alias the return key */
  95. /* to this item, and also bold border it for you (yaaaaa!) */
  96. pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, short newItem)
  97. {
  98.     0x303C, 0x0304, 0xAA68
  99. };
  100.  
  101.  
  102.  
  103.  
  104. /* Indicates which item should be aliased to escape or Command - . */
  105. pascal OSErr SetDialogCancelItem(DialogPtr theDialog, short newItem)
  106. {
  107.     0x303C, 0x0305, 0xAA68
  108. };
  109.  
  110.  
  111.  
  112.  
  113. /* Tells the dialog manager that there is an edit line in this dialog, and */
  114. /* it should track and change to an I-Beam cursor when over the edit line */
  115. pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks) = 
  116. {
  117.     0x303C, 0x0306, 0xAA68
  118. };
  119.  
  120.