Zebra API Doc

zebra.layout.FlowLayout Class

Flow layout manager group and places components aligned with different vertical and horizontal alignments

   // create panel and set flow layout for it
   // components added to the panel will be placed 
   // horizontally aligned at the center of the panel 
   var p = new zebra.ui.Panel();
   p.setLayout(new zebra.layout.FlowLayout(zebra.layout.CENTER, zebra.layout.CENTER));

   // add three buttons into the panel with flow layout 
   p.add(new zebra.ui.Button("Button 1"));
   p.add(new zebra.ui.Button("Button 2"));
   p.add(new zebra.ui.Button("Button 3"));

Constructor

zebra.layout.FlowLayout

(
  • [ax]
  • [ay]
  • [dir]
  • [gap]
)

Parameters:

  • [ax] Integer | String optional

    (zebra.layout.LEFT by default) horizontal alignment:

    zebra.layout.LEFT - left alignment 
    zebra.layout.RIGHT - right alignment 
    zebra.layout.CENTER - center alignment 
    
    or
    
    "left" 
    "center"
    "right"
  • [ay] Integer | String optional

    (zebra.layout.TOP by default) vertical alignment:

    zebra.layout.TOP - top alignment 
    zebra.layout.CENTER - center alignment 
    zebra.layout.BOTTOM - bottom alignment 
    
    or
    
    "top" 
    "center"
    "bottom"
  • [dir] Integer | String optional

    (zebra.layout.HORIZONTAL by default) a direction the component has to be placed in the layout

    zebra.layout.VERTICAL - vertical placed components
    zebra.layout.HORIZONTAL - horizontal placed components 
    
    or
    
    "vertical" 
    "horizontal"
  • [gap] Integer optional

    a space in pixels between laid out components

Item Index

Attributes

Attributes

ax

Integer | String readonly

Horizontal laid out components alignment

Default: zebra.layout.LEFT

ay

Integer | String readonly

Vertical laid out components alignment

Default: zebra.layout.TOP

direction

Integer | String readonly

Laid out components direction

Default: zebra.layout.HORIZONTAL

gap

Integer readonly

Gap between laid out components

Default: 0