• Aucun résultat trouvé

msgAppGetApp Win

Dans le document PenPofnt GO (Page 104-110)

Finds a clsApp Win object within a document.

Takes P_APP_GET_APP_WIN, returns STATUS.

tdefine msgAppGetAppWin MakeMsg(clsApp, 36)

94 PENPOINT API REFERENCE

Part 2 / PenPoint Application Framework

typedef struct APP_GET_APP_WIN {

UUID uuid;

II

in: app win's uuid.

OBJECT win;

II

out: app win. Set to objNull if no match.

APP_GET_APP_WIN, *P_APP_GET_APP_WIN;

The document recursively enumerates its children, searching for a clsApp Win object with a matching app WinMetrics.app UUID (see appwin.h).

Descendants: You should handle this message only if you are managing embedded windows that are not in the main window's window tree. Typically you call the ancestor first. If the ancestor passes back a non-null win, then you don't need to do anything. However, if the ancestor passes back objNull for the win, you should check for a clsApp Win with a matching uuid.

msgAppOwnsSelection

Tests if any object in a document owns the selection.

Takes P_APP_OWNS_SELECTION, returns STATUS.

tdefine msgAppOwnsSelection MakeMsg(clsApp, 37) typedef struct APP OWNS SELECTION {

BOOLEAN checkChildren;

II

in: check child documents, too?

BOOLEAN ownSelection;

II

out: true if doc(s) own the selection.

APP_OWNS_SELECTION, *P_APP_OWNS_SELECTION;

The document sets ownS election to true if the selection belongs to itself or one of its children (if checkChildren is true).

Descendants: You normally do not handle this message.

msgAppOpenTo

Opens a document to a specific state.

Takes U32, returns STATUS.

tdefine msgAppOpenTo MakeMsg(clsApp, 38)

II

States to pass to msgAppOpenTo

tdefine appOpenToNormal 0

II

Open a doc in place.

tdefine appOpenToFloating 1

II

Open a doc to floating.

tdefine appOpenToNextState 2

II

Goto next state. Not Implemented.

If appOpenToNormal is passed in, the document sends msgAppOpenChild to its parent to open itself.

If appOpenT oFloating is passed in, the document self sends msgAppFloat to open itself.

Descendants: You normally do not handle this message.

msgAppCloseTo

Closes a document to a specific state.

Takes U32, returns STATUS.

tdefine msgAppCloseTo MakeMsg(clsApp, 39)

II

States to pass to msgAppCloseTo

tdefine appCloseToNormal 0

II

Close to icon.

tdefine appCloseToNextState 1

II

Close to next state.

Short description: you probably don't need to worry about this message.

Long description: When the user taps on an embedded document icon, the document opens. If the user then double taps on the embedded document's title bar, the embedded document floats above its parent (allowing the user to resize it, without changing the layout of the parent). When the user closes the

Comments

Arguments

APP.H 95 Messages

floating document, it "closes" to its next state (i.e., open, but not floating). Closing it again closes the embedded document down to its icon.

When the user closes an embedded document, the Application Framework sends the document msgAppCloseTo, passing it appCloseToNextState. However, the Application Framework needs a mechanism to close an embedded document all the way down to its icon (e.g., when the user closes the parent document). In such cases, the Application Framework sends msgAppCloseTo to the document, passing appCloseT oNormal.

Descendants: You normally do not handle this message.

msgAppHide

Hides an open document.

Takes nothing, returns STATUS.

#define msgAppHide MakeMsg(clsApp, 40)

This message is used to get a document and all its associated windows off the screen as quickly as possible. It is usually followed (via ObjectPost) by msgAppClose, which is a heavier-weight message.

The document (1) sends msgWinExtract to all windows in metrics.floatingWins, (2) sends msgWinExtract to metrics.mainWin, and (3) recursively sends msgAppHide to all documents on metrics.children.

Descendants: You should handle this message if you have visible windows that are not children of the main window or in the floating window list. The ancestor should be called after your handler.

msgAppSetFloatingRect

Specifies a document's floating size and position.

Takes P _RECT32, returns STATUS.

#define msgAppSetFloatingRect MakeMsg(clsApp, 41) Descendants: You normally do not handle this message.

msgAppSetOpenRect

Specifies a document's open size and position.

Takes P_RECT32, returns STATUS.

#define msgAppSetOpenRect MakeMsg(clsApp, 42) Descendants: You normally do not handle this message.

msgAppGetOptionSheet

Passes back the requested option sheet of a document.

Takes P _APP _GET_OPTION_SHEET, returns STATUS.

#define msgAppGetOptionSheet MakeMsg(clsApp, 91) typedef struct APP GET OPTION SHEET {

TAG sheetTag; - II in~ tag of option sheet.

OBJECT sheet; II out: sheet uid.

APP_GET_OPTION_SHEET, *P_APP_GET_OPTION_SHEET;

96 PENPOINT API REFERENCE

Part 2 / PenPoint Application Framework

If the requested option sheet has already been created, the document just passes back its uid.

Otherwise, it creates the sheet by self sending msgOptionCreateSheet. If the requested sheetTag is not tagAppDocOptSheet, the document self sends msgOptionAddCards to let descendants add option cards to the newly created sheet.

Descendants: You normally do not handle this message. If you want to add other cards to the document's option sheets, you can handle msgAppAddCards.

msgAppGetDocOptionSheetClient

Passes back the client for a document's option sheets.

Takes P _OBJECT, returns STATUS.

#define msgAppGetDocOptionSheetClient MakeMsg(clsApp, 93) The document passes back its main window's client window.

Descendants: You normally do not handle this message.

msgAppAddCards

Adds cards to the specified option sheet of a document.

Takes P _OPTION_TAG, returns STATUS.

#define msgAppAddCards MakeMsg(clsApp, 100)

If the specified sheet is tagAppAboutOptSheet, the document adds the "About Document" and "About Application" option cards to the sheet. If the sheet is tagAppDocOptSheet, the document adds the

"Controls," "Access" and "Comments" cards. If the sheet is tagAppPrintSetupOptSheet, the document adds the "Print Layout" card.

Descendants: You tend not to handle this message. However, you can handle it if you want to add cards

to any of the document's option sheets.

msgAppShowOptionSheet

Shows or hides a document's option sheet.

Takes P_APP_SHOW_OPTION_SHEET, returns STATUS.

#define msgAppShowOptionSheet MakeMsg(clsApp, 92) typedef struct APP SHOW OPTION SHEET {

TAG sheetTag; II-In: Option sheet tag.

TAG cardTag; II In: Option card tag to initially show, or II null to show the top card.

BOOLEAN show; II In: true = show, false = hide.

OBJECT sheet; II Out: option sheet.

APP_SHOW_OPTION_SHEET, *P_APP_SHOW_OPTION_SHEET;

The Application Framework sends this message to show (or hide) any of a document's option sheets. It is sent when, for example, the user picks any of the option cards from the SAMs or draws the check gesture on a document's title, over a selection, or over an embedded document icon.

If show is true, the document self sends msgAppGetOptionSheet to get the requested option sheet. To display the

sheet,

the document sends msgOptionGetCards and msgOptionShowCardAndSheet to the sheet.

If show is false, the document self sends msgAppFindFloatingWin and msgAppRemoveFloatingWin to find and then hide the requested option sheet.

Descendants: You normally do not handle this message.

Comments

Arguments

Comments

Comments

Comments

msgAppApplyEmbeddeeProps

Applies Embedded Printing option card values to first level embeddees.

Takes OBJECT, returns STATUS.

fdefine msgAppApplyEmbeddeeProps MakeMsg(clsApp, 98) Descendants: You normally do not handle this message.

msgAppGetBorderMetrics

Passes back a document's border metrics.

Takes p ~pp _BORDER_METRICS, returns STATUS.

fdefine msgAppGetBorderMetrics // Border styles

MakeMsg(clsApp, 94) fdefine appBorderNone 0

fdefine appBorderSingle 1 fdefine appBorderDouble 2 fdefine appBorderDashed 3 typedef struct APP_BORDER_METRICS

U16 controls 1; // Out: true/false.

U16 titleLine 1; // Out: true/false.

U16 menuLine 1; // Out: true/false.

U16 corkMargin 1; // Out: true/false.

U16 scrollMargins 1; // Out: true/false.

U16 borderStyle 4; // Out: Border style.

U16 reserved 7;

APP_BORDER_METRICS, *P_APP_BORDER_METRICS;

Descendants: You normally do not handle this message.

msgAppSetControls

Turns a document's controls on or off.

Takes U32, returns STATUS.

fdefine msgAppSetControls MakeMsg(clsApp, 47)

APP.H 97 Messages

If appOff is passed in, the document turns its controls off. If appOn is passed in, the controls are turned on. If appToggle is passed in, the document

will

toggle the state of the controls.

Descendants: You normally do not handle this message.

msgAppSetPrintControls

Turns a document's screen decorations off for printing.

Takes BOOLEAN, returns STATUS.

fdefine msgAppSetPrintControls MakeMsg(clsApp, 99)

The document turns its controls off so that it can be printed. It leaves user-set borders on only if the docurilentis printing itself as an embedded document (pArgs = false).

Descendants: You normally do not handle this message.

98 PENPOINT API REFERENCE

Part 2 / PenPoint Application Framework

msgAppSetTideLine

Turns a document's title line on or off.

Takes U32, returns STATUS.

fdefine msgAppSetTitleLine MakeMsg(clsApp, 44)

If appOff is passed in, the document hides its title line. If appOn is passed in, the title line is displayed.

If app Toggle is passed in, the document toggles whether the title line is displayed.

Descendants: You normally do not handle this message.

msgAppSetMenuLine

Turns a document's menu bar on or off.

Takes U32, returns STATUS.

fdefine msgAppSetMenuLine MakeMsg(clsApp, 45)

If appOff is passed in, the document hides its menu bar. If appOn is passed in, the menu bar is displayed. If app Toggle is passed in, the document toggles whether the menu bar is displayed.

Descendants: You normally do not handle this message.

msgAppSetCorkMargin

Turns a document's cork margin on or off Takes U32, returns STATUS.

fdefine msgAppSetCorkMargin MakeMsg(clsApp, 48)

If appOff is passed in, the document hides its cork margin. If appOn is passed in, the cork margin is created (ifit doesn't exist) and displayed. If appToggle is passed in, the document toggles whether the' cork margin is displayed.

Descendants: You normally do not handle this message.

msgAppSetScrollBars

Turns a document's scroll bars on or off.

Takes U32, returns STATUS.

fdefine msgAppSetScrollBars MakeMsg(clsApp, 46)

If appOff is passed in, the document hides its scroll bars. If appOn is passed in, the scroll bars are displayed. If app Toggle is passed in, the document toggles whether the scroll bars are displayed.

Descendants: You normally do not handle this message.

msgAppSetBorderStyle

Specifies the border style.

Takes U32, returns STATUS.

fdefine msgAppSetBorderStyle MakeMsg(clsApp, 95)

The possible values for pArgs are listed above in msgAppGetBorderMetrics.

Descendants: You normally do not handle this message.

Comments

Comments Return Value

Comments

APP.H 99 Messages

msgAppRevert

Reverts to the filed copy of a document.

Takes BOOLEAN, returns STATUS.

#define msgAppRevert MakeMsg(clsApp, 49)

The document reverts to its previously saved state. If true is passed in, the document displays a note, asking the user to confirm the action first. If false is passed in, the document just does the action.

Descendants: If you do not support revert, you should handle this message by returning stsAppRefused.

On the other hand, if you support revert but you manage your own data files or use memory mapped files, then it may be necessary to handle this message by appropriately undoing all data modifications since the last save. The ancestor should be called before your handler.

msgAppIsPageLevel

Asks a document if it shows up as a page in the Notebook (as opposed to being embedded).

Takes nothing, returns STATUS.

#define msgAppIsPageLevel MakeMsg(clsApp, 50) Descendants: You normally do not handle this message.

stsOK If the document is page-level (i.e., its embeddor inherits from dsContainerApp or dsRootContainerApp) .

stsNoMatch If the document is not page-level.

Dans le document PenPofnt GO (Page 104-110)