home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Snippets / StandardGetFolder / StandardGetFolder source / SGF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-22  |  3.5 KB  |  95 lines  |  [TEXT/KAHL]

  1. /*************************************************************************************************
  2.  
  3. SGF.h -- Copyright Chris Larson, 1993 -- All rights reserved.
  4.          Based partly upon StandardGetFolder example by Steve Falkenburg (MacDTS)
  5.          and partly on the code in Inside Macintosh: Files.
  6.                        
  7.          Dialog box layouts taken from Inside Macintosh: Files.
  8.          
  9.  This file contains the declarations necessary to compile the StandardGetFolder.c file.
  10.  It should only be #included by StandardGetFolder.c. To use the StandardGetFolder call,
  11.  #include the StandardGetFolder.h file in your source.
  12.  
  13.     Bug Reports/Comments to cklarson@engr.ucdavis.edu
  14.  
  15.     Version 1.0
  16.  
  17. *************************************************************************************************/
  18.  
  19. #ifndef __CKLSGF__
  20. #define __CKLSGF__
  21.  
  22. // ----------
  23. // Include Files
  24. // ----------
  25.  
  26. #include <Aliases.h>
  27. #include <Finder.h>
  28. #include <Folders.h>
  29. #include <GestaltEqu.h>
  30. #include <Packages.h>
  31. #include "PStrings.h"            // My set of pascal string routines
  32. #include <Traps.h>
  33.  
  34. // ----------
  35. // Constant Declarations
  36. // ----------
  37.  
  38. #define rGetFolderDialogID            16042    // Res ID of the StandardGetFolder dialog.
  39.  
  40. #define rLeftStringID                16000    // Res ID of the button title wrapper string, left side.
  41. #define rRightStringID                16001    // Res ID of the button title wrapper string, right side.
  42. #define rDesktopNameStringID        16002    // Res ID of the desktop folder name substitute string.
  43. #define rSelectKeyStringID            16003    // Res ID of the string holding the select key character.
  44.  
  45. #define sfItemPromptStatText        10        // Item number of the prompt.
  46. #define sfItemSelectFolderButton    11        // Item number of the select button.
  47.  
  48. #define kIsFolderFlag                0x10    // flag indicating the file is a directory.
  49.  
  50. #define kIsAliasFlag                0x8000    // flag indicating that the file is an alias.
  51. #define kInvisibleFlag                0x4000    // flag indicating that the file is invisible.
  52.  
  53. #define kNullVol                    0x8000    // Null value for volume reference numbers (TN 77).
  54.  
  55. #define kAllFiles                    -1        // Constant specifying that all file types be filtered.
  56.  
  57. #define kInFront                    ((WindowPtr)-1) // Specifies that this window appear in front.
  58.  
  59. #define kHitButtonDelay                8L        // The number of ticks to fake a button press.
  60.  
  61. #define kTitleOffset                8        // Padding length for the button title.
  62.  
  63. #define kEnterKey                    0x03    // Character code of the enter key.
  64. #define kReturnKey                    0x0D    // Character code of the return key.
  65.  
  66. #define kInverted                    1        // highlight value of a pressed button.
  67. #define kNormal                        0        // Highlight value of an unpressed button.
  68. #define kInactive                    255        // Constant indicating to dim a control.
  69.  
  70. #define kExistingPopUpStrings        -6045    // Resource ID of strings to replace.
  71. #define kNewPopUpStrings            6045    // Resource ID of replacement strings.
  72.  
  73. // ----------
  74. // Variable Types
  75. // ----------
  76.  
  77. typedef void (*WindowFunc)(EventRecord*);    // Declaration of pointer to application window function.
  78.  
  79. // ----------
  80. // Function Prototypes
  81. // ----------
  82.  
  83. pascal Boolean GetFolderFileFilterYD (CInfoPBPtr paramBlock, StandardFileReply *myData);
  84. pascal short GetFolderDialogHookYD (short itemHit, DialogPtr theDialog, StandardFileReply *myData);
  85. pascal Boolean GetFolderModalFilterYD (DialogPtr theDialog, EventRecord *theEvent, short *itemHit,
  86.                                         StandardFileReply *myData);
  87.  
  88. void CallAppWindowFunction (EventRecord *theEvent);
  89. void SetButtonTitle (ControlHandle theButton, Str255 newTitle, Rect *buttonRect, DialogPtr theDialog);
  90. void HitButton (DialogPtr theDialog, short itemNumber);
  91.  
  92. pascal Handle Patch (ResType type, short id);
  93.  
  94. #endif
  95.