The workspacePreDeactivate event fires at the VERY start of a workspace being deactivated. The client can add or remove WorkspaceEventHandlers from the WorkspaceEvent.
-------- Import ----------------- Global variables --------- -------- Connect the handler to the event. --------- "userInterface_var" is a variable referencing a UserInterface object. -------- Event handler function definition --------- |
-------- Global variables ----------------- Connect the handler to the event. --------- "userInterface_var" is a variable referencing a UserInterface object. "MyWorkspacePreDeactivateHandler" is the name of the class that handles the event. -------- Event handler class definition --------- |
--------- Required include files. ------------------ Event handler class definition and global declaration. --------- class MyWorkspacePreDeactivateEventHandler : public adsk::core::WorkspaceEventHandler { public: void notify(const Ptr<WorkspaceEventArgs>& eventArgs) override { // Code to react to the event. ui->messageBox("In MyWorkspacePreDeactivateEventHandler event handler."); } } _workspacePreDeactivate; --------- Connect the handler to the event. --------- |
-------- Event handler function definition ----------------- Connect the handler to the event. --------- "MyWorkspacePreDeactivateHandler" is the name of the class that handles the event. "userInterface_var" is a variable referencing a UserInterface object. |