home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 July / macformat-026.iso / mac / Shareware City / Developers / PopupCDEF-10b5 / Source / PopupDemo.r < prev    next >
Encoding:
Text File  |  1994-11-30  |  19.8 KB  |  654 lines  |  [TEXT/KAHL]

  1. /*    See the file Distribution for distribution terms.
  2.     (c) Copyright 1994 Ari Halberstadt */
  3.  
  4. /*---------------------------------------------------------------------------*/
  5. /* Resources for the Popup Demo application. */
  6. /*---------------------------------------------------------------------------*/
  7.  
  8. /* Defining POPUP_CDEF_RESOURCE_ONLY allows us to include "PopupCDEF.h",
  9.     which defines various constants. */
  10. #define POPUP_CDEF_RESOURCE_ONLY        (1)
  11.  
  12. /*    Defining SystemSevenOrLater allows us to use System 7 dependent resource
  13.     features, like automatic positioning of windows. */
  14. #define SystemSevenOrLater                (1)
  15.  
  16. #include <SysTypes.r>
  17. #include <Types.r>
  18. #include "PopupCDEF.h"
  19.  
  20. /*---------------------------------------------------------------------------*/
  21. /*    Resource IDs. */
  22. /*---------------------------------------------------------------------------*/
  23.  
  24. #define kDialogID                            (128)
  25.  
  26. #define kPopupIDFont                        (128)
  27. #define kPopupIDSize                        (129)
  28. #define kPopupIDStyle                    (130)
  29. #define kPopupIDAlign                    (131)
  30. #define kPopupIDIcons                    (132)
  31. #define kPopupIDLongTitle                (133)
  32. #define kPopupIDRightAligned            (134)
  33. #define kPopupIDWindowFont                (135)
  34. #define kPopupIDDisabledItem            (136)
  35. #define kPopupIDDisabled                (137)
  36. #define kPopupIDNoTitle                    (138)
  37. #define kPopupIDColor                    (139)
  38.  
  39. #define kIconID                            (1)
  40. #define kSmallIconIDLeft                (1)
  41. #define kSmallIconIDCenter                (2)
  42. #define kSmallIconIDRight                (3)
  43. #define kSmallIconIDJustify            (4)
  44. #define kColorIconID                        (44)
  45.  
  46. /*---------------------------------------------------------------------------*/
  47. /* Control sizes. The width and height of the rectangle of a 'CNTL' resource
  48.     must be the same as the width and height of the rectangle of a 'DITL'
  49.     item. To ensure that the width and height are the same, we define these
  50.     constants. */
  51. /*---------------------------------------------------------------------------*/
  52.  
  53. #define kControlFontW                    (250)
  54. #define kControlFontH                    (20)
  55.  
  56. #define kControlSizeW                    (22)
  57. #define kControlSizeH                    (20)
  58.  
  59. #define kControlStyleW                    (250)
  60. #define kControlStyleH                    (24)
  61.  
  62. #define kControlAlignW                    (200)
  63. #define kControlAlignH                    (24)
  64.  
  65. #define kControlIconsW                    (200)
  66. #define kControlIconsH                    (64)
  67.  
  68. #define kControlLongTitleW                (250)
  69. #define kControlLongTitleH                (38)
  70.  
  71. #define kControlRightAlignedW            (250)
  72. #define kControlRightAlignedH            (24)
  73.  
  74. #define kControlWindowFontW            (200)
  75. #define kControlWindowFontH            (20)
  76.  
  77. #define kControlDisabledItemW            (250)
  78. #define kControlDisabledItemH            (20)
  79.  
  80. #define kControlDisabledW                (200)
  81. #define kControlDisabledH                (22)
  82.  
  83. #define kControlNoTitleW                (200)
  84. #define kControlNoTitleH                (20)
  85.  
  86. #define kControlColorW                    (250)
  87. #define kControlColorH                    (64)
  88.  
  89. /*---------------------------------------------------------------------------*/
  90. /* Colors. */
  91. /*---------------------------------------------------------------------------*/
  92.  
  93. #define kRGB100                    65535
  94. #define kRGB075                    49152
  95. #define kRGB050                    32768
  96. #define kRGB025                    16384
  97. #define kRGB000                    0
  98.  
  99. #define kRGBColorWhite            kRGB100,    kRGB100,    kRGB100
  100. #define kRGBColorGray75            kRGB075,    kRGB075,    kRGB075
  101. #define kRGBColorGray50            kRGB050,    kRGB050,    kRGB050
  102. #define kRGBColorGray25            kRGB025,    kRGB025,    kRGB025
  103. #define kRGBColorBlack            kRGB000,    kRGB000,    kRGB000
  104.  
  105. #define kRGBColorRed                kRGB100,    kRGB000,    kRGB000
  106. #define kRGBColorRed75            kRGB075,    kRGB000,    kRGB000
  107. #define kRGBColorRed50            kRGB050,    kRGB000,    kRGB000
  108. #define kRGBColorRed25            kRGB025,    kRGB000,    kRGB000
  109.  
  110. #define kRGBColorGreen            kRGB000,    kRGB100,    kRGB000
  111. #define kRGBColorGreen75        kRGB000,    kRGB075,    kRGB000
  112. #define kRGBColorGreen50        kRGB000,    kRGB050,    kRGB000
  113. #define kRGBColorGreen25        kRGB000,    kRGB025,    kRGB000
  114.  
  115. #define kRGBColorBlue            kRGB000,    kRGB000,    kRGB100
  116. #define kRGBColorBlue75            kRGB000,    kRGB000,    kRGB075
  117. #define kRGBColorBlue50            kRGB000,    kRGB000,    kRGB050
  118. #define kRGBColorBlue25            kRGB000,    kRGB000,    kRGB025
  119.  
  120. #define kRGBColorCyan            kRGB000,    kRGB100,    kRGB100
  121. #define kRGBColorCyan75            kRGB000,    kRGB075,    kRGB075
  122. #define kRGBColorCyan50            kRGB000,    kRGB050,    kRGB050
  123. #define kRGBColorCyan25            kRGB000,    kRGB025,    kRGB025
  124.  
  125. #define kRGBColorMagenta        kRGB100,    kRGB000,    kRGB100
  126. #define kRGBColorMagenta75        kRGB075,    kRGB000,    kRGB075
  127. #define kRGBColorMagenta50        kRGB050,    kRGB000,    kRGB050
  128. #define kRGBColorMagenta25        kRGB025,    kRGB000,    kRGB025
  129.  
  130. #define kRGBColorYellow            kRGB100,    kRGB100,    kRGB000
  131. #define kRGBColorYellow75        kRGB075,    kRGB075,    kRGB000
  132. #define kRGBColorYellow50        kRGB050,    kRGB050,    kRGB000
  133. #define kRGBColorYellow25        kRGB025,    kRGB025,    kRGB000
  134.  
  135. /*---------------------------------------------------------------------------*/
  136. /* Controls. */
  137. /*---------------------------------------------------------------------------*/
  138.  
  139. resource 'CNTL' (kPopupIDFont, "Font popup", purgeable) {
  140.     { 0, 0, kControlFontH, kControlFontW },
  141.     0,
  142.     visible,
  143.     54,
  144.     kPopupIDFont,
  145.     kPopupProcID + popupFixedWidth + popupUseAddResMenu,
  146.     'FOND',
  147.     "Font:"
  148. };
  149.  
  150. resource 'CNTL' (kPopupIDSize, "Size popup", purgeable) {
  151.     { 0, 0, kControlSizeH, kControlSizeW },
  152.     0,
  153.     visible,
  154.     0,
  155.     kPopupIDSize,
  156.     kPopupProcID + popupFixedWidth + popupTypeIn,
  157.     0,
  158.     ""
  159. };
  160.  
  161. resource 'CNTL' (kPopupIDStyle, "Style popup", purgeable) {
  162.     { 0, 0, kControlStyleH, kControlStyleW },
  163.     popupTitleItalic + popupTitleUnderline,
  164.     visible,
  165.     54,
  166.     kPopupIDStyle,
  167.     kPopupProcID + popupFixedWidth,
  168.     0,
  169.     "Style:"
  170. };
  171.  
  172. resource 'CNTL' (kPopupIDAlign, "Align popup", purgeable) {
  173.     { 0, 0, kControlAlignH, kControlAlignW },
  174.     0,
  175.     visible,
  176.     0,
  177.     kPopupIDAlign,
  178.     kPopupProcID + popupFixedWidth,
  179.     0,
  180.     "Align:"
  181. };
  182.  
  183. resource 'CNTL' (kPopupIDIcons, "Icons popup", purgeable) {
  184.     { 0, 0, kControlIconsH, kControlIconsW },
  185.     0,
  186.     visible,
  187.     54,
  188.     kPopupIDIcons,
  189.     kPopupProcID + popupFixedWidth,
  190.     0,
  191.     "Icons:"
  192. };
  193.  
  194. resource 'CNTL' (kPopupIDLongTitle, "Long title popup", purgeable) {
  195.     { 0, 0, kControlLongTitleH, kControlLongTitleW },
  196.     0,
  197.     visible,
  198.     0,
  199.     kPopupIDLongTitle,
  200.     kPopupProcID + popupFixedWidth,
  201.     0,
  202.     "Really long title that's too long to display:"
  203. };
  204.  
  205. resource 'CNTL' (kPopupIDRightAligned, "Right aligned popup", purgeable) {
  206.     { 0, 0, kControlRightAlignedH, kControlRightAlignedW },
  207.     popupTitleUnderline + popupTitleRightJust,
  208.     visible,
  209.     0,
  210.     kPopupIDRightAligned,
  211.     kPopupProcID + popupFixedWidth,
  212.     0,
  213.     "Right Aligned"
  214. };
  215.  
  216. resource 'CNTL' (kPopupIDWindowFont, "Window font popup", purgeable) {
  217.     { 0, 0, kControlWindowFontH, kControlWindowFontW },
  218.     0,
  219.     visible,
  220.     0,
  221.     kPopupIDWindowFont,
  222.     kPopupProcID + popupFixedWidth + popupUseWFont,
  223.     0,
  224.     "Window Font:"
  225. };
  226.  
  227. resource 'CNTL' (kPopupIDDisabledItem, "Disabled item popup", purgeable) {
  228.     { 0, 0, kControlDisabledItemH, kControlDisabledItemW },
  229.     0,
  230.     visible, 
  231.     0,
  232.     kPopupIDDisabledItem,
  233.     kPopupProcID,
  234.     0,
  235.     "Disabled Item:"
  236. };
  237.  
  238. resource 'CNTL' (kPopupIDDisabled, "Disabled popup", purgeable) {
  239.     { 0, 0, kControlDisabledH, kControlDisabledW },
  240.     0,
  241.     visible,
  242.     0,
  243.     kPopupIDDisabled,
  244.     kPopupProcID + popupFixedWidth,
  245.     0,
  246.     "Disabled:"
  247. };
  248.  
  249. resource 'CNTL' (kPopupIDNoTitle, "No title popup", purgeable) {
  250.     { 0, 0, kControlNoTitleH, kControlNoTitleW },
  251.     0,
  252.     visible,
  253.     0,
  254.     kPopupIDNoTitle,
  255.     kPopupProcID + popupFixedWidth,
  256.     0,
  257.     ""
  258. };
  259.  
  260. resource 'CNTL' (kPopupIDColor, "Color popup", purgeable) {
  261.     { 0, 0, kControlColorH, kControlColorW },
  262.     0,
  263.     visible,
  264.     0,
  265.     kPopupIDColor,
  266.     kPopupProcID,
  267.     0,
  268.     "Color Menu:"
  269. };
  270.  
  271. /*---------------------------------------------------------------------------*/
  272. /* Control color tables. */
  273. /*---------------------------------------------------------------------------*/
  274.  
  275. resource 'cctb' (kPopupIDDisabled, "Popup control color table", purgeable) {
  276.     {        
  277.         kPopupPartTitleFore,                kRGBColorRed,
  278.         kPopupPartTitleBack,                kRGBColorCyan,
  279.         kPopupPartTitleDisabled,        kRGBColorGray50,
  280.  
  281.         kPopupPartItemFore,                kRGBColorGreen,
  282.         kPopupPartItemBack,                kRGBColorMagenta,
  283.         kPopupPartItemDisabled,            kRGBColorGray50,
  284.  
  285.         kPopupPartIconFore,                kRGBColorBlue,
  286.         kPopupPartIconBack,                kRGBColorYellow,
  287.         kPopupPartIconDisabled,            kRGBColorGray50,
  288.  
  289.         kPopupPartTriangleFore,            kRGBColorGreen50,
  290.         kPopupPartTriangleDisabled,    kRGBColorGray50,
  291.  
  292.         kPopupPartFrameFore,                kRGBColorBlack,
  293.         kPopupPartFrameDisabled,        kRGBColorGray50,
  294.  
  295.         kPopupPartShadowFore,            kRGBColorBlue75,
  296.         kPopupPartShadowDisabled,        kRGBColorGray25,
  297.     }
  298. };
  299.  
  300. /*---------------------------------------------------------------------------*/
  301. /* Menus. */
  302. /*---------------------------------------------------------------------------*/
  303.  
  304. resource 'MENU' (kPopupIDFont, "Font popup") {
  305.     kPopupIDFont, textMenuProc, allEnabled, enabled, "Font",
  306.     {
  307.         /* no items */
  308.     }
  309. };
  310.  
  311. resource 'MENU' (kPopupIDSize, "Size popup") {
  312.     kPopupIDSize, textMenuProc, allEnabled, enabled, "Size",
  313.     {
  314.         /* [1] */ "9", noIcon, noKey, noMark, plain,
  315.         /* [2] */ "10", noIcon, noKey, noMark, plain,
  316.         /* [3] */ "12", noIcon, noKey, noMark, plain,
  317.         /* [4] */ "14", noIcon, noKey, noMark, plain,
  318.         /* [5] */ "18", noIcon, noKey, noMark, plain,
  319.         /* [6] */ "24", noIcon, noKey, noMark, plain
  320.     }
  321. };
  322.  
  323. resource 'MENU' (kPopupIDStyle, "Style popup") {
  324.     kPopupIDStyle, textMenuProc, allEnabled, enabled, "Style",
  325.     {
  326.         /* [1] */ "Plain", noIcon, "T", noMark, plain,
  327.         /* [2] */ "Bold", noIcon, "B", noMark, bold,
  328.         /* [3] */ "Italic", noIcon, "I", noMark, italic,
  329.         /* [4] */ "Underline", noIcon, "U", noMark, underline,
  330.         /* [5] */ "Outline", noIcon, noKey, noMark, outline,
  331.         /* [6] */ "Shadow", noIcon, noKey, noMark, shadow,
  332.         /* [7] */ "Condensed", noIcon, noKey, noMark, condense,
  333.         /* [8] */ "Extended", noIcon, noKey, noMark, extend
  334.     }
  335. };
  336.  
  337. resource 'MENU' (kPopupIDAlign, "Align popup") {
  338.     kPopupIDAlign, textMenuProc, allEnabled, enabled, "Alignment",
  339.     {
  340.         /* [1] */ "Left", kSmallIconIDLeft, "\0x1E", noMark, plain,
  341.         /* [2] */ "Center", kSmallIconIDCenter, "\0x1E", noMark, plain,
  342.         /* [3] */ "Right", kSmallIconIDRight, "\0x1E", noMark, plain,
  343.         /* [4] */ "Justify", kSmallIconIDJustify, "\0x1E", noMark, plain
  344.     }
  345. };
  346.  
  347. resource 'MENU' (kPopupIDIcons, "Icons popup") {
  348.     kPopupIDIcons, textMenuProc, allEnabled, enabled, "Icons",
  349.     {
  350.         /* [1] */ "Color Icon", kColorIconID, noKey, noMark, plain,
  351.         /* [2] */ "Regular icon", kIconID, noKey, noMark, plain,
  352.         /* [3] */ "Reduced icon", kIconID, "\0x1D", noMark, plain,
  353.         /* [4] */ "Small icon", kSmallIconIDLeft, "\0x1E", noMark, plain
  354.     }
  355. };
  356.  
  357. resource 'MENU' (kPopupIDLongTitle, "Long title popup") {
  358.     kPopupIDLongTitle, textMenuProc, allEnabled, enabled, "Icons",
  359.     {
  360.         /* [1] */ "Big icon", kIconID, noKey, noMark, plain,
  361.         /* [2] */ "Reduced icon", kIconID, "\0x1D", noMark, plain,
  362.         /* [3] */ "Small icon", kSmallIconIDLeft, "\0x1E", noMark, plain
  363.     }
  364. };
  365.  
  366. resource 'MENU' (kPopupIDRightAligned, "Right aligned popup") {
  367.     kPopupIDRightAligned, textMenuProc, allEnabled, enabled, "Alignment",
  368.     {
  369.         /* [1] */ "Left", kSmallIconIDLeft, "\0x1E", noMark, plain,
  370.         /* [2] */ "Center", 2, "\0x1E", noMark, plain,
  371.         /* [3] */ "Right", 3, "\0x1E", noMark, plain,
  372.         /* [4] */ "Justify", 4, "\0x1E", noMark, plain
  373.     }
  374. };
  375.  
  376. resource 'MENU' (kPopupIDWindowFont, "Window font popup") {
  377.     kPopupIDWindowFont, textMenuProc, allEnabled, enabled, "Style",
  378.     {
  379.         /* [1] */ "Plain", noIcon, noKey, noMark, plain,
  380.         /* [2] */ "Bold", noIcon, "B", noMark, bold,
  381.         /* [3] */ "Italic", noIcon, "I", noMark, italic,
  382.         /* [4] */ "Underline", noIcon, "U", noMark, underline,
  383.         /* [5] */ "Outline", noIcon, noKey, noMark, outline,
  384.         /* [6] */ "Shadow", noIcon, noKey, noMark, shadow,
  385.         /* [7] */ "Condensed", noIcon, noKey, noMark, condense,
  386.         /* [8] */ "Extended", noIcon, noKey, noMark, extend
  387.     }
  388. };
  389.  
  390. resource 'MENU' (kPopupIDDisabledItem, "Disabled item popup") {
  391.     kPopupIDDisabledItem, textMenuProc, 0x7FFFFFFE, enabled, "Disabled Item",
  392.     {    
  393.         /* [1] */ "Disabled Item", noIcon, noKey, noMark, plain,
  394.         /* [2] */ "Enabled Item", noIcon, noKey, noMark, plain
  395.     }
  396. };
  397.  
  398. resource 'MENU' (kPopupIDDisabled, "Disabled popup") {
  399.     kPopupIDDisabled, textMenuProc, allEnabled, enabled, "Disabled",
  400.     {
  401.         /* [ 1] */ "One", kSmallIconIDLeft, "\0x1E", noMark, plain,
  402.         /* [ 2] */ "Two", noIcon, noKey, noMark, plain,
  403.         /* [ 3] */ "Three", noIcon, noKey, noMark, plain,
  404.         /* [ 4] */ "Four", noIcon, noKey, noMark, plain,
  405.         /* [ 5] */ "Five", noIcon, noKey, noMark, plain,
  406.         /* [ 6] */ "Six", noIcon, noKey, noMark, plain,
  407.         /* [ 7] */ "Seven", noIcon, noKey, noMark, plain,
  408.         /* [ 8] */ "Eight", noIcon, noKey, noMark, plain,
  409.         /* [ 9] */ "Nine", noIcon, noKey, noMark, plain,
  410.         /* [10] */ "Ten", noIcon, noKey, noMark, plain,
  411.         /* [11] */ "Eleven", noIcon, noKey, noMark, plain,
  412.         /* [12] */ "Twelve", noIcon, noKey, noMark, plain,
  413.         /* [13] */ "Thirteen", noIcon, noKey, noMark, plain,
  414.         /* [14] */ "Fourteen", noIcon, noKey, noMark, plain,
  415.         /* [15] */ "Fifteen", noIcon, noKey, noMark, plain,
  416.         /* [16] */ "Sixteen", noIcon, noKey, noMark, plain,
  417.         /* [17] */ "Seventeen", noIcon, noKey, noMark, plain,
  418.         /* [18] */ "Eighteen", noIcon, noKey, noMark, plain,
  419.         /* [19] */ "Nineteen", noIcon, noKey, noMark, plain,
  420.         /* [20] */ "Twenty", noIcon, noKey, noMark, plain,
  421.         /* [21] */ "Twenty One", noIcon, noKey, noMark, plain,
  422.         /* [22] */ "Twenty Two", noIcon, noKey, noMark, plain,
  423.         /* [23] */ "Twenty Three", noIcon, noKey, noMark, plain,
  424.         /* [24] */ "Twenty Four", noIcon, noKey, noMark, plain,
  425.         /* [25] */ "Twenty Five", noIcon, noKey, noMark, plain,
  426.         /* [26] */ "Twenty Six", noIcon, noKey, noMark, plain,
  427.         /* [27] */ "Twenty Seven", noIcon, noKey, noMark, plain,
  428.         /* [28] */ "Twenty Eight", noIcon, noKey, noMark, plain,
  429.         /* [29] */ "Twenty Nine", noIcon, noKey, noMark, plain,
  430.         /* [30] */ "Thirty", noIcon, noKey, noMark, plain,
  431.         /* [31] */ "Thirty One", noIcon, noKey, noMark, plain,
  432.         /* [32] */ "Thirty Two", noIcon, noKey, noMark, plain,
  433.         /* [33] */ "Thirty Three", noIcon, noKey, noMark, plain,
  434.         /* [34] */ "Thirty Four", noIcon, noKey, noMark, plain,
  435.         /* [35] */ "Thirty Five", noIcon, noKey, noMark, plain,
  436.         /* [36] */ "Thirty Six", noIcon, noKey, noMark, plain,
  437.         /* [37] */ "Thirty Seven", noIcon, noKey, noMark, plain,
  438.         /* [38] */ "Thirty Eight", noIcon, noKey, noMark, plain,
  439.         /* [39] */ "Thirty Nine", noIcon, noKey, noMark, plain,
  440.         /* [40] */ "Forty", noIcon, noKey, noMark, plain
  441.     }
  442. };
  443.  
  444. resource 'MENU' (kPopupIDNoTitle, "No title popup") {
  445.     kPopupIDNoTitle, textMenuProc, allEnabled, enabled, "No Title",
  446.     {
  447.         /* [ 1] */ "This", noIcon, noKey, noMark, plain,
  448.         /* [ 2] */ "Popup", noIcon, noKey, noMark, plain,
  449.         /* [ 3] */ "Menu", noIcon, noKey, noMark, plain,
  450.         /* [ 4] */ "Control", noIcon, noKey, noMark, plain,
  451.         /* [ 5] */ "Does", noIcon, noKey, noMark, plain,
  452.         /* [ 6] */ "Not", noIcon, noKey, noMark, plain,
  453.         /* [ 7] */ "Have", noIcon, noKey, noMark, plain,
  454.         /* [ 8] */ "A", noIcon, noKey, noMark, plain,
  455.         /* [ 9] */ "Title", noIcon, noKey, noMark, plain
  456.     }
  457. };
  458.  
  459. resource 'MENU' (kPopupIDColor, "Color popup") {
  460.     kPopupIDColor, textMenuProc, 0x7FFFFFFC, enabled, "Color Menu",
  461.     {
  462.         /* [ 1] */ "Disabled Color Icon", kColorIconID, noKey, noMark, plain,
  463.         /* [ 2] */ "Disabled B&W Icon", kIconID, noKey, noMark, plain,
  464.         /* [ 3] */ "Enabled Default Color", noIcon, noKey, noMark, plain,
  465.         /* [ 4] */ "Black", noIcon, noKey, noMark, plain,
  466.         /* [ 5] */ "Red", noIcon, noKey, noMark, plain,
  467.         /* [ 6] */ "Orange", noIcon, noKey, noMark, plain,
  468.         /* [ 7] */ "Yellow", noIcon, noKey, noMark, plain,
  469.         /* [ 8] */ "Big Color Icon", kColorIconID, noKey, noMark, plain,
  470.         /* [ 9] */ "Blue Small Icon", kSmallIconIDLeft, "\0x1E", noMark, plain,
  471.         /* [10] */ "Purple Icon", kIconID, noKey, noMark, plain
  472.     }
  473. };
  474.  
  475. /*---------------------------------------------------------------------------*/
  476. /* Menu color tables. */
  477. /*---------------------------------------------------------------------------*/
  478.  
  479. resource 'mctb' (kPopupIDColor, "Popup menu color table") {
  480.     {    /* [ 1] */ kPopupIDColor, 4,
  481.             {    /* [ 1] */     65535, 0, 52428,
  482.                 /* [ 2] */     0, 0, 0,
  483.                 /* [ 3] */     65535, 0, 52428,
  484.                 /* [ 4] */     0, 39321, 65535
  485.             },
  486.         /* [ 2] */ kPopupIDColor, 5,
  487.             {
  488.                 /* [ 1] */     65535, 0, 52428,
  489.                 /* [ 2] */     56797, 0, 0,
  490.                 /* [ 3] */     65535, 0, 52428,
  491.                 /* [ 4] */     0, 39321, 65535
  492.             },
  493.         /* [ 3] */ kPopupIDColor, 6,
  494.             {
  495.                 /* [ 1] */     65535, 0, 52428,
  496.                 /* [ 2] */     65535, 26214, 0,
  497.                 /* [ 3] */     65535, 0, 52428,
  498.                 /* [ 4] */     0, 39321, 65535
  499.             },
  500.         /* [ 4] */ kPopupIDColor, 7,
  501.             {
  502.                 /* [ 1] */     65535, 0, 52428,
  503.                 /* [ 2] */     65535, 65535, 0,
  504.                 /* [ 3] */     65535, 0, 52428,
  505.                 /* [ 4] */     0, 39321, 65535
  506.             },
  507.         /* [ 5] */ kPopupIDColor, 8,
  508.             {
  509.                 /* [ 1] */     65535, 0, 52428,
  510.                 /* [ 2] */     0, 26214, 0,
  511.                 /* [ 3] */     65535, 0, 52428,
  512.                 /* [ 4] */     0, 39321, 65535
  513.             },
  514.         /* [ 6] */ kPopupIDColor, 9,
  515.             {
  516.                 /* [ 1] */     65535, 0, 52428,
  517.                 /* [ 2] */     0, 0, 56797,
  518.                 /* [ 3] */     65535, 0, 52428,
  519.                 /* [ 4] */     0, 39321, 65535
  520.             },
  521.         /* [ 7] */ kPopupIDColor, 10,
  522.             {
  523.                 /* [ 1] */     65535, 0, 52428,
  524.                 /* [ 2] */     13107, 0, 39321,
  525.                 /* [ 3] */     65535, 0, 52428,
  526.                 /* [ 4] */     0, 39321, 65535
  527.             },
  528.         /* [ 8] */ kPopupIDColor, 0,
  529.             {
  530.                 /* [ 1] */     0, 26214, 0,
  531.                 /* [ 2] */     65535, 65535, 65535,
  532.                 /* [ 3] */     65535, 0, 52428,
  533.                 /* [ 4] */     0, 39321, 65535
  534.             }
  535.     }
  536. };
  537.  
  538. /*---------------------------------------------------------------------------*/
  539. /* Dialogs. */
  540. /*---------------------------------------------------------------------------*/
  541.  
  542. resource 'DLOG' (kDialogID, "Popup demo", purgeable) {
  543.     {40, 4, 337, 488},
  544.     documentProc,
  545.     invisible,
  546.     noGoAway,
  547.     0x0,
  548.     kDialogID,
  549.     "Popup Demo",
  550.     centerMainScreen
  551. };
  552.  
  553. resource 'DITL' (kDialogID, "Popup demo", purgeable) {
  554.     {
  555.  
  556.         /* [ 1] */ {4, 422, 24, 480},
  557.             Button { enabled, "Quit" },
  558.  
  559.         /* [ 2] */ {52, 8, 52 + kControlFontH, 8 + kControlFontW },
  560.             Control { enabled, kPopupIDFont },
  561.  
  562.         /* [ 3] */ {54, 277, 70, 316},
  563.             StaticText { disabled, "Size:" },
  564.  
  565.         /* [ 4] */ {54, 322, 70, 379},
  566.             EditText { enabled, "999" },
  567.  
  568.         /* [ 5] */ {52, 385, 52 + kControlSizeH, 385 + kControlSizeW },
  569.             Control { enabled, kPopupIDSize },
  570.  
  571.         /* [ 6] */ {80, 8, 80 + kControlStyleH, 8 + kControlStyleW },
  572.             Control { enabled, kPopupIDStyle },
  573.     
  574.         /* [ 7] */ {80, 272, 80 + kControlAlignH, 272 + kControlAlignW },
  575.             Control { enabled, kPopupIDAlign },
  576.  
  577.         /* [ 8] */ {148, 8, 148 + kControlLongTitleH, 8 + kControlLongTitleW },
  578.             Control { enabled, kPopupIDLongTitle },
  579.     
  580.         /* [ 9] */ {228, 272, 228 + kControlIconsH, 272 + kControlIconsW },
  581.             Control { enabled, kPopupIDIcons },
  582.  
  583.         /* [10] */ {112, 8, 112 + kControlRightAlignedH, 8 + kControlRightAlignedW },
  584.             Control { enabled, kPopupIDRightAligned },
  585.  
  586.         /* [11] */ {112, 272, 112 + kControlWindowFontH, 272 + kControlWindowFontW },
  587.             Control { enabled, kPopupIDWindowFont },
  588.  
  589.         /* [12] */ {196, 8, 196 + kControlDisabledItemH, 8 + kControlDisabledItemW },
  590.             Control { enabled, kPopupIDDisabledItem },
  591.  
  592.         /* [13] */ {168, 280, 168 + kControlDisabledH, 280 + kControlDisabledW },
  593.             Control { disabled, kPopupIDDisabled },
  594.  
  595.         /* [14] */ {196, 272, 196 + kControlNoTitleH, 272 + kControlNoTitleW },
  596.             Control { enabled, kPopupIDNoTitle },
  597.  
  598.         /* [15] */ {228, 8, 228 + kControlColorH, 8 + kControlColorW },
  599.             Control { enabled, kPopupIDColor },
  600.  
  601.         /* [16] */ {148, 272, 148 + 20, 272 + 200 },
  602.             CheckBox { enabled, "Enable Popup Menu" },
  603.  
  604.         /* [17] */ {4, 8, 43, 407}, StaticText { disabled,
  605.             "This application demonstrates various types of popup menus created "
  606.             "using %s popup CDEF."
  607.         }
  608.     }
  609. };
  610.  
  611. resource 'dctb' (kDialogID, "Popup demo", purgeable) {
  612.     {    /* causes dialog manager to create a color dialog */ }
  613. };
  614.  
  615. /*---------------------------------------------------------------------------*/
  616. /* Finder resources. */
  617. /*---------------------------------------------------------------------------*/
  618.  
  619. resource 'vers' (1, purgeable) {
  620.     0x1,
  621.     0x0,
  622.     beta,
  623.     0x5,
  624.     verUS,
  625.     "1.0b5",
  626.     "1.0b5, © 1994 by Ari Halberstadt.\n"
  627. };
  628.  
  629. /*---------------------------------------------------------------------------*/
  630. /* Process Manager resources. For a native PowerPC version of the
  631.     application, this would include a 'cfrg' resource. */
  632. /*---------------------------------------------------------------------------*/
  633.  
  634. resource 'SIZE' (0, purgeable) {
  635.     reserved,
  636.     ignoreSuspendResumeEvents,
  637.     reserved,
  638.     canBackground,
  639.     needsActivateOnFGSwitch,
  640.     backgroundAndForeground,
  641.     dontGetFrontClicks,
  642.     ignoreAppDiedEvents,
  643.     is32BitCompatible,
  644.     notHighLevelEventAware,
  645.     onlyLocalHLEvents,
  646.     notStationeryAware,
  647.     dontUseTextEditServices,
  648.     reserved,
  649.     reserved,
  650.     reserved,
  651.     386 * 1024,
  652.     386 * 1024,
  653. };
  654.