ToolBarStandardButton()
Syntax
ToolBarStandardButton(#ButtonID, #ButtonIcon [,Mode])Description
Add a standard button to the toolbar being constructed. CreateToolBar() must be called before to use this command. A standard button is an icon which is available directly under the OS. The '#ButtonIcon' parameter must be one of the following constants :#PB_ToolBarIcon_New #PB_ToolBarIcon_Open #PB_ToolBarIcon_Save #PB_ToolBarIcon_Print #PB_ToolBarIcon_Find #PB_ToolBarIcon_Replace #PB_ToolBarIcon_Cut #PB_ToolBarIcon_Copy #PB_ToolBarIcon_Paste #PB_ToolBarIcon_Undo #PB_ToolBarIcon_Redo #PB_ToolBarIcon_Delete #PB_ToolBarIcon_Properties #PB_ToolBarIcon_Help
With the optional 'Mode' parameter can be adjusted, if the ToolBar button will act as a toggle button or not. One of the following constants can be used:#PB_ToolBar_Normal: the button will act as standard button (default setting) #PB_ToolBar_Toggle: the button will act as toggle buttonLater the GetToolBarButtonState() and SetToolBarButtonState() commands can be used on it.
The later checking of an event, means if the user clicked on an item of the toolbar, will done the same way like checking for a menu event with the command EventMenu().
Example:If OpenWindow(0, 0, 0, 150, 25, "ToolBar", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) If CreateToolBar(0, WindowID(0)) ToolBarStandardButton(0, #PB_ToolBarIcon_New) ToolBarStandardButton(1, #PB_ToolBarIcon_Open) ToolBarStandardButton(2, #PB_ToolBarIcon_Save) EndIf Repeat Event = WaitWindowEvent() If Event = #PB_Event_Menu Debug "ToolBar ID: "+Str(EventMenu()) EndIf Until Event = #PB_Event_CloseWindow EndIf
Supported OS
Windows, Linux, MacOS X