Library Reference  

SystemUI Library Overview


Supported with: ArcGIS Engine, ArcGIS Desktop, ArcGIS Server

Library dependencies: System


The SystemUI library contains the interface definitions for user interface components that can be extended within ArcGIS. These include the ICommand, ITool, and IToolControl interfaces. The developer uses these interfaces to extend either the ArcGIS Desktop applications or the UI components utilized by the developer components within ArcGIS Engine. The objects contained within this library are utility objects available to the developer to simplify some user interface developments.

The developer does not extend this library but can extend ArcGIS Desktop by implementing interfaces contained within this library. This subject is covered in Extending ArcObjects: see the Extending the user interface topic.

The SystemUI library contains some diverse objects with unrelated functionality, however there are some areas that can be grouped into subsystems. These library subsystems are:

Operations

An operation is an action, or group of actions, that may be undone or redone. You can implement IOperation to make an object that performs some actions that are capable of undo and redo. You are only likely to call members of IOperation if you are implementing undo and redo for a standalone application.

An application can implement an operation stack to provide undo and redo facilities. As you carry out operations they are added to the stack, then you can use undo and redo in the application to manipulate the stack to undo or redo the operations.

ArcMap has an operation stack, which can be obtained with the IMxDocument::OperationStack property. ArcMaps buttons and tools wrap their actions in an operation and add the operations to the stack.

The VBA code below uses the operation stack to undo a previous operation.

[Visual Basic for Applications]
Public Sub Undo()
  Dim pMxDoc As IMxDocument
  Set pMxDoc = ThisDocument
  pMxDoc.OperationStack.Undo
End Sub

Depending on your scenario, there are different methodologies for creating an operation and adding it to the operation stack. If your tool edits features and rows, you can use IEditor::StartOperation and IEditor::StopOperation and the actions in between will be automatically added to the operation stack as a single operation. Stopping an edit session clears the operation stack. If you are outside an edit session and updating a geodatabase directly, calls to IWorkspaceEdit::StartEditOperation and StopEditOperation will not automatically add anything to ArcMaps operation stack since these interfaces are independent of ArcMap. For other actions, on graphic elements for example, you need to create a custom operation object that implements IOperation. The operation is executed and loaded onto the stack with a call to IOperationStack::Do.

Outside the context of ArcGIS applications such as ArcMap, you can add undo and redo capability by using the ControlsOperationStack class. Usually, you cocreate this class in conjunction with the ToolbarControl and add undo and redo buttons which manipulate the operation stack via IOperationStack.


Command and tool hosts

The CommandHost and ToolHost objects are used when developing with the ArcGIS C++ API. This enables commands and tools to be developed for UNIX platforms. A tool host holds C++ tool implementations in a toolbar. A command host holds C++ command implementations in a toolbar.