home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / 第1特集Plug-in / Photoshop / Plug-in_Kit_2.5.1.sit / Plug-in_Kit_2.5.1 / Code / DialogUtilities.h < prev    next >
Text File  |  1993-04-26  |  4KB  |  134 lines

  1. /* Plug-in module utility routines */
  2.  
  3. /* Copyright 1993 by Adobe Systems, Inc.  All rights reserved. */
  4.  
  5. /* The routines in this module provide a collection of utilities for doing
  6.  * things like centering dialogs, etc.. They expect that the host's A5-world
  7.  * is the currently active A5-world.
  8.  */
  9.  
  10. #ifndef __DialogUtilities__
  11. #define __DialogUtilities__
  12.  
  13. #include <Dialogs.h>
  14. #include <StdDef.h>
  15. #include <Types.h>
  16.  
  17. #include "PIGeneral.h"
  18.  
  19. /*****************************************************************************/
  20.  
  21. /* Set the cursor to the arrow cursor. */
  22.  
  23. void SetArrowCursor ();
  24.  
  25. /*****************************************************************************/
  26.  
  27. /* Centers a dialog template 1/3 of the way down on the main screen. */
  28.  
  29. void CenterDialog (DialogTHndl dt);
  30.  
  31. /* The following routine sets up a moveable modal dialog. */
  32.  
  33. void SetUpMoveableModal (DialogTHndl dt, OSType hostSig);
  34.                          
  35. /* The following routine takes the place of ModalDialog in running moveable
  36.  * modal dialogs.
  37.  */
  38.                          
  39. void MoveableModalDialog (DialogPtr dp,
  40.                           ProcessEventProc processEvent,
  41.                           ModalFilterProcPtr filter,
  42.                           short *item);
  43.                           
  44. /* The following routine displays a centered alert. */
  45.  
  46. short ShowAlert (short alertID);
  47.  
  48. /* The following routine displays a standard about box dialog. */
  49.  
  50. void ShowAbout (short dialogID);
  51.  
  52. /*****************************************************************************/
  53.  
  54. /* Set an item hook so that it will outline the OK button in a dialog. */
  55.  
  56. void SetOutlineOKHook (DialogPtr dp, short hookItem);
  57.  
  58. /* The following routine sets a user item to be a group box.  It expects
  59.    the next item to be the title for the group box. */
  60.  
  61. void SetOutlineGroup (DialogPtr dp, short groupItem);
  62.  
  63. /*****************************************************************************/
  64.  
  65. /* The following routine selects an edit text item. */
  66.  
  67. void SelectTextItem (DialogPtr dp, short item);
  68.  
  69. /* The following routine sets the text of a text item. */
  70.  
  71. void StuffText (DialogPtr dp, short item, Str255 text);
  72.  
  73. /* The following routine extracts the text of a text item. */
  74.  
  75. void FetchText (DialogPtr dp, short item, Str255 text);
  76.  
  77. /* The following routine stuffs a numeric value into a text field. */
  78.  
  79. void StuffNumber (DialogPtr dp, short item, long value);
  80.  
  81. /* Here is the corresponding routine to retrieve the value from a text
  82.    field.  It will do range checking and validate that it has been
  83.    handed a number.  If it has not been handed a number, it brings up
  84.    an appropriate error dialog, inserts an appropriately pinned value,
  85.    and selects the item.
  86.   
  87.    It returns TRUE iff it gets a valid value in the field. */
  88.  
  89.  Boolean FetchNumber (DialogPtr dp,
  90.                        short item,
  91.                       long min,
  92.                       long max,
  93.                       long *value);
  94.  
  95. /*****************************************************************************/
  96.  
  97. /* Set the state of a check box (or radio button). */
  98.  
  99. void SetCheckBoxState (DialogPtr dp, short item, Boolean checkIt);
  100.  
  101. /* Determine the state of a check box (or radio button). */
  102.  
  103. Boolean GetCheckBoxState (DialogPtr dp, short item);
  104.  
  105. /* Set a radio group (from first to last item) to reflect the selection. */
  106.  
  107. void SetRadioGroupState (DialogPtr dp, short first, short last, short item);
  108.                          
  109. /* Get the selected button within a radio group. */
  110.  
  111. short GetRadioGroupState (DialogPtr dp, short first, short last);
  112.  
  113. /* Utility routine to disable a control. */
  114.  
  115. void DisableControl (DialogPtr dp, short item);
  116.  
  117. /* Utility routine to enable a control. */
  118.  
  119. void EnableControl (DialogPtr dp, short item);
  120.  
  121. /* Utility routine to invalidate an item. */
  122.  
  123. void InvalItem (DialogPtr dp, short item);
  124.  
  125. /*****************************************************************************/
  126.  
  127. /* Little routine to flash a button set off by a keystroke. */
  128.  
  129. void FlashDialogButton (DialogPtr dp, short item);
  130.  
  131. /*****************************************************************************/
  132.  
  133. #endif
  134.