Contents Up Previous Next

wxStoredTree

wxStoredTree provides storage for node labels, position and client data. It also provides hit-testing (which node a mouse event occurred on). It is usually a more convenient class to use than wxTreeLayout.

Derived from

wxTreeLayout

Members

wxStoredTree::wxStoredTree
wxStoredTree::AddChild
wxStoredTree::GetClientData
wxStoredTree::GetNode
wxStoredTree::GetNodeCount
wxStoredTree::GetNumNodes
wxStoredTree::HitTest
wxStoredTree::NameToId
wxStoredTree::SetClientData


wxStoredTree::wxStoredTree

wxStoredTree(int noNodes = 200)

Constructor. Specify the maximum number of nodes to be allocated.


wxStoredTree::AddChild

long AddChild(const wxString& name, const wxString& parent = "")

Adds a child with a given parent, returning the node id.


wxStoredTree::GetClientData

long GetClientData(long id) const

Gets the client data for the given node.


wxStoredTree::GetNode

wxStoredNode* GetNode(long id) const

Returns the wxStoredNode object for the given node id.


wxStoredTree::GetNodeCount

int GetNodeCount() const

Returns the current number of nodes.


wxStoredTree::GetNumNodes

int GetNumNodes() const

Returns the maximum number of nodes.


wxStoredTree::HitTest

wxString HitTest(wxMouseEvent& event, wxDC& dc)

Returns a string with the node name corresponding to the position of the mouse event, or the empty string if no node was detected.


wxStoredTree::NameToId

long NameToId(const wxString& name)

Returns the id for the given node name, or -1 if there was no such node.


wxStoredTree::SetClientData

void SetClientData(long id, long clientData)

Sets client data for the given node.