home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- #
- # Apple Macintosh Developer Technical Support
- #
- # Standard File Sample Application
- #
- # StdFile
- #
- # StdFile.r - Rez Source
- #
- # Copyright ⌐ 1989 Apple Computer, Inc.
- # All rights reserved.
- #
- # Versions:
- # 1.00 04/89
- #
- # Components:
- # StdFile.c April 1, 1989
- # StdFile.p April 1, 1989
- # StdFile.h April 1, 1988
- # StdFile.r April 1, 1988
- # StdFile.rsrc April 1, 1988
- # CStdFile.make April 1, 1989
- # PStdFile.make April 1, 1988
- #
- ------------------------------------------------------------------------------*/
-
- #include "Types.r"
- #include "SysTypes.r"
-
- #include "StdFile.h"
-
- /* The following file holds:
- About box alert
- About box DITL
- Application Icon
- Doug's face
- */
- include "StdFile.rsrc";
-
-
- resource 'MBAR' (rMenuBar, preload) {
- {mApple, mFile, mEdit, mSFile};
- };
-
- resource 'MENU' (mApple, "Apple", preload) {
- mApple, textMenuProc,
- 0b11111111111111111111111111111101, /* Disable item #2 */
- enabled, apple,
- {
- "About " AppName "╔",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mFile, "File", preload) {
- mFile, textMenuProc,
- allEnabled,
- enabled, "File",
- {
- "Quit",
- noicon, "Q", nomark, plain
- }
- };
-
- resource 'MENU' (mEdit, "Edit", preload) {
- mEdit, textMenuProc,
- 0b00000, /* Disable all items */
- enabled, "Edit",
- {
- "Undo",
- noicon, "Z", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Cut",
- noicon, "X", nomark, plain;
- "Copy",
- noicon, "C", nomark, plain;
- "Paste",
- noicon, "V", nomark, plain;
- "Clear",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mSFile, "Standard File", preload) {
- mSFile, textMenuProc,
- allEnabled,
- enabled, "Standard File",
- {
- "Normal SFGetFile",
- noicon, nokey, nomark, plain;
- "Normal SFPutFile",
- noicon, nokey, nomark, plain;
- "Normal SFPGetFile with Simple File Filter",
- noicon, nokey, nomark, plain;
- "Normal SFPPutFile",
- noicon, nokey, nomark, plain;
- "Complex FileFilter Sample",
- noicon, nokey, nomark, plain;
- "Select a directory",
- noicon, nokey, nomark, plain;
- "MultiFile",
- noicon, nokey, nomark, plain;
- "Lists & PutFile problem",
- noicon, nokey, nomark, plain;
- "PutFile with Options",
- noicon, nokey, nomark, plain;
- "Idle time and updates",
- noicon, nokey, nomark, plain;
- "GetFile from System Folder",
- noicon, nokey, nomark, plain
- }
- };
-
-
- type 'SFil' as 'STR ';
-
- resource 'SFil' (0) {
- "Sample Standard File Routines - Macintosh Developer Technical Support - v2.0"
- };
-
- resource 'vers' (1) {
- 2,0,development,1,verUS,
- "2.0d1",
- "v2.0d1 - Apple Developer Technical Support"
- };
-
-
- resource 'BNDL' (128) {
- 'SFil',
- 0,
- {'ICN#',{0, 128},
- 'FREF',{0, 128}
- }
- };
-
-
- resource 'FREF' (128) {
- 'APPL',
- 0,
- ""
- };
-
-
- resource 'SIZE' (-1) {
- dontSaveScreen,
- ignoreSuspendResumeEvents,
- enableOptionSwitch,
- cannotBackground,
- notMultiFinderAware,
- backgroundAndForeground,
- getFrontClicks,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- 40*1024,
- 40*1024
- };
-
- resource 'STR#' (rStrMisc) {
- { /* array StringArray: 5 elements */
- /* [1] */ "MySave";
- /* [2] */ "K free";
- /* [3] */ "DTS 'R' US";
- /* [4] */ "The item selected was ";
- /* [5] */ "The Cancel button was pressed."
- }
- };
-
- resource 'STR#' (rStrList) {
- { /* array StringArray: 7 elements */
- /* [1] */ "This";
- /* [2] */ "is";
- /* [3] */ "just";
- /* [4] */ "a";
- /* [5] */ "gratuitous";
- /* [6] */ "list";
- /* [7] */ "item"
- }
- };
-
- /* --------------------- Copy of Standard GetFile Dialog --------------------- */
-
- resource 'DLOG' (-4000, purgeable) {
- {0, 0, 200, 348},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- -4000,
- ""
- };
-
- resource 'DITL' (-4000, purgeable) {
- { /* array DITLarray: 10 elements */
- /* [1] */ {138, 256, 156, 336}, Button {enabled,"Open"},
- /* [2] */ {1152, 59, 1232, 77}, Button {enabled,"Hidden"},
- /* [3] */ {163, 256, 181, 336}, Button {enabled,"Cancel"},
- /* [4] */ {39, 232, 59, 347}, UserItem {disabled},
- /* [5] */ {68, 256, 86, 336}, Button {enabled,"Eject"},
- /* [6] */ {93, 256, 111, 336}, Button {enabled,"Drive"},
- /* [7] */ {39, 12, 185, 230}, UserItem {enabled},
- /* [8] */ {39, 229, 185, 246}, UserItem {enabled},
- /* [9] */ {124, 252, 125, 340}, UserItem {disabled},
- /* [10] */ {1044, 20, 1145, 116}, StaticText {disabled,""}
- }
- };
-
-
- /* --------------------- Copy of Standard PutFile Dialog --------------------- */
-
- resource 'DLOG' (-3999, purgeable) {
- {0, 0, 184, 304},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- -3999,
- ""
- };
-
- resource 'DITL' (-3999, purgeable) {
- { /* array DITLarray: 8 elements */
- /* [1] */ {132, 218, 150, 288}, Button {enabled,"Save"},
- /* [2] */ {158, 218, 176, 288}, Button {enabled,"Cancel"},
- /* [3] */ {136, 14, 152, 197}, StaticText {disabled,"Save as:"},
- /* [4] */ {29, 198, 49, 302}, UserItem {disabled},
- /* [5] */ {56, 218, 74, 288}, Button {enabled,"Eject"},
- /* [6] */ {82, 218, 100, 288}, Button {enabled,"Drive"},
- /* [7] */ {157, 17, 173, 194}, EditText {enabled,""},
- /* [8] */ {29, 14, 127, 197}, UserItem {disabled}
- }
- };
-
-
- /* -------------------------- Used for custom SFPGetFile -------------------------- */
-
- resource 'DLOG' (rSFPGetFileDLOG, purgeable) {
- {0, 0, 200, 349},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 1000,
- ""
- };
-
- resource 'DITL' (rSFPGetFileDLOG, purgeable) {
- { /* array DITLarray: 13 elements */
- /* [1] */ {138, 256, 156, 336}, Button {enabled,"Open"};
- /* [2] */ {1152, 59, 1232, 77}, Button {enabled,"Hidden"};
- /* [3] */ {163, 256, 181, 336}, Button {enabled,"Cancel"};
- /* [4] */ {39, 252, 59, 347}, UserItem {disabled};
- /* [5] */ {68, 256, 86, 336}, Button {enabled,"Eject"};
- /* [6] */ {93, 256, 111, 336}, Button {enabled,"Drive"};
- /* [7] */ {39, 12, 180, 230}, UserItem {enabled};
- /* [8] */ {39, 229, 180, 245}, UserItem {enabled};
- /* [9] */ {124, 252, 125, 340}, UserItem {disabled};
- /* [10] */ {1044, 20, 1145, 116}, StaticText {disabled,""};
- /* [11] */ {1, 14, 20, 142}, RadioButton {enabled,"Text files only"};
- /* [12] */ {19, 14, 38, 176}, RadioButton {enabled,"Text and applications"};
- /* [13] */ {6, 256, 24, 336}, Button {enabled,"Quit"}
- }
- };
-
- /* -------------------------- Used for custom SFPPutFile -------------------------- */
-
- resource 'DLOG' (rSFPPutFileDLOG, purgeable) {
- {0, 0, 164, 304},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 1001,
- ""
- };
-
- resource 'DITL' (rSFPPutFileDLOG, purgeable) {
- { /* array DITLarray: 12 elements */
- /* [1] */ {74, 12, 92, 82}, Button {enabled,"Save"};
- /* [2] */ {74, 114, 92, 184}, Button {enabled,"Cancel"};
- /* [3] */ {12, 12, 28, 184}, StaticText {disabled,"Save as:"};
- /* [4] */ {16, 209, 34, 295}, UserItem {disabled};
- /* [5] */ {74, 217, 92, 287}, Button {enabled,"Eject"};
- /* [6] */ {101, 217, 119, 287}, Button {enabled,"Drive"};
- /* [7] */ {34, 14, 50, 182}, EditText {enabled,""};
- /* [8] */ {16, 200, 88, 201}, UserItem {disabled};
- /* [9] */ {128, 217, 146, 287}, Button {enabled,"Quit"};
- /* [10] */ {102, 11, 122, 108}, RadioButton {enabled,"Text Only"};
- /* [11] */ {129, 11, 149, 108}, RadioButton {enabled,"Formatted"};
- /* [12] */ {37, 202, 73, 303}, UserItem {disabled}
- }
- };
-
-
- /* -------------------------- Used for Setdirectory -------------------------- */
-
- resource 'DLOG' (rGetDirectoryDLOG, purgeable) {
- {0, 0, 217, 348},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 1002,
- ""
- };
-
- resource 'DITL' (rGetDirectoryDLOG, purgeable) {
- { /* array DITLarray: 13 elements */
- /* [1] */ {142, 256, 160, 336}, Button {enabled,"Open"},
- /* [2] */ {1152, 59, 1232, 77}, Button {enabled,"Hidden"},
- /* [3] */ {193, 256, 211, 336}, Button {enabled,"Cancel"},
- /* [4] */ {43, 232, 63, 347}, UserItem {disabled},
- /* [5] */ {72, 256, 90, 336}, Button {enabled,"Eject"},
- /* [6] */ {97, 256, 115, 336}, Button {enabled,"Drive"},
- /* [7] */ {43, 12, 189, 230}, UserItem {enabled},
- /* [8] */ {43, 229, 189, 246}, UserItem {enabled},
- /* [9] */ {128, 252, 129, 340}, UserItem {disabled},
- /* [10] */ {1044, 20, 1145, 116}, StaticText {disabled,""},
- /* [11] */ {167, 256, 185, 336}, Button {enabled,"Directory"},
- /* [12] */ {0, 30, 18, 215}, Button {enabled,"Select Current Directory:"},
- /* [13] */ {200, 20, 1145, 116}, StaticText {disabled,""}
- }
- };
-
-
- /* -------------------------- For custom MultiFile #1 -------------------------- */
-
- resource 'DLOG' (rMultiFileDLOG, purgeable) {
- {0, 0, 200, 348},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 1003,
- ""
- };
-
- resource 'DITL' (rMultiFileDLOG, purgeable) {
- { /* array DITLarray: 11 elements */
- /* [1] */ {138, 256, 156, 336}, Button {enabled,"Open"},
- /* [2] */ {1152, 59, 1232, 77}, Button {enabled,"Hidden"},
- /* [3] */ {163, 256, 181, 336}, Button {enabled,"Cancel"},
- /* [4] */ {39, 232, 59, 347}, UserItem {disabled}, /* disk name */
- /* [5] */ {68, 256, 86, 336}, Button {enabled,"Eject"},
- /* [6] */ {93, 256, 111, 336}, Button {enabled,"Drive"},
- /* [7] */ {1039, 12, 1185, 230}, UserItem {enabled}, /* filename list */
- /* [8] */ {1039, 229, 1185, 246}, UserItem {enabled}, /* unused */
- /* [9] */ {124, 252, 125, 340}, UserItem {disabled}, /* dotted line */
- /* [10] */ {1044, 20, 1145, 116}, StaticText {disabled,""},
- /* [11] */ {39, 12, 185, 230}, UserItem {enabled} /* my list item */
- }
- };
-
-
- /* -------------------------- For custom MultiFile #2 -------------------------- */
-
- resource 'DLOG' (rListsNPutFileDLOG, purgeable) {
- {0, 0, 262, 304},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 1004,
- ""
- };
-
- resource 'DITL' (rListsNPutFileDLOG, purgeable) {
- { /* array DITLarray: 9 elements */
- /* [1] */ {132, 218, 150, 288}, Button {enabled,"Save"},
- /* [2] */ {158, 218, 176, 288}, Button {enabled,"Cancel"},
- /* [3] */ {136, 14, 152, 197}, StaticText {disabled,"Save as:"},
- /* [4] */ {29, 198, 49, 302}, UserItem {disabled},
- /* [5] */ {56, 218, 74, 288}, Button {enabled,"Eject"},
- /* [6] */ {82, 218, 100, 288}, Button {enabled,"Drive"},
- /* [7] */ {157, 17, 173, 194}, EditText {enabled,""},
- /* [8] */ {29, 14, 127, 197}, UserItem {disabled},
- /* [9] */ {185, 14, 251, 197}, UserItem {disabled}
- }
- };
-
-
- /* -------------------------- For FileTypes Sample -------------------------- */
-
-
- resource 'DLOG' (rOptionsDLOG, purgeable) {
- {0, 0, 214, 304},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 1005,
- ""
- };
-
- resource 'DITL' (rOptionsDLOG, purgeable) {
- { /* array DITLarray: 10 elements */
- /* [1] */ {132, 218, 150, 288}, Button {enabled,"Save"},
- /* [2] */ {158, 218, 176, 288}, Button {enabled,"Cancel"},
- /* [3] */ {136, 14, 152, 197}, StaticText {disabled,"Save as:"},
- /* [4] */ {29, 198, 49, 302}, UserItem {disabled},
- /* [5] */ {56, 218, 74, 288}, Button {enabled,"Eject"},
- /* [6] */ {82, 218, 100, 288}, Button {enabled,"Drive"},
- /* [7] */ {157, 17, 173, 194}, EditText {enabled,""},
- /* [8] */ {29, 14, 127, 197}, UserItem {disabled},
- /* [9] */ {184, 218, 202, 288}, Button {enabled,"Options╔"},
- /* [10] */ {184, 14, 202, 197}, StaticText {disabled,""},
- }
- };
-
-
- resource 'DLOG' (rOptionsSubDLOG, "Options Dialog", purgeable) {
- {40, 40, 192, 392},
- dBoxProc,
- invisible,
- noGoAway,
- 0x0,
- 2000,
- "New Dialog"
- };
-
- resource 'DITL' (rOptionsSubDLOG, "Options Dialog", purgeable) {
- { /* array DITLarray: 11 elements */
- /* [1] */ {8, 272, 28, 332}, Button {enabled,"OK"},
- /* [2] */ {32, 272, 52, 332}, Button {enabled,"Cancel"},
- /* [3] */ {40, 24, 56, 120}, RadioButton {enabled,"ZowiePaint"},
- /* [4] */ {64, 24, 80, 120}, RadioButton {enabled,"PICT2"},
- /* [5] */ {88, 24, 104, 120}, RadioButton {enabled,"PICT"},
- /* [6] */ {112, 24, 128, 120}, RadioButton {enabled,"MacPaint"},
- /* [7] */ {64, 152, 80, 248}, RadioButton {enabled,"TIFF"},
- /* [8] */ {88, 152, 104, 248}, RadioButton {enabled,"PixelPaint"},
- /* [9] */ {112, 152, 128, 248}, RadioButton {enabled,"Pffffff"},
- /* [10] */ {15, 16, 137, 263}, UserItem {disabled},
- /* [11] */ {8, 32, 28, 92}, StaticText {disabled,"Formats"}
- }
- };
-
-