ToolMap
Loading...
Searching...
No Matches
wxTreeMultiItem Class Reference

An intermediate class which is used to return as 'item' value for the wxTreeMultiCtrl. This class is comparable with wxTreeItemId. More...

#include <wxTreeMultiCtrl.h>

Public Member Functions

 wxTreeMultiItem ()
 
 wxTreeMultiItem (TreeMultiItemBase *ptr)
 
TreeMultiItemBaseGetItem () const
 
void operator= (const wxTreeMultiItem &item)
 
bool operator== (wxTreeMultiItem const &item) const
 
bool operator!= (wxTreeMultiItem const &item) const
 
wxTreeMultiItem GetParent () const
 
bool IsOk () const
 
bool IsWindowItem () const
 
bool IsNodeItem () const
 
bool IsRootItem () const
 
bool IsExpanded () const
 
bool IsExcluded ()
 
bool IsSelected (void) const
 
bool IsVisible ()
 
wxString GetName () const
 

Detailed Description

An intermediate class which is used to return as 'item' value for the wxTreeMultiCtrl. This class is comparable with wxTreeItemId.

The wxTreeMultiItem is used to pass information to the user about the tree node in question. It can also be used point out where the subnodes should be added.

For example:

wxTreeMultiItem item = MyMultiTreeCtrl->AddRoot("This is the first root");
// now add a node to the root
if(item.IsOk())
MyMultiTreeCtrl->AppendWindow(item, new wxStaticText(MyMultiTreeCtrl, -1, "This is a static text");
An intermediate class which is used to return as 'item' value for the wxTreeMultiCtrl....
Definition wxTreeMultiCtrl.h:173
bool IsOk() const
Definition wxTreeMultiCtrl.h:241

The wxTreeMultiItem comes in three internal types which are used in the wxTreeMultiCtrl. For functions such as wxTreeMultiCtrl::AddRoot, a Root item is returned. For functions such as wxTreeMultiCtrl::AppendWindow, a Window node is returned. For functions such as wxTreeMultiCtrl::AppendNode, a Node item is returned.

  • A Root item represents a top level item. Special operations on this item is adding multiple nodes to it from a top level.
  • A Node item represents a container item which has multiple sub items which can both be Window items, or Node items. A root item is a special type of Node item, so all operations which are only for Node items, are also for Root items.
  • A Window node represents an end node, which points to a wxWindow which represents the visual contents of this node. This type of node can hold any wxWindow derived class.

Constructor & Destructor Documentation

◆ wxTreeMultiItem()

wxTreeMultiItem::wxTreeMultiItem ( )
inline

Default declaration constructor, and should be used when declaring an item which gets assigned a new value by e.g. wxTreeMultiCtrl::AppendNode.

Member Function Documentation

◆ GetName()

wxString wxTreeMultiItem::GetName ( ) const
inline

Returns the name of the current item. This is the internal reference name. If IsOK() returns false, the string returned is also empty.

◆ GetParent()

wxTreeMultiItem wxTreeMultiItem::GetParent ( ) const
inline

Returns the parent of the current wxTreeMultiItem. This means the wxTreeMultiNode is returned. It can be useful to check or clear the checkbox at this level.

◆ IsExcluded()

bool wxTreeMultiItem::IsExcluded ( )
inline

Returns true if this node is excluded from drawing. Please note that when this node is not visible due to a higher excluded parent node but not literally excluded itself, it will return false (not excluded). Use wxTreeMultiCtrl::GetExcludedParent() to get the node that hides this one.

◆ IsExpanded()

bool wxTreeMultiItem::IsExpanded ( ) const
inline

Returns TRUE if the node is expanded, else FALSE if it is collapsed. If the item is not a Root or Node item, an assertion failure is generated (in debug mode) or FALSE is returned (in release mode).

See also
wxTreeMultiCtrl::Expand, wxTreeMultiCtrl::Collapse, wxTreeMultiCtrl::CollapseAndReset

◆ IsNodeItem()

bool wxTreeMultiItem::IsNodeItem ( ) const
inline

Returns TRUE when the wxTreeMultiItem is a Node item. This means the item is both valid, and points to a node element (i.e. setting the caption, counting node children, etc). If the item is invalid or not a Node item, FALSE is returned. When the item is actually a root item (specialised node type), this also returns TRUE.

See also
wxTreeMultiCtrl::AppendNode wxTreeMultiCtrl::AddRoot

◆ IsOk()

bool wxTreeMultiItem::IsOk ( ) const
inline

Validates if the wxTreeMultiItem is a valid instance to use in the wxTreeMultiCtrl. Returns TRUE when there is a member value is associated with it, or FALSE when not. This value can also be checked when this class is returned from a wxTreeMultiCtrl operation. For example:

wxTreeMultiItem item = MyTreeMultiCtrl->FindNode("NAME");
if(item.IsOk())
{
// Found the node, now do something with it
}
else
{
// Sorry, not found
}

◆ IsRootItem()

bool wxTreeMultiItem::IsRootItem ( ) const
inline

Returns True when the wxTreeMultiItem is a Root (top node) item. This means the item is both valid, and points to a root element (this item is always shown as first node in the tree). A root node is always visible, but can contain other collapsed children. If the item is invalid or not a Root node, FALSE is returned.

◆ IsSelected()

bool wxTreeMultiItem::IsSelected ( void  ) const
inline

Returns true if the item is selected. Please note that currently only nodes can be selected.

◆ IsVisible()

bool wxTreeMultiItem::IsVisible ( )
inline

Returns true if this node is visible. Please note that when this node is a child node of a collapsed node, it is not visible. Also if this node is a child node of an excluded node, it is also not visible. It does NOT return false when it's drawn somewhere outside of the visible area.

◆ IsWindowItem()

bool wxTreeMultiItem::IsWindowItem ( ) const
inline

Returns TRUE when the wxTreeMultiItem is a Window item. This means the item is both valid, and points to a window node. This means it can be used in functions that expect a Window node. If the item is invalid or a Window item, FALSE is returned

See also
wxTreeMultiCtrl::AppendWindow

◆ operator!=()

bool wxTreeMultiItem::operator!= ( wxTreeMultiItem const &  item) const
inline

Inequality operator. It returns true if the items are different or one of them is invalid.

◆ operator=()

void wxTreeMultiItem::operator= ( const wxTreeMultiItem item)
inline

The copy operator. Used in assigning one wxTreeMultiItem to another, usually in returning wxTreeMultiItem classes from the wxTreeMultiCtrl.

◆ operator==()

bool wxTreeMultiItem::operator== ( wxTreeMultiItem const &  item) const
inline

Equality operator. It returns true if the items are identical or if both items are invalid.


The documentation for this class was generated from the following file: