home *** CD-ROM | disk | FTP | other *** search
- /* Plug-in module utility routines */
-
- /* Copyright 1993 by Adobe Systems, Inc. All rights reserved. */
-
- /* The routines in this module provide a collection of utilities for doing
- * things like centering dialogs, etc.. They expect that the host's A5-world
- * is the currently active A5-world.
- */
-
- #ifndef __DialogUtilities__
- #define __DialogUtilities__
-
- #include <Dialogs.h>
- #include <StdDef.h>
- #include <Types.h>
-
- #include "PIGeneral.h"
-
- /*****************************************************************************/
-
- /* Set the cursor to the arrow cursor. */
-
- void SetArrowCursor ();
-
- /*****************************************************************************/
-
- /* Centers a dialog template 1/3 of the way down on the main screen. */
-
- void CenterDialog (DialogTHndl dt);
-
- /* The following routine sets up a moveable modal dialog. */
-
- void SetUpMoveableModal (DialogTHndl dt, OSType hostSig);
-
- /* The following routine takes the place of ModalDialog in running moveable
- * modal dialogs.
- */
-
- void MoveableModalDialog (DialogPtr dp,
- ProcessEventProc processEvent,
- ModalFilterProcPtr filter,
- short *item);
-
- /* The following routine displays a centered alert. */
-
- short ShowAlert (short alertID);
-
- /* The following routine displays a standard about box dialog. */
-
- void ShowAbout (short dialogID);
-
- /*****************************************************************************/
-
- /* Set an item hook so that it will outline the OK button in a dialog. */
-
- void SetOutlineOKHook (DialogPtr dp, short hookItem);
-
- /* The following routine sets a user item to be a group box. It expects
- the next item to be the title for the group box. */
-
- void SetOutlineGroup (DialogPtr dp, short groupItem);
-
- /*****************************************************************************/
-
- /* The following routine selects an edit text item. */
-
- void SelectTextItem (DialogPtr dp, short item);
-
- /* The following routine sets the text of a text item. */
-
- void StuffText (DialogPtr dp, short item, Str255 text);
-
- /* The following routine extracts the text of a text item. */
-
- void FetchText (DialogPtr dp, short item, Str255 text);
-
- /* The following routine stuffs a numeric value into a text field. */
-
- void StuffNumber (DialogPtr dp, short item, long value);
-
- /* Here is the corresponding routine to retrieve the value from a text
- field. It will do range checking and validate that it has been
- handed a number. If it has not been handed a number, it brings up
- an appropriate error dialog, inserts an appropriately pinned value,
- and selects the item.
-
- It returns TRUE iff it gets a valid value in the field. */
-
- Boolean FetchNumber (DialogPtr dp,
- short item,
- long min,
- long max,
- long *value);
-
- /*****************************************************************************/
-
- /* Set the state of a check box (or radio button). */
-
- void SetCheckBoxState (DialogPtr dp, short item, Boolean checkIt);
-
- /* Determine the state of a check box (or radio button). */
-
- Boolean GetCheckBoxState (DialogPtr dp, short item);
-
- /* Set a radio group (from first to last item) to reflect the selection. */
-
- void SetRadioGroupState (DialogPtr dp, short first, short last, short item);
-
- /* Get the selected button within a radio group. */
-
- short GetRadioGroupState (DialogPtr dp, short first, short last);
-
- /* Utility routine to disable a control. */
-
- void DisableControl (DialogPtr dp, short item);
-
- /* Utility routine to enable a control. */
-
- void EnableControl (DialogPtr dp, short item);
-
- /* Utility routine to invalidate an item. */
-
- void InvalItem (DialogPtr dp, short item);
-
- /*****************************************************************************/
-
- /* Little routine to flash a button set off by a keystroke. */
-
- void FlashDialogButton (DialogPtr dp, short item);
-
- /*****************************************************************************/
-
- #endif
-