]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/treectrl.tex
test wxTE_NO_VSCROLL
[wxWidgets.git] / docs / latex / wx / treectrl.tex
index 0c25fccc32b537b205554168770b1415269f7b02..4a45fdb5dadaaf6f4bbd9f3de073141d1081d8fd 100644 (file)
@@ -13,7 +13,7 @@
 
 A tree control presents information as a hierarchy, with items that may be expanded
 to show further items. Items in a tree control are referenced by wxTreeItemId handles,
 
 A tree control presents information as a hierarchy, with items that may be expanded
 to show further items. Items in a tree control are referenced by wxTreeItemId handles,
-which may be tested for validity by calling wxTreeItemId::IsOk.
+which may be tested for validity by calling \helpref{wxTreeItemId::IsOk}{wxtreeitemidisok}.
 
 To intercept events from a tree control, use the event table macros described in \helpref{wxTreeEvent}{wxtreeevent}.
 
 
 To intercept events from a tree control, use the event table macros described in \helpref{wxTreeEvent}{wxtreeevent}.
 
@@ -130,7 +130,7 @@ Default constructor.
 
 \func{}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
 \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
 
 \func{}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
 \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
-\param{long}{ style = wxTR\_HAS\_BUTTONS}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}}
+\param{long}{ style = wxTR\_HAS\_BUTTONS}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``treeCtrl"}}
 
 Constructor, creating and showing a tree control.
 
 
 Constructor, creating and showing a tree control.
 
@@ -160,7 +160,7 @@ appropriately.}
 
 \func{void}{\destruct{wxTreeCtrl}}{\void}
 
 
 \func{void}{\destruct{wxTreeCtrl}}{\void}
 
-Destructor, destroying the list control.
+Destructor, destroying the tree control.
 
 
 \membersection{wxTreeCtrl::AddRoot}\label{wxtreectrladdroot}
 
 
 \membersection{wxTreeCtrl::AddRoot}\label{wxtreectrladdroot}
@@ -238,6 +238,28 @@ See also \helpref{SetStateImageList}{wxtreectrlsetstateimagelist}.
 Collapses the given item.
 
 
 Collapses the given item.
 
 
+\membersection{wxTreeCtrl::CollapseAll}\label{wxtreectrlcollapseall}
+
+\func{void}{CollapseAll}{\void}
+
+Collapses the root item.
+
+\wxheading{See also}
+
+\helpref{ExpandAll}{wxtreectrlexpandall}
+
+
+\membersection{wxTreeCtrl::CollapseAllChildren}\label{wxtreectrlcollapseallchildren}
+
+\func{void}{CollapseAllChildren}{\param{const wxTreeItemId\&}{ item}}
+
+Collapses this item and all of its children, recursively.
+
+\wxheading{See also}
+
+\helpref{ExpandAllChildren}{wxtreectrlexpandallchildren}
+
+
 \membersection{wxTreeCtrl::CollapseAndReset}\label{wxtreectrlcollapseandreset}
 
 \func{void}{CollapseAndReset}{\param{const wxTreeItemId\&}{ item}}
 \membersection{wxTreeCtrl::CollapseAndReset}\label{wxtreectrlcollapseandreset}
 
 \func{void}{CollapseAndReset}{\param{const wxTreeItemId\&}{ item}}
@@ -249,7 +271,7 @@ Collapses the given item and removes all children.
 
 \func{bool}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
 \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
 
 \func{bool}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
 \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
-\param{long}{ style = wxTR\_HAS\_BUTTONS}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}}
+\param{long}{ style = wxTR\_HAS\_BUTTONS}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``treeCtrl"}}
 
 Creates the tree control. See \helpref{wxTreeCtrl::wxTreeCtrl}{wxtreectrlconstr} for further details.
 
 
 Creates the tree control. See \helpref{wxTreeCtrl::wxTreeCtrl}{wxtreectrlconstr} for further details.
 
@@ -331,6 +353,20 @@ Scrolls and/or expands items to ensure that the given item is visible.
 Expands the given item.
 
 
 Expands the given item.
 
 
+\membersection{wxTreeCtrl::ExpandAll}\label{wxtreectrlexpandall}
+
+\func{void}{ExpandAll}{\void}
+
+Expands all items in the tree.
+
+
+\membersection{wxTreeCtrl::ExpandAllChildren}\label{wxtreectrlexpandallchildren}
+
+\func{void}{ExpandAllChildren}{\param{const wxTreeItemId\&}{ item}}
+
+Expands the given item and all its children recursively.
+
+
 \membersection{wxTreeCtrl::GetBoundingRect}\label{wxtreectrlgetitemrect}
 
 \constfunc{bool}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = {\tt false}}}
 \membersection{wxTreeCtrl::GetBoundingRect}\label{wxtreectrlgetitemrect}
 
 \constfunc{bool}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = {\tt false}}}
@@ -657,7 +693,7 @@ Returns the state image list (from which application-defined state images are ta
 
 \membersection{wxTreeCtrl::HitTest}\label{wxtreectrlhittest}
 
 
 \membersection{wxTreeCtrl::HitTest}\label{wxtreectrlhittest}
 
-\func{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}}
+\constfunc{wxTreeItemId}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}}
 
 Calculates which (if any) item is under the given point, returning the tree item
 id at this point plus extra information {\it flags}. {\it flags} is a bitlist of the following:
 
 Calculates which (if any) item is under the given point, returning the tree item
 id at this point plus extra information {\it flags}. {\it flags} is a bitlist of the following:
@@ -714,6 +750,13 @@ Returns {\tt true} if the given item is in bold state.
 See also: \helpref{SetItemBold}{wxtreectrlsetitembold}
 
 
 See also: \helpref{SetItemBold}{wxtreectrlsetitembold}
 
 
+\membersection{wxTreeCtrl::IsEmpty}\label{wxtreectrlisempty}
+
+\constfunc{bool}{IsEmpty}{}
+
+Returns \true if the control is empty (i.e. has no items, even no root one).
+
+
 \membersection{wxTreeCtrl::IsExpanded}\label{wxtreectrlisexpanded}
 
 \constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}}
 \membersection{wxTreeCtrl::IsExpanded}\label{wxtreectrlisexpanded}
 
 \constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}}
@@ -751,7 +794,12 @@ items in the tree control. The function should return a negative, zero or
 positive value if the first item is less than, equal to or greater than the
 second one.
 
 positive value if the first item is less than, equal to or greater than the
 second one.
 
-The base class version compares items alphabetically.
+Please note that you \textbf{must} use wxRTTI macros 
+\helpref{DECLARE\_DYNAMIC\_CLASS}{declaredynamicclass} and 
+\helpref{IMPLEMENT\_DYNAMIC\_CLASS}{implementdynamicclass} if you override this
+function because otherwise the base class considers that it is not overridden
+and uses the default comparison, i.e. sorts the items alphabetically, which
+allows it optimize away the calls to the virtual function completely.
 
 See also: \helpref{SortChildren}{wxtreectrlsortchildren}
 
 
 See also: \helpref{SortChildren}{wxtreectrlsortchildren}
 
@@ -1004,3 +1052,59 @@ all items if it does have this style.
 
 Unselects the given item. This works in multiselection controls only.
 
 
 Unselects the given item. This works in multiselection controls only.
 
+
+
+
+
+%% the wxTreeItemId opaque class
+
+
+\section{\class{wxTreeItemId}}\label{wxtreeitemid}
+
+An opaque reference to a tree item.
+
+
+\wxheading{Derived from}
+
+None
+
+\wxheading{Include files}
+
+<wx/treebase.h>
+
+\wxheading{See also}
+
+\helpref{wxTreeCtrl}{wxtreectrl}, \helpref{wxTreeItemData}{wxtreeitemdata},\\
+\helpref{wxTreeCtrl overview}{wxtreectrloverview}
+
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxTreeItemId::wxTreeItemId}\label{wxtreeitemidconstr}
+
+\func{}{wxTreeItemId}{\void}
+
+Default constructor. wxTreemItemIds are not meant to be constructed explicitly by
+the user; they are returned by the \helpref{wxTreeCtrl}{wxtreectrl} functions instead.
+
+
+\membersection{wxTreeItemId::IsOk}\label{wxtreeitemidisok}
+
+\constfunc{bool}{IsOk}{}
+
+Returns \true if this instance is referencing a valid tree item.
+
+
+\membersection{Operators}\label{wxtreeitemidoperators}
+
+\constfunc{void}{operator $!$}{}
+
+Synonim for \helpref{IsOk}{wxtreeitemidisok}
+
+
+\constfunc{bool}{operator $==$}{\param{const wxTreeItemId\& }{item}}
+
+\constfunc{bool}{operator $!=$}{\param{const wxTreeItemId\& }{item}}
+
+Operators for comparison between \helpref{wxTreeItemId}{wxtreeitemid} objects.
+