2.2.7.10 ToolbarButton


Name

ToolbarButton

Remark

Class offers Origin C-based access to toolbar button settings used in the Button Settings Dialog Box. It allows toolbar buttons to be created, modified, and deleted.

It is generally used in conjunction with the ToolbarButtonGroup class.

Hierarchy

  • ToolbarButton

Header to Include

origin.h

Members

Name Brief
ToolbarButton()
Constructor.
int Load(const INIFile &ini, LPCSTR pcszSec)
int Load(const INIFile &ini, int nIndex)
Loads button setting from a button group INI file section either by custom button section name or by using a zero-based index to generate a section name to look up. Always returns 0. Creates a default button if INI file is not found. "CustomButton" is the base name of the section. The following two examples load from the same section:
int ToolbarButton::Load("C:\MyToolbar.ini", 0);// 0 is converted to 1 internally.
int ToolbarButton::Load("C:\MyToolbar.ini", "CustomButton1");
int Save(const INIFile &ini, int nIndex)
int Save(const INIFile &ini, LPCSTR pcszSec)
Save buttons setting to a button group INI file section either by custom button section name or by using a zero-based index to generate a section name to look up. Always returns 0. "CustomButton" is the base name of the section. The following two examples save to the same section:
ToolbarButton::Save("C:\MyToolbar.ini", 0);// 0 is converted to 1 internally.
ToolbarButton::Save("C:\MyToolbar.ini", "CustomButton1");
void SetID(UINT nID)
UINT GetID()
Setter/Getter for the Id button property.
void SetImage(int nIndex)
int GetImage()
Setter/Getter for the zero-based button image index on the button group bitmap.
void SetOGSFile(LPCSTR pcszFile)
LPCSTR GetOGSFile()
Setter/Getter for full path and file name of OGS script file. Corresponds to File Name in the Button Settings Dialog Box.
void SetOGSSec(LPCSTR pcszSec)
LPCSTR GetOGSSec()
Setter/Getter for the section to run in the OGS script file. Corresponds to Section Name in the Button Settings Dialog Box.
void SetOGSCode(LPCSTR pcszCode)
LPCSTR GetOGSCode()
Setter/Getter for the actual LabTalk code to run when the button is clicked.
void SetArgList(LPCSTR pcszArgList)
LPCSTR GetArgList()
Setter/Getter for the argument list to pass to the section. Corresponds to Argument List in the Button Settings Dialog Box.
void SetToolTip(LPCSTR pcszToolTip)
LPCSTR GetToolTip()
Setter/Getter for tool tip text to display on button mouseover. Corresponds to Tool Tip Tezt in the Button Settings Dialog Box.
void SetStatBar(LPCSTR pcszStatBar)
LPCSTR GetStatBar()
Setter/Getter for status bar text on button mouseover. Corresponds to Status Bar in the Button Settings Dialog Box.
void SetLTExpr(LPCSTR pcszLTExpr)
LPCSTR GetLTExpr()
Setter/Getter for the LabTalk expression to use for enabling the button. Corresponds to LabTalk expression to enable in the Button Settings Dialog Box.
void SetLTMulti(LPCSTR pcszLTMulti)
LPCSTR GetLTMulti()
Setter/Getter for the LabTalk variable to use for toggling a multi-state button. Corresponds to LabTalk variable to toggle in the Button Settings Dialog Box.
void SetContext(int nContext)
int GetContext()
Setter/Getter for the button context. UBG_CONTEXT_TEMPL = Template; UBG_CONTEXT_WINDOW = Window; UBG_CONTEXT_ALWAYS = Always. Corresponds to Context radio group in the Button Settings Dialog Box.
void SetTemplate(LPCSTR pcszTemplate)
LPCSTR GetTemplate()
Setter/Getter for full path and file name of the Origin template. Corresponds to the selected template in the Button Settings Dialog Box.
void SetWindow(int nWindow)
int GetWindow()
Setter/Getter for Windows types to enable the button for. Corresponds to the window types in the Button Settings Dialog Box.

Can one one (or a bitwise combination) of the following:

UBG_WND_WKS
UBG_WND_MATRIX
UBG_WND_GRAPH
UBG_WND_LAYOUT
UBG_WND_EXCEL