AGI Ui Plugins 11Send 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.
Windows






Windows & Linux

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
MemberValueDescription
eToolBarButtonOptionNone0No options. QueryState is called to determine button state.
eToolBarButtonOptionAlwaysOn1Indicates the button state is always enabled. QueryState is never called.
eToolBarButtonOptionNeedScenario2Indicates 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 toolbarCopy Code
//IAgUiPluginToolbarBuilder builder; 
builder.AddButton("MyFirstCommand""Example CSharp Ui Plugin Toolbar Button""Open a Custom user interface.", AgEToolBarButtonOptions.eToolBarButtonOptionAlwaysOn, null); 

See Also

© 2019 Analytical Graphics, Inc. All Rights Reserved.