2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 //---------------------------------------------------------------------------
29 // $RCSfile: TreeMultiItemNode.h,v $
30 // $Source: /cvs/creatis/bbtk/kernel/src/ThirdParty/wx/treemultictrl/TreeMultiItemNode.h,v $
32 // $Date: 2012/11/16 08:49:16 $
33 //---------------------------------------------------------------------------
34 // Author: Jorgen Bodde
35 // Copyright: (c) Jorgen Bodde
36 // License: wxWidgets License
37 //---------------------------------------------------------------------------
39 #ifndef __TREEMULTIITEMNODE_HPP_
40 #define __TREEMULTIITEMNODE_HPP_
43 #pragma interface "TreeMultiItemNode.cpp"
49 #include "wx/treebase.h"
52 #include <wx/dynarray.h>
53 #include "TreeMultiItemBase.h"
54 #include "TreeMultiItemWindow.h"
57 * This class is the element class for WX_OBJ_ARRAY and it
58 * should be filled with the member variables and methods to
59 * manipulate each object inside the object array.
61 * See wxArray for all base methods manipulating the array
62 * Clear() can be used to safely delete all objects.
65 // declare the array class here
67 WX_DECLARE_OBJARRAY(TreeMultiItemBase, TreeMultiItemBaseArray);
69 class TreeMultiItemNode : public TreeMultiItemBase
72 TreeMultiItemBaseArray _items;
74 /** Caption of this node. */
77 /** Indicates if this node is expanded (true) or collapsed (false) */
80 /** visual attributes of the node */
81 wxTreeItemAttr m_Attributes;
84 TreeMultiItemNode(TreeMultiItemNode *parent, const wxString &caption = wxEmptyString, const wxString &name = wxEmptyString);
85 virtual ~TreeMultiItemNode();
88 virtual TreeMultiItemNode *IsTreeMultiItemNode() const {
89 return (TreeMultiItemNode *)this;
93 void AddNode(TreeMultiItemBase *node);
94 void InsertNode(TreeMultiItemBase* NodePtr, size_t Position);
98 void DeleteNode(TreeMultiItemBase *node);
99 void DeleteNode(int index);
100 TreeMultiItemBase *RemoveNode(TreeMultiItemBase *node);
101 TreeMultiItemBase *RemoveNode(int index);
104 int GetNodeCount() const;
105 TreeMultiItemBase *GetNode(int index) const;
106 int Index(TreeMultiItemBase *node, bool searchFromEnd = false) const;
107 TreeMultiItemBase *GetNodeNext(int &cookie) const;
109 TreeMultiItemBase* First() const;
110 TreeMultiItemBase* Last() const;
112 /** Fold function sets or clears the expanded flag. Note when excluded from drawing, this
113 will have no effect on redraw */
114 void Fold(bool expand) {
115 if(_nodeExpanded != expand)
116 _nodeExpanded = expand;
119 /** Return caption */
120 const wxString &GetCaption() const {
124 /** Returns true if the node is expanded. Subnodes can still be collapsed though */
125 bool IsExpanded() const {
126 return _nodeExpanded;