Zebra API Doc

zebra.ui.SplitPan Class

Extends zebra.ui.Panel

Splitter panel UI component class. The component splits its area horizontally or vertically into two areas. Every area hosts an UI component. A size of the parts can be controlled by mouse cursor dragging. Gripper element is children UI component that can be customized. For instance:

 // create split panel
 var sp = new zebra.ui.SplitPan(new zebra.ui.Label("Left panel"), 
                               new zebra.ui.Label("Right panel")); 

 // customize gripper background color depending on its state
 sp.gripper.setBackground(new zebra.ui.ViewSet({
      "over" : "yellow"
      "out" : null,
      "pressed.over" : "red"
 }));

Constructor

zebra.ui.SplitPan

(
  • [first]
  • [second]
  • [o]
)

Parameters:

  • [first] zebra.ui.Panel optional

    a first UI component in splitter panel

  • [second] zebra.ui.Panel optional

    a second UI component in splitter panel

  • [o] Integer optional

    an orientation of splitter element: zebra.layout.VERTICAL or zebra.layout.HORIZONTAL

Methods

setGap

(
  • g
)

Set gap between gripper element and sizable panels

Parameters:

  • g Integer

    a gap

setGripperLoc

(
  • l
)

Set gripper element location

Parameters:

  • l Integer

    a location of the gripper element

setGripperMovable

(
  • b
)

Set the given gripper movable state

Parameters:

  • b Boolean

    the gripper movable state.

setLeftMinSize

(
  • m
)

Set the minimal size of the left (or top) sizeable panel

Parameters:

  • m Integer

    a minimal possible size

setRightMinSize

(
  • m
)

Set the minimal size of the right (or bottom) sizeable panel

Parameters:

  • m Integer

    a minimal possible size

Attributes

gap

Integer readonly

A gap between gripper element and first and second UI components

Default: 1

gripper

zebra.ui.Panel readonly

A reference to gripper UI component

isMoveable

Boolean readonly

Indicates if the splitter bar can be moved

Default: true

leftComp

zebra.ui.Panel readonly

A reference to left (top) sizable UI component

leftMinSize

Integer readonly

A minimal size of the left (or top) sizable panel

Default: 50

rightComp

zebra.ui.Panel readonly

A reference to right (bottom) sizable UI component

rightMinSize

Integer readonly

A minimal size of right (or bottom) sizable panel

Default: 50