X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FThirdParty%2Fwx%2Ftreemultictrl%2FwxTreeMultiCtrl.h;h=456dcf62968d7ad7a045765a748e0f5ab550b368;hb=9c6b34ade419c6f122fedac19563dca4c2407bc2;hp=d997e3ec5721d09760cbab869accf9917082d00f;hpb=302e341409d918a232cd2ec25f2c533c27eb9011;p=bbtk.git
diff --git a/kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h b/kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h
index d997e3e..456dcf6 100644
--- a/kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h
+++ b/kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h
@@ -1,11 +1,38 @@
-//---------------------------------------------------------------------------
-// $RCSfile: wxTreeMultiCtrl.h,v $
-// $Source: /cvs/creatis/bbtk/kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h,v $
-// $Revision: 1.1 $
-// $Date: 2008/03/28 13:42:19 $
-//---------------------------------------------------------------------------
-// Author: Jorgen Bodde
-// Copyright: (c) Jorgen Bodde
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÃ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+//---------------------------------------------------------------------------
+// $RCSfile: wxTreeMultiCtrl.h,v $
+// $Source: /cvs/creatis/bbtk/kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiCtrl.h,v $
+// $Revision: 1.3 $
+// $Date: 2012/11/16 08:49:16 $
+//---------------------------------------------------------------------------
+// Author: Jorgen Bodde
+// Copyright: (c) Jorgen Bodde
// License: wxWidgets License
//---------------------------------------------------------------------------
@@ -184,13 +211,13 @@ public:
wxTreeMultiItem(TreeMultiItemBase *ptr) {
_item = ptr;
- };
-
- // Returns the TreeMultiItemBase class. This shoult *NOT* be
- // used if you don't know what you are doing! This means never use it. */
- TreeMultiItemBase *GetItem() const {
- return _item;
- };
+ };
+
+ // Returns the TreeMultiItemBase class. This shoult *NOT* be
+ // used if you don't know what you are doing! This means never use it. */
+ TreeMultiItemBase *GetItem() const {
+ return _item;
+ };
#endif // _NO_DOXYGEN_
@@ -198,21 +225,21 @@ public:
classes from the wxTreeMultiCtrl.
*/
void operator=(const wxTreeMultiItem &item) {
- _item = item._item;
- };
-
- /** Equality operator. It returns true if the items are identical or if both items are invalid. */
- bool operator==(wxTreeMultiItem const& item) const {return (this->GetItem() == item.GetItem());}
-
- /** Inequality operator. It returns true if the items are different or one of them is invalid. */
- bool operator!=(wxTreeMultiItem const& item) const {return (this->GetItem() != item.GetItem());}
-
- /** 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. */
- wxTreeMultiItem GetParent() const{
- wxCHECK(IsOk(), wxTreeMultiItem(0));
- return wxTreeMultiItem(_item->GetParent());
- };
+ _item = item._item;
+ };
+
+ /** Equality operator. It returns true if the items are identical or if both items are invalid. */
+ bool operator==(wxTreeMultiItem const& item) const {return (this->GetItem() == item.GetItem());}
+
+ /** Inequality operator. It returns true if the items are different or one of them is invalid. */
+ bool operator!=(wxTreeMultiItem const& item) const {return (this->GetItem() != item.GetItem());}
+
+ /** 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. */
+ wxTreeMultiItem GetParent() const{
+ wxCHECK(IsOk(), wxTreeMultiItem(0));
+ return wxTreeMultiItem(_item->GetParent());
+ };
/** 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:
@@ -288,32 +315,32 @@ public:
Use wxTreeMultiCtrl::GetExcludedParent() to get the node that hides this one. */
bool IsExcluded() {
wxCHECK(_item, false);
- return _item->IsExcluded();
- }
-
- /** Returns true if the item is selected.
- Please note that currently only nodes can be selected.
- */
- bool IsSelected(void) const
- {
- wxCHECK(this->GetItem(),false);
- return this->GetItem()->IsSelected();
- }
- /** 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. */
+ return _item->IsExcluded();
+ }
+
+ /** Returns true if the item is selected.
+ Please note that currently only nodes can be selected.
+ */
+ bool IsSelected(void) const
+ {
+ wxCHECK(this->GetItem(),false);
+ return this->GetItem()->IsSelected();
+ }
+ /** 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. */
bool IsVisible() {
wxCHECK(_item, false);
return _item->IsVisible();
}
-
-};
-
-WX_DECLARE_OBJARRAY(wxTreeMultiItem,wxArrayTreeMultiItem);
-
-/** \class wxTreeMultiWindowInfo
- \ingroup classes
- \brief This class contains information for every Window node to be added.
+
+};
+
+WX_DECLARE_OBJARRAY(wxTreeMultiItem,wxArrayTreeMultiItem);
+
+/** \class wxTreeMultiWindowInfo
+ \ingroup classes
+ \brief This class contains information for every Window node to be added.
This class can be used to modify the behaviour of the Window node to be added, and can be reused to pass along
upon every wxTreeMultiCtrl::AppendWindow call. For example:
@@ -362,25 +389,25 @@ private:
#if(CHECKBOXVIEW)
/** Checkstate for checkboxed property sheets */
bool _checkState;
-#endif
-
-public:
-#if(CHECKBOXVIEW)
- wxTreeMultiWindowInfo(int flags, int frontSpacing, int topSpacing, bool checkState = false)
- : _flags(flags)
- , _frontSpacing(frontSpacing)
- , _frontSpacingOrg(frontSpacing)
- , _topSpacing(topSpacing)
- , _checkState(checkState)
-#else
- wxTreeMultiWindowInfo(int flags, int frontSpacing, int topSpacing)
- : _flags(flags)
- , _frontSpacing(frontSpacing)
- , _frontSpacingOrg(frontSpacing)
- , _topSpacing(topSpacing)
-#endif
- {
- // constructor
+#endif
+
+public:
+#if(CHECKBOXVIEW)
+ wxTreeMultiWindowInfo(int flags, int frontSpacing, int topSpacing, bool checkState = false)
+ : _flags(flags)
+ , _frontSpacing(frontSpacing)
+ , _frontSpacingOrg(frontSpacing)
+ , _topSpacing(topSpacing)
+ , _checkState(checkState)
+#else
+ wxTreeMultiWindowInfo(int flags, int frontSpacing, int topSpacing)
+ : _flags(flags)
+ , _frontSpacing(frontSpacing)
+ , _frontSpacingOrg(frontSpacing)
+ , _topSpacing(topSpacing)
+#endif
+ {
+ // constructor
}
/** Adds indent to original front spacing and increments it with that value (quick extra indent).
The original value of FrontSpacing (see SetFrontSpacing() gets indented by multiplying
@@ -574,22 +601,22 @@ private:
bool _checkboxView;
/** Height and weight for checkbox */
- int _checkHeight, _checkWidth;
-#endif
-
- /** brush for highlighting nodes */
- wxBrush* m_HilightBrush;
-
- /** This captionFont is made equal to the font of the wxScrolledWindow. As extra the bold face
- is set on it when this is wanted by the user (see flags) */
- wxFont _captionFont;
-
- /** list of selected items */
- wxArrayTreeMultiItem m_SelectedItems;
-
- /** Does the actual collapsing / expanding. So that Expand and Collapse aren't using the same code twice */
- void DoFold(TreeMultiItemBase *item, bool expand, bool recursive);
-
+ int _checkHeight, _checkWidth;
+#endif
+
+ /** brush for highlighting nodes */
+ wxBrush* m_HilightBrush;
+
+ /** This captionFont is made equal to the font of the wxScrolledWindow. As extra the bold face
+ is set on it when this is wanted by the user (see flags) */
+ wxFont _captionFont;
+
+ /** list of selected items */
+ wxArrayTreeMultiItem m_SelectedItems;
+
+ /** Does the actual collapsing / expanding. So that Expand and Collapse aren't using the same code twice */
+ void DoFold(TreeMultiItemBase *item, bool expand, bool recursive);
+
/** Redraws and recalculates the nodes from the current node. It will also clear all 'dirty' flags when
they are recalculated */
void RedrawFromNode(TreeMultiItemNode *n);
@@ -632,31 +659,31 @@ private:
/** Recalculates totally needed virtual size of the wxTreeMultiCtrl. It will scan for
the largest window, with the biggest size, and report that back */
- void RecalculateVirtualSize();
-
- /** Adjusts scrollbars in window, usually done after virtual size (x,y) is recalculated */
- using wxScrolledWindow::AdjustScrollbars;
- virtual void AdjustScrollbars(int x, int y);
-
- /** Recalculates and accumulates largest x and y */
+ void RecalculateVirtualSize();
+
+ /** Adjusts scrollbars in window, usually done after virtual size (x,y) is recalculated */
+ using wxScrolledWindow::AdjustScrollbars;
+ virtual void AdjustScrollbars(int x, int y);
+
+ /** Recalculates and accumulates largest x and y */
void RecalculateVirtualSizeFromNode(const TreeMultiItemNode *node, int &x, int &y);
-
- /** Scans for TreeMultiItemBase node that contains x,y and in area returns a hittest constant to
- indicate what matched */
- TreeMultiItemBase *FindNodeByPoint(TreeMultiItemBase *b, wxPoint const& pt, int &area);
-
- /** Scans for TreeMultiItemWindow that holds the wxWindow pointer. Does not scan in panels or does
- a deep search. Reason, this function is used to advance to next TreeMultiItemWindow for focus
+
+ /** Scans for TreeMultiItemBase node that contains x,y and in area returns a hittest constant to
+ indicate what matched */
+ TreeMultiItemBase *FindNodeByPoint(TreeMultiItemBase *b, wxPoint const& pt, int &area);
+
+ /** Scans for TreeMultiItemWindow that holds the wxWindow pointer. Does not scan in panels or does
+ a deep search. Reason, this function is used to advance to next TreeMultiItemWindow for focus
on this wxScrolledWindow. If a sub window is found, it will skip other windows on that same level */
wxTreeMultiItem FindWindowNode(wxWindow *wnd, TreeMultiItemNode *n = 0);
/** Finds next visible window item in chain. If not found use FindFirstVisibleItem to start from the
- beginning */
- TreeMultiItemWindow *FindNextVisibleWindowItem(TreeMultiItemBase *b, int index = -1);
-
- /** Adjust the centering of the bitmap icons (collapse / expand) when the caption font changes. They need to
- be centered in the middle of the font, so a bit of deltaY adjustment is needed */
- void AdjustIconsDeltaY();
+ beginning */
+ TreeMultiItemWindow *FindNextVisibleWindowItem(TreeMultiItemBase *b, int index = -1);
+
+ /** Adjust the centering of the bitmap icons (collapse / expand) when the caption font changes. They need to
+ be centered in the middle of the font, so a bit of deltaY adjustment is needed */
+ void AdjustIconsDeltaY();
/** Calculate the spanning of the individual nodes */
void CalculateNodeSpanning(TreeMultiItemBase *b);
@@ -669,47 +696,47 @@ private:
will get tristate if the checked items are scattered (some are some aren't). If all nodes in this
node are checked, the parent node gets checked all the way up to the last one that matches
criteria. If all are cleared, parent node gets cleared */
- void ScanTristateCheckstates(TreeMultiItemBase *b);
-#endif
-
- /** \name Private add and delete methods
- @{
- */
-
- /** Inserts a node into the parent's node at the specified position.
- As this is a private method error checking is limited. Therefore, it has to be guaranteed that this method
- is only called with a valid parent node pointer.
- The position is zero based. In case the position is equal or larger than the current number of
- parent's elements the new node is appended.
- The newly inserted node is being returned.
- */
- wxTreeMultiItem InsertNode(TreeMultiItemNode* ParentPtr, size_t Position, wxString const& Caption, wxString const& Name);
-
- /** Inserts a window into the parent's node at the specified position.
- As this is a private method error checking is limited. Therefore, it has to be guaranteed that this method
- is only called with a valid parent node and window pointer.
- The position is zero based. In case the position is equal or larger than the current number of
- parent's elements the new node is appended.
- The newly inserted window is being returned.
- */
- wxTreeMultiItem InsertWindow(TreeMultiItemNode* ParentPtr, size_t Position, wxWindow* WindowPtr, wxString const& Name,
- wxTreeMultiWindowInfo const& Info, int Flags);
-
- /** @}
- */
-private:
- void Init();
-
+ void ScanTristateCheckstates(TreeMultiItemBase *b);
+#endif
+
+ /** \name Private add and delete methods
+ @{
+ */
+
+ /** Inserts a node into the parent's node at the specified position.
+ As this is a private method error checking is limited. Therefore, it has to be guaranteed that this method
+ is only called with a valid parent node pointer.
+ The position is zero based. In case the position is equal or larger than the current number of
+ parent's elements the new node is appended.
+ The newly inserted node is being returned.
+ */
+ wxTreeMultiItem InsertNode(TreeMultiItemNode* ParentPtr, size_t Position, wxString const& Caption, wxString const& Name);
+
+ /** Inserts a window into the parent's node at the specified position.
+ As this is a private method error checking is limited. Therefore, it has to be guaranteed that this method
+ is only called with a valid parent node and window pointer.
+ The position is zero based. In case the position is equal or larger than the current number of
+ parent's elements the new node is appended.
+ The newly inserted window is being returned.
+ */
+ wxTreeMultiItem InsertWindow(TreeMultiItemNode* ParentPtr, size_t Position, wxWindow* WindowPtr, wxString const& Name,
+ wxTreeMultiWindowInfo const& Info, int Flags);
+
+ /** @}
+ */
+private:
+ void Init();
+
// handlers
//---------
- //virtual void OnDraw(wxDC& dc);
- void OnPaint(wxPaintEvent &event);
- void OnMouseClick (wxMouseEvent& event);
- void OnRightMouseClick(wxMouseEvent& Event);
- void OnKey(wxKeyEvent &event);
- void OnSize(wxSizeEvent &event);
-
+ //virtual void OnDraw(wxDC& dc);
+ void OnPaint(wxPaintEvent &event);
+ void OnMouseClick (wxMouseEvent& event);
+ void OnRightMouseClick(wxMouseEvent& Event);
+ void OnKey(wxKeyEvent &event);
+ void OnSize(wxSizeEvent &event);
+
/** Recalculates the spanning controls */
void RecalculateSpanSizes();
@@ -765,66 +792,66 @@ public:
*/
/** Adds a root node to the wxTreeMultiItem. There can be many root nodes. Use this wxTreeMultiNode pointer to add
- more subnodes to it. */
- wxTreeMultiItem AddRoot(const wxString &caption, const wxString &name = wxEmptyString);
-
- /** Adds a window to the tree control. Use this wxTreeMultiItem method to add a window class to the
- current wxTreeMultiItem. The wxTreeMultiItem must point to a Node class. If this is not the case
- an empty wxTreeMultiItem is returned. The mask is used to override the mask settings of the
- wxTreeMultiWindowInfo class. This can be handy to set or clear extra flags only needed for certain
- situations */
- wxTreeMultiItem AppendWindow(const wxTreeMultiItem &ParentItem, wxWindow *window = NULL, const wxString &name = wxEmptyString,
- wxTreeMultiWindowInfo const& info = wxTreeMultiWindowInfoDefault, int flags = 0);
-
- /** Adds a window to the tree control. Use this method to add a window class at the specified position
- of the parent's wxTreeMultiItem. In case the position is smaller than the current number of children all elements
- are shifted upwards, otherwise the new window is appended to the parent's wxTreeMultiItem.
- The parent wxTreeMultiItem must point to a Node class. If this is not the case an
- empty wxTreeMultiItem is returned.
- */
- wxTreeMultiItem InsertWindow(wxTreeMultiItem const& ParentItem, size_t Position, wxWindow *window = NULL, wxString const& Name = wxEmptyString,
- wxTreeMultiWindowInfo const& info = wxTreeMultiWindowInfoDefault, int flags = 0);
-
- /** Adds a window to the tree control. Use this method to add a window class as the first element
- of the parent's wxTreeMultiItem. The parent wxTreeMultiItem must point to a Node class. If this is not the case an
- empty wxTreeMultiItem is returned.
- */
- wxTreeMultiItem PrependWindow(wxTreeMultiItem const& ParentItem, wxWindow *window = NULL, const wxString &name = wxEmptyString,
- wxTreeMultiWindowInfo const& info = wxTreeMultiWindowInfoDefault, int flags = 0);
-
- /** Adds a node to the tree control. Use this wxTreeMultiItem method to add a recursive subnode class as the last element
- of the parent's wxTreeMultiItem. The parent wxTreeMultiItem must point to a Node class. If this is not the case
- an empty wxTreeMultiItem is returned. A node can contain multiple nodes or window classes */
- wxTreeMultiItem AppendNode(wxTreeMultiItem const& ParentItem, const wxString &caption = wxEmptyString,
- const wxString &name = wxEmptyString);
-
- /** Adds a node to the tree control. Use this method to add a recursive subnode class at the specified position
- of the parent's wxTreeMultiItem. In case the position is smaller than the current number of nodes all elements
- are shifted upwards, otherwise the new node is appended to the parent's wxTreeMultiItem.
- The parent wxTreeMultiItem must point to a Node class. If this is not the case an
- empty wxTreeMultiItem is returned. A node can contain multiple nodes or window classes.
- */
- wxTreeMultiItem InsertNode(wxTreeMultiItem const& ParentItem, size_t Position, wxString const& caption, wxString const& name);
-
- /** Adds a node to the tree control. Use this method to add a recursive subnode class as the first element
- of the parent's wxTreeMultiItem. The parent wxTreeMultiItem must point to a Node class. If this is not the case an
- empty wxTreeMultiItem is returned. A node can contain multiple nodes or window classes.
- */
- wxTreeMultiItem PrependNode(wxTreeMultiItem const& ParentItem, wxString const& caption = wxEmptyString,
- wxString const& name = wxEmptyString);
-
- /** Delete item from the tree control. Whenever it is present, delete it. If not, return false. After
- deletion the wxTreeMultiItem is 0, thus IsOk will return false */
- bool Delete(wxTreeMultiItem &item);
-
- /** Deletes all the items from the wxTreeMultiCtrl. */
- void DeleteAllItems(void)
- {
- this->_root.Clear();
- this->m_SelectedItems.Clear();
- Refresh();
- };
-
+ more subnodes to it. */
+ wxTreeMultiItem AddRoot(const wxString &caption, const wxString &name = wxEmptyString);
+
+ /** Adds a window to the tree control. Use this wxTreeMultiItem method to add a window class to the
+ current wxTreeMultiItem. The wxTreeMultiItem must point to a Node class. If this is not the case
+ an empty wxTreeMultiItem is returned. The mask is used to override the mask settings of the
+ wxTreeMultiWindowInfo class. This can be handy to set or clear extra flags only needed for certain
+ situations */
+ wxTreeMultiItem AppendWindow(const wxTreeMultiItem &ParentItem, wxWindow *window = NULL, const wxString &name = wxEmptyString,
+ wxTreeMultiWindowInfo const& info = wxTreeMultiWindowInfoDefault, int flags = 0);
+
+ /** Adds a window to the tree control. Use this method to add a window class at the specified position
+ of the parent's wxTreeMultiItem. In case the position is smaller than the current number of children all elements
+ are shifted upwards, otherwise the new window is appended to the parent's wxTreeMultiItem.
+ The parent wxTreeMultiItem must point to a Node class. If this is not the case an
+ empty wxTreeMultiItem is returned.
+ */
+ wxTreeMultiItem InsertWindow(wxTreeMultiItem const& ParentItem, size_t Position, wxWindow *window = NULL, wxString const& Name = wxEmptyString,
+ wxTreeMultiWindowInfo const& info = wxTreeMultiWindowInfoDefault, int flags = 0);
+
+ /** Adds a window to the tree control. Use this method to add a window class as the first element
+ of the parent's wxTreeMultiItem. The parent wxTreeMultiItem must point to a Node class. If this is not the case an
+ empty wxTreeMultiItem is returned.
+ */
+ wxTreeMultiItem PrependWindow(wxTreeMultiItem const& ParentItem, wxWindow *window = NULL, const wxString &name = wxEmptyString,
+ wxTreeMultiWindowInfo const& info = wxTreeMultiWindowInfoDefault, int flags = 0);
+
+ /** Adds a node to the tree control. Use this wxTreeMultiItem method to add a recursive subnode class as the last element
+ of the parent's wxTreeMultiItem. The parent wxTreeMultiItem must point to a Node class. If this is not the case
+ an empty wxTreeMultiItem is returned. A node can contain multiple nodes or window classes */
+ wxTreeMultiItem AppendNode(wxTreeMultiItem const& ParentItem, const wxString &caption = wxEmptyString,
+ const wxString &name = wxEmptyString);
+
+ /** Adds a node to the tree control. Use this method to add a recursive subnode class at the specified position
+ of the parent's wxTreeMultiItem. In case the position is smaller than the current number of nodes all elements
+ are shifted upwards, otherwise the new node is appended to the parent's wxTreeMultiItem.
+ The parent wxTreeMultiItem must point to a Node class. If this is not the case an
+ empty wxTreeMultiItem is returned. A node can contain multiple nodes or window classes.
+ */
+ wxTreeMultiItem InsertNode(wxTreeMultiItem const& ParentItem, size_t Position, wxString const& caption, wxString const& name);
+
+ /** Adds a node to the tree control. Use this method to add a recursive subnode class as the first element
+ of the parent's wxTreeMultiItem. The parent wxTreeMultiItem must point to a Node class. If this is not the case an
+ empty wxTreeMultiItem is returned. A node can contain multiple nodes or window classes.
+ */
+ wxTreeMultiItem PrependNode(wxTreeMultiItem const& ParentItem, wxString const& caption = wxEmptyString,
+ wxString const& name = wxEmptyString);
+
+ /** Delete item from the tree control. Whenever it is present, delete it. If not, return false. After
+ deletion the wxTreeMultiItem is 0, thus IsOk will return false */
+ bool Delete(wxTreeMultiItem &item);
+
+ /** Deletes all the items from the wxTreeMultiCtrl. */
+ void DeleteAllItems(void)
+ {
+ this->_root.Clear();
+ this->m_SelectedItems.Clear();
+ Refresh();
+ };
+
/** Deletes all children of the current node. The wxTreeMultiItem needs to be of type Node to
do this. Call GetParentNode to get the parent wxTreeMultiItem which is always a node. */
void DeleteChildren(const wxTreeMultiItem &item);
@@ -863,61 +890,61 @@ public:
Collapse(item, false);
};
- /** @}
- */
-
- /** @name Selection manipulation
- These methods allow you to select, unselect or test wxTreeMultiItems on selection.
- Currently only items of type Node can be manipulated.
- @{
- */
-
- /** Returns the number of selected items. */
- size_t GetSelectedItemCount(void) const {return this->m_SelectedItems.GetCount();}
-
- /** Returns the first selected item.
- If there is no selected item an invalid tree multi item is returned.
- */
- wxTreeMultiItem GetFirstSelectedItem(void) const;
-
- /** Returns the last selected item.
- If there is no selected item an invalid tree multi item is returned.
- */
- wxTreeMultiItem GetLastSelectedItem(void) const;
-
- /** Returns a selected item with the specified index.
- If there is no selected item with the passed index an invalide tree multi item is returned.
- */
- wxTreeMultiItem GetSelectedItem(size_t Index) const;
-
- /** Returns the index of the selected item.
- In case the item is not selected "GetSelectedItemCount()" - which is an invalid index - is returned.
- */
- size_t GetSelectedItemIndex(wxTreeMultiItem const& Item) const;
-
- /** Selects the specified item AND in case
- - UnselectOthers is set all other selected items are going to be unselected;
- - ExpandSelection is set all items between the last selected item and the passed item
- are selected, too (in case there this is the first selection all items between the first root
- and the passed item are selected).
- If the passed item is already selected the other parameters are ignored.
- Please not that currently only nodes can be selected, therefore, if any other item is passed nothing will happen.
- */
- void SelectItem(wxTreeMultiItem const& Item, bool UnselectOthers=true, bool ExpandSelection=false);
-
- /** Unselect all selected items. */
- void UnselectAll(void);
-
- /** Unselect specified item */
- void Unselect(wxTreeMultiItem const& Item);
-
- /** @}
- */
-
-
- /** \name Visibility manipulation
- These methods allow you to manipulate a certain wxTreeMultiItem to temporarily exclude or to include
- the node from drawing. Whenever it is excluded, all operations can still be performed, however
+ /** @}
+ */
+
+ /** @name Selection manipulation
+ These methods allow you to select, unselect or test wxTreeMultiItems on selection.
+ Currently only items of type Node can be manipulated.
+ @{
+ */
+
+ /** Returns the number of selected items. */
+ size_t GetSelectedItemCount(void) const {return this->m_SelectedItems.GetCount();}
+
+ /** Returns the first selected item.
+ If there is no selected item an invalid tree multi item is returned.
+ */
+ wxTreeMultiItem GetFirstSelectedItem(void) const;
+
+ /** Returns the last selected item.
+ If there is no selected item an invalid tree multi item is returned.
+ */
+ wxTreeMultiItem GetLastSelectedItem(void) const;
+
+ /** Returns a selected item with the specified index.
+ If there is no selected item with the passed index an invalide tree multi item is returned.
+ */
+ wxTreeMultiItem GetSelectedItem(size_t Index) const;
+
+ /** Returns the index of the selected item.
+ In case the item is not selected "GetSelectedItemCount()" - which is an invalid index - is returned.
+ */
+ size_t GetSelectedItemIndex(wxTreeMultiItem const& Item) const;
+
+ /** Selects the specified item AND in case
+ - UnselectOthers is set all other selected items are going to be unselected;
+ - ExpandSelection is set all items between the last selected item and the passed item
+ are selected, too (in case there this is the first selection all items between the first root
+ and the passed item are selected).
+ If the passed item is already selected the other parameters are ignored.
+ Please not that currently only nodes can be selected, therefore, if any other item is passed nothing will happen.
+ */
+ void SelectItem(wxTreeMultiItem const& Item, bool UnselectOthers=true, bool ExpandSelection=false);
+
+ /** Unselect all selected items. */
+ void UnselectAll(void);
+
+ /** Unselect specified item */
+ void Unselect(wxTreeMultiItem const& Item);
+
+ /** @}
+ */
+
+
+ /** \name Visibility manipulation
+ These methods allow you to manipulate a certain wxTreeMultiItem to temporarily exclude or to include
+ the node from drawing. Whenever it is excluded, all operations can still be performed, however
the node may not be visible.
@{
*/
@@ -943,13 +970,13 @@ public:
\li wxTMC_HITTEST_GUTTER If the front part of the item is clicked (where the node is)
\li wxTMC_HITTEST_WINDOW If located in the window area
\li wxTMC_HITTEST_CAPTION If located on the caption of the MultiTreeItemNode
-
- Returned is the item which is located under the mouse, or none (IsOk = false) if
- no item under the mouse */
- wxTreeMultiItem HitTest(wxPoint const& pt, int &flags);
-
- /** @name Find methods
- These methods are used for finding a node in the wxTreeMultiCtrl.
+
+ Returned is the item which is located under the mouse, or none (IsOk = false) if
+ no item under the mouse */
+ wxTreeMultiItem HitTest(wxPoint const& pt, int &flags);
+
+ /** @name Find methods
+ These methods are used for finding a node in the wxTreeMultiCtrl.
@{
*/
@@ -1065,13 +1092,13 @@ public:
#if(CHECKBOXVIEW)
/** Gets the checkbox state of the wxTreeMultiItem pointed out by "item". If the item does not have a checkbox
- associated (or the item is not ok), it will return -1. If the checkbox is checked it will return 1,
- unchecked is 0, and tri-state (usually only for caption nodes) it will return 2. This needs USE_CHECKBOXVIEW
- set to YES, or CHECKBOXVIEW=1 during compile*/
- int GetCheckboxState(const wxTreeMultiItem &item, bool WXUNUSED(recursive)) {
- wxCHECK(item.IsOk(), -1);
-
- // return the checkbox state
+ associated (or the item is not ok), it will return -1. If the checkbox is checked it will return 1,
+ unchecked is 0, and tri-state (usually only for caption nodes) it will return 2. This needs USE_CHECKBOXVIEW
+ set to YES, or CHECKBOXVIEW=1 during compile*/
+ int GetCheckboxState(const wxTreeMultiItem &item, bool WXUNUSED(recursive)) {
+ wxCHECK(item.IsOk(), -1);
+
+ // return the checkbox state
TreeMultiItemBase *b = item.GetItem();
if(b->GetCheckbox())
return b->GetCheckboxState();
@@ -1135,26 +1162,26 @@ public:
#endif
/** @}
- */
-
- /** @name Iteration methods
- Allows the user to iterate through a wxTreeMultiCtrl node, and get all the children or siblings.
- To start an iteration from the lowest level the functions GetFirstRoot and GetLastRoot are provided.
- @{
- */
-
- /** Returns the first root. */
- wxTreeMultiItem GetFirstRoot(void) const {return wxTreeMultiItem(this->_root.First());}
-
- /** Returns the last root. */
- wxTreeMultiItem GetLastRoot(void) const {return wxTreeMultiItem(this->_root.Last());}
-
- /** Returns the items parent. */
- wxTreeMultiItem GetParent(wxTreeMultiItem const& item) const;
-
- /** Returns the first child of this node. The type of wxTreeMultiItem needs to be of Node. Whenever not succesful,
- the item returned is not ok (IsOk = false). Upon success, a valid child is returned. The cookie variable doesn't
- need to be initialized */
+ */
+
+ /** @name Iteration methods
+ Allows the user to iterate through a wxTreeMultiCtrl node, and get all the children or siblings.
+ To start an iteration from the lowest level the functions GetFirstRoot and GetLastRoot are provided.
+ @{
+ */
+
+ /** Returns the first root. */
+ wxTreeMultiItem GetFirstRoot(void) const {return wxTreeMultiItem(this->_root.First());}
+
+ /** Returns the last root. */
+ wxTreeMultiItem GetLastRoot(void) const {return wxTreeMultiItem(this->_root.Last());}
+
+ /** Returns the items parent. */
+ wxTreeMultiItem GetParent(wxTreeMultiItem const& item) const;
+
+ /** Returns the first child of this node. The type of wxTreeMultiItem needs to be of Node. Whenever not succesful,
+ the item returned is not ok (IsOk = false). Upon success, a valid child is returned. The cookie variable doesn't
+ need to be initialized */
wxTreeMultiItem GetFirstChild(const wxTreeMultiItem &item, int &cookie) const;
/** Returns the next child in the iteration on the level of 'item'. Make sure you called GetFirstChild first
@@ -1162,33 +1189,33 @@ public:
wxTreeMultiItem GetNextChild(const wxTreeMultiItem &item, int &cookie) const;
/** Returns the last child of this node. The type of 'item' needs to be of Node. Whenever not succesful,
- the item returned is not ok (IsOk = false). Upon success, a valid last child is returned. */
- wxTreeMultiItem GetLastChild(const wxTreeMultiItem &item) const;
-
- /** Returns the next sibling of the passed item. */
- wxTreeMultiItem GetNextSibling(wxTreeMultiItem const& item) const;
-
- /** Returns the previous sibling of the passed item. */
- wxTreeMultiItem GetPrevSibling(wxTreeMultiItem const& item) const;
-
- /** Returns the next item. "Next" is defined by the following order:
- - in case the current item has a child it is the first child of the current item;
- - in case the current item has a next sibling as the next sibling;
- - as the parent's (or one of its ancestor's) next sibling.
- */
- wxTreeMultiItem GetNext(wxTreeMultiItem const& item) const;
-
- /** Returns the previous item. "Previous" is defined by the following order:
- - in case the current item has a child it is the last child of the current item;
- - in case the current item has a previous sibling it is the previous sibling;
- - as the parent's (or one of its ancestor's) previous sibling.
- */
- wxTreeMultiItem GetPrevious(wxTreeMultiItem const& item) const;
-
-
- /** @}
- */
-
+ the item returned is not ok (IsOk = false). Upon success, a valid last child is returned. */
+ wxTreeMultiItem GetLastChild(const wxTreeMultiItem &item) const;
+
+ /** Returns the next sibling of the passed item. */
+ wxTreeMultiItem GetNextSibling(wxTreeMultiItem const& item) const;
+
+ /** Returns the previous sibling of the passed item. */
+ wxTreeMultiItem GetPrevSibling(wxTreeMultiItem const& item) const;
+
+ /** Returns the next item. "Next" is defined by the following order:
+ - in case the current item has a child it is the first child of the current item;
+ - in case the current item has a next sibling as the next sibling;
+ - as the parent's (or one of its ancestor's) next sibling.
+ */
+ wxTreeMultiItem GetNext(wxTreeMultiItem const& item) const;
+
+ /** Returns the previous item. "Previous" is defined by the following order:
+ - in case the current item has a child it is the last child of the current item;
+ - in case the current item has a previous sibling it is the previous sibling;
+ - as the parent's (or one of its ancestor's) previous sibling.
+ */
+ wxTreeMultiItem GetPrevious(wxTreeMultiItem const& item) const;
+
+
+ /** @}
+ */
+
/** @name Get and set methods
These methods allow you to set or get certain properties of the wxTreeMultiCtrl.
@{
@@ -1206,13 +1233,13 @@ public:
beginning. */
void SetCaptionFont(const wxFont &font);
- /** @}
- */
-
- void OnDraw(wxDC& dc);
-
-private:
- DECLARE_EVENT_TABLE()
-};
+ /** @}
+ */
+
+ void OnDraw(wxDC& dc);
+
+private:
+ DECLARE_EVENT_TABLE()
+};
#endif