home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Pascal Sample 3.0B10 / Source / SampleDialog.p < prev    next >
Encoding:
Text File  |  1993-10-13  |  3.8 KB  |  137 lines  |  [TEXT/MPS ]

  1. (******************************************************************************
  2. *
  3. *    Apple Macintosh Developer Technical Support
  4. *
  5. *    Interfaces for the dialog utilities
  6. *
  7. *    Program:    Sample 3.0
  8. *    FILE:        SampleDialog - Pascal implementation
  9. *
  10. *    by:            Matt Deatherage
  11. *
  12. *    Copyright © 1988-1993 Apple Computer, Inc.
  13. *    All rights reserved.
  14. *
  15. *******************************************************************************
  16. * This unit, the "SampleDialog" unit, implements the modal dialog that lets
  17. * you change characteristics of a given circle.  The dialog includes two
  18. * pop-up menus, two editable text fields, eight checkboxes, three buttons
  19. * and one circle user item.
  20. *  
  21. * Since we want Sample to run under 6.0.7 or later, we don't use the Pop-Up
  22. * CDEF built into the Communications Toolbox (or in System 7.0), because
  23. * we'd have to duplicate its functionality if it wasn't present.  To this
  24. * end, this unit includes utility routines to draw a pop-up as a user item,
  25. * to Handle editable text tied to pop-ups, to turn a QuickDraw txFace byte
  26. * into eight checkboxes and more besides.
  27. *
  28. * It's usually better to use system functions when they're available, and
  29. * it would be better if this code used the pop-up CDEF if it were available,
  30. * since using that code automatically gets you new features as they're added
  31. * to the code in the system.
  32. ******************************************************************************)
  33.  
  34. UNIT SampleDialog;
  35.  
  36. INTERFACE
  37.  
  38. (*******************************************************************************
  39. * Used Units
  40. *******************************************************************************)
  41.  
  42. USES Traps, Menus, Fonts, Packages, Resources, ToolUtils, PrintTraps, AppleTalk,
  43.      Processes, PPCToolbox, EPPC, Notification, AppleEvents, SampleUtilities,
  44.      TrafficLights, Features;
  45.  
  46. (*******************************************************************************
  47. * Constants
  48. *******************************************************************************)
  49.  
  50. CONST
  51.  
  52.     { Constants for the dialog templates }
  53.  
  54.     circleDialogID = 130;
  55.     prefsID = 132;
  56.  
  57.     rSizeTooBigAlert = 131;
  58.  
  59.     rOnlyTenCirclesID = 4000;
  60.     rLessThan500Please = 4001;
  61.     rInsetTooMuch = 4002;
  62.     rInsetMustBeChanged = 4003;
  63.  
  64.     { Symbolic constants for item numbers used in both dialogs }
  65.  
  66.     dialogTitle = 3;
  67.  
  68.     { Item ID numbers in the "Modify Circle" dialog }
  69.  
  70.     fontTitle = 4;
  71.     fontPopUp = 5;
  72.     sizeTitle = 6;
  73.     sizeEditText = 7;
  74.     sizePopUp = 8;
  75.     styleTitle = 9;
  76.     boldBox = 10;
  77.     italicBox = 11;
  78.     underlineBox = 12;
  79.     outlineBox = 13;
  80.     shadowBox = 14;
  81.     condensedBox = 15;
  82.     extendedBox = 16;
  83.     plainBox = 17;
  84.     textTitle = 18;
  85.     textEditText = 19;
  86.     colorButton = 20;
  87.     circleUserItem = 21;
  88.     defaultUserItem = 22;
  89.  
  90.     { Item ID numbers in the "Preferences" dialog }
  91.  
  92.     numCirclesEditText = 4;
  93.     maxCirclesTitle = 5;
  94.     rectSizeEditText = 6;
  95.     rectSizeTitle = 7;
  96.     circleInsetEditText = 8;
  97.     circleInsetTitle = 9;
  98.     prefsUserItem = 10;
  99.     forNewDocsTitle = 11;
  100.  
  101.     { Resource IDs for the menus }
  102.  
  103.     mFonts = 132;
  104.     mSize = 133;
  105.  
  106.     { Resource IDs for other things }
  107.  
  108.     rPopDownArrowID = 1000;
  109.  
  110. (*******************************************************************************
  111. *
  112. * DoCircleOptions - present the "Modify Circle" dialog
  113. *
  114. * This routine takes a pointer to a circle record and presents a robust
  115. * dialog allowing the user to modify it.  It returns TRUE if there were
  116. * changes to the circle.
  117. *
  118. *******************************************************************************)
  119.  
  120. FUNCTION DoCircleOptions(VAR circle: CircleRec): BOOLEAN;
  121.  
  122. (*******************************************************************************
  123. *
  124. * DoEditPreferences - allow the user to edit the application preferences.
  125. *
  126. *******************************************************************************)
  127.  
  128. PROCEDURE DoEditPreferences;
  129.  
  130. IMPLEMENTATION
  131.  
  132. {$I SampleDialog.inc1.p}
  133.  
  134. END. {SampleDialog unit }
  135.