• Aucun résultat trouvé

Standard Application Menu Messages

Dans le document PenPofnt GO (Page 111-116)

msgAppCreateMenuBar

Creates the standard application menu bar.

Takes P_OBJECT, returns STATUS.

#define msgAppCreateMenuBar MakeMsg(clsApp, 55)

Descendants: You should handle this message by creating the document's menu bar. If pArgs is non-null when the ancestor is called, clsApp will pre-pend the Document, Edit, and Option menus to the provided menu bar. So you should call the ancestor after you make the menu bar. After the ancestor returns, you can fix up the Document and Edit menus to remove any buttons that you don't support or to add any new buttons.

See the earlier description "Enabling and Disabling SAMs" for more details.

msgAppCreateClientWin

Creates a document's client window.

Takes P _OBJECT, returns STATUS.

#define msgAppCreateClientWin MakeMsg(clsApp, 56)

The document creates a default client window of class clsEmbeddedWin and passes back its uid.

The Application Framework does not send this message by default. Instead, you should self se'nd it at the appropriate time (typically during msgApplnit, since the client window is usually stateful).

Descendants: You should handle this message by creating your application- specific client window. In such cases, you tend not to call your ancestor.

Comments

Comments

Comments

Comments

APP.H '10'1 Standard Application Menu Messages

msgAppSend

Sends a document.

Takes OBJECT, returns STATUS.

fdefine rnsgAppSend MakeMsg (clsApp, 57)

When the user taps on a button in the Send menu, the SAMs send this message to the document, passing in theSendManager. The document then self sends msgApplnvokeManager, passing on theSendManager.

Descendants: You normally do not handle this message.

msgAppPrint

Prints a document.

Takes OBJECT, returns STATUS.

fdefine rnsgAppPrint MakeMsg(clsApp, 58)

When the user issues the Print command (either by tapping on the Print button in the SAMs or by drawing the print gesture on the document's title line), the Application Framework sends this message to the document, passing it thePrintManager. The document then self sends msgApplnvokeManager, passing on thePrintManager.

Descendants: You normally do not handle this message.

msgAppPrintSetup

Displays a document's print setup option sheet.

Takes nothing, returns STATUS.

fdefine rnsgAppPrintSetup MakeMsg(clsApp, 59)

When the user taps on Print Setup, the SAMs send this message to the document. The document self sends msgAppOptionShowOptionSheet, passing it tagAppPrintSetupOptSheet.

Descendants: You normally do not handle this message.

msgApplmport

Obsolete message. Not implemented.

Takes nothing, returns STATUS.

fdefine rnsgApplrnport msglmport

msgAppExport

Prepa~es to export a document as a file.

Takes OBJECT, returns STATUS.

fdefine rnsgAppExport

MakeMsg(clsApp, 60)

MakeMsg(clsApp, 61) The document self sends msgApplnvokeManager, passing on pArgs.

Descendants: You normally do not handle this message.

102 PENPOINT API REFERENCE

Part 2 / PenPoint Application Framework

msgAppAbout

Displays a document's "About" option sheet.

Takes nothing, returns SfATUS.

fdefine msgAppAbout MakeMsg(clsApp, 62)

When the user taps on About, the SAMs send this message to the document. The document self sends msgAppOptionShowSheet, passing it tagAppAboutOptSheet.

Descendants: You normally do not handle this message. Instead, you should handle

msgOptionAddCards by adding more cards to the About option sheet. Likewise, you should handle msgOptionProvideCard by modifying or adding specific controls to the standard About cards.

msgAppHelp

Shows help for the application. Not implemented - Reserved.

Takes nothing, returns SfATUS.

fdefine msgAppHelp MakeMsg(clsApp, 63)

Descendants: You should not handle this message. Instead, you can provide help via resource files (see the Tic-Tac-Toe sample application for an example).

msgAppUndo

Undoes the previous operation on a document.

Takes nothing, returns SfATUS.

fdefine msgAppUndo MakeMsg(clsApp, 64)

The document sends msgUndoCurrent to theUndoManager.

Descendants: You normally do not handle this message. Instead, see UNDO.H for information on how to undo your application's commands.

msgAppMoveSel

Prepares to move a document's selection.

Takes nothing, returns SfATUS.

fdefine msgAppMoveSel MakeMsg(clsApp, 65)

When the user issues the Move command (either by tapping on Move in the SAMs or by press-holding on a selection in the document), the Application Framework sends this message to the document. The document finds its selected object (by sending msgSelOwner to theSelectionManager) and then sends it msgSelBeginMove.

Descendants: You normally do not handle this message.

msgAppCopySel

Prepares to copy the document's selection.

Takes nothing, returns SfATUS.

fdefine msgAppCopySel MakeMsg(clsApp, 66)

Comments

Comments

Comments

Comments

Comments

APP.H 103 Standard Application Menu Messages

When the user issues the Copy command (either by tapping on Copy in the SAMs or by

tap-press-holding on a selection in the document), the Application Framework sends this message to the document. The document finds its selected object (by sending msgSelOwner to theSelectionManager) and then sends it msgSelBeginCopy.

Descendants: You normally do not handle this message.

msgAppDeleteSel

Deletes a document's selection.

Takes nothing, returns STATUS.

tdefine msgAppDeleteSel MakeMsg(clsApp, 67)

When the user issues the Delete command (either by tapping on Delete in the SAMs or by drawing the delete gesture, the Application Framework sends this message to the document. The document gets its selected object (by sending msgSelOwner to theSelectionManager) and then sends it msgSelDelete.

Descendants: You normally do not handle this message.

msgAppSelOptions

Prepares to display the options for a document's selection. Obsolete.

Takes nothing, returns STATUS.

tdefine msgAppSelOptions MakeMsg(clsApp, 68) Descendants: You should not handle this message.

msgAppSelectAll

Selects all of the objects in a document.

Takes nothing, returns STATUS. Category: descendant responsibility.

tdefine msgAppSelectAll MakeMsg(clsApp, 69)

When the user taps on Select All in the Standard Application Menu, the document self sends this message.

clsApp does not do anything in its message handler for this message.

Descendants: You should handle this message and select everything in the document. You tend not to

call the ancestor.

msgAppSearch

Searches a document for a string.

Takes OBJECT, returns STATUS.

tdefine msgAppSearch MakeMsg(clsApp, 70)

When the user issues the Find command (either by tapping on Find in SAMs or by drawing the find gesture on the document's title line), the Application Framework sends this message to the document, passing it theSeachManager. In response, the document self sends msgApplnvokeManager, passing on theSearchManager.

Descendants: You normally do not handle this message.

104 PENPOINT API REFERENCE

Comments

Part 2 / PenPoint Application Framework

msgAppSpell

Prepares to check a document's spelling.

Takes OBJECT, returns STATUS.

*define msgAppSpell MakeMsg(clsApp, 71)

When the user issues the Spell command (either by tapping on Spell in SAMs or by drawing the spell gesture on the document's title line), the Application Framework sends this message to the document, passing it theSpellManager. In response, the document self sends msgApplnvokeManager, passing on theSpellManager.

Descendants: You normally do not handle this message.

msgApplnvokeManager

Routes a message to a manager.

Takes OBJECT, returns STATUS.

*define msgAppInvokeManager MakeMsg(clsApp, 72)

To route a standard application menu message to the object that provides the behavior, the document self sends msgApplnvokeManager. The argument to the message is the well-known UID of the manager that performs the operation. When the document receives msgApplnvokeManager, it sends

msgAppExecute to the manager object.

Descendants: You normally do not handle this message.

msgAppExecute

Sent to the manager to execute the manager's behavior on a document.

Takes P _APP _EXECUTE, returns STATUS.

*define msgAppExecute MakeMsg(clsApp, 73) typedef struct APP EXECUTE

OBJECT app; - II Requesting document.

OBJECT sel; II Selected object.

U32 count; II Number of_uuids.

UUID uuid[l]; II UUIDs of documents to operate on.

APP_EXECUTE, *P_APP_EXECUTE;

The document sends msgAppExecute to a manager when it receives msgApplnvoke manager. The manager performs some operation on the document or documents specified in the pArgs, such as printing, searching, or spell checking.

Descendants: You normally do not handle this message.

msgAppExecuteGesture

Invokes the default gesture behavior for a document's tide line.

Takes P_GWIN_GESTURE, returns STATUS.

*define msgAppExecuteGesture MakeMsg(clsApp, 74)

Descendants: You normally do not handle this message. However, if you want to handle a tide line gesture differently than the default, you should handle this message. You tend not to call the ancestor.

APP.H 105

Dans le document PenPofnt GO (Page 111-116)