VCL
[ class tree: VCL ] [ index: VCL ] [ all elements ]

Class: TreeNode

Source Location: /comctrls.inc.php

Class Overview

Object
   |
   --Persistent
      |
      --TreeNode

TreeNode describes an individual node in a tree view control.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: Persistent

Persistent::allowserialize()
This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property.
Persistent::assign()
Assigns the source properties to this object.
Persistent::assignError()
Raises an assignation error.
Persistent::assignTo()
Assigns this object to another object.
Persistent::inSession()
This method determines if this object exists in the current session.
Persistent::readNamePath()
Used to serialize/unserialize. It returns the full path to identify this component.
Persistent::readOwner()
Owner of the component.
Persistent::serialize()
Stores this object into the session.
Persistent::unserialize()
This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call.

Class: Object

Object::__construct()
Constructs an object and initializes its data before the object is first used.
Object::className()
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
Object::classNameIs()
Determines whether an object is of a specific type.
Object::classParent()
Returns the type of the immediate ancestor of a class.
Object::inheritsFrom()
Determines the relationship of two object types.
Object::methodExists()
Check if a method exists declared on this object instance.
Object::readProperty()
Reads a property from the streams
Object::__get()
To virtualize properties
Object::__set()
To virtualize properties

Class Details

[line 1677]
TreeNode describes an individual node in a tree view control.

Each node in a tree view control consists of a label and an optional image. Each item can be the parent of a list of subitems. By clicking an item, the user can expand or collapse the associated list of subitems.




Tags:

see:  TreeView


[ Top ]


Class Variables

$_caption = ""

[line 1679]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_expanded = 0

[line 1680]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_imageindex = -1

[line 1681]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_itemid = 0

[line 1682]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_items = array()

[line 1683]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_level = 0

[line 1684]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_parentnode = null

[line 1687]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_selectedindex = -1

[line 1685]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_tag = 0

[line 1686]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 1690]

TreeNode __construct( )



Overrides Object::__construct() (Constructs an object and initializes its data before the object is first used.)

[ Top ]

method addChild [line 1710]

TreeNode addChild( string $caption, [integer $tag = 0], [integer $imageindex = -1], [integer $selectedindex = -1])

Add a child node to the current TreeNode object.



Tags:

return:  Returns the newly created TreeNode object.


Parameters:

string   $caption   The caption of the new node.
integer   $tag   The tag for custom identification of the node.
integer   $imageindex   If a image list is assigend to the TreeView this index is used to set an individual icon for the TreeNode.
integer   $selectedindex   Index of selected icon.

[ Top ]

method findNodeWithItemID [line 1738]

mixed findNodeWithItemID( string $itemid)

This function is used to find a TreeNode object with the ItemID property.

Since ItemID is the only unique identifier of the TreeNode this function is one to safly find a tree node. The node where the function is called is compared and all child nodes.




Tags:

return:  Returns the TreeNode object if found, otherwise null.
see:  TreeNode::getItemID()


Parameters:

string   $itemid   ItemID to search for.

[ Top ]

method getCaption [line 1771]

string getCaption( )

Caption to be shown on the node.

Use Caption to specify the string that is displayed in the tree view. The value of Caption can be assigned directly at run-time or can be set within the TreeView Items Editor while modifying the Items property of the TreeView component.




[ Top ]

method getExpanded [line 1783]

bool getExpanded( )

Specifies whether the tree node is expanded.

When a tree node is expanded, the minus button is shown and child nodes are displayed. Set Expanded to true to display the children of a node. Set Expanded to false to collapse the node, hiding all of its descendants.




[ Top ]

method getImageIndex [line 1793]

integer getImageIndex( )

Specifies which image is displayed when a node is in its normal state and is not currently selected.

Use the ImageIndex property with the Images property of the tree view to specify the image for the node in its normal state.




[ Top ]

method getItemID [line 1805]

string getItemID( )

Contains a string that uniquely identifies each node in a tree view.

It is used to search nodes in findNodeWithItemID().




Tags:



[ Top ]

method getItems [line 1816]

array getItems( )

Items is an array of child TreeNode objects.

Use Items to access childs nodes based on its position. The first child node has an index of 0, the second an index of 1, and so on.




[ Top ]

method getLevel [line 1837]

integer getLevel( )

Level of the TreeNode. This property is for information purpose only.

Nothing happens by setting a different level. The setter is used so the property is serialized/unserialized.




[ Top ]

method getParentNode [line 1868]

object Returns getParentNode( )

Reference to parent TreeNode object.

A Parent node is one level higher than the node and contains the node as a subnode.




Tags:

return:  a TreeNode object or null if root.


[ Top ]

method getSelectedIndex [line 1847]

integer getSelectedIndex( )

Specifies the index in the tree view’s image list of the image displayed for the node when it is selected.

Use the SelectedIndex property to specify an image to display when the tree node is selected.




[ Top ]

method getTag [line 1858]

mixed getTag( )

Tag to to identify the TreeNode differently than with the ItemID.

The Tag property should be a simple type (string, integer, etc) since it is used as a variable in javascript.




[ Top ]

method setCaption [line 1772]

void setCaption( $value)



Parameters:

   $value  

[ Top ]

method setExpanded [line 1784]

void setExpanded( $value)



Parameters:

   $value  

[ Top ]

method setImageIndex [line 1794]

void setImageIndex( $value)



Parameters:

   $value  

[ Top ]

method setItemID [line 1806]

void setItemID( $value)



Parameters:

   $value  

[ Top ]

method setItems [line 1817]

void setItems( $value)



Parameters:

   $value  

[ Top ]

method setLevel [line 1838]

void setLevel( $value)



Parameters:

   $value  

[ Top ]

method setParentNode [line 1869]

void setParentNode( $value)



Parameters:

   $value  

[ Top ]

method setSelectedIndex [line 1848]

void setSelectedIndex( $value)



Parameters:

   $value  

[ Top ]

method setTag [line 1859]

void setTag( $value)



Parameters:

   $value  

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:51:14 -0700 by phpDocumentor 1.4.1