Event Message Constants

Header: Navigation.h

Your application can provide an event-handling function to update application windows and handle other events related to your Open and Save dialog boxes. Navigation Services informs you of pertinent events by supplying event message constants to your event-handling function via the param field of a structure of type NavCBRec. These constants are defined in the NavEventCallbackMessages data type. For more information, see “Handling Events”.

enum {
    kNavCBEvent = 0,
    kNavCBCustomize = 1,
    kNavCBStart = 2,
    kNavCBTerminate = 3,
    kNavCBAdjustRect = 4,
    kNavCBNewLocation = 5,
    kNavCBShowDesktop = 6,
    kNavCBSelectEntry = 7,
    kNavCBPopupMenuSelect = 8,
    kNavCBAccept = 9,
    kNavCBCancel = 10,
    kNavCBAdjustPreview = 11,
    kNavCBOpenSelection = -2147483648
};

Constant descriptions

kNavCBEvent

Tells your application that an event has occurred (including an idle event), which provides an opportunity for your application to track controls, update other windows, and so forth. Your application can obtain the event record describing this event from the event field of the structure of type NavCBRec. The kNavCBEvent constant is the only message that needs to be processed by most applications that do not customize Open and Save dialog boxes.

kNavCBCustomize

Tells your application to supply a dialog box customization request. The customRect field of the NavCBRec structure defines a rectangle in the local coordinates of the dialog box; the top-left coordinates define the anchor point for a customization rectangle. If you want to customize the dialog box, your application responds to the kNavCBCustomize message by setting a value in the customRect field that completes the dimensions of the customization rectangle. After your application responds, Navigation Services inspects the customRect field to determine if the requested dimensions result in a dialog box that can fit on the screen. If the dimensions are too large, then Navigation Services responds by setting the rectangle to the largest size that the screen can accommodate. Your application can continue to “negotiate” by examining the customRect field and requesting a different size until Navigation Services provides an acceptable rectangle value, at which time you should create your custom control or item list. The minimum size for the customization area is 400 pixels wide by 40 pixels high. For more information, see “Adding Custom Controls”.

Note: Don’t add new dialog box items until your application receives the kNavCBStart event message constant.

kNavCBStart

Tells your application that a dialog box is ready to be displayed. After receiving the kNavCBCustomize event message constant, your event-handling function should wait for the kNavCBStart event message constant to ensure that your application can safely add dialog items. No additional data is provided to your application with this constant. For more information, see “Adding Custom Controls”.

kNavCBTerminate

Tells your application that the dialog box is about to be closed, which means you must remove any user-interface items that were created in response to the kNavCBStart message. No additional data is provided to your application with this constant.

kNavCBAdjustRect

Tells your application that the dialog box has been resized and the customization rectangle has been accordingly resized. Use the customRect field from the structure of type NavCBRec to determine the new customization rectangle size. Your application does not need to offset the controls; Navigation Services moves them automatically. Your application is responsible for any redrawing of the controls or handling events beyond moving the controls, however. For more information, see “Adding Custom Controls”.

kNavCBNewLocation

Tells your application that a new location is being viewed in the dialog box. The param field of the NavCBRec structure contains a pointer to an AEDesc structure of type 'typeFSS' describing the new location. This pointer is valid only during the execution of your event-handling function. For more information on how to parse AEDesc structures, see “Obtaining Object Descriptions”.

kNavCBShowDesktop

Tells your application that the Open or Save dialog box is showing the desktop view, consisting of the composite of all desktop folders from all mounted volumes. The param field of the NavCBRec structure contains a pointer to an AEDescList structure identifying the desktop location. This pointer is valid only during the execution of your event-handling function. For more information on how to parse AEDesc structures, see “Obtaining Object Descriptions”.

kNavCBSelectEntry

Tells your application that an entry in the browser list has been selected or deselected by the user. The param field of the NavEventDataInfo structure contains a pointer to an AEDescList record of type 'typeFSS' identifying the current selection. If the user deselects the current selection, the AEDescList record contains an empty reference. This pointer is valid only during the execution of your event-handling function. For more information on how to parse AEDesc structures, see “Obtaining Object Descriptions”.

kNavCBPopupMenuSelect

Tells your application that a selection was made from the Open dialog box’s Show pop-up menu or Save dialog box’s Format pop-up menu. The param field of the NavCBRec structure contains a pointer to a structure of type NavMenuItemSpec describing the pop-up menu item selected. This data is valid only during the execution of your event-handling function.

kNavCBAccept

Tells your application that the user has pressed the Accept button.

kNavCBCancel

Tells your application that the user has pressed the Cancel button.

kNavCBAdjustPreview

Tells your application that the user has toggled the preview area on or off. The param field of the NavCBRec structure contains a pointer to a Boolean value of true if the preview area is toggled on and false if toggled off. This information is useful if your application creates custom controls in the preview area. For more information, see “Drawing Custom Previews”.

kNavCBOpenSelection

(Navigation Services 2.0 or later.) Tells your application that the user has opened a file or chosen a file object. After detecting this constant, you can call the function NavCustomControl and specify one of the NavActionState constants, described in “Action State Constants”, in order to block the opening or choosing action. For more information on using the NavCustomControl function, see “Handling Events”.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)