Name

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

Synopsis

LZX: basetabslider
JavaScript: 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

Known Direct Subclasses: tabslider

Details

Properties (7)

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.
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.

Methods (7)

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);
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.
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.

LZX Synopsis

<class name="basetabslider" extends=" baselist ">
  <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=" slideduration " value="300" />
  <attribute name=" spacing " value="0" />
  <method name=" addItem " args="txt" />
  <method name=" calcAvailableHeight " />
  <method name=" doAddSubview " args="v" />
  <method name=" openNext " />
  <method name=" openTab " args="tabelement, withAnimation" />
  <method name=" select " args="item" />
  <method name=" setHeight " args="h" />
</class>

JavaScript Synopsis

public basetabslider extends  baselist  {
  public var inset_bottom ;
  public var inset_left ;
  public var inset_right ;
  public var inset_top ;
  public var mintabheight ;
  public var slideduration ;
  public var spacing ;
  prototype public function addItem (txt : String);
  prototype public function calcAvailableHeight ();
  prototype public function doAddSubview (v);
  prototype public function openNext () : boolean;
  prototype public function openTab (tabelement : basetabelement, withAnimation : boolean);
  prototype public function select (item : LzView);
  prototype public function setHeight (h : Number);
}