home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / scnote / stdfile.018 / StdFile.r < prev    next >
Encoding:
Text File  |  1989-04-02  |  11.6 KB  |  447 lines

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Standard File Sample Application
  6. #
  7. #    StdFile
  8. #
  9. #    StdFile.r    -    Rez Source
  10. #
  11. #    Copyright ⌐ 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #                1.00                04/89
  16. #
  17. #    Components:
  18. #                StdFile.c            April 1, 1989
  19. #                StdFile.p            April 1, 1989
  20. #                StdFile.h            April 1, 1988
  21. #                StdFile.r            April 1, 1988
  22. #                StdFile.rsrc        April 1, 1988
  23. #                CStdFile.make        April 1, 1989
  24. #                PStdFile.make        April 1, 1988
  25. #
  26. ------------------------------------------------------------------------------*/
  27.  
  28. #include "Types.r"
  29. #include "SysTypes.r"
  30.  
  31. #include "StdFile.h"
  32.  
  33. /* The following file holds: 
  34.         About box alert
  35.         About box DITL
  36.         Application Icon
  37.         Doug's face
  38. */
  39. include "StdFile.rsrc";
  40.  
  41.  
  42. resource 'MBAR' (rMenuBar, preload) {
  43.     {mApple, mFile, mEdit, mSFile};
  44. };
  45.  
  46. resource 'MENU' (mApple, "Apple", preload) {
  47.     mApple, textMenuProc,
  48.     0b11111111111111111111111111111101,    /* Disable item #2 */
  49.     enabled, apple,
  50.     {
  51.         "About " AppName "╔",
  52.             noicon, nokey, nomark, plain;
  53.         "-",
  54.             noicon, nokey, nomark, plain
  55.     }
  56. };
  57.  
  58. resource 'MENU' (mFile, "File", preload) {
  59.     mFile, textMenuProc,
  60.     allEnabled,
  61.     enabled, "File",
  62.     {
  63.         "Quit",
  64.             noicon, "Q", nomark, plain
  65.     }
  66. };
  67.  
  68. resource 'MENU' (mEdit, "Edit", preload) {
  69.     mEdit, textMenuProc,
  70.     0b00000,    /* Disable all items */
  71.     enabled, "Edit",
  72.      {
  73.         "Undo",
  74.             noicon, "Z", nomark, plain;
  75.         "-",
  76.             noicon, nokey, nomark, plain;
  77.         "Cut",
  78.             noicon, "X", nomark, plain;
  79.         "Copy",
  80.             noicon, "C", nomark, plain;
  81.         "Paste",
  82.             noicon, "V", nomark, plain;
  83.         "Clear",
  84.             noicon, nokey, nomark, plain
  85.     }
  86. };
  87.  
  88. resource 'MENU' (mSFile, "Standard File", preload) {
  89.     mSFile, textMenuProc,
  90.     allEnabled,
  91.     enabled, "Standard File",
  92.      {
  93.         "Normal SFGetFile",
  94.             noicon, nokey, nomark, plain;
  95.         "Normal SFPutFile",
  96.             noicon, nokey, nomark, plain;
  97.         "Normal SFPGetFile with Simple File Filter",
  98.             noicon, nokey, nomark, plain;
  99.         "Normal SFPPutFile",
  100.             noicon, nokey, nomark, plain;
  101.         "Complex FileFilter Sample",
  102.             noicon, nokey, nomark, plain;
  103.         "Select a directory",
  104.             noicon, nokey, nomark, plain;
  105.         "MultiFile",
  106.             noicon, nokey, nomark, plain;    
  107.         "Lists & PutFile problem",
  108.             noicon, nokey, nomark, plain;
  109.         "PutFile with Options",
  110.             noicon, nokey, nomark, plain;
  111.         "Idle time and updates",
  112.             noicon, nokey, nomark, plain;
  113.         "GetFile from System Folder",
  114.             noicon, nokey, nomark, plain
  115.     }
  116. };
  117.  
  118.  
  119. type 'SFil' as 'STR ';
  120.  
  121. resource 'SFil' (0) {
  122.     "Sample Standard File Routines - Macintosh Developer Technical Support - v2.0"
  123. };
  124.  
  125. resource 'vers' (1) {
  126.     2,0,development,1,verUS,
  127.     "2.0d1",
  128.     "v2.0d1 - Apple Developer Technical Support"
  129. };    
  130.  
  131.  
  132. resource 'BNDL' (128) {
  133.     'SFil',
  134.     0,
  135.     {'ICN#',{0, 128},
  136.      'FREF',{0, 128}
  137.     }
  138. };
  139.  
  140.  
  141. resource 'FREF' (128) {
  142.     'APPL',
  143.     0,
  144.     ""
  145. };
  146.  
  147.  
  148. resource 'SIZE' (-1) {
  149.     dontSaveScreen,
  150.     ignoreSuspendResumeEvents,
  151.     enableOptionSwitch,
  152.     cannotBackground,
  153.     notMultiFinderAware,
  154.     backgroundAndForeground,
  155.     getFrontClicks,
  156.     reserved,
  157.     reserved,
  158.     reserved,
  159.     reserved,
  160.     reserved,
  161.     reserved,
  162.     reserved,
  163.     reserved,
  164.     reserved,
  165.     40*1024,
  166.     40*1024
  167. };
  168.  
  169. resource 'STR#' (rStrMisc) {
  170.      {    /* array StringArray: 5 elements */
  171. /* [1] */    "MySave";
  172. /* [2] */    "K free";
  173. /* [3] */    "DTS 'R' US";
  174. /* [4] */    "The item selected was ";
  175. /* [5] */    "The Cancel button was pressed."
  176.     }
  177. };
  178.  
  179. resource 'STR#' (rStrList) {
  180.     {    /* array StringArray: 7 elements */
  181. /* [1] */    "This";
  182. /* [2] */    "is";
  183. /* [3] */    "just";
  184. /* [4] */    "a";
  185. /* [5] */    "gratuitous";
  186. /* [6] */    "list";
  187. /* [7] */    "item"
  188.     }
  189. };
  190.  
  191. /* --------------------- Copy of Standard GetFile Dialog --------------------- */
  192.  
  193. resource 'DLOG' (-4000, purgeable) {
  194.     {0, 0, 200, 348},
  195.     dBoxProc,
  196.     invisible,
  197.     noGoAway,
  198.     0x0,
  199.     -4000,
  200.     ""
  201. };
  202.  
  203. resource 'DITL' (-4000, purgeable) {
  204.     { /* array DITLarray: 10 elements */
  205. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"},
  206. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  207. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"},
  208. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  209. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"},
  210. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"},
  211. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  212. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  213. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  214. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""}
  215.     }
  216. };
  217.  
  218.  
  219. /* --------------------- Copy of Standard PutFile Dialog --------------------- */
  220.  
  221. resource 'DLOG' (-3999, purgeable) {
  222.     {0, 0, 184, 304},
  223.     dBoxProc,
  224.     invisible,
  225.     noGoAway,
  226.     0x0,
  227.     -3999,
  228.     ""
  229. };
  230.  
  231. resource 'DITL' (-3999, purgeable) {
  232.     { /* array DITLarray: 8 elements */
  233. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  234. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  235. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  236. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  237. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  238. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  239. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  240. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled}
  241.     }
  242. };
  243.  
  244.  
  245. /* -------------------------- Used for custom SFPGetFile -------------------------- */
  246.  
  247. resource 'DLOG' (rSFPGetFileDLOG, purgeable) {
  248.     {0, 0, 200, 349},
  249.     dBoxProc,
  250.     invisible,
  251.     noGoAway,
  252.     0x0,
  253.     1000,
  254.     ""
  255. };
  256.  
  257. resource 'DITL' (rSFPGetFileDLOG, purgeable) {
  258.     {    /* array DITLarray: 13 elements */
  259. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"};
  260. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"};
  261. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"};
  262. /* [4] */    {39, 252, 59, 347},        UserItem    {disabled};
  263. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"};
  264. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"};
  265. /* [7] */    {39, 12, 180, 230},        UserItem    {enabled};
  266. /* [8] */    {39, 229, 180, 245},    UserItem    {enabled};
  267. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled};
  268. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""};
  269. /* [11] */    {1, 14, 20, 142},        RadioButton    {enabled,"Text files only"};
  270. /* [12] */    {19, 14, 38, 176},        RadioButton    {enabled,"Text and applications"};
  271. /* [13] */    {6, 256, 24, 336},        Button        {enabled,"Quit"}
  272.     }
  273. };
  274.  
  275. /* -------------------------- Used for custom SFPPutFile -------------------------- */
  276.  
  277. resource 'DLOG' (rSFPPutFileDLOG, purgeable) {
  278.     {0, 0, 164, 304},
  279.     dBoxProc,
  280.     invisible,
  281.     noGoAway,
  282.     0x0,
  283.     1001,
  284.     ""
  285. };
  286.  
  287. resource 'DITL' (rSFPPutFileDLOG, purgeable) {
  288.      {    /* array DITLarray: 12 elements */
  289. /* [1] */    {74, 12, 92, 82},        Button        {enabled,"Save"};
  290. /* [2] */    {74, 114, 92, 184},        Button        {enabled,"Cancel"};
  291. /* [3] */    {12, 12, 28, 184},        StaticText    {disabled,"Save as:"};
  292. /* [4] */    {16, 209, 34, 295},        UserItem    {disabled};
  293. /* [5] */    {74, 217, 92, 287},        Button        {enabled,"Eject"};
  294. /* [6] */    {101, 217, 119, 287},    Button        {enabled,"Drive"};
  295. /* [7] */    {34, 14, 50, 182},        EditText    {enabled,""};
  296. /* [8] */    {16, 200, 88, 201},        UserItem    {disabled};
  297. /* [9] */    {128, 217, 146, 287},    Button        {enabled,"Quit"};
  298. /* [10] */    {102, 11, 122, 108},    RadioButton    {enabled,"Text Only"};
  299. /* [11] */    {129, 11, 149, 108},    RadioButton {enabled,"Formatted"};
  300. /* [12] */    {37, 202, 73, 303},        UserItem    {disabled}
  301.     }
  302. };
  303.  
  304.  
  305. /* -------------------------- Used for Setdirectory -------------------------- */
  306.  
  307. resource 'DLOG' (rGetDirectoryDLOG, purgeable) {
  308.     {0, 0, 217, 348},
  309.     dBoxProc,
  310.     invisible,
  311.     noGoAway,
  312.     0x0,
  313.     1002,
  314.     ""
  315. };
  316.  
  317. resource 'DITL' (rGetDirectoryDLOG, purgeable) {
  318.     {    /* array DITLarray: 13 elements */
  319. /* [1] */    {142, 256, 160, 336},    Button        {enabled,"Open"},
  320. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  321. /* [3] */    {193, 256, 211, 336},    Button        {enabled,"Cancel"},
  322. /* [4] */    {43, 232, 63, 347},        UserItem    {disabled},
  323. /* [5] */    {72, 256, 90, 336},        Button        {enabled,"Eject"},
  324. /* [6] */    {97, 256, 115, 336},    Button        {enabled,"Drive"},
  325. /* [7] */    {43, 12, 189, 230},        UserItem    {enabled},
  326. /* [8] */    {43, 229, 189, 246},    UserItem    {enabled},
  327. /* [9] */    {128, 252, 129, 340},    UserItem    {disabled},
  328. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""},
  329. /* [11] */    {167, 256, 185, 336},    Button        {enabled,"Directory"},
  330. /* [12] */    {0, 30, 18, 215},        Button        {enabled,"Select Current Directory:"},
  331. /* [13] */    {200, 20, 1145, 116},    StaticText    {disabled,""}
  332.     }
  333. };
  334.  
  335.  
  336. /* -------------------------- For custom MultiFile #1 -------------------------- */
  337.  
  338. resource 'DLOG' (rMultiFileDLOG, purgeable) {
  339.     {0, 0, 200, 348},
  340.     dBoxProc,
  341.     invisible,
  342.     noGoAway,
  343.     0x0,
  344.     1003,
  345.     ""
  346. };
  347.  
  348. resource 'DITL' (rMultiFileDLOG, purgeable) {
  349.     { /* array DITLarray: 11 elements */
  350. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"},
  351. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  352. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"},
  353. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},        /* disk name */
  354. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"},
  355. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"},
  356. /* [7] */    {1039, 12, 1185, 230},        UserItem    {enabled},    /* filename list */
  357. /* [8] */    {1039, 229, 1185, 246},    UserItem    {enabled},        /* unused */
  358. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},        /* dotted line */
  359. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""},
  360. /* [11] */    {39, 12, 185, 230},        UserItem    {enabled}        /* my list item */
  361.     }
  362. };
  363.  
  364.  
  365. /* -------------------------- For custom MultiFile #2 -------------------------- */
  366.  
  367. resource 'DLOG' (rListsNPutFileDLOG, purgeable) {
  368.     {0, 0, 262, 304},
  369.     dBoxProc,
  370.     invisible,
  371.     noGoAway,
  372.     0x0,
  373.     1004,
  374.     ""
  375. };
  376.  
  377. resource 'DITL' (rListsNPutFileDLOG, purgeable) {
  378.     { /* array DITLarray: 9 elements */
  379. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  380. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  381. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  382. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  383. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  384. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  385. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  386. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled},
  387. /* [9] */    {185, 14, 251, 197},    UserItem    {disabled}
  388.     }
  389. };
  390.  
  391.  
  392. /* -------------------------- For FileTypes Sample -------------------------- */
  393.  
  394.  
  395. resource 'DLOG' (rOptionsDLOG, purgeable) {
  396.     {0, 0, 214, 304},
  397.     dBoxProc,
  398.     invisible,
  399.     noGoAway,
  400.     0x0,
  401.     1005,
  402.     ""
  403. };
  404.  
  405. resource 'DITL' (rOptionsDLOG, purgeable) {
  406.     { /* array DITLarray: 10 elements */
  407. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  408. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  409. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  410. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  411. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  412. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  413. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  414. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled},
  415. /* [9] */    {184, 218, 202, 288},    Button        {enabled,"Options╔"},
  416. /* [10] */    {184, 14, 202, 197},    StaticText    {disabled,""},
  417.     }
  418. };
  419.  
  420.  
  421. resource 'DLOG' (rOptionsSubDLOG, "Options Dialog", purgeable) {
  422.     {40, 40, 192, 392},
  423.     dBoxProc,
  424.     invisible,
  425.     noGoAway,
  426.     0x0,
  427.     2000,
  428.     "New Dialog"
  429. };
  430.  
  431. resource 'DITL' (rOptionsSubDLOG, "Options Dialog", purgeable) {
  432.     { /* array DITLarray: 11 elements */
  433. /* [1] */    {8, 272, 28, 332},        Button        {enabled,"OK"},
  434. /* [2] */    {32, 272, 52, 332},        Button        {enabled,"Cancel"},
  435. /* [3] */    {40, 24, 56, 120},        RadioButton    {enabled,"ZowiePaint"},
  436. /* [4] */    {64, 24, 80, 120},        RadioButton    {enabled,"PICT2"},
  437. /* [5] */    {88, 24, 104, 120},        RadioButton    {enabled,"PICT"},
  438. /* [6] */    {112, 24, 128, 120},    RadioButton    {enabled,"MacPaint"},
  439. /* [7] */    {64, 152, 80, 248},        RadioButton    {enabled,"TIFF"},
  440. /* [8] */    {88, 152, 104, 248},    RadioButton    {enabled,"PixelPaint"},
  441. /* [9] */    {112, 152, 128, 248},    RadioButton    {enabled,"Pffffff"},
  442. /* [10] */    {15, 16, 137, 263},        UserItem    {disabled},
  443. /* [11] */    {8, 32, 28, 92},        StaticText    {disabled,"Formats"}
  444.     }
  445. };
  446.  
  447.