wxTreeMultiItem Class Reference
[wxTreeMultiCtrl Classes]

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

#include <wxTreeMultiCtrl.h>

Collaboration diagram for wxTreeMultiItem:

Collaboration graph
[legend]

List of all members.

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 ()

Private Attributes

TreeMultiItemBase_item


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");

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.

Definition at line 172 of file wxTreeMultiCtrl.h.


Constructor & Destructor Documentation

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.

Definition at line 179 of file wxTreeMultiCtrl.h.

References _item.

Referenced by GetParent().

00179                       {
00180         _item = 0;
00181     };

Here is the caller graph for this function:

wxTreeMultiItem::wxTreeMultiItem ( TreeMultiItemBase ptr  )  [inline]

Definition at line 185 of file wxTreeMultiCtrl.h.

References _item.

00185                                             {
00186         _item = ptr;
00187     };


Member Function Documentation

TreeMultiItemBase* wxTreeMultiItem::GetItem (  )  const [inline]

Definition at line 191 of file wxTreeMultiCtrl.h.

References _item.

Referenced by wxTreeMultiCtrl::GetChildrenCount(), wxTreeMultiCtrl::GetWindow(), IsSelected(), operator!=(), and operator==().

00191                                        {
00192         return _item;
00193     };

Here is the caller graph for this function:

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.

Definition at line 200 of file wxTreeMultiCtrl.h.

References _item.

00200                                                 {
00201         _item = item._item;
00202     };

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

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

Definition at line 205 of file wxTreeMultiCtrl.h.

References GetItem().

00205 {return (this->GetItem() == item.GetItem());}

Here is the call graph for this function:

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

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

Definition at line 208 of file wxTreeMultiCtrl.h.

References GetItem().

00208 {return (this->GetItem() != item.GetItem());}

Here is the call graph for this function:

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.

Definition at line 212 of file wxTreeMultiCtrl.h.

References _item, TreeMultiItemBase::GetParent(), IsOk(), and wxTreeMultiItem().

00212                                          {
00213                 wxCHECK(IsOk(), wxTreeMultiItem(0));
00214                 return wxTreeMultiItem(_item->GetParent());
00215         };

Here is the call graph for this function:

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
            }

Definition at line 235 of file wxTreeMultiCtrl.h.

References _item.

Referenced by GetParent().

00235                       {
00236         return _item != 0;
00237     };

Here is the caller graph for this function:

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

Definition at line 244 of file wxTreeMultiCtrl.h.

References _item, and TreeMultiItemBase::IsTreeMultiItemWindow().

Referenced by wxTreeMultiCtrl::GetWindow().

00244                               {
00245         if(_item && _item->IsTreeMultiItemWindow())
00246             return true;
00247         return false;
00248     };

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 256 of file wxTreeMultiCtrl.h.

References _item, TreeMultiItemBase::IsTreeMultiItemNode(), and TreeMultiItemBase::IsTreeMultiItemRoot().

Referenced by wxTreeMultiCtrl::GetChildrenCount().

00256                             {
00257         if(_item && (_item->IsTreeMultiItemNode() || _item->IsTreeMultiItemRoot()))
00258             return true;
00259         return false;
00260     };

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 267 of file wxTreeMultiCtrl.h.

References _item, and TreeMultiItemBase::IsTreeMultiItemRoot().

00267                             {
00268         if(_item && _item->IsTreeMultiItemRoot())
00269             return true;
00270         return false;
00271     };

Here is the call graph for this function:

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

Definition at line 278 of file wxTreeMultiCtrl.h.

References _item, TreeMultiItemNode::IsExpanded(), and TreeMultiItemBase::IsTreeMultiItemNode().

00278                             {
00279         wxCHECK(_item, false);
00280         TreeMultiItemNode *n = _item->IsTreeMultiItemNode();
00281         wxCHECK(n, false);
00282 
00283         return n->IsExpanded();
00284     };

Here is the call graph for this function:

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.

Definition at line 289 of file wxTreeMultiCtrl.h.

References _item, and TreeMultiItemBase::IsExcluded().

00289                       {
00290         wxCHECK(_item, false);
00291         return _item->IsExcluded();
00292     }

Here is the call graph for this function:

bool wxTreeMultiItem::IsSelected ( void   )  const [inline]

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

Definition at line 297 of file wxTreeMultiCtrl.h.

References GetItem(), and TreeMultiItemBase::IsSelected().

00298     {
00299       wxCHECK(this->GetItem(),false);
00300       return this->GetItem()->IsSelected();
00301     }

Here is the call graph for this function:

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.

Definition at line 305 of file wxTreeMultiCtrl.h.

References _item, and TreeMultiItemBase::IsVisible().

00305                      {
00306         wxCHECK(_item, false);
00307         return _item->IsVisible();
00308     }

Here is the call graph for this function:


Member Data Documentation


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

Generated on Wed Nov 12 11:38:18 2008 for BBTK by  doxygen 1.5.6