appTrigger
appTrigger(
l_args
)
=> g_context / nil
Description
The application trigger is responsible for any necessary banner setup (except for menus), installing the window popup menu, and other application-specific initialization. It is also responsible for managing the application context.
The application trigger is responsible for setting the window interface procedures and otherwise connecting itself to the window. This is referred to as “installing” the application into the window. This will only need to be done when the current application is to be the displayed application; that is, for ’install and ’pop actions.
After the data trigger has returned successfully from opening the data, its handle is stored in the window and the application trigger is called with the same argument list, with perhaps a different action. The application trigger creates a context and installs its window procedures. The application trigger returns this context (which is a SKILL data structure), and it will be placed in the stack along with the data handle.
If the application trigger fails, the Design Editor operation in progress is aborted, with a potentially partial result.
Arguments
|
l_args->action
|
Valid values: install, push, pop, close, change, reset, save, swap, copy, copyInstall
-
’
install
Indicates this design is about to be installed and displayed in the window. The trigger should create and initialize the context as necessary, including any application specific initialization, and install its popup menu and any bindkeys, etc. If successful, g_context is returned, at which time it is attached to the stack.
|
|
|
If the item is to go on the stack, but is going to be immediately pushed, then l_args->pushed will be t and the application need not install pop-ups, etc. The context must still be created and initialized but is not installed in the window. The context should be created in the pushed state, as if the operation ’push had been called with it.
If this design is being edited in place l_args->eip will be t. In this case, the application can assume that there is at least one item already stacked. EditInPlace stack elements are marked by the Design Editor. If l_args->pushed is nil, the application might want to reinstall pop-ups, and so forth, but this is not necessary.
|
|
|
-
’
push
Indicates this design was displayed and about to be pushed underneath a new design. The popup should be removed, and that portion of the context which is to remain around while the design is underneath should be saved. The trigger should return nil if this level cannot be pushed, thus aborting the stacking operation. Otherwise, g_context will replace the context in the associated stack element. If the trigger intends to replace the existing context with a new handle, it is responsible for deleting the existing context.
If l_args->eip is t, then the new design was generated by an edit in place. (This is not the same as when the current design was there as a result of an edit-in-place.) In this case, the application might want to do something different with the context.
|
|
|
-
’
pop
Indicates this design was pushed and the design on top of it was just removed. This action is the same as ’install but assumes that the context already exists in a pushed state and that some work might be necessary to restore it. If successful, g_context is the popped context. Otherwise nil is returned. If the design was pushed in an edit-in-place operation, l_args->eip will be t. -
’
close
Indicates this design is about to be removed from the stack. All menus, etc. should be removed unless l_args->pushed is t, in which case this is not necessary because this stack element was not the one displayed. The application context should be deleted. If the design was installed in an edit-in-place operation, l_args->eip will be t. This returns t if successful, nil otherwise.
|
|
|
-
’
change
Indicates the design’s access mode was changed by the user. Any context changes (such as disable/enable menu items) that might be required to keep in sync should be done. The return value is ignored. -
’
reset
Indicates that the design was just refreshed from disk and edits were discarded. Any context changes (such as deleting references to objects which might have gone away) that might be required should be done. The return value is ignored. -
’
save
Indicates that the design was just saved to disk. Any context changes (such as changing the name frame) that might be required should be done. The return value is ignored.
|
|
|
-
’
swap
Indicates that a new design has replaced the current stack element, and the app trigger must re-initialize the context according to the new design. “swap” is equivalent to “close” on the old stack element and “open” on the new one, except that by definition, the same trigger is called in both cases. Hence, the trigger only need be called once, and it will not normally need to reinstall the banner/popup menus, bindkeys, etc.
It will have to re-initialize the current context to the new design. g_context is returned, and might or might not be the same as the original handle. If not, the app trigger is responsible for deleting the previous version. The old cellview is passed as args->oldCellView, and the appTrigger is responsible for closing this cellview. -
’
copy
Indicates that the user is copying the window and the context needs to be copied. In this case, l_args->srcContext is the context associated with this stack element in the source window. l_args->window is the destination window. l_args->eip is the source stack item eip state. l_args->pushed is t if the source stack frame was a pushed frame and nil if it was the displayed frame. The application trigger returns g_context, which is the copy of the source context, or nil if a copy could not be made. -
’
copyInstall
Indicates that the context has already been copied, and all that is necessary is to install it in the window.
|
Return to top