[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]

Application Button

sd-add-application-button
sd-remove-application-button
sd-switch-application
sd-get-current-application

Concept

The Application Button allows switching between complementary applications and Creo Elements/Direct Modeling. Each application is responsible for modifications of Creo Elements/Direct Modeling's default User Interface and for the correct cleanup after returning from the complementary application, i.e. restoration of Creo Elements/Direct Modeling's default User Interface.
After each application switch the event *SD-SWITCH-APPLICATION-EVENT* is processed. Subscribe any function to this event to do additional cleanup work for specific applications.

The application button appears in the Application ribbon tab. The button of the active application gets pressed and in addition to that the main Creo Elements/Direct Modeling window title changes to the name of the activated application (here 3D Documentation).

The Application tab provides a fast access to switch between different applications.

Function Index Top of Page

SD-ADD-APPLICATION-BUTTON  [function]

(sd-add-application-button name
                           :icon icon
                           :activateAction LISP-form
                           :cleanupAction LISP-form)
Description:
Creates a new application button in the Application ribbon tab.
Note: If you create a button for a new application, make sure to announce the application before this call by calling sd-add-application-data.

With the definition of ribbon tabs the application to which it belongs is defined. Switching of an application automatically shows and hides corresponding ribbon tabs.

Parameters:
name {STRING}
Name of the application as handle. If another application button with the same name exists, this button will be destroyed silently.
It is not possible to destroy or change the Creo Elements/Direct Modeling application button.
:icon {STRING}
Relative path to optional icon. The icon is displayed in the 'Application' ribbon tab in the 'Add-On' ribbon group.
:activateAction {quoted LISP form}
LISP Form which will be evaluated when the user hits this application button. Here the new application can modify Creo Elements/Direct Modeling's default User Interface and can add new UI components.
:cleanupAction {quoted LISP form}
LISP Form which will be evaluated when the user selects another application out of the application tab or he returns to the core application Modeling. The programmer of this application is responsible to restorate Creo Elements/Direct Modeling's UI in this function, that means he must undo all his modifications and additions. This is not true for the ribbon tabs. They are switched by system functionality.

Return Value:
t - success
nil - failure

Example:
(sd-add-application-button "Test-Application"
                           :icon "Addins/addin_default")

See Also:
sd-fluentui-add-ribbon-tab
sd-fluentui-show-ribbon-tab-in-application
sd-fluentui-hide-ribbon-tab-in-application

Function Index Top of Page

SD-REMOVE-APPLICATION-BUTTON  [function]

(sd-remove-application-button name)
Description:
Removes an application button from the Application ribbon tab. If this application button was the current application button Creo Elements/Direct Modeling switches automatically to the Modeling application.

Parameters:
name {STRING} - Name of the application

Return Value:
t - success
nil - failure

Function Index Top of Page

SD-SWITCH-APPLICATION  [function]

(sd-switch-application name)
Description:
Switches to the application with name name if it exists. The application button will be set accordingly. The event *SD-SWITCH-APPLICATION-EVENT* is processed as well.

Parameters:
name {STRING}
Name of the application where to switch to. Same as in sd-add-application-button.

Return Value:
t - success
nil - failure

Example:
(defun my-application-switch-notification (from to)
  (format t "~%Application switched from ~S to ~S" from to))

(sd-subscribe-event *SD-SWITCH-APPLICATION-EVENT* 'my-application-switch-notification)

(sd-switch-application "SheetAdvisor")

Function Index Top of Page

SD-GET-CURRENT-APPLICATION  [function]

(sd-get-current-application)
Description:
Returns the name of the current application. If you are in the core Creo Elements/Direct Modeling application, "SolidDesigner" will be returned.

Parameters:

Return Value:
name {STRING} - The name of the current application
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2024 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved