+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name: treectrl.tex
+%% Purpose: wxTreeCtrl documentation
+%% Author: wxWidgets Team
+%% Modified by:
+%% Created:
+%% RCS-ID: $Id$
+%% Copyright: (c) wxWidgets Team
+%% License: wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\section{\class{wxTreeCtrl}}\label{wxtreectrl}
A tree control presents information as a hierarchy, with items that may be expanded
to document that no buttons are to be drawn.}
\twocolitem{\windowstyle{wxTR\_HAS\_BUTTONS}}{Use this style
to show + and - buttons to the left of parent items.}
-\twocolitem{\windowstyle{wxTR\_TWIST\_BUTTONS}}{Use this style
-to show Mac-style twister buttons to the left of parent items.
-If both wxTR\_HAS\_BUTTONS and wxTR\_TWIST\_BUTTONS are given,
-twister buttons are generated. Generic only.}
\twocolitem{\windowstyle{wxTR\_NO\_LINES}}{Use this style
to hide vertical level connectors.}
\twocolitem{\windowstyle{wxTR\_FULL\_ROW\_HIGHLIGHT}}{Use this style to have the background
colour and the selection highlight extend over the entire horizontal
-row of the tree control window. (This flag is ignored under Windows unless you
+row of the tree control window. (This flag is ignored under Windows unless you
specify wxTR\_NO\_LINES as well.) }
\twocolitem{\windowstyle{wxTR\_LINES\_AT\_ROOT}}{Use this style
to show lines between root nodes.
\twocolitem{{\bf EVT\_TREE\_KEY\_DOWN(id, func)}}{A key has been pressed.}
\twocolitem{{\bf EVT\_TREE\_ITEM\_GETTOOLTIP(id, func)}}{The opportunity to set the item tooltip
is being given to the application (call wxTreeEvent::SetToolTip). Windows only.}
-\twocolitem{{\bf EVT\_TREE\_ITEM\_MENU(id, func)}}{The menu key has been pressed, asking for a context menu for the selected item.}
+\twocolitem{{\bf EVT\_TREE\_ITEM\_MENU(id, func)}}{The context menu for the selected item has been requested, either by a right click or by using the menu key.}
+\twocolitem{{\bf EVT\_TREE\_STATE\_IMAGE\_CLICK(id, func)}}{The state image has been clicked. Windows only.}
\end{twocollist}
\wxheading{See also}
implemented in the system library {\tt comctl32.dll}. Some versions of this
library are known to have bugs with handling the tree control colours: the
usual symptom is that the expanded items leave black (or otherwise incorrectly
-coloured) background behind them, especially for the controls using non
-default background colour. The recommended solution is to upgrade the {\tt comctl32.dll}
-to a newer version: see
-\urlref{http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp}{http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp}.
+coloured) background behind them, especially for the controls using non-default background colour. The recommended solution is to upgrade the {\tt comctl32.dll}
+to a newer version: see
+\urlref{http://www.microsoft.com/downloads/release.asp?ReleaseID=11916}{http://www.microsoft.com/downloads/release.asp?ReleaseID=11916}.
\latexignore{\rtfignore{\wxheading{Members}}}
\func{void}{DeleteAllItems}{\void}
-Deletes all the items in the control. Note that this may not generate
+Deletes all 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.
\func{void}{DeleteChildren}{\param{const wxTreeItemId\& }{item}}
Deletes all children of the given item (but not the item itself). Note that
-this will {\bf not} generate any events unlike
+this will {\bf not} generate any events unlike
\helpref{Delete}{wxtreectrldelete} method.
If you have called \helpref{wxTreeCtrl::SetItemHasChildren}{wxtreectrlsetitemhaschildren}, you
item's image is also taken into account.
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
+if it was not (in this case {\it rect} is not changed) -- for example, if the
item is currently invisible.
+Notice that the rectangle coordinates are logical, not physical ones. So, for
+example, the x coordinate may be negative if the tree has a horizontal
+scrollbar and its position is not $0$.
+
\pythonnote{The wxPython version of this method requires only the
{\tt item} and {\tt textOnly} parameters. The return value is either a
{\tt wxRect} object or {\tt None}.}
-\perlnote{In wxPerl this method only takes the parameters {\tt item} and
+\perlnote{In wxPerl this method only takes the parameters {\tt item} and
{\tt textOnly}, and returns a Wx::Rect ( or undef ).}
\membersection{wxTreeCtrl::GetChildrenCount}\label{wxtreectrlgetchildrencount}
-\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = {\tt true}}}
+\constfunc{unsigned int}{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
of descendants, otherwise only one level of children is counted.
\membersection{wxTreeCtrl::GetCount}\label{wxtreectrlgetcount}
-\constfunc{int}{GetCount}{\void}
+\constfunc{unsigned int}{GetCount}{\void}
Returns the number of items in the control.
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
-clash with wxWindow::GetParent.}
-
-
\membersection{wxTreeCtrl::GetPrevSibling}\label{wxtreectrlgetprevsibling}
\constfunc{wxTreeItemId}{GetPrevSibling}{\param{const wxTreeItemId\&}{ item}}
\membersection{wxTreeCtrl::GetSelections}\label{wxtreectrlgetselections}
-\constfunc{size\_t}{GetSelections}{\param{wxArrayTreeItemIds\& }{selection}}
+\constfunc{unsigned int}{GetSelections}{\param{wxArrayTreeItemIds\& }{selection}}
Fills the array of tree items passed in with the currently selected items. This
function can be called only if the control has the wxTR\_MULTIPLE style.
\membersection{wxTreeCtrl::SelectItem}\label{wxtreectrlselectitem}
-\func{bool}{SelectItem}{\param{const wxTreeItemId\&}{ item}, \param{bool }{select = \true}}
+\func{void}{SelectItem}{\param{const wxTreeItemId\&}{ item}, \param{bool }{select = \true}}
Selects the given item. In multiple selection controls, can be also used to
deselect a currently selected item if the value of \arg{select} is false.
\end{twocollist}}
}%
+\membersection{wxTreeCtrl::SetItemDropHighlight}\label{wxtreectrlsetitemdrophighlight}
+
+\func{void}{SetItemDropHighlight}{\param{const wxTreeItemId\&}{ item}, \param{bool}{highlight = {\tt true}}}
+
+Gives the item the visual feedback for Drag'n'Drop actions, which is
+useful if something is dragged from the outside onto the tree control
+(as opposed to a DnD operation within the tree control, which already
+is implemented internally).
+
\membersection{wxTreeCtrl::SetItemFont}\label{wxtreectrlsetitemfont}
\func{void}{SetItemFont}{\param{const wxTreeItemId\&}{ item}, \param{const wxFont\& }{font}}
\func{void}{UnselectItem}{\param{const wxTreeItemId\& }{item}}
Unselects the given item. This works in multiselection controls only.
-
-