| Visual Basic | |
|---|---|
Public Interface IToolbarItem | |
| C# | |
|---|---|
public interface IToolbarItem | |
| JavaScript | |
|---|---|
Object dsToolbarItem | |
| COM native C++ | |
|---|---|
interface IToolbarItem | |
| C++ | |
|---|---|
class dsToolbarItem | |
The following code snippets show how to add a toolbar button with a ToolTip to a toolbar:
- COM native C++ (from the DraftSight API COM native C++ template file DsAddinConnection.cpp)
- C++ ( from the DraftSight API C++ template file dsAddinConnection.cpp)
COM native C++
IToolbarPtr pToolbar = m_DsApp->AddToolbar( m_sApiUuid, dsUIState_Document, L"DsAddin Toolbar");
IToolbarItemPtr pToolbarItem;
pToolbarItem = pToolbar->InsertToolbarItem( m_sApiUuid, dsToolBarItemType_UserCommand, ++position, L"Open Notepad", pNotepad.GetUserCommandID() );
C++
if( NULL != pToolbar )dsToolbar_ptr pToolbar;
dsApp->AddToolbar( myApplication::appID, dsUIState_Document, ToolbarName, &pToolbar );
{
"Notepad";dsToolbarItem_ptr pToolbarItem;
dsString ButtonName = L
dsString UserCmdID;
pMenu->GetID( &UserCmdID );
pToolbar->InsertToolbarItem( myApplication::appID, dsToolBarItemType_UserCommand, 1, ButtonName, UserCmdID, &pToolbarItem );
To display the list of available toolbars, right-click a toolbar in the DraftSight user interface and select Toolbars to open the Specify Toolbars dialog.
Syntax