| Example |
//Create the invisible test layer used for calculation of the text metrix
//before the text is actually appears somewhere on the screen.
//You have to create "fld" variable it will be used within some
//tab related classes to calculate the size of the tab buttons.
var m_testLayer:MovieClip = pseudo.BaseMovie.create(_root, "m_testLayer", 16);
m_testLayer.createTextField("fld", 1, 0, 0, 1, 1);
var fld:TextField = m_testLayer["fld"];
fld.html = true;
fld.autoSize = "left";
m_testLayer._visible = false;
_global.testLayer = m_testLayer;
//Get instance of the look and feel
var look:Object = pseudo.look.AquaLook.getInstance();
//create an instance of TabbedPane class
var m_tpane = pseudo.TabbedPane.create(_root, "tpane", 1);
m_tpane.setLook(look);
m_tpane.setSize(300, 200);
m_tpane.setCanClose(false);
m_tpane._x = 10;
m_tpane._y = 10;
//Add simple basic panes with the text using the function below
m_tpane.addTab({item:createPane("pane 1", 2, look), text:"tab 1"});
m_tpane.addTab({item:createPane("pane 2", 3, look), text:"tab 2"});
m_tpane.update();
m_tpane.draw();
// Creates simple pane with a text
function createPane(text:String, depth:Number, look:Object):pseudo.Pane
{
var pane:pseudo.Pane = pseudo.Pane.create(_root, "pane" + depth, depth);
var lbl:pseudo.Label = pseudo.Label(pane.setContent(pseudo.Label));
lbl.setText(text);
lbl.setAlign("center");
pane.setLook(look);
return pane;
}
|