wxTreeTextCtrl(void) {};
wxTreeTextCtrl( wxWindow *parent, const wxWindowID id,
bool *accept, wxString *res, wxTreeCtrl *owner,
- const wxString &value = "",
+ const wxString &value = wxEmptyString,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+#if wxUSE_VALIDATORS
int style = 0, const wxValidator& validator = wxDefaultValidator,
- const wxString &name = "wxTreeTextCtrlText" );
+#endif
+ const wxString &name = wxTextCtrlNameStr );
void OnChar( wxKeyEvent &event );
void OnKillFocus( wxFocusEvent &event );
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
+#if wxUSE_VALIDATORS
const wxValidator &validator = wxDefaultValidator,
+#endif
const wxString& name = wxTreeCtrlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
+#if wxUSE_VALIDATORS
const wxValidator &validator = wxDefaultValidator,
+#endif
const wxString& name = wxTreeCtrlNameStr);
// accessors
// retrieve items label
wxString GetItemText(const wxTreeItemId& item) const;
- // get the normal item image
- int GetItemImage(const wxTreeItemId& item) const;
- // get the selected item image
- int GetItemSelectedImage(const wxTreeItemId& item) const;
+ // get one of the images associated with the item (normal by default)
+ int GetItemImage(const wxTreeItemId& item,
+ wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
// get the data associated with the item
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
// set items label
void SetItemText(const wxTreeItemId& item, const wxString& text);
- // set the normal item image
- void SetItemImage(const wxTreeItemId& item, int image);
- // set the selected item image
- void SetItemSelectedImage(const wxTreeItemId& item, int image);
+ // get one of the images associated with the item (normal by default)
+ void SetItemImage(const wxTreeItemId& item, int image,
+ wxTreeItemIcon which = wxTreeItemIcon_Normal);
// associate some data with the item
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
// NB: this function is not reentrant and not MT-safe (FIXME)!
void SortChildren(const wxTreeItemId& item);
+ // deprecated functions: use Set/GetItemImage directly
+ // get the selected item image
+ int GetItemSelectedImage(const wxTreeItemId& item) const
+ { return GetItemImage(item, wxTreeItemIcon_Selected); }
+ // set the selected item image
+ void SetItemSelectedImage(const wxTreeItemId& item, int image)
+ { SetItemImage(item, image, wxTreeItemIcon_Selected); }
+
+ // implementation
+
// callbacks
void OnPaint( wxPaintEvent &event );
void OnSetFocus( wxFocusEvent &event );
friend class wxTreeRenameTimer;
friend class wxTreeTextCtrl;
+ wxFont m_normalFont;
+ wxFont m_boldFont;
+
wxGenericTreeItem *m_anchor;
wxGenericTreeItem *m_current, *m_key_current, *m_currentEdit;
bool m_hasFocus;