pseudo.TabbedPane class
View Sample :: Return to index  
pseudo.TabbedPane.TabbedPane()
TabbedPane constructor. You never use the constructor to create this component.

Parameters None
Returns Nothing
Example
    None


pseudo.TabbedPane.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.TabbedPane
Use this static function to create new TabbedPane on the specified movie clip. Never use constructor directly to do it.

Parameters pOwner The movie clip on which the new TabbedPane will be drawn.
strName The new TabbedPane instance name.
nDepth The new TabbedPane instance depth.
Returns The reference to new TabbedPane instance
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;
	}
			
		   


pseudo.TabbedPane.addTab(tab:Object, pos:Number):Void
Adds tab into TabComponent.
  • tab - Object that contains following fields: item - tab content (mostly it is Pane class instance), text - tab text
  • pos - tab position. If this parameter is omitted then tab is inserted to the end.
Parameters tab Object instance Object that contains following fields: item - tab content (mostly it is Pane class instance), text - tab text.
pos Number value indicating tab position. If this parameter is omitted then tab is inserted to the end.
Returns Nothing
Example
 //Create item to be put into the tabbed pane
		var pane:pseudo.Pane = pseudo.Pane.create(_root, "pane" + 2, 2);
		var lbl:pseudo.Label = pseudo.Label(pane.setContent(pseudo.Label));
		lbl.setText("pane 1");
		lbl.setAlign("center");
		pane.setLook(look);
//add tab
		m_tpane.addTab({item:pane, text:"tab 1"});
		


pseudo.TabbedPane.getTab(id:String):Object
Returns tab with given id if exists null otherwise.
Parameters id String tab identifier. You can assign it to tab by calling 'setName' function.
Returns Object value
Example
     
   m_tpane.getTab("myTab");

pseudo.TabbedPane. getTabs():Array
Returns array of all tabs of tab component.
Parameters None
Returns Array object
Example
    
  m_tpane.getTabs();  



pseudo.TabbedPane.addTabs(tabs:Array):Void
Adds array of tabs after the last tab of tab component.

Parameters tabs Array object containg the tabs
Returns Nothing
Example
    
  
  m_tpane.addTabs(tabs);

pseudo.TabbedPane.closeTab(id:String):Void
Closes tab with given id. Removes tab from tabBar and tab content.

Parameters id String tab identifier. You can assign it to tab by calling 'setName' function.
Returns Nothing
Example
  m_tpane.closeTab("myTab");    
                

pseudo.TabbedPane.moveTab(idFrom:String, idTo:String, bBefore:Boolean):Void
Moves tab to another position..

Parameters idFrom String identifier of the tab to move. You can assign it to tab by calling 'setName' function.
idTo String identifier of the tab to which to move. You can assign it to tab by calling 'setName' function.
bBefore Boolean value indicating if the tab should move to "before" position: before the "to" Tab
Returns Nothing
Example
  m_tpane.moveTab("myTab", "yourTab", true);    
                

pseudo.TabbedPane.selectTab(id:String):Void
Sets focus to tab with given id.

Parameters id String tab identifier. You can assign it to tab by calling 'setName' function.
Returns Nothing
Example
  m_tpane.selectTab("myTab");    
                

 

Flash UI Components (c)TUFaT.com, All Rights Reserved.