AGI Ui Plugins 11 Send comments on this topic.
AddButton Method (IAgUiPluginToolbarBuilder)
See Also  Example
CommandID
A named command
Title
A text associated with the command. The text will be displayed in a tool tip.
Description
A text displayed in the status bar when a mouse is over the button.
Options
PictureDisp
An icon associated with the toolbar button. Can be null. If no icon is specified, the button will display the text specified by the Title parameter.





Description

Adds a standard push-style button.

Note: Toolbar changes may not be immediately reflected in STK. To force a toolbar reset, go to Edit > Preferences > UI Plugins. Select the current plugin, then click "Reset Toolbars."

Syntax

[Visual Basic .NET]
Public Sub AddButton( _
   ByVal CommandID As String, _
   ByVal Title As String, _
   ByVal Description As String, _
   ByVal Options As AgEToolBarButtonOptions, _
   ByVal PictureDisp As Picture _
) 

[C#]
public void AddButton(
string CommandID,
string Title,
string Description,
AgEToolBarButtonOptions Options,
System.Drawing.Image PictureDisp
);

[Managed C++]
public: void AddButton(
String __gc ^ CommandID,
String __gc ^ Title,
String __gc ^ Description,
AgEToolBarButtonOptions Options,
stdole::IPictureDisp ^ PictureDisp
);

[Java]
public  addButton(
String CommandID,
String Title,
String Description,
AgEToolBarButtonOptions Options,
Picture PictureDisp
);

[Unmanaged C++]
public: HRESULT AddButton(
BSTR CommandID,
BSTR Title,
BSTR Description,
AgEToolBarButtonOptions Options,
stdole::IPictureDisp * PictureDisp
);

Parameters

CommandID
A named command
Title
A text associated with the command. The text will be displayed in a tool tip.
Description
A text displayed in the status bar when a mouse is over the button.
Options
Member Value Description
eToolBarButtonOptionNone 0 No options. QueryState is called to determine button state.
eToolBarButtonOptionAlwaysOn 1 Indicates the button state is always enabled. QueryState is never called.
eToolBarButtonOptionNeedScenario 2 Indicates the button is disabled if no scenario is loaded. If a scenario is loaded, QueryState is called to determine button state.
PictureDisp
An icon associated with the toolbar button. Can be null. If no icon is specified, the button will display the text specified by the Title parameter.

Example

Add a button to a custom toolbar Copy Code
//IAgUiPluginToolbarBuilder builder; 
builder.AddButton("MyFirstCommand""Example CSharp Ui Plugin Toolbar Button""Open a Custom user interface.", AgEToolBarButtonOptions.eToolBarButtonOptionAlwaysOn, null); 

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1