Zebra API Doc

zebra.ui.Toolbar Class

Extends zebra.ui.Panel

Toolbar UI component. Handy way to place number of click able elements

Methods

addDecorative

(
  • c
)
zebra.ui.Panel

Add the given component as decorative element of the toolbar. Decorative elements don't fire event and cannot be pressed

Parameters:


Return: zebra.ui.Panel

a component that has been added

addImage

(
  • img
)
zebra.ui.Panel

Add an image as the toolbar element

Parameters:

  • img String | Image

    an image or a path to the image


Return: zebra.ui.Panel

a component that has been added

addLine

() zebra.ui.Panel

Add line to the toolbar component. Line is a decorative ] element that logically splits toolbar elements. Line as any other decorative element doesn't fire event


Return: zebra.ui.Panel

a component that has been added

addRadio

(
  • g
  • c
)
zebra.ui.Panel

Add a radio box as the toolbar element that belongs to the given group and has the specified content component

Parameters:


Return: zebra.ui.Panel

a component that has been added

addSwitcher

(
  • c
)
zebra.ui.Panel

Add a check box as the toolbar element with the specified content component

Parameters:


Return: zebra.ui.Panel

a component that has been added

isDecorative

(
  • c
)
Boolean protected

Test if the given component is a decorative element in the toolbar

Parameters:


Return: Boolean

return true if the component is decorative element of the toolbar

Events

pressed

Fired when a toolbar element has been pressed

   var t = new zebra.ui.Toolbar();

   // add three pressable icons
   t.addImage("icon1.jpg");
   t.addImage("icon2.jpg");
   t.addLine();
   t.addImage("ico3.jpg");

   // catch a toolbar icon has been pressed
   t.bind(function (src) {
       ...
   });

Event Parameters: