Name

basetabslider — A non-visual container that animates and coordinates the sliding of basetabelements

Synopsis

LZX: basetabslider
JavaScript: lz.basetabslider
Type: Class
Access: public
Topic: Components.Base Components
Declared in: lps/components/base/basetabslider.lzx

Description

A basetabslider coordinates the opening and closing of its basetabelements contained within its scope. basetabslider and basetabelement have no visual aspects. The tabslider class (which extends basetabslider) does contain a visual UI and shows how basetabslider can be extended to create your own visual framework for a unique tab slider.

An example of the use of these classes is shown below. In order to make the base classes visible, background colors have been assigned to them.

<canvas height="220">
              <include href="base/basetabslider.lzx"/>
              <basetabslider bgcolor="yellow" width="100" height="200" mintabheight="40" spacing="2" slideduration="300">
                <basetabelement clickable="true" bgcolor="red" width="100%"/>
                <basetabelement clickable="true" bgcolor="red" width="100%"/>
                <basetabelement clickable="true" bgcolor="red" width="100%"/>
              </basetabslider>
            </canvas>

The mintabheight specified for a basetabslider applies to all of its basetabelements except those basetabelements that define it for themselves, as demonstrated in the following example.

<canvas height="220">
              <include href="base/basetabslider.lzx"/>
              <basetabslider bgcolor="yellow" width="100" height="200" mintabheight="40" spacing="2" slideduration="300">
                <basetabelement clickable="true" bgcolor="red" width="100%"/>
                <basetabelement clickable="true" bgcolor="red" width="100%" minheight="15"/>
                <basetabelement clickable="true" bgcolor="red" width="100%"/>
              </basetabslider>
            </canvas>
This class is a non-visual container that animates and coordinates the sliding of basetabelements.

Superclass Chain

node (LzNode) » view (LzView) » basecomponent » basevaluecomponent » baseformitem » baselist » basetabslider

Known Subclasses

Details

Properties (13)

availableheight
<attribute name="availableheight" value="0" />
private var availableheight;
_defaultview
<attribute name="_defaultview" value="null" />
private var _defaultview;
hilite
<attribute name="hilite" value="false" />
private var hilite;
Deprecated. See todo 3570.
inset_bottom
<attribute name="inset_bottom" value="8" />
public var inset_bottom;
The bottom inset for content appearing within a tabelement. Default is 8.
inset_left
<attribute name="inset_left" value="8" />
public var inset_left;
The left inset for content appearing within a tabelement. Default is 8.
inset_right
<attribute name="inset_right" value="8" />
public var inset_right;
The right inset for content appearing within a tabelement. Default is 8.
inset_top
<attribute name="inset_top" value="8" />
public var inset_top;
The top inset for content appearing within a tabelement. Default is 8.
mintabheight
<attribute name="mintabheight" value="22" />
public var mintabheight;
The default height of every tab when closed. Default is 22.
opennedtab
<attribute name="opennedtab" value="null" />
private var opennedtab;
slideduration
<attribute name="slideduration" value="300" />
public var slideduration;
The duration of the tabs openning and closing. Default is 300.
spacing
<attribute name="spacing" value="0" />
public var spacing;
The spacing of the tabs. Default is 0.
_spacinginitdone
<attribute name="_spacinginitdone" value="false" />
private var _spacinginitdone;
resetHeight() should only get called from setSpacing not during init.
totalminheight
<attribute name="totalminheight" value="0" />
private var totalminheight;

Methods (10)

addItem()
<method name="addItem" args="txt" />
public function addItem(txt : String);
Add the new item (instantiated using itemclassname) and a new tabelement.
calcAvailableHeight()
<method name="calcAvailableHeight" />
public function calcAvailableHeight();
Calculate the height available to place items in basetabslider.
doAddSubview()
<method name="doAddSubview" args="v" />
public function doAddSubview(v);
init()
<method name="init" />
private function init();
openNext()
<method name="openNext" />
public function openNext() : boolean;
Open next tabelement. Nothing will be opened if the last basetabelement is encountered.
openTab()
<method name="openTab" args="tabelement, withAnimation" />
public function openTab(tabelement : basetabelement, withAnimation : boolean);
Deprecated: use this.select(atabview) instead.
resetHeight()
<method name="resetHeight" />
private function resetHeight();
Recalculate the available height and update the opened tab.
select()
<method name="select" args="item" />
public function select(item : LzView);
Select a tabelement.
setHeight()
<method name="setHeight" args="h" />
public function setHeight(h : Number);
Set the height of the basetabslider.
_setSpacing()
<method name="_setSpacing" args="sp" />
private function _setSpacing(sp);

LZX Synopsis

<class name="lz.basetabslider" extends=" lz.baselist ">
  <attribute name=" availableheight " value="0" />
  <attribute name=" _defaultview " value="null" />
  <attribute name=" hilite " value="false" />
  <attribute name=" inset_bottom " value="8" />
  <attribute name=" inset_left " value="8" />
  <attribute name=" inset_right " value="8" />
  <attribute name=" inset_top " value="8" />
  <attribute name=" mintabheight " value="22" />
  <attribute name=" opennedtab " value="null" />
  <attribute name=" slideduration " value="300" />
  <attribute name=" spacing " value="0" />
  <attribute name=" _spacinginitdone " value="false" />
  <attribute name=" totalminheight " value="0" />
  <method name=" addItem " args="txt" />
  <method name=" calcAvailableHeight " />
  <method name=" doAddSubview " args="v" />
  <method name=" init " />
  <method name=" openNext " />
  <method name=" openTab " args="tabelement, withAnimation" />
  <method name=" resetHeight " />
  <method name=" select " args="item" />
  <method name=" setHeight " args="h" />
  <method name=" _setSpacing " args="sp" />
</class>

JavaScript Synopsis

public lz.basetabslider extends  lz.baselist  {
  private var availableheight ;
  private var _defaultview ;
  private var hilite ;
  public var inset_bottom ;
  public var inset_left ;
  public var inset_right ;
  public var inset_top ;
  public var mintabheight ;
  private var opennedtab ;
  public var slideduration ;
  public var spacing ;
  private var _spacinginitdone ;
  private var totalminheight ;
  prototype public function addItem (txt : String);
  prototype public function calcAvailableHeight ();
  prototype public function doAddSubview (v);
  prototype private function init ();
  prototype public function openNext () : boolean;
  prototype public function openTab (tabelement : basetabelement, withAnimation : boolean);
  prototype private function resetHeight ();
  prototype public function select (item : LzView);
  prototype public function setHeight (h : Number);
  prototype private function _setSpacing (sp);
}