treectrl.tex
来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 1,021 行 · 第 1/3 页
TEX
1,021 行
\twocolitem{wxTREE\_HITTEST\_NOWHERE}{In the client area but below the last item.}
\twocolitem{wxTREE\_HITTEST\_ONITEMBUTTON}{On the button associated with an item.}
\twocolitem{wxTREE\_HITTEST\_ONITEMICON}{On the bitmap associated with an item.}
\twocolitem{wxTREE\_HITTEST\_ONITEMINDENT}{In the indentation associated with an item.}
\twocolitem{wxTREE\_HITTEST\_ONITEMLABEL}{On the label (string) associated with an item.}
\twocolitem{wxTREE\_HITTEST\_ONITEMRIGHT}{In the area to the right of an item.}
\twocolitem{wxTREE\_HITTEST\_ONITEMSTATEICON}{On the state icon for a tree view item that is in a user-defined state.}
\twocolitem{wxTREE\_HITTEST\_TOLEFT}{To the right of the client area.}
\twocolitem{wxTREE\_HITTEST\_TORIGHT}{To the left of the client area.}
\end{twocollist}
\pythonnote{in wxPython both the wxTreeItemId and the flags are
returned as a tuple.}
\perlnote{In wxPerl this method only takes the {\tt point} parameter
and returns a 2-element list {\tt ( item, flags )}.}
\membersection{wxTreeCtrl::InsertItem}\label{wxtreectrlinsertitem}
\func{wxTreeItemId}{InsertItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxTreeItemId\& }{previous}, \param{const wxString\&}{ text},
\param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = {\tt NULL}}}
\func{wxTreeItemId}{InsertItem}{\param{const wxTreeItemId\& }{parent}, \param{size\_t}{ before}, \param{const wxString\&}{ text},
\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
selected items, respectively.
If {\it image} > -1 and {\it selImage} is -1, the same image is used for
both selected and unselected items.
\pythonnote{The second form of this method is called
{\tt InsertItemBefore} in wxPython.}
\membersection{wxTreeCtrl::IsBold}\label{wxtreectrlisbold}
\constfunc{bool}{IsBold}{\param{const wxTreeItemId\& }{item}}
Returns {\tt true} if the given item is in bold state.
See also: \helpref{SetItemBold}{wxtreectrlsetitembold}
\membersection{wxTreeCtrl::IsExpanded}\label{wxtreectrlisexpanded}
\constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}}
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.
\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).
\membersection{wxTreeCtrl::ItemHasChildren}\label{wxtreectrlitemhaschildren}
\constfunc{bool}{ItemHasChildren}{\param{const wxTreeItemId\&}{ item}}
Returns {\tt true} if the item has children.
\membersection{wxTreeCtrl::OnCompareItems}\label{wxtreectrloncompareitems}
\func{int}{OnCompareItems}{\param{const wxTreeItemId\& }{item1}, \param{const wxTreeItemId\& }{item2}}
Override this function in the derived class to change the sort order of the
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.
The base class version compares items alphabetically.
See also: \helpref{SortChildren}{wxtreectrlsortchildren}
\membersection{wxTreeCtrl::PrependItem}\label{wxtreectrlprependitem}
\func{wxTreeItemId}{PrependItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text},
\param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = {\tt NULL}}}
Appends an item as the first child of {\it parent}, return a new item id.
The {\it image} and {\it selImage} parameters are an index within
the normal image list specifying the image to use for unselected and
selected items, respectively.
If {\it image} > -1 and {\it selImage} is -1, the same image is used for
both selected and unselected items.
\membersection{wxTreeCtrl::ScrollTo}\label{wxtreectrlscrollto}
\func{void}{ScrollTo}{\param{const wxTreeItemId\&}{ item}}
Scrolls the specified item into view.
\membersection{wxTreeCtrl::SelectItem}\label{wxtreectrlselectitem}
\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.
\membersection{wxTreeCtrl::SetButtonsImageList}\label{wxtreectrlsetbuttonsimagelist}
\func{void}{SetButtonsImageList}{\param{wxImageList*}{ imageList}}
Sets the buttons image list (from which application-defined button images are taken).
The button images assigned with this method will
{\bf not} be deleted by wxTreeCtrl's destructor, you must delete it yourself.
Setting or assigning the button image list enables the display of image buttons.
Once enabled, the only way to disable the display of button images is to set
the button image list to {\tt NULL}.
This function is only available in the generic version.
See also \helpref{AssignButtonsImageList}{wxtreectrlassignbuttonsimagelist}.
\membersection{wxTreeCtrl::SetIndent}\label{wxtreectrlsetindent}
\func{void}{SetIndent}{\param{int }{indent}}
Sets the indentation for the tree control.
\membersection{wxTreeCtrl::SetImageList}\label{wxtreectrlsetimagelist}
\func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
Sets the normal image list. Image list assigned with this method will
{\bf not} be deleted by wxTreeCtrl's destructor, you must delete it yourself.
See also \helpref{AssignImageList}{wxtreectrlassignimagelist}.
\membersection{wxTreeCtrl::SetItemBackgroundColour}\label{wxtreectrlsetitembackgroundcolour}
\func{void}{SetItemBackgroundColour}{\param{const wxTreeItemId\&}{ item}, \param{const wxColour\& }{col}}
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}}}
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}
\membersection{wxTreeCtrl::SetItemData}\label{wxtreectrlsetitemdata}
\func{void}{SetItemData}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemData* }{data}}
Sets the item client data.
\pythonnote{wxPython provides the following shortcut method:\par
\indented{2cm}{\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf SetPyData(item, obj)}}{Associate the given Python
Object with the wxTreeItemData for the given item Id.}
\end{twocollist}}
}%
\perlnote{wxPerl provides the following shortcut method:
\indented{2cm}{
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf SetPlData( item, data )}}{Sets the Perl data
associated with the Wx::TreeItemData. It is just the same as
tree->GetItemData(item)->SetData(data).}
\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}}
Sets the item's font. All items in the tree should have the same height to avoid
text clipping, so the fonts height should be the same for all of them,
although font attributes may vary.
\wxheading{See also}
\helpref{SetItemBold}{wxtreectrlsetitembold}
\membersection{wxTreeCtrl::SetItemHasChildren}\label{wxtreectrlsetitemhaschildren}
\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,
but instead adding them only when needed, thus minimizing memory
usage and loading time.
\membersection{wxTreeCtrl::SetItemImage}\label{wxtreectrlsetitemimage}
\func{void}{SetItemImage}{\param{const wxTreeItemId\&}{ item},
\param{int }{image}, \param{wxTreeItemIcon }{which = wxTreeItemIcon\_Normal}}
Sets the specified item image. See \helpref{GetItemImage}{wxtreectrlgetitemimage}
for the description of the {\it which} parameter.
\membersection{wxTreeCtrl::SetItemSelectedImage}\label{wxtreectrlsetitemselectedimage}
\func{void}{SetItemSelectedImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{selImage}}
Sets the selected item image (this function is obsolete, use {\tt SetItemImage(item, wxTreeItemIcon\_Selected}) instead).
\membersection{wxTreeCtrl::SetItemText}\label{wxtreectrlsetitemtext}
\func{void}{SetItemText}{\param{const wxTreeItemId\&}{ item}, \param{const wxString\& }{text}}
Sets the item label.
\membersection{wxTreeCtrl::SetItemTextColour}\label{wxtreectrlsetitemtextcolour}
\func{void}{SetItemTextColour}{\param{const wxTreeItemId\&}{ item}, \param{const wxColour\& }{col}}
Sets the colour of the item's text.
\membersection{wxTreeCtrl::SetQuickBestSize}\label{wxtreectrlsetquickbestsize}
\func{void}{SetQuickBestSize}{\param{bool}{ quickBestSize}}
If true is passed, specifies that the control will use a quick calculation for the best size,
looking only at the first and last items. Otherwise, it will look at all items.
The default is false.
\wxheading{See also}
\helpref{wxTreeCtrl::GetQuickBestSize}{wxtreectrlgetquickbestsize}
\membersection{wxTreeCtrl::SetStateImageList}\label{wxtreectrlsetstateimagelist}
\func{void}{SetStateImageList}{\param{wxImageList*}{ imageList}}
Sets the state image list (from which application-defined state images are taken).
Image list assigned with this method will
{\bf not} be deleted by wxTreeCtrl's destructor, you must delete it yourself.
See also \helpref{AssignStateImageList}{wxtreectrlassignstateimagelist}.
\membersection{wxTreeCtrl::SetWindowStyle}\label{wxtreectrlsetwindowstyle}
\func{void}{SetWindowStyle}{\param{long}{styles}}
Sets the mode flags associated with the display of the tree control.
The new mode takes effect immediately.
(Generic only; MSW ignores changes.)
\membersection{wxTreeCtrl::SortChildren}\label{wxtreectrlsortchildren}
\func{void}{SortChildren}{\param{const wxTreeItemId\&}{ item}}
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
case-sensitive alphabetical order).
\wxheading{See also}
\helpref{wxTreeItemData}{wxtreeitemdata}, \helpref{OnCompareItems}{wxtreectrloncompareitems}
\membersection{wxTreeCtrl::Toggle}\label{wxtreectrltoggle}
\func{void}{Toggle}{\param{const wxTreeItemId\&}{ item}}
Toggles the given item between collapsed and expanded states.
\membersection{wxTreeCtrl::ToggleItemSelection}\label{wxtreectrltoggleitemselection}
\func{void}{ToggleItemSelection}{\param{const wxTreeItemId\&}{ item}}
Toggles the given item between selected and unselected states. For
multiselection controls only.
\membersection{wxTreeCtrl::Unselect}\label{wxtreectrlunselect}
\func{void}{Unselect}{\void}
Removes the selection from the currently selected item (if any).
\membersection{wxTreeCtrl::UnselectAll}\label{wxtreectrlunselectall}
\func{void}{UnselectAll}{\void}
This function either behaves the same as \helpref{Unselect}{wxtreectrlunselect}
if the control doesn't have wxTR\_MULTIPLE style, or removes the selection from
all items if it does have this style.
\membersection{wxTreeCtrl::UnselectItem}\label{wxtreectrlunselectitem}
\func{void}{UnselectItem}{\param{const wxTreeItemId\& }{item}}
Unselects the given item. This works in multiselection controls only.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?