X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/513e0cea96dfcdc066d8b5b751c2874c7bf06a39..71aba8333cc915afff9e740c944f7fa7247abacb:/docs/latex/wx/treectrl.tex diff --git a/docs/latex/wx/treectrl.tex b/docs/latex/wx/treectrl.tex index 96bede2004..c5d51fdeb0 100644 --- a/docs/latex/wx/treectrl.tex +++ b/docs/latex/wx/treectrl.tex @@ -237,12 +237,15 @@ Creates the tree control. See \helpref{wxTreeCtrl::wxTreeCtrl}{wxtreectrlconstr} Deletes the specified item. A {\tt EVT\_TREE\_DELETE\_ITEM} event will be generated. +This function may cause a subsequent call to GetNextChild to fail. + \membersection{wxTreeCtrl::DeleteAllItems}\label{wxtreectrldeleteallitems} \func{void}{DeleteAllItems}{\void} -Deletes all the items in the control. Note that this will {\bf not} generate -any events unlike \helpref{Delete}{wxtreectrldelete} method. +Deletes all the items in the control. Note that this may not generate +{\tt EVT\_TREE\_DELETE\_ITEM} events under some Windows versions although +normally such event is generated for each removed item. \membersection{wxTreeCtrl::DeleteChildren}\label{wxtreectrldeletechildren} @@ -252,6 +255,10 @@ Deletes all children of the given item (but not the item itself). Note that this will {\bf not} generate any events unlike \helpref{Delete}{wxtreectrldelete} method. +If you have called \helpref{wxTreeCtrl::SetItemHasChildren}{wxtreectrlsetitemhaschildren}, you +may need to call it again since {\it DeleteChildren} does not automatically +clear the setting. + \membersection{wxTreeCtrl::EditLabel}\label{wxtreectrleditlabel} \func{void}{EditLabel}{\param{const wxTreeItemId\&}{ item}} @@ -273,7 +280,7 @@ will be sent which can be vetoed as well. \func{void}{EndEditLabel}{\param{bool }{cancelEdit}} -Ends label editing. If {\it cancelEdit} is {\tt TRUE}, the edit will be cancelled. +Ends label editing. If {\it cancelEdit} is {\tt true}, the edit will be cancelled. This function is currently supported under Windows only. @@ -295,13 +302,13 @@ Expands the given item. \membersection{wxTreeCtrl::GetBoundingRect}\label{wxtreectrlgetitemrect} -\constfunc{bool}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = {\tt FALSE}}} +\constfunc{bool}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = {\tt false}}} -Retrieves the rectangle bounding the {\it item}. If {\it textOnly} is {\tt TRUE}, +Retrieves the rectangle bounding the {\it item}. If {\it textOnly} is {\tt true}, only the rectangle around the item's label will be returned, otherwise the item's image is also taken into account. -The return value is {\tt TRUE} if the rectangle was successfully retrieved or {\tt FALSE} +The return value is {\tt true} if the rectangle was successfully retrieved or {\tt false} if it was not (in this case {\it rect} is not changed) - for example, if the item is currently invisible. @@ -322,9 +329,9 @@ This function is only available in the generic version. \membersection{wxTreeCtrl::GetChildrenCount}\label{wxtreectrlgetchildrencount} -\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = {\tt TRUE}}} +\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = {\tt true}}} -Returns the number of items in the branch. If {\it recursively} is {\tt TRUE}, returns the total number +Returns the number of items in the branch. If {\it recursively} is {\tt true}, returns the total number of descendants, otherwise only one level of children is counted. \membersection{wxTreeCtrl::GetCount}\label{wxtreectrlgetcount} @@ -344,7 +351,7 @@ if no label is being edited. \membersection{wxTreeCtrl::GetFirstChild}\label{wxtreectrlgetfirstchild} -\constfunc{wxTreeItemId}{GetFirstChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}} +\constfunc{wxTreeItemId}{GetFirstChild}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemIdValue \& }{cookie}} Returns the first child; call \helpref{wxTreeCtrl::GetNextChild}{wxtreectrlgetnextchild} for the next child. @@ -468,7 +475,7 @@ Returns the last child of the item (or an invalid tree item if this item has no \membersection{wxTreeCtrl::GetNextChild}\label{wxtreectrlgetnextchild} -\constfunc{wxTreeItemId}{GetNextChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}} +\constfunc{wxTreeItemId}{GetNextChild}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemIdValue \& }{cookie}} Returns the next child; call \helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild} for the first child. @@ -508,10 +515,19 @@ Returns an invalid tree item if there are no further siblings. Returns the next visible item. +\membersection{wxTreeCtrl::GetItemParent}\label{wxtreectrlgetitemparent} + +\constfunc{wxTreeItemId}{GetItemParent}{\param{const wxTreeItemId\&}{ item}} + +Returns the item's parent. + \membersection{wxTreeCtrl::GetParent}\label{wxtreectrlgetparent} \constfunc{wxTreeItemId}{GetParent}{\param{const wxTreeItemId\&}{ item}} +{\bf NOTE:} This function is deprecated and will only work if {\tt WXWIN\_COMPATIBILITY\_2\_2} +is defined. Use \helpref{wxTreeCtrl::GetItemParent}{wxtreectrlgetitemparent} instead. + Returns the item's parent. \pythonnote{This method is named {\tt GetItemParent} to avoid a name @@ -615,6 +631,7 @@ returned as a tuple.} \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = {\tt NULL}}} Inserts an item after a given one ({\it previous}) or before one identified by its position ({\it before}). +{\it before} must be less than the number of children. The {\it image} and {\it selImage} parameters are an index within the normal image list specifying the image to use for unselected and @@ -629,7 +646,7 @@ both selected and unselected items. \constfunc{bool}{IsBold}{\param{const wxTreeItemId\& }{item}} -Returns {\tt TRUE} if the given item is in bold state. +Returns {\tt true} if the given item is in bold state. See also: \helpref{SetItemBold}{wxtreectrlsetitembold} @@ -637,25 +654,25 @@ See also: \helpref{SetItemBold}{wxtreectrlsetitembold} \constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}} -Returns {\tt TRUE} if the item is expanded (only makes sense if it has children). +Returns {\tt true} if the item is expanded (only makes sense if it has children). \membersection{wxTreeCtrl::IsSelected}\label{wxtreectrlisselected} \constfunc{bool}{IsSelected}{\param{const wxTreeItemId\&}{ item}} -Returns {\tt TRUE} if the item is selected. +Returns {\tt true} if the item is selected. \membersection{wxTreeCtrl::IsVisible}\label{wxtreectrlisvisible} \constfunc{bool}{IsVisible}{\param{const wxTreeItemId\&}{ item}} -Returns {\tt TRUE} if the item is visible (it might be outside the view, or not expanded). +Returns {\tt true} if the item is visible (it might be outside the view, or not expanded). \membersection{wxTreeCtrl::ItemHasChildren}\label{wxtreectrlitemhaschildren} \constfunc{bool}{ItemHasChildren}{\param{const wxTreeItemId\&}{ item}} -Returns {\tt TRUE} if the item has children. +Returns {\tt true} if the item has children. \membersection{wxTreeCtrl::OnCompareItems}\label{wxtreectrloncompareitems} @@ -735,9 +752,9 @@ Sets the colour of the item's background. \membersection{wxTreeCtrl::SetItemBold}\label{wxtreectrlsetitembold} -\func{void}{SetItemBold}{\param{const wxTreeItemId\& }{item}, \param{bool}{ bold = {\tt TRUE}}} +\func{void}{SetItemBold}{\param{const wxTreeItemId\& }{item}, \param{bool}{ bold = {\tt true}}} -Makes item appear in bold font if {\it bold} parameter is {\tt TRUE} or resets it to +Makes item appear in bold font if {\it bold} parameter is {\tt true} or resets it to the normal state. See also: \helpref{IsBold}{wxtreectrlisbold} @@ -778,7 +795,7 @@ although font attributes may vary. \membersection{wxTreeCtrl::SetItemHasChildren}\label{wxtreectrlsetitemhaschildren} -\func{void}{SetItemHasChildren}{\param{const wxTreeItemId\&}{ item}, \param{bool }{hasChildren = {\tt TRUE}}} +\func{void}{SetItemHasChildren}{\param{const wxTreeItemId\&}{ item}, \param{bool }{hasChildren = {\tt true}}} Force appearance of the button next to the item. This is useful to allow the user to expand the items which don't have any children now, @@ -834,7 +851,7 @@ The new mode takes effect immediately. Sorts the children of the given item using \helpref{OnCompareItems}{wxtreectrloncompareitems} method of wxTreeCtrl. You should override that method to change the sort order (the default is ascending -alphabetical order). +case-sensitive alphabetical order). \wxheading{See also}