Class UIEnvironment
Provides access to the application's UI environment
Namespace: ABB.Robotics.RobotStudio.Environment
Assembly: ABB.Robotics.RobotStudio.Environment.dll
Syntax
public sealed class UIEnvironment
Remarks
It is not possible to create an instance of this class; all methods are static.
Properties
ActiveNonContextualRibbonTab
Gets the last active non-contextual tab. If the currently active tab is a non-contextual tab, it will be returned.
Declaration
public static RibbonTab ActiveNonContextualRibbonTab { get; }
Property Value
Type | Description |
---|---|
RibbonTab |
ActiveRibbonTab
Gets or sets the currently active tab in the Ribbon
Declaration
public static RibbonTab ActiveRibbonTab { get; set; }
Property Value
Type | Description |
---|---|
RibbonTab |
ApplicationMenu
Returns the application menu displayed when the Application Button is pressed
Declaration
public static ApplicationMenu ApplicationMenu { get; }
Property Value
Type | Description |
---|---|
ApplicationMenu |
BackstageVisible
True if the Backstage (File) tab is currently active, false otherwise.
Declaration
public static bool BackstageVisible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Note that the Backstage/File tab is not part of the RibbonTabs collection.
CommandBarControls
Returns a collection of all registered CommandBarControls
Declaration
public static CommandBarControlCollection CommandBarControls { get; }
Property Value
Type | Description |
---|---|
CommandBarControlCollection |
Remarks
Controls that does not have an ID, or have never been added to a collection (this or another one) cannot be found in this collection.
CurrentlyExecutingCommand
Returns the CommandBarButton or CommandBarButtonGroup that is currently being executed, or null if no command is currently being executed.
Declaration
public static CommandBarControl CurrentlyExecutingCommand { get; }
Property Value
Type | Description |
---|---|
CommandBarControl |
DefaultWindowZoom
Gets or sets the default zoom level for windows implementing IZoomableWindow
Declaration
public static double DefaultWindowZoom { get; set; }
Property Value
Type | Description |
---|---|
Double |
GroupDocumentWindows
Gets or sets if document windows are grouped based on their Category property.
Declaration
public static bool GroupDocumentWindows { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Existing windows will not be regrouped if this property is changed.
MainWindow
Returns an object describing the main window
Declaration
public static MainWindow MainWindow { get; }
Property Value
Type | Description |
---|---|
MainWindow |
Notifications
Gets a collection of Notification objects that are shown in a popup when the user clicks the notification icon in the RobotStudio title bar.
Declaration
public static NotificationCollection Notifications { get; }
Property Value
Type | Description |
---|---|
NotificationCollection |
QuickAccessCandidates
Returns a collection of controls visible on the "Customize Quick Access" menu
Declaration
public static CommandBarControlCollection QuickAccessCandidates { get; }
Property Value
Type | Description |
---|---|
CommandBarControlCollection |
QuickAccessToolBar
Returns a CommandBar representing the contents of the Quick Access toolbar in the upper-left corner
Declaration
public static CommandBar QuickAccessToolBar { get; }
Property Value
Type | Description |
---|---|
CommandBar |
RibbonContextualTabs
Returns the collection of contextual tab groups defined for the ribbon
Declaration
public static RibbonContextTabGroupCollection RibbonContextualTabs { get; }
Property Value
Type | Description |
---|---|
RibbonContextTabGroupCollection |
RibbonMinimized
Gets or sets if the ribbon is minimized so that only the tabs are visible. Default is false.
Declaration
public static bool RibbonMinimized { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
RibbonSelectionType
Gets or sets the current selection type, i.e. an object defining the type of the object(s) currently being selected
Declaration
public static object RibbonSelectionType { get; set; }
Property Value
Type | Description |
---|---|
Object |
RibbonTabs
Returns the collection of (non-contextual) tabs in the Ribbon
Declaration
public static RibbonTabCollection RibbonTabs { get; }
Property Value
Type | Description |
---|---|
RibbonTabCollection |
ShowScreenTips
Gets or sets if screen tips are shown for command elements
Declaration
public static bool ShowScreenTips { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
StatusBar
Returns the main statusbar
Declaration
public static StatusBar StatusBar { get; }
Property Value
Type | Description |
---|---|
StatusBar |
UserToolBar
Returns a CommandBar representing the contents of the User toolbar in the upper-right corner
Declaration
public static CommandBar UserToolBar { get; }
Property Value
Type | Description |
---|---|
CommandBar |
VisibleRibbonContextualTabs
Returns the collection of currently visible contextual tab groups
Declaration
public static RibbonContextTabGroupCollection VisibleRibbonContextualTabs { get; }
Property Value
Type | Description |
---|---|
RibbonContextTabGroupCollection |
VisualStyle
Returns an object containing Visual Styles-related information for the application
Declaration
public static VisualStyle VisualStyle { get; }
Property Value
Type | Description |
---|---|
VisualStyle |
Windows
Returns a collection of all Windows in the application
Declaration
public static WindowCollection Windows { get; }
Property Value
Type | Description |
---|---|
WindowCollection |
Methods
DisableCommands(Task)
Disables all commands until the specified task has completed;
Declaration
public static void DisableCommands(Task task)
Parameters
Type | Name | Description |
---|---|---|
Task | task |
Exit()
Exits the application
Declaration
public static void Exit()
GetActiveNotificationAreaHelpId()
Gets the currently active notification area help ID
Declaration
public static string GetActiveNotificationAreaHelpId()
Returns
Type | Description |
---|---|
String |
GetContextMenu(Object)
Gets or creates a context menu popup for the specified selection type
Declaration
public static CommandBarContextPopup GetContextMenu(object ctxType)
Parameters
Type | Name | Description |
---|---|---|
Object | ctxType |
Returns
Type | Description |
---|---|
CommandBarContextPopup |
GetContextMenus()
Gets a dictionary that contains all specified selection types and their associated context menu popup.
Declaration
public static IReadOnlyDictionary<object, CommandBarContextPopup> GetContextMenus()
Returns
Type | Description |
---|---|
IReadOnlyDictionary<Object, CommandBarContextPopup> |
HideNotificationArea()
Hides the default notification area above the DocumentWindow tabs
Declaration
public static void HideNotificationArea()
HideNotificationArea(String)
Hides the notification area with the specified Id.
Declaration
public static void HideNotificationArea(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | Notification area id |
LoadWindowConfiguration(TextReader)
Loads a window and toolbar configuration from a stream
Declaration
public static void LoadWindowConfiguration(TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
TextReader | reader | Stream to read from |
LoadWindowConfiguration(TextReader, IEnumerable<String>)
Loads a window and toolbar configuration from a stream
Declaration
public static void LoadWindowConfiguration(TextReader reader, IEnumerable<string> windowIDs)
Parameters
Type | Name | Description |
---|---|---|
TextReader | reader | Stream to read from |
IEnumerable<String> | windowIDs | A collection of window ids for which the configuration should be applied. The collection needs to contain at least one id |
OnActivateWindow(Window)
Moves a window to the front of the list that is used to determine the active window when switching between ribbon tabs.
Declaration
public static void OnActivateWindow(Window wnd)
Parameters
Type | Name | Description |
---|---|---|
Window | wnd |
PresentDocumentWindow(DocumentWindow)
Ensures that a DocumentWindow is presented on screen.
Declaration
public static void PresentDocumentWindow(DocumentWindow window)
Parameters
Type | Name | Description |
---|---|---|
DocumentWindow | window | The DocumentWindow to present. |
SaveDockedWindowsConfiguration(TextWriter)
Only save docked windows
Declaration
public static void SaveDockedWindowsConfiguration(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | Stream to write to |
SaveWindowConfiguration(TextWriter)
Saves the current window and toolbar configuration to file
Declaration
public static void SaveWindowConfiguration(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | Stream to write to |
ShowContextMenu(Object[], Int32, Int32)
Shows a context menu for the specified selection types
Declaration
public static void ShowContextMenu(object[] selTypes, int x, int y)
Parameters
Type | Name | Description |
---|---|---|
Object[] | selTypes | Selection types to build context menu for |
Int32 | x | Menu x-position (in screen coordinates) |
Int32 | y | Menu y-position (in screen coordinates) |
Remarks
Only context menu items valid for all given types will be displayed.
ShowNotificationArea(Image, String, CommandBarPopup, String)
Displays a notification area above the DocumentWindow tabs
Declaration
public static void ShowNotificationArea(Image image, string text, CommandBarPopup menuPopup, string helpId)
Parameters
Type | Name | Description |
---|---|---|
Image | image | Small (16x16) Image to be displayed before the text (can be null) |
String | text | Text to be displayed in the notification area |
CommandBarPopup | menuPopup | Menu that will be displayed when the area is clicked (can be null) |
String | helpId | Context help ID |
ShowNotificationArea(Image, String, CommandBarPopup, String, DocumentWindow)
Displays a notification area above the DocumentWindow tabs
Declaration
public static void ShowNotificationArea(Image image, string text, CommandBarPopup menuPopup, string helpId, DocumentWindow associatedWindow)
Parameters
Type | Name | Description |
---|---|---|
Image | image | Small (16x16) Image to be displayed before the text (can be null) |
String | text | Text to be displayed in the notification area |
CommandBarPopup | menuPopup | Menu that will be displayed when the area is clicked (can be null) |
String | helpId | Context help ID |
DocumentWindow | associatedWindow | The notification area will only be visible if the associated DocumentWindow is also visible. |
ShowNotificationArea(String, Image, String, CommandBarPopup, String)
Displays a notification area above the DocumentWindow tabs
Declaration
public static void ShowNotificationArea(string id, Image image, string text, CommandBarPopup menuPopup, string helpId)
Parameters
Type | Name | Description |
---|---|---|
String | id | Unique identifier for this notification area. |
Image | image | Small (16x16) Image to be displayed before the text (can be null) |
String | text | Text to be displayed in the notification area |
CommandBarPopup | menuPopup | Menu that will be displayed when the area is clicked (can be null) |
String | helpId | Context help ID |
Remarks
Use this instead of ShowNotificationArea(Image, String, CommandBarPopup, String) for displaying multiple notification areas simultaneously.
ShowNotificationArea(String, Image, String, CommandBarPopup, String, DocumentWindow)
Displays a notification area above the DocumentWindow tabs
Declaration
public static void ShowNotificationArea(string id, Image image, string text, CommandBarPopup menuPopup, string helpId, DocumentWindow associatedWindow)
Parameters
Type | Name | Description |
---|---|---|
String | id | Unique identifier for this notification area. |
Image | image | Small (16x16) Image to be displayed before the text (can be null) |
String | text | Text to be displayed in the notification area |
CommandBarPopup | menuPopup | Menu that will be displayed when the area is clicked (can be null) |
String | helpId | Context help ID |
DocumentWindow | associatedWindow | The notification area will only be visible if the associated DocumentWindow is also visible. |
Remarks
Use this instead of ShowNotificationArea(String, Image, String, CommandBarPopup, String) for displaying multiple notification areas simultaneously.
ShowNotificationArea(String, Control, String, DocumentWindow)
Displays a notification area with a custom control above the DocumentWindow tabs
Declaration
public static void ShowNotificationArea(string id, Control control, string helpId = null, DocumentWindow associatedWindow = null)
Parameters
Type | Name | Description |
---|---|---|
String | id | Unique identifier for this notification area. |
Control | control | Control to display in the area. |
String | helpId | Context help ID |
DocumentWindow | associatedWindow | The notification area will only be visible if the associated DocumentWindow is also visible. |
Remarks
The height of the control must be a low value.
UpdateUI()
Forces an update of the GUI (command enabled status etc)
Declaration
public static void UpdateUI()
Events
ActiveRibbonTabChanged
Raised after the active RibbonTab has been changed
Declaration
public static event EventHandler ActiveRibbonTabChanged
Event Type
Type | Description |
---|---|
EventHandler |
ActiveRibbonTabChanging
Raised before the active RibbonTab changes
Declaration
public static event EventHandler ActiveRibbonTabChanging
Event Type
Type | Description |
---|---|
EventHandler |
BackstageVisibleChanged
Raised when the BackstageVisible property has been changed
Declaration
public static event EventHandler BackstageVisibleChanged
Event Type
Type | Description |
---|---|
EventHandler |
Exception
Raised when an exception is thrown by an event handler and caught by the environment.
Declaration
public static event ExceptionEventHandler Exception
Event Type
Type | Description |
---|---|
ExceptionEventHandler |
ExecutedCommand
Raised after a command has been executed
Declaration
public static event ExecutedCommandEventHandler ExecutedCommand
Event Type
Type | Description |
---|---|
ExecutedCommandEventHandler |
ExecutingCommand
Raised whenever a command is about to be executed
Declaration
public static event ExecutingCommandEventHandler ExecutingCommand
Event Type
Type | Description |
---|---|
ExecutingCommandEventHandler |
Exited
Raised when the application has started to shutdown
Declaration
public static event EventHandler Exited
Event Type
Type | Description |
---|---|
EventHandler |
Remarks
The EventArgs argument can be cast to a ExitedEventArgs for registering tasks that must be completed before the application process exits.
Exiting
Raised before the application exits, giving clients a chance to abort the shutdown
Declaration
public static event CancelEventHandler Exiting
Event Type
Type | Description |
---|---|
CancelEventHandler |
Idle
Equivalent to Application.Idle, but occurs at a lower rate (maximum four times per second)
Declaration
public static event EventHandler Idle
Event Type
Type | Description |
---|---|
EventHandler |
RibbonSelectionTypeChanged
Raised when the RibbonSelectionType property has been changed
Declaration
public static event EventHandler RibbonSelectionTypeChanged
Event Type
Type | Description |
---|---|
EventHandler |
TrackCommandBarControl
Raised when a CommandBarControl is tracked
Declaration
public static event TrackCommandBarControlEventHandler TrackCommandBarControl
Event Type
Type | Description |
---|---|
TrackCommandBarControlEventHandler |
UpdateCommandUI
Raised when a command's UI state must be updated
Declaration
public static event UpdateCommandUIEventHandler UpdateCommandUI
Event Type
Type | Description |
---|---|
UpdateCommandUIEventHandler |