/////////////////////////////////////////////////////////////////////////////
// Name: treectrl.h
-// Purpose: documentation for wxTreeItemData class
+// Purpose: interface of wxTreeItemData
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
@library{wxcore}
@category{FIXME}
- @seealso
- wxTreeCtrl
+ @see wxTreeCtrl
*/
class wxTreeItemData : public wxClientData
{
public:
/**
Default constructor.
-
+
In addition, the following methods are added in wxPython for accessing
the object:
-
+
@b GetData()
-
+
Returns a reference to the Python Object
-
+
@b SetData(obj)
-
+
Associates a new Python Object with the
wxTreeItemData
*/
};
+
/**
@class wxTreeCtrl
@wxheader{treectrl.h}
in wxTreeEvent.
@beginStyleTable
- @style{wxTR_EDIT_LABELS}:
+ @style{wxTR_EDIT_LABELS}
Use this style if you wish the user to be able to edit labels in
the tree control.
- @style{wxTR_NO_BUTTONS}:
+ @style{wxTR_NO_BUTTONS}
For convenience to document that no buttons are to be drawn.
- @style{wxTR_HAS_BUTTONS}:
+ @style{wxTR_HAS_BUTTONS}
Use this style to show + and - buttons to the left of parent items.
- @style{wxTR_NO_LINES}:
+ @style{wxTR_NO_LINES}
Use this style to hide vertical level connectors.
- @style{wxTR_FULL_ROW_HIGHLIGHT}:
+ @style{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 specify
wxTR_NO_LINES as well.)
- @style{wxTR_LINES_AT_ROOT}:
+ @style{wxTR_LINES_AT_ROOT}
Use this style to show lines between root nodes. Only applicable if
wxTR_HIDE_ROOT is set and wxTR_NO_LINES is not set.
- @style{wxTR_HIDE_ROOT}:
+ @style{wxTR_HIDE_ROOT}
Use this style to suppress the display of the root node,
effectively causing the first-level nodes to appear as a series of
root nodes.
- @style{wxTR_ROW_LINES}:
+ @style{wxTR_ROW_LINES}
Use this style to draw a contrasting border between displayed rows.
- @style{wxTR_HAS_VARIABLE_ROW_HEIGHT}:
+ @style{wxTR_HAS_VARIABLE_ROW_HEIGHT}
Use this style to cause row heights to be just big enough to fit
the content. If not set, all rows use the largest row height. The
default is that this flag is unset. Generic only.
- @style{wxTR_SINGLE}:
+ @style{wxTR_SINGLE}
For convenience to document that only one item may be selected at a
time. Selecting another item causes the current selection, if any,
to be deselected. This is the default.
- @style{wxTR_MULTIPLE}:
+ @style{wxTR_MULTIPLE}
Use this style to allow a range of items to be selected. If a
second range is selected, the current range, if any, is deselected.
- @style{wxTR_DEFAULT_STYLE}:
+ @style{wxTR_DEFAULT_STYLE}
The set of flags that are closest to the defaults for the native
control for a particular toolkit.
@endStyleTable
@category{ctrl}
@appearance{treectrl.png}
- @seealso
- wxTreeItemData, @ref overview_wxtreectrloverview "wxTreeCtrl overview",
+ @see wxTreeItemData, @ref overview_wxtreectrloverview "wxTreeCtrl overview",
wxListBox, wxListCtrl, wxImageList, wxTreeEvent
*/
class wxTreeCtrl : public wxControl
//@{
/**
Constructor, creating and showing a tree control.
-
+
@param parent
Parent window. Must not be @NULL.
@param id
Window validator.
@param name
Window name.
-
+
@see Create(), wxValidator
*/
wxTreeCtrl();
/**
Collapses the root item.
-
+
@see ExpandAll()
*/
void CollapseAll();
/**
Collapses this item and all of its children, recursively.
-
+
@see ExpandAllChildren()
*/
void CollapseAllChildren(const wxTreeItemId& item);
If the user changed the label (i.e. s/he does not press ESC or leave
the text control without changes, a EVT_TREE_END_LABEL_EDIT event
will be sent which can be vetoed as well.
-
+
@see EndEditLabel(), wxTreeEvent
*/
void EditLabel(const wxTreeItemId& item);
/**
Ends label editing. If @a cancelEdit is @true, the edit will be cancelled.
This function is currently supported under Windows only.
-
+
@see EditLabel()
*/
void EndEditLabel(bool cancelEdit);
/**
Returns the edit control being currently used to edit a label. Returns @NULL
if no label is being edited.
- @b NB: It is currently only implemented for wxMSW.
+ @note It is currently only implemented for wxMSW.
*/
wxTextCtrl* GetEditControl() const;
GetFirstChild and GetNextChild should be the same variable.
Returns an invalid tree item (i.e. IsOk() returns @false) if there are no
further children.
-
+
@see GetNextChild(), GetNextSibling()
*/
wxTreeItemId GetFirstChild(const wxTreeItemId& item,
//@{
/**
Returns the font of the item label.
- */
- wxTreeItemData* GetItemData(const wxTreeItemId& item) const;
- const See also
- wxTreeItemData
-wxPython note:
-wxPython provides the following shortcut method:
-
-
-
-
-
-
-
- GetPyData(item)
-
-
-
-
- Returns the Python Object
- associated with the wxTreeItemData for the given item Id.
-
-
-
-
-
+ @see wxTreeItemData
+ @beginWxPythonOnly
+ wxPython provides the following shortcut method:
+ @li GetPyData(item): Returns the Python Object associated with the
+ wxTreeItemData for the given item Id.
+ @endWxPythonOnly
+ */
+ wxTreeItemData* GetItemData(const wxTreeItemId& item) const;
wxFont GetItemFont(const wxTreeItemId& item) const;
//@}
/**
Returns the last child of the item (or an invalid tree item if this item has no
children).
-
+
@see GetFirstChild(), GetNextSibling(),
GetLastChild()
*/
enumeration on one and the same object simultaneously). The cookie passed to
GetFirstChild and GetNextChild should be the same.
Returns an invalid tree item if there are no further children.
-
+
@see GetFirstChild()
*/
wxTreeItemId GetNextChild(const wxTreeItemId& item,
Returns the next sibling of the specified item; call GetPrevSibling() for the
previous sibling.
Returns an invalid tree item if there are no further siblings.
-
+
@see GetPrevSibling()
*/
wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
Returns the previous sibling of the specified item; call GetNextSibling() for
the next sibling.
Returns an invalid tree item if there are no further children.
-
+
@see GetNextSibling()
*/
wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
/**
Returns @true if the control will use a quick calculation for the best size,
looking only at the first and last items. The default is @false.
-
+
@see SetQuickBestSize()
*/
bool GetQuickBestSize() const;
Calculates which (if any) item is under the given point, returning the tree item
id at this point plus extra information @e flags. @a flags is a bitlist of the
following:
-
+
wxTREE_HITTEST_ABOVE
-
+
Above the client area.
-
+
wxTREE_HITTEST_BELOW
-
+
Below the client area.
-
+
wxTREE_HITTEST_NOWHERE
-
+
In the client area but below the last item.
-
+
wxTREE_HITTEST_ONITEMBUTTON
-
+
On the button associated with an item.
-
+
wxTREE_HITTEST_ONITEMICON
-
+
On the bitmap associated with an item.
-
+
wxTREE_HITTEST_ONITEMINDENT
-
+
In the indentation associated with an item.
-
+
wxTREE_HITTEST_ONITEMLABEL
-
+
On the label (string) associated with an item.
-
+
wxTREE_HITTEST_ONITEMRIGHT
-
+
In the area to the right of an item.
-
+
wxTREE_HITTEST_ONITEMSTATEICON
-
+
On the state icon for a tree view item that is in a user-defined state.
-
+
wxTREE_HITTEST_TOLEFT
-
+
To the right of the client area.
-
+
wxTREE_HITTEST_TORIGHT
-
+
To the left of the client area.
*/
wxTreeItemId HitTest(const wxPoint& point, int& flags) const;
positive value if the first item is less than, equal to or greater than the
second one.
Please note that you @b must use wxRTTI macros
- DECLARE_DYNAMIC_CLASS and
- IMPLEMENT_DYNAMIC_CLASS if you override this
+ DECLARE_DYNAMIC_CLASS() and
+ IMPLEMENT_DYNAMIC_CLASS() 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.
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.
-
+
@see SetItemBold()
*/
void SetItemFont(const wxTreeItemId& item, const wxFont& font);
the best size,
looking only at the first and last items. Otherwise, it will look at all items.
The default is @false.
-
+
@see GetQuickBestSize()
*/
void SetQuickBestSize(bool quickBestSize);
OnCompareItems() method of wxTreeCtrl. You
should override that method to change the sort order (the default is ascending
case-sensitive alphabetical order).
-
+
@see wxTreeItemData, OnCompareItems()
*/
void SortChildren(const wxTreeItemId& item);
};
+
/**
@class wxTreeEvent
@wxheader{treectrl.h}
@library{wxbase}
@category{events}
- @seealso
- wxTreeCtrl
+ @see wxTreeCtrl
*/
class wxTreeEvent : public wxNotifyEvent
{
*/
void SetToolTip(const wxString& tooltip);
};
+