ToolBarStandardButton()

Syntax

ToolBarStandardButton(#ButtonID, #ButtonIcon)
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
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 EventMenuID().

Example:
  If OpenWindow(0, 0, 0, 150, 25, #PB_Window_SystemMenu |#PB_Window_ScreenCentered, "ToolBar")
    If CreateToolBar(0, WindowID())
      ToolBarStandardButton(0, #PB_ToolBarIcon_New)
      ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
      ToolBarStandardButton(2, #PB_ToolBarIcon_Save)
    EndIf
    Repeat
      EventID = WaitWindowEvent()
      If EventID = #PB_Event_Menu
        Debug "ToolBar ID: "+Str(EventMenuID())
      EndIf
    Until EventID = #PB_Event_CloseWindow 
  EndIf

Supported OS

Windows, Linux, MacOS X

<- ToolBarSeparator() - ToolBar Index - ToolBarToolTip() ->