Class zebkit.ui.ScrollPan
extends <zebkit.ui.Panel>
<zebkit.ui>

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 zebkit.ui.ScrollPan(new zebkit.ui.ImagePan("largePicture.jpg"));

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

       // scroll horizontally a large picture
       var scrollPan = new zebkit.ui.ScrollPan(new zebkit.ui.ImagePan("largePicture.jpg"),
                                              "horizontal");
Constructor:
zebkit.ui.ScrollPan ([c], [scrolls], [autoHide])

Parameters:
  • [c] <zebkit.ui.Panel>

    an UI component that has to be placed into scroll panel

  • [scrolls] <String>

    a scroll bars that have to be shown. Use "vertical", "horizontal" or "both" string value to control scroll bars visibility. By default the value is "both"

  • [autoHide] <Boolean>

    a boolean value that says if the scrollbars have to work in auto hide mode. Pass true to switch scrollbars in auto hide mode. By default the value is false




public void scrolled (psx, psy)
public void scrollTo (sx, sy)
public void scrollXTo (sx)
public void scrollYTo (sy)
public void setAutoHide (b)


Inherited methods:
$setConstraints(c)    add(constr, d)    byConstraints([p], c)    byPath(path, [cb])    calcPreferredSize(target)    doLayout( )    fire(event, [path], [params])    focused( )    getBottom( )    getCanvas( )    getComponentAt(x, y)    getHorPadding( )    getLeft( )    getPreferredSize( )    getRight( )    getTop( )    getVerPadding( )    hasFocus( )    indexOf(c)    insert(i, constr, d)    invalidate( )    invalidateLayout( )    kidAdded(index, constr, l)    kidRemoved(i, l)    laidout( )    load(JSON)    off([eventName], [path], [cb])    on([eventName], [path], cb)    paintComponent(g)    paintViewAt(g, ax, ay, v)    properties([path], props)    property([path], name, value)    recalc( )    relocated(px, py)    remove(c)    removeAll( )    removeAt(i)    removeByConstraints(ctr)    removeMe([after])    repaint([x], [y], [w], [h])    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    setAt(i, d)    setBackground(v)    setBorder([v])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setConstraints(ctr)    setEnabled(b)    setId(id)    setKids(a)    setLayout(m)    setLeftPadding(left)    setLocation(xx, yy)    setPadding(v)    setParent(o)    setPreferredSize(w, h)    setProperties([path], props)    setRightPadding(right)    setSize(w, h)    setTopPadding(top)    setVisible(b)    toBack( )    toFront( )    toPreferredHeight( )    toPreferredSize( )    toPreferredWidth( )    toView(target)    validate( )    validateMetric( )    vrp( )   


public void 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

public void scrollTo (sx, sy)

Scroll horizontally and vertically to the given positions


Parameters:
  • sx <Integer>

    a horizontal position

  • sy <Integer>

    a vertical position

public void scrollXTo (sx)

Scroll horizontally


Parameters:
  • sx <Integer>

    a position

public void scrollYTo (sy)

Scroll vertically


Parameters:
  • sy <Integer>

    a position

public chainable setAutoHide (b)

Set the given auto hide state.


Parameters:


Inherited attributes:
public zebkit.draw.View bg    public zebkit.draw.View border    public Boolean canHaveFocus    public Object constraints    public Integer height    public Boolean isEnabled    public Boolean isValid    public Boolean isVisible    public Array kids    public zebkit.layout.Layout layout    public zebkit.layout.Layoutable parent    public Integer width    public Integer x    public Integer y   



public <Boolean> autoHide

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

public <zebkit.ui.Scroll> hBar

Horizontal scroll bar component

public <zebkit.ui.Panel> scrollObj

Scrollable target component

public <zebkit.ui.Scroll> vBar

Vertical scroll bar component