Zebra API Doc

zebra.ui.ScrollPan Class

Extends zebra.ui.Panel

Scroll UI panel. The component is used to manage scrolling for a children UI component that occupies more space than it is available. The usage is very simple, just put an component you want to scroll horizontally or/and vertically in the scroll panel:

   // scroll vertically and horizontally a large picture
   var scrollPan = new zebra.ui.ScrollPan(new zebra.ui.ImagePan("largePicture.jpg"));

   // scroll vertically  a large picture
   var scrollPan = new zebra.ui.ScrollPan(new zebra.ui.ImagePan("largePicture.jpg"),
                                          zebra.layout.VERTICAL);

   // scroll horizontally a large picture
   var scrollPan = new zebra.ui.ScrollPan(new zebra.ui.ImagePan("largePicture.jpg"),
                                          zebra.layout.HORIZONTAL);

Constructor

zebra.ui.ScrollPan

(
  • [c]
  • [barMask]
)

Parameters:

  • [c] zebra.ui.Panel optional

    an UI component that has to be placed into scroll panel

  • [barMask] Integer optional

    a scroll bars mask that allows developers to control vertical and horizontal scroll bars visibility.

Item Index

Methods

scrolled

(
  • psx
  • psy
)

Scroll manager listener method that is called every time a target component has been scrolled

Parameters:

  • psx Integer

    previous scroll x location

  • psy Integer

    previous scroll y location

setAutoHide

(
  • b
)

Set the given auto hide state.

Parameters:

  • b Boolean

    an auto hide state.

Attributes

autoHide

Boolean readonly

Indicate if the scroll bars should be hidden when they are not active

hBar

zebra.ui.Scroll readonly

Horizontal scroll bar component

scrollObj

zebra.ui.Panel readonly

Scrollable target component

vBar

zebra.ui.Scroll readonly

Vertical scroll bar component