|
Mac OS 9
|
Dialog Manager interfaces. More...
#include <MacTypes.h>#include <MixedMode.h>#include <Events.h>#include <MacWindows.h>#include <TextEdit.h>#include <Controls.h>#include <MacErrors.h>#include <CarbonEvents.h>Go to the source code of this file.
Data Structures | |
| struct | DialogRecord |
| struct | DialogTemplate |
| struct | AlertTemplate |
| struct | AlertStdAlertParamRec |
| struct | AlertStdCFStringAlertParamRec |
Macros | |
| #define | NewSoundUPP(userRoutine) |
| #define | NewModalFilterUPP(userRoutine) |
| #define | NewModalFilterYDUPP(userRoutine) |
| #define | NewUserItemUPP(userRoutine) |
| #define | DisposeSoundUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeModalFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeModalFilterYDUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeUserItemUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeSoundUPP(soundNumber, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppSoundProcInfo, (soundNumber)) |
| #define | InvokeModalFilterUPP(theDialog, theEvent, itemHit, userUPP) |
| #define | InvokeModalFilterYDUPP(theDialog, theEvent, itemHit, yourDataPtr, userUPP) |
| #define | InvokeUserItemUPP(theDialog, itemNo, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppUserItemProcInfo, (theDialog), (itemNo)) |
| #define | NewSoundProc(userRoutine) NewSoundUPP(userRoutine) |
| #define | NewModalFilterProc(userRoutine) NewModalFilterUPP(userRoutine) |
| #define | NewModalFilterYDProc(userRoutine) NewModalFilterYDUPP(userRoutine) |
| #define | NewUserItemProc(userRoutine) NewUserItemUPP(userRoutine) |
| #define | CallSoundProc(userRoutine, soundNumber) InvokeSoundUPP(soundNumber, userRoutine) |
| #define | CallModalFilterProc(userRoutine, theDialog, theEvent, itemHit) InvokeModalFilterUPP(theDialog, theEvent, itemHit, userRoutine) |
| #define | CallModalFilterYDProc(userRoutine, theDialog, theEvent, itemHit, yourDataPtr) InvokeModalFilterYDUPP(theDialog, theEvent, itemHit, yourDataPtr, userRoutine) |
| #define | CallUserItemProc(userRoutine, theDialog, itemNo) InvokeUserItemUPP(theDialog, itemNo, userRoutine) |
| #define | GetDialogWindow(dialog) ((WindowRef)dialog) |
| #define | GetDialogTextEditHandle(dialog) (((DialogPeek)dialog)->textH) |
| #define | GetDialogDefaultItem(dialog) (((DialogPeek)dialog)->aDefItem) |
| #define | GetDialogCancelItem(dialog) (((DialogPeek)dialog)->editOpen) |
| #define | GetDialogKeyboardFocusItem(dialog) |
| #define | SetPortDialogPort(dialog) (MacSetPort((GrafPtr)dialog)) |
| #define | GetDialogPort(dialog) ((CGrafPtr)dialog) |
| #define | GetDialogFromWindow(window) ((DialogRef)window) |
Typedefs | |
| typedef SInt16 | DITLMethod |
| typedef SInt16 | StageList |
| typedef DialogPtr | DialogRef |
| typedef struct DialogRecord | DialogRecord |
| typedef DialogRecord * | DialogPeek |
| typedef struct DialogTemplate | DialogTemplate |
| typedef DialogTemplate * | DialogTPtr |
| typedef DialogTPtr * | DialogTHndl |
| typedef struct AlertTemplate | AlertTemplate |
| typedef AlertTemplate * | AlertTPtr |
| typedef AlertTPtr * | AlertTHndl |
| typedef SInt16 | DialogItemIndexZeroBased |
| typedef SInt16 | DialogItemIndex |
| typedef SInt16 | DialogItemType |
| typedef EventRecord * | theEvent |
| typedef EventRecord DialogItemIndex * | itemHit |
| typedef EventRecord short void * | yourDataPtr |
| typedef DialogItemIndex | itemNo |
| typedef DialogRef | theDialog |
| typedef QTModelessCallbackProcPtr | QTModelessCallbackUPP |
| typedef SInt16 | AlertType |
| typedef struct AlertStdAlertParamRec | AlertStdAlertParamRec |
| typedef AlertStdAlertParamRec * | AlertStdAlertParamPtr |
| typedef struct AlertStdCFStringAlertParamRec | AlertStdCFStringAlertParamRec |
| typedef AlertStdCFStringAlertParamRec * | AlertStdCFStringAlertParamPtr |
Enumerations | |
| enum | { kControlDialogItem = 4 , kButtonDialogItem = kControlDialogItem | 0 , kCheckBoxDialogItem = kControlDialogItem | 1 , kRadioButtonDialogItem = kControlDialogItem | 2 , kResourceControlDialogItem = kControlDialogItem | 3 , kStaticTextDialogItem = 8 , kEditTextDialogItem = 16 , kIconDialogItem = 32 , kPictureDialogItem = 64 , kUserDialogItem = 0 , kHelpDialogItem = 1 , kItemDisableBit = 128 } |
| enum | { ctrlItem = 4 , btnCtrl = 0 , chkCtrl = 1 , radCtrl = 2 , resCtrl = 3 , statText = 8 , editText = 16 , iconItem = 32 , picItem = 64 , userItem = 0 , itemDisable = 128 } |
| enum | { kStdOkItemIndex = 1 , kStdCancelItemIndex = 2 , ok = kStdOkItemIndex , cancel = kStdCancelItemIndex } |
| enum | { kStopIcon = 0 , kNoteIcon = 1 , kCautionIcon = 2 , stopIcon = kStopIcon , noteIcon = kNoteIcon , cautionIcon = kCautionIcon } |
| enum | { overlayDITL = 0 , appendDITLRight = 1 , appendDITLBottom = 2 } |
| enum | { uppSoundProcInfo = 0x00000080 } |
| enum | { uppModalFilterProcInfo = 0x00000FD0 } |
| enum | { uppModalFilterYDProcInfo = 0x00003FD0 } |
| enum | { uppUserItemProcInfo = 0x000002C0 } |
| enum | { kAlertStopAlert = 0 , kAlertNoteAlert = 1 , kAlertCautionAlert = 2 , kAlertPlainAlert = 3 } |
| enum | { kAlertDefaultOKText = -1 , kAlertDefaultCancelText = -1 , kAlertDefaultOtherText = -1 } |
| enum | { kAlertStdAlertOKButton = 1 , kAlertStdAlertCancelButton = 2 , kAlertStdAlertOtherButton = 3 , kAlertStdAlertHelpButton = 4 } |
| enum | { kDialogFlagsUseThemeBackground = (1 << 0) , kDialogFlagsUseControlHierarchy = (1 << 1) , kDialogFlagsHandleMovableModal = (1 << 2) , kDialogFlagsUseThemeControls = (1 << 3) } |
| enum | { kAlertFlagsUseThemeBackground = (1 << 0) , kAlertFlagsUseControlHierarchy = (1 << 1) , kAlertFlagsAlertIsMovable = (1 << 2) , kAlertFlagsUseThemeControls = (1 << 3) } |
| enum | { kDialogFontNoFontStyle = 0 , kDialogFontUseFontMask = 0x0001 , kDialogFontUseFaceMask = 0x0002 , kDialogFontUseSizeMask = 0x0004 , kDialogFontUseForeColorMask = 0x0008 , kDialogFontUseBackColorMask = 0x0010 , kDialogFontUseModeMask = 0x0020 , kDialogFontUseJustMask = 0x0040 , kDialogFontUseAllMask = 0x00FF , kDialogFontAddFontSizeMask = 0x0100 , kDialogFontUseFontNameMask = 0x0200 , kDialogFontAddToMetaFontMask = 0x0400 } |
| enum | { kDialogFontUseThemeFontIDMask = 0x0080 } |
| enum | { kHICommandOther } |
| enum | { kStdCFStringAlertVersionOne } |
| enum | { kStdAlertDoNotDisposeSheet = 1 << 0 , kStdAlertDoNotAnimateOnDefault = 1 << 1 , kStdAlertDoNotAnimateOnCancel = 1 << 2 , kStdAlertDoNotAnimateOnOther = 1 << 3 } |
Functions | |
| typedef | CALLBACK_API (void, SoundProcPtr)(SInt16 soundNumber) |
| typedef | CALLBACK_API (Boolean, ModalFilterProcPtr)(DialogRef theDialog |
| typedef | CALLBACK_API (Boolean, ModalFilterYDProcPtr)(DialogRef theDialog |
| typedef | CALLBACK_API (void, UserItemProcPtr)(DialogRef theDialog |
| typedef | STACK_UPP_TYPE (SoundProcPtr) SoundUPP |
| typedef | STACK_UPP_TYPE (ModalFilterProcPtr) ModalFilterUPP |
| typedef | STACK_UPP_TYPE (ModalFilterYDProcPtr) ModalFilterYDUPP |
| typedef | STACK_UPP_TYPE (UserItemProcPtr) UserItemUPP |
| SoundUPP | NewSoundUPP (SoundProcPtr userRoutine) |
| ModalFilterUPP | NewModalFilterUPP (ModalFilterProcPtr userRoutine) |
| ModalFilterYDUPP | NewModalFilterYDUPP (ModalFilterYDProcPtr userRoutine) |
| UserItemUPP | NewUserItemUPP (UserItemProcPtr userRoutine) |
| void | DisposeSoundUPP (SoundUPP userUPP) |
| void | DisposeModalFilterUPP (ModalFilterUPP userUPP) |
| void | DisposeModalFilterYDUPP (ModalFilterYDUPP userUPP) |
| void | DisposeUserItemUPP (UserItemUPP userUPP) |
| void | InvokeSoundUPP (SInt16 soundNumber, SoundUPP userUPP) |
| Boolean | InvokeModalFilterUPP (DialogRef theDialog, EventRecord *theEvent, DialogItemIndex *itemHit, ModalFilterUPP userUPP) |
| Boolean | InvokeModalFilterYDUPP (DialogRef theDialog, EventRecord *theEvent, short *itemHit, void *yourDataPtr, ModalFilterYDUPP userUPP) |
| void | InvokeUserItemUPP (DialogRef theDialog, DialogItemIndex itemNo, UserItemUPP userUPP) |
| typedef | CALLBACK_API_C (void, QTModelessCallbackProcPtr)(EventRecord *theEvent |
| void | SetModelessDialogCallbackProc (DialogRef theDialog, QTModelessCallbackProcPtr callbackProc) |
| OSErr | GetDialogControlNotificationProc (void *theProc) |
| void | SetDialogMovableModal (DialogRef theDialog) |
| void * | GetDialogParent (DialogRef theDialog) |
| void | InitDialogs (void *ignored) |
| Initialize before using Dialog Manager functions. More... | |
| if (sndNum==0) return | |
| HLock (mySound) | |
| HUnlock (mySound) | |
| DialogRef | NewDialog (void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle items) |
| DialogRef | GetNewDialog (SInt16 dialogID, void *dStorage, WindowRef behind) |
| DialogRef | NewColorDialog (void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle items) |
| void | CloseDialog (DialogRef theDialog) |
| void | DisposeDialog (DialogRef theDialog) |
| void | ModalDialog (ModalFilterUPP modalFilter, DialogItemIndex *itemHit) |
| Boolean | IsDialogEvent (const EventRecord *theEvent) |
| Check if an event belongs to a dialog window. More... | |
| Boolean | DialogSelect (const EventRecord *theEvent, DialogRef *theDialog, DialogItemIndex *itemHit) |
| void | DrawDialog (DialogRef theDialog) |
| void | UpdateDialog (DialogRef theDialog, RgnHandle updateRgn) |
| void | HideDialogItem (DialogRef theDialog, DialogItemIndex itemNo) |
| void | ShowDialogItem (DialogRef theDialog, DialogItemIndex itemNo) |
| DialogItemIndexZeroBased | FindDialogItem (DialogRef theDialog, Point thePt) |
| void | DialogCut (DialogRef theDialog) |
| void | DialogPaste (DialogRef theDialog) |
| void | DialogCopy (DialogRef theDialog) |
| void | DialogDelete (DialogRef theDialog) |
| DialogItemIndex | Alert (SInt16 alertID, ModalFilterUPP modalFilter) |
| DialogItemIndex | StopAlert (SInt16 alertID, ModalFilterUPP modalFilter) |
| DialogItemIndex | NoteAlert (SInt16 alertID, ModalFilterUPP modalFilter) |
| DialogItemIndex | CautionAlert (SInt16 alertID, ModalFilterUPP modalFilter) |
| void | GetDialogItem (DialogRef theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box) |
| void | SetDialogItem (DialogRef theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box) |
| void | ParamText (ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3) |
| void | SelectDialogItemText (DialogRef theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel) |
| void | GetDialogItemText (Handle item, Str255 text) |
| void | SetDialogItemText (Handle item, ConstStr255Param text) |
| SInt16 | GetAlertStage (void) |
| void | SetDialogFont (SInt16 fontNum) |
| void | ResetAlertStage (void) |
| void | GetParamText (StringPtr param0, StringPtr param1, StringPtr param2, StringPtr param3) |
| DialogRef | newdialog (void *dStorage, const Rect *boundsRect, const char *title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle items) |
| DialogRef | newcolordialog (void *dStorage, const Rect *boundsRect, const char *title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle items) |
| void | paramtext (const char *param0, const char *param1, const char *param2, const char *param3) |
| void | getdialogitemtext (Handle item, char *text) |
| void | setdialogitemtext (Handle item, const char *text) |
| DialogItemIndexZeroBased | finddialogitem (DialogRef theDialog, Point *thePt) |
| void | AppendDITL (DialogRef theDialog, Handle theHandle, DITLMethod method) |
| DialogItemIndex | CountDITL (DialogRef theDialog) |
| void | ShortenDITL (DialogRef theDialog, DialogItemIndex numberItems) |
| OSStatus | InsertDialogItem (DialogRef theDialog, DialogItemIndex afterItem, DialogItemType itemType, Handle itemHandle, const Rect *box) |
| OSStatus | RemoveDialogItems (DialogRef theDialog, DialogItemIndex itemNo, DialogItemIndex amountToRemove, Boolean disposeItemData) |
| Boolean | StdFilterProc (DialogRef theDialog, EventRecord *event, DialogItemIndex *itemHit) |
| OSErr | GetStdFilterProc (ModalFilterUPP *theProc) |
| GetStdFilterProc Get a pointer to the Dialog Manager's standard dialog filter. More... | |
| OSErr | SetDialogDefaultItem (DialogRef theDialog, DialogItemIndex newItem) |
| SetDialogDefaultItem Tell Dialog Mgr which item in dialog should be default item. More... | |
| OSErr | SetDialogCancelItem (DialogRef theDialog, DialogItemIndex newItem) |
| SetDialogCancelItem Tell Dialog Mgr which item should be default cancel item. More... | |
| OSErr | SetDialogTracksCursor (DialogRef theDialog, Boolean tracks) |
| DialogRef | NewFeaturesDialog (void *inStorage, const Rect *inBoundsRect, ConstStr255Param inTitle, Boolean inIsVisible, SInt16 inProcID, WindowRef inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags) |
| OSErr | AutoSizeDialog (DialogRef inDialog) |
| OSErr | StandardAlert (AlertType inAlertType, ConstStr255Param inError, ConstStr255Param inExplanation, const AlertStdAlertParamRec *inAlertParam, SInt16 *outItemHit) |
| OSStatus | GetStandardAlertDefaultParams (AlertStdCFStringAlertParamPtr param, UInt32 version) |
| OSStatus | CreateStandardAlert (AlertType alertType, CFStringRef error, CFStringRef explanation, const AlertStdCFStringAlertParamRec *param, DialogRef *outAlert) |
| OSStatus | RunStandardAlert (DialogRef inAlert, ModalFilterUPP filterProc, DialogItemIndex *outItemHit) |
| OSStatus | CreateStandardSheet (AlertType alertType, CFStringRef error, CFStringRef explanation, const AlertStdCFStringAlertParamRec *param, EventTargetRef notifyTarget, DialogRef *outSheet) |
| OSStatus | CloseStandardSheet (DialogRef inSheet, UInt32 inResultCommand) |
| OSErr | GetDialogItemAsControl (DialogRef inDialog, SInt16 inItemNo, ControlRef *outControl) |
| OSErr | MoveDialogItem (DialogRef inDialog, SInt16 inItemNo, SInt16 inHoriz, SInt16 inVert) |
| OSErr | SizeDialogItem (DialogRef inDialog, SInt16 inItemNo, SInt16 inWidth, SInt16 inHeight) |
| OSErr | AppendDialogItemList (DialogRef dialog, SInt16 ditlID, DITLMethod method) |
| OSStatus | SetDialogTimeout (DialogRef inDialog, SInt16 inButtonToPress, UInt32 inSecondsToWait) |
| OSStatus | GetDialogTimeout (DialogRef inDialog, SInt16 *outButtonToPress, UInt32 *outSecondsToWait, UInt32 *outSecondsRemaining) |
| OSStatus | SetModalDialogEventMask (DialogRef inDialog, EventMask inMask) |
| OSStatus | GetModalDialogEventMask (DialogRef inDialog, EventMask *outMask) |
| WindowRef | GetDialogWindow (DialogRef dialog) |
| TEHandle | GetDialogTextEditHandle (DialogRef dialog) |
| SInt16 | GetDialogDefaultItem (DialogRef dialog) |
| SInt16 | GetDialogCancelItem (DialogRef dialog) |
| SInt16 | GetDialogKeyboardFocusItem (DialogRef dialog) |
| void | SetPortDialogPort (DialogRef dialog) |
| CGrafPtr | GetDialogPort (DialogRef dialog) |
| void | CouldDialog (SInt16 dialogID) |
| void | FreeDialog (SInt16 dialogID) |
| void | CouldAlert (SInt16 alertID) |
| void | FreeAlert (SInt16 alertID) |
Variables | |
| Handle | mySound |
| Set up to use non-standard sounds for alerts. More... | |
| OSErr | err = SndNewChannel(&myChan, 0, 0, 0L) |
| </pre > *par | Copyright |
Dialog Manager interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define GetDialogKeyboardFocusItem | ( | dialog | ) |
| #define NewModalFilterUPP | ( | userRoutine | ) |
pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes)
| #define NewModalFilterYDUPP | ( | userRoutine | ) |
pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes, 4_bytes)
| #define NewSoundProc | ( | userRoutine | ) | NewSoundUPP(userRoutine) |
support for pre-Carbon UPP routines: New...Proc and Call...Proc
| #define NewSoundUPP | ( | userRoutine | ) |
pascal no_return_value Func(2_bytes)
| #define NewUserItemUPP | ( | userRoutine | ) |
pascal no_return_value Func(4_bytes, 2_bytes)
| typedef SInt16 DialogItemIndexZeroBased |
new type abstractions for the dialog manager
| typedef SInt16 DITLMethod |
OLDROUTINENAMES Dialog Item List Manipulation Constants
| typedef QTModelessCallbackProcPtr QTModelessCallbackUPP |
CALL_NOT_IN_CARBON
| anonymous enum |
CALL_NOT_IN_CARBON !TARGET_OS_MAC ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© © Following types are valid with Appearance 1.0 and later ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
| Enumerator | |
|---|---|
| kAlertStopAlert | Alert types to pass into StandardAlert |
| anonymous enum |
StandardAlert alert button numbers
| anonymous enum |
| anonymous enum |
For dftb resource
| anonymous enum |
Also for dftb resource. This one is available in Mac OS X or later. It corresponds directly to kControlUseThemeFontIDMask from Controls.h.
| anonymous enum |
Summary: Flags to CreateStandardAlert that are specified in the AlertStdCFStringAlertParamRec.flags field.
| DialogItemIndex Alert | ( | SInt16 | alertID, |
| ModalFilterUPP | modalFilter | ||
| ) |
| OSErr AppendDialogItemList | ( | DialogRef | dialog, |
| SInt16 | ditlID, | ||
| DITLMethod | method | ||
| ) |
| void AppendDITL | ( | DialogRef | theDialog, |
| Handle | theHandle, | ||
| DITLMethod | method | ||
| ) |
CALL_NOT_IN_CARBON AppendDITL()
| OSErr AutoSizeDialog | ( | DialogRef | inDialog | ) |
| typedef CALLBACK_API | ( | Boolean | , |
| ModalFilterYDProcPtr | |||
| ) |
ModalFilterYDProcPtr was previously in StandardFile.h
| typedef CALLBACK_API | ( | void | , |
| SoundProcPtr | |||
| ) |
dialog manager callbacks
| typedef CALLBACK_API_C | ( | void | , |
| QTModelessCallbackProcPtr | |||
| ) |
CALL_NOT_IN_CARBON QuickTime 3.0
| DialogItemIndex CautionAlert | ( | SInt16 | alertID, |
| ModalFilterUPP | modalFilter | ||
| ) |
| void CloseDialog | ( | DialogRef | theDialog | ) |
| OSStatus CloseStandardSheet | ( | DialogRef | inSheet, |
| UInt32 | inResultCommand | ||
| ) |
Summary: Closes a standard sheet dialog and releases the dialog data structures.
Discussion: CloseStandardSheet is meant to be used when you need to remove a sheet because of a higher-priority request to close the sheet's document window. For example, you might have a Save Changes sheet open on a document window. Meanwhile, the user drags the document into the trash. When your application sees that the document has been moved to the trash, it knows that it should close the document window, but first it needs to close the sheet. CloseStandardSheet should not be used by your Carbon event handler in response to a click in one of the sheet buttons; the Dialog Manager will close the sheet automatically in that case. If kStdAlertDoNotDisposeSheet was specified when the sheet was created, the sheet dialog will be hidden but not released, and you can reuse the sheet later.
Parameters:
inSheet: The sheet to close.
inResultCommand: This command, if not zero, will be sent to the EventTarget specified when the sheet was created.
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| void CouldAlert | ( | SInt16 | alertID | ) |
| void CouldDialog | ( | SInt16 | dialogID | ) |
| DialogItemIndex CountDITL | ( | DialogRef | theDialog | ) |
| OSStatus CreateStandardAlert | ( | AlertType | alertType, |
| CFStringRef | error, | ||
| CFStringRef | explanation, | ||
| const AlertStdCFStringAlertParamRec * | param, | ||
| DialogRef * | outAlert | ||
| ) |
Summary: Creates an alert containing standard elements and using standard formatting rules.
Discussion: CreateStandardAlert should be used in conjunction with RunStandardAlert. After CreateStandardAlert returns, the alert is still invisible. RunStandardAlert will show the alert and run a modal dialog loop to process events in the alert.
Parameters:
alertType: The type of alert to create.
error: The error string to display.
explanation: The explanation string to display. May be NULL or empty to display no explanation.
param: The parameter block describing how to create the alert. May be NULL.
outAlert: On exit, contains the new alert.
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| param | can be NULL |
| outAlert | can be NULL |
| OSStatus CreateStandardSheet | ( | AlertType | alertType, |
| CFStringRef | error, | ||
| CFStringRef | explanation, | ||
| const AlertStdCFStringAlertParamRec * | param, | ||
| EventTargetRef | notifyTarget, | ||
| DialogRef * | outSheet | ||
| ) |
Summary: Creates an alert containing standard elements and using standard formatting rules, and prepares it to be displayed as a sheet.
Discussion: CreateStandardSheet should be used in conjunction with ShowSheetWindow. After CreateStandardSheet returns, the alert is still invisible. ShowSheetWindow will show the alert and then return. Events in the sheet are handled asynchronously; the application should be prepared for the sheet window to be part of its windowlist while running its own event loop. When a button in the sheet is pressed, the EventTargetRef passed to CreateStandardSheet will receive a command event with one of the command IDs kHICommandOK, kHICommandCancel, or kHICommandOther. The sheet is closed before the command is sent.
Parameters:
alertType: The type of alert to create.
error: The error string to display.
explanation: The explanation string to display. May be NULL or empty to display no explanation.
param: The parameter block describing how to create the alert. May be NULL.
notifyTarget: The event target to be notified when the sheet is closed. The caller should install an event handler on this target for the [kEventClassCommand, kEventProcessCommand] event.
outSheet: On exit, contains the new alert.
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| param | can be NULL |
| notifyTarget | can be NULL |
| void DialogCopy | ( | DialogRef | theDialog | ) |
| void DialogCut | ( | DialogRef | theDialog | ) |
| void DialogDelete | ( | DialogRef | theDialog | ) |
| void DialogPaste | ( | DialogRef | theDialog | ) |
| Boolean DialogSelect | ( | const EventRecord * | theEvent, |
| DialogRef * | theDialog, | ||
| DialogItemIndex * | itemHit | ||
| ) |
| void DisposeDialog | ( | DialogRef | theDialog | ) |
CALL_NOT_IN_CARBON DisposeDialog()
| void DisposeModalFilterUPP | ( | ModalFilterUPP | userUPP | ) |
CALL_NOT_IN_CARBON DisposeModalFilterUPP()
| void DisposeModalFilterYDUPP | ( | ModalFilterYDUPP | userUPP | ) |
| void DisposeSoundUPP | ( | SoundUPP | userUPP | ) |
| void DisposeUserItemUPP | ( | UserItemUPP | userUPP | ) |
| void DrawDialog | ( | DialogRef | theDialog | ) |
| DialogItemIndexZeroBased finddialogitem | ( | DialogRef | theDialog, |
| Point * | thePt | ||
| ) |
| DialogItemIndexZeroBased FindDialogItem | ( | DialogRef | theDialog, |
| Point | thePt | ||
| ) |
| void FreeAlert | ( | SInt16 | alertID | ) |
| void FreeDialog | ( | SInt16 | dialogID | ) |
| SInt16 GetAlertStage | ( | void | ) |
| SInt16 GetDialogCancelItem | ( | DialogRef | dialog | ) |
| OSErr GetDialogControlNotificationProc | ( | void * | theProc | ) |
GetDialogControlNotificationProc()
| SInt16 GetDialogDefaultItem | ( | DialogRef | dialog | ) |
| void GetDialogItem | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo, | ||
| DialogItemType * | itemType, | ||
| Handle * | item, | ||
| Rect * | box | ||
| ) |
| OSErr GetDialogItemAsControl | ( | DialogRef | inDialog, |
| SInt16 | inItemNo, | ||
| ControlRef * | outControl | ||
| ) |
| void getdialogitemtext | ( | Handle | item, |
| char * | text | ||
| ) |
| void GetDialogItemText | ( | Handle | item, |
| Str255 | text | ||
| ) |
| SInt16 GetDialogKeyboardFocusItem | ( | DialogRef | dialog | ) |
| void* GetDialogParent | ( | DialogRef | theDialog | ) |
| OSStatus GetDialogTimeout | ( | DialogRef | inDialog, |
| SInt16 * | outButtonToPress, | ||
| UInt32 * | outSecondsToWait, | ||
| UInt32 * | outSecondsRemaining | ||
| ) |
©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© © Accessor functions ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© GetDialogWindow()
| OSStatus GetModalDialogEventMask | ( | DialogRef | inDialog, |
| EventMask * | outMask | ||
| ) |
APIs in Carbon GetParamText()
| OSStatus GetStandardAlertDefaultParams | ( | AlertStdCFStringAlertParamPtr | param, |
| UInt32 | version | ||
| ) |
CFString-based StandardAlert and StandardSheet APIs are only available on Mac OS X and later GetStandardAlertDefaultParams()
Summary: Fills out an AlertStdCFStringAlertParamRec with default values: - not movable - no help button - default button with title "OK" - no cancel or other buttons
Parameters:
param: The parameter block to initialize.
version: The parameter block version; pass kStdCFStringAlertVersionOne.
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| OSErr GetStdFilterProc | ( | ModalFilterUPP * | theProc | ) |
GetStdFilterProc Get a pointer to the Dialog Manager's standard dialog filter.
GetStdFilterProc returns a pointer to the Dialog Manager's standard dialog filter. theProc pointer to dialog filter procedure pointer.
error code
This routine is not yet documented in any MPW header file (hence, it is not
in any THINK C or THINK Pascal header file either). The information given
above comes from Macintosh Technical Note #304. This tech. note also gives
the inline glue for the call as follows:
pascal OSErr GetStdFilterProc (ProcPtr *theProc)
= {0x303C, 0x0203, 0xAA68};
| void HideDialogItem | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo | ||
| ) |
| void InitDialogs | ( | void * | ignored | ) |
Initialize before using Dialog Manager functions.
©©© end Appearance 1.0 or later stuff NOTE: Code running under MultiFinder or System 7.0 or newer should always pass NULL to InitDialogs.
InitDialogs initializes the Dialog Manager and optionally installs a routine to get control after a fatal system error. It should be called once, after calling InitGraf , InitFonts , InitWindows , InitMenus , TEInit (in that order), and before using any other Dialog Manager functions. resumeProc is the address of a caller-supplied routine. In the event of a fatal system error, the system error alert is displayed and if the user then selects the Resume button, resumeProc will get control. If you use resumeProc =NIL, no routine is installed and the Resume button will be dimmed.
none
InitDialogs installs the standard sound procedure (see ErrorSound ) and sets all text-replacement parameters to empty strings (see ParamText ). It also stores the value of resumeProc into the low-memory variable ResumeProc . During application development, you may wish to create a "resume" procedure that jumps to some sort of diagnostic code, in an attempt to locate where the error occurred. The code at resumeProc expects no parameters. When it gets control, the stack has been discarded (reset to the value of the global variable CurStackBase ) and A5 has been set to its position before the error occurred. You can test your custom code by calling SysError and clicking the Resume button when the alert appears. See SysError , System Error Codes , and IM pg II-356-363 for related information.
| OSStatus InsertDialogItem | ( | DialogRef | theDialog, |
| DialogItemIndex | afterItem, | ||
| DialogItemType | itemType, | ||
| Handle | itemHandle, | ||
| const Rect * | box | ||
| ) |
| Boolean InvokeModalFilterUPP | ( | DialogRef | theDialog, |
| EventRecord * | theEvent, | ||
| DialogItemIndex * | itemHit, | ||
| ModalFilterUPP | userUPP | ||
| ) |
CALL_NOT_IN_CARBON InvokeModalFilterUPP()
| Boolean InvokeModalFilterYDUPP | ( | DialogRef | theDialog, |
| EventRecord * | theEvent, | ||
| short * | itemHit, | ||
| void * | yourDataPtr, | ||
| ModalFilterYDUPP | userUPP | ||
| ) |
| void InvokeSoundUPP | ( | SInt16 | soundNumber, |
| SoundUPP | userUPP | ||
| ) |
| void InvokeUserItemUPP | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo, | ||
| UserItemUPP | userUPP | ||
| ) |
| Boolean IsDialogEvent | ( | const EventRecord * | theEvent | ) |
Check if an event belongs to a dialog window.
IsDialogEvent should be called directly after GetNextEvent if there are any currently-open modeless dialogs. If the return value is TRUE, the next step is to call DialogSelect and handle the event. theEvent is the address of an EventRecord . Normally, this will contain the data obtained by a call to GetNextEvent in your main event loop.
a Boolean value indicating whether the event occurred in a modeless dialog window. It is one of: FALSE (0)theEvent is unrelated to dialogs TRUE (1)theEvent occurred in a dialog; use DialogSelect to find which dialog and to handle the event.
You should call IsDialogEvent in your main event loop if you have opened any modeless dialogs (see NewDialog and GetNewDialog ). It is OK to call this if all such dialogs are closed or haven't yet been opened - it just returns FALSE. The return value is TRUE if theEvent is an "activate" or "update" event for any dialog window. If the active window is a dialog, the return value is TRUE for all mouse-downs in its content region and all other events related to the window. In most cases, the next step is to call DialogSelect to see which dialog is associated with theEvent and to handle the event. However, that function doesn't handle ␑-shifted keys or disk-insert events. Thus, you may need to do some preprocessing of theEvent beforehand. If all your dialogs are modal, events are handled immediately after the dialog is displayed by a loop that calls ModalDialog and you won't need this function. Note: It is normal to call IsDialogEvent and DialogSelect in your event loop even when GetNextEvent returns FALSE (no event). This ensures correct blinking of the caret for editText items. DAs: This call checks the windowKind field of the relevant WindowRecord , looking for a 2 (dialogKind). Since DAs must set their reference number in this field, you must store 2 into dialog window's windowKind field, call IsDialogEvent , and restore the value afterwards. See DialogSelect for an example of usage.
| void ModalDialog | ( | ModalFilterUPP | modalFilter, |
| DialogItemIndex * | itemHit | ||
| ) |
| OSErr MoveDialogItem | ( | DialogRef | inDialog, |
| SInt16 | inItemNo, | ||
| SInt16 | inHoriz, | ||
| SInt16 | inVert | ||
| ) |
| DialogRef newcolordialog | ( | void * | dStorage, |
| const Rect * | boundsRect, | ||
| const char * | title, | ||
| Boolean | visible, | ||
| SInt16 | procID, | ||
| WindowRef | behind, | ||
| Boolean | goAwayFlag, | ||
| SInt32 | refCon, | ||
| Handle | items | ||
| ) |
| DialogRef NewColorDialog | ( | void * | dStorage, |
| const Rect * | boundsRect, | ||
| ConstStr255Param | title, | ||
| Boolean | visible, | ||
| SInt16 | procID, | ||
| WindowRef | behind, | ||
| Boolean | goAwayFlag, | ||
| SInt32 | refCon, | ||
| Handle | items | ||
| ) |
| DialogRef newdialog | ( | void * | dStorage, |
| const Rect * | boundsRect, | ||
| const char * | title, | ||
| Boolean | visible, | ||
| SInt16 | procID, | ||
| WindowRef | behind, | ||
| Boolean | goAwayFlag, | ||
| SInt32 | refCon, | ||
| Handle | items | ||
| ) |
| DialogRef NewDialog | ( | void * | dStorage, |
| const Rect * | boundsRect, | ||
| ConstStr255Param | title, | ||
| Boolean | visible, | ||
| SInt16 | procID, | ||
| WindowRef | behind, | ||
| Boolean | goAwayFlag, | ||
| SInt32 | refCon, | ||
| Handle | items | ||
| ) |
CALL_NOT_IN_CARBON NewDialog()
| DialogRef NewFeaturesDialog | ( | void * | inStorage, |
| const Rect * | inBoundsRect, | ||
| ConstStr255Param | inTitle, | ||
| Boolean | inIsVisible, | ||
| SInt16 | inProcID, | ||
| WindowRef | inBehind, | ||
| Boolean | inGoAwayFlag, | ||
| SInt32 | inRefCon, | ||
| Handle | inItemListHandle, | ||
| UInt32 | inFlags | ||
| ) |
©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© © Appearance Dialog Routines (available only with Appearance 1.0 and later) ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© NewFeaturesDialog()
| ModalFilterUPP NewModalFilterUPP | ( | ModalFilterProcPtr | userRoutine | ) |
CALL_NOT_IN_CARBON NewModalFilterUPP()
| ModalFilterYDUPP NewModalFilterYDUPP | ( | ModalFilterYDProcPtr | userRoutine | ) |
| SoundUPP NewSoundUPP | ( | SoundProcPtr | userRoutine | ) |
| UserItemUPP NewUserItemUPP | ( | UserItemProcPtr | userRoutine | ) |
| DialogItemIndex NoteAlert | ( | SInt16 | alertID, |
| ModalFilterUPP | modalFilter | ||
| ) |
| void paramtext | ( | const char * | param0, |
| const char * | param1, | ||
| const char * | param2, | ||
| const char * | param3 | ||
| ) |
| void ParamText | ( | ConstStr255Param | param0, |
| ConstStr255Param | param1, | ||
| ConstStr255Param | param2, | ||
| ConstStr255Param | param3 | ||
| ) |
| OSStatus RemoveDialogItems | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo, | ||
| DialogItemIndex | amountToRemove, | ||
| Boolean | disposeItemData | ||
| ) |
| void ResetAlertStage | ( | void | ) |
| OSStatus RunStandardAlert | ( | DialogRef | inAlert, |
| ModalFilterUPP | filterProc, | ||
| DialogItemIndex * | outItemHit | ||
| ) |
Summary: Shows and runs a standard alert using a modal dialog loop.
Parameters:
inAlert: The alert to display.
filterProc: An event filter function for handling events that do not apply to the alert. May be NULL.
outItemHit: On exit, contains the item index of the button that was pressed to close the alert.
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| outItemHit | can be NULL |
| void SelectDialogItemText | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo, | ||
| SInt16 | strtSel, | ||
| SInt16 | endSel | ||
| ) |
| OSErr SetDialogCancelItem | ( | DialogRef | theDialog, |
| DialogItemIndex | newItem | ||
| ) |
SetDialogCancelItem Tell Dialog Mgr which item should be default cancel item.
SetDialogCancelItem indicates to the Dialog Manager which item is the default cancel item. It will alias the escape or "Command - period". theDialog dialog whose default item is being set. newItem item to make be the default cancel item.
error code
This routine is not yet documented in any MPW header file (hence, it is not
in any THINK C or THINK Pascal header file either). The information given
above comes from Macintosh Technical Note #304. This tech. note also gives
the inline glue for the call as follows:
pascal OSErr SetDialogCancelItem (DialogPtr theDialog,
short newItem) = {0x303C,0x0305,0xAA68};
| OSErr SetDialogDefaultItem | ( | DialogRef | theDialog, |
| DialogItemIndex | newItem | ||
| ) |
SetDialogDefaultItem Tell Dialog Mgr which item in dialog should be default item.
SetDialogDefaultItem indicates to the Dialog Manager which item is the default. It will alias the return and enter keys to this item, and also bold border it. theDialog dialog whose default item is being set. newItem item to make be the default item.
error code
This routine is not yet documented in any MPW header file (hence, it is not
in any THINK C or THINK Pascal header file either). The information given
above comes from Macintosh Technical Note #304. This tech. note also gives
the inline glue for the call as follows:
pascal OSErr SetDialogDefaultItem (DialogPtr theDialog,
short newItem) = {0x303C,0x0304,0xAA68};
| void SetDialogFont | ( | SInt16 | fontNum | ) |
| void SetDialogItem | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo, | ||
| DialogItemType | itemType, | ||
| Handle | item, | ||
| const Rect * | box | ||
| ) |
| void setdialogitemtext | ( | Handle | item, |
| const char * | text | ||
| ) |
| void SetDialogItemText | ( | Handle | item, |
| ConstStr255Param | text | ||
| ) |
| void SetDialogMovableModal | ( | DialogRef | theDialog | ) |
| OSStatus SetDialogTimeout | ( | DialogRef | inDialog, |
| SInt16 | inButtonToPress, | ||
| UInt32 | inSecondsToWait | ||
| ) |
©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© © Dialog Routines available only with Appearance 1.1 and later ©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© SetDialogTimeout()
| OSStatus SetModalDialogEventMask | ( | DialogRef | inDialog, |
| EventMask | inMask | ||
| ) |
| void SetModelessDialogCallbackProc | ( | DialogRef | theDialog, |
| QTModelessCallbackProcPtr | callbackProc | ||
| ) |
SetModelessDialogCallbackProc()
| void SetPortDialogPort | ( | DialogRef | dialog | ) |
| void ShortenDITL | ( | DialogRef | theDialog, |
| DialogItemIndex | numberItems | ||
| ) |
| void ShowDialogItem | ( | DialogRef | theDialog, |
| DialogItemIndex | itemNo | ||
| ) |
| OSErr SizeDialogItem | ( | DialogRef | inDialog, |
| SInt16 | inItemNo, | ||
| SInt16 | inWidth, | ||
| SInt16 | inHeight | ||
| ) |
| OSErr StandardAlert | ( | AlertType | inAlertType, |
| ConstStr255Param | inError, | ||
| ConstStr255Param | inExplanation, | ||
| const AlertStdAlertParamRec * | inAlertParam, | ||
| SInt16 * | outItemHit | ||
| ) |
Regarding StandardAlert and constness: Even though the inAlertParam parameter is marked const here, there was a chance Dialog Manager would modify it on versions of Mac OS prior to 9. StandardAlert()
| outItemHit | can be NULL |
| Boolean StdFilterProc | ( | DialogRef | theDialog, |
| EventRecord * | event, | ||
| DialogItemIndex * | itemHit | ||
| ) |
| DialogItemIndex StopAlert | ( | SInt16 | alertID, |
| ModalFilterUPP | modalFilter | ||
| ) |
| mySound |
Set up to use non-standard sounds for alerts.
ErrorSound lets you override the standard sounds that are made when alerts are invoked. soundProc is the address of a pascal-style procedure. This routine will get control at each stage of each alert. A value of NIL disables alert beeping altogether and also disables the menu bar-blinking that occurs when the speaker volume has been set to 0.
none
If you never call this function, the alert will emit simple beeps - up to 3; one beep for the current alert stage - at the current speaker volume (adjustable via the control panel DA). In the event that the volume has been set to 0, the standard "sound" is a flashing of the menu bar. See SysBeep . If you call ErrorSound ( 0 ), beeping and flashing will not occur. To customize the sounds, use ErrorSound ( mySounds), as illustrated in the following example. Note: Sound number 1 is the sound made when a user clicks outside of a modal dialog box (as well as in a stage-1 alert). Example #include < Dialogs.h > #include < Sound.h> pascal void MySoundProc( short sndNum ); #define kSndResNum 128 // 'snd ' resource number pascal void MySoundProc(short sndNum) /* sndNum will range from 0 to 3