Class CommandBarControl
Base class for all items appearing in tool bars, menus and context menus.
Inheritance
Namespace: ABB.Robotics.RobotStudio.Environment
Assembly: ABB.Robotics.RobotStudio.Environment.dll
Syntax
public abstract class CommandBarControl
Remarks
Most classes inheriting from CommandBarControl takes an ID argument in their constructors. Each instance of a CommandBarControl which is added to the UIEnvironment must have a unique ID. The Id is used to identify the control in for example the ExecuteCommand event handler. CommandBarControls with a unique ID and has been added to a control collection, can be found using CommandBarControls. In order to avoid collisions between Id strings used by Add-Ins, its is recomended that the name of the Add-In is used as a prefix. For example "MyCompany.MyAddin.LaunchSetupDialog", instead of using only "LaunchSetupDialog" as the Id.
The same CommandBarControl can be added to multiple collections, in order to display the same menu/toolbar choice in multiple places.
Constructors
CommandBarControl(String, String)
Internal use only
Declaration
protected CommandBarControl(string id, string caption)
Parameters
Type | Name | Description |
---|---|---|
String | id | |
String | caption |
Properties
Caption
Gets or sets the user-visible caption of the control
Declaration
public string Caption { get; set; }
Property Value
Type | Description |
---|---|
String |
HelpId
Gets or sets the help ID of the control, used for context sensitive help.
Declaration
public string HelpId { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
By default, this will be the same as the control ID
HelpText
Gets or sets the help text that will be displayed in ScreenTips, as well as in CommandBarGalleryPopups with the GalleryTextPosition property set to 'Right'
Declaration
public string HelpText { get; set; }
Property Value
Type | Description |
---|---|
String |
Id
Gets the unique Id of the control.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
String |
See Also
Image
Gets or sets the control's small (16x16 pixel for 100% display scaling) image
Declaration
public Image Image { get; set; }
Property Value
Type | Description |
---|---|
Image |
ImagePlacement
Specifies the placement of the control's image if both text and image are visible.
Declaration
public ImagePlacement ImagePlacement { get; set; }
Property Value
Type | Description |
---|---|
ImagePlacement |
Remarks
Only valid for controls in a ToolBarControl.
IsUndoable
Gets or sets if this CommandBarControl represents an undoable command.
Declaration
public bool IsUndoable { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This property is used to avoid unintended nesting of undoable operations. If it is True, the command will be disabled while any other undoable operation is in progress.
LargeImage
Gets or sets the control's large (32x32 pixel for 100% display scaling) image
Declaration
public Image LargeImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
LargeThemedImage
Gets the control's large image, recolored for use in the ribbon according to the current theme.
Declaration
public Image LargeThemedImage { get; }
Property Value
Type | Description |
---|---|
Image |
Remarks
This is automatically generated from LargeImage if it meets certain criteria; otherwise LargeImage is returned.
ScreenTipImage
Gets or sets the image that will be displayed in the control's ScreenTip
Declaration
public Image ScreenTipImage { get; set; }
Property Value
Type | Description |
---|---|
Image |
Remarks
The image should not be wider than 100 pixels, otherwise it will be scaled down.
Tag
Gets or sets a user-defined object for the control
Declaration
public object Tag { get; set; }
Property Value
Type | Description |
---|---|
Object |
ThemedImage
Gets the control's image, recolored for use in the ribbon according to the current theme.
Declaration
public Image ThemedImage { get; }
Property Value
Type | Description |
---|---|
Image |
Remarks
This is automatically generated from Image if it meets certain criteria; otherwise Image is returned.
Visible
Gets or sets if the CommandBarControl should be visible in the UI or not.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
ResolveTarget(IList<Delegate>)
Given a list of command handlers, resolves which one shall handle the command. This method is called from the CommandBarButton and CommandBarCommandGroup.
Declaration
protected Delegate ResolveTarget(IList<Delegate> delegates)
Parameters
Type | Name | Description |
---|---|---|
IList<Delegate> | delegates | A list with potential handlers. |
Returns
Type | Description |
---|---|
Delegate | The resolved handler. |
ToString()
Returns a string representation of this
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Events
TrackCommandBarControl
This event is raised when the CommandBarControl is tracked, i.e. the user moves the mouse over the control.
Declaration
public event TrackCommandBarControlEventHandler TrackCommandBarControl
Event Type
Type | Description |
---|---|
TrackCommandBarControlEventHandler |