Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
treelistctrl.h
Go to the documentation of this file.
1 // Name: treelistctrl.h
3 // Purpose: wxTreeListCtrl class
4 // Created: 01/02/97
5 // Author: Robert Roebling
6 // Maintainer: Ronan Chartois (pgriddev)
7 // Version: $Id: treelistctrl.h 3043 2012-07-31 19:28:14Z pgriddev $
8 // Copyright: (c) 2004-2011 Robert Roebling, Julian Smart, Alberto Griggio,
9 // Vadim Zeitlin, Otto Wyss, Ronan Chartois
10 // Licence: wxWindows
12 
13 
14 #ifndef TREELISTCTRL_H
15 #define TREELISTCTRL_H
16 
17 #if defined(__GNUG__) && !defined(__APPLE__)
18  #pragma interface "treelistctrl.h"
19 #endif
20 
21 #include <wx/treectrl.h>
22 #include <wx/control.h>
23 #include <wx/pen.h>
24 #include <wx/listctrl.h> // for wxListEvent
25 #if wxUSE_XRC
26  #include "wx/xrc/xmlres.h"
27 #endif
28 
29 
30 namespace wxcode {
31 
32 class wxTreeListItem;
33 class wxTreeListHeaderWindow;
34 class wxTreeListMainWindow;
35 
36 #define wxTR_COLUMN_LINES 0x1000 // put border around items
37 #define wxTR_VIRTUAL 0x4000 // The application provides items text on demand.
38 
39 //-----------------------------------------------------------------------------
40 // wxTreeListColumnAttrs
41 //-----------------------------------------------------------------------------
42 
43 enum {
45 };
46 
47 class wxTreeListColumnInfo: public wxObject {
48 
49 public:
50  wxTreeListColumnInfo (const wxString &text = wxEmptyString,
51  int width = DEFAULT_COL_WIDTH,
52  int flag = wxALIGN_LEFT,
53  int image = -1,
54  bool shown = true,
55  bool edit = false,
56  const wxString &tooltip = wxEmptyString) {
57  m_text = text;
58  m_width = width;
59  m_flag = flag;
60  m_image = image;
61  m_selected_image = -1;
62  m_shown = shown;
63  m_edit = edit;
64  m_tooltip = tooltip;
65  }
66 
68  m_text = other.m_text;
69  m_width = other.m_width;
70  m_flag = other.m_flag;
71  m_image = other.m_image;
73  m_shown = other.m_shown;
74  m_edit = other.m_edit;
75  m_tooltip = other.m_tooltip;
76  }
77 
79 
80  // get/set
81  wxString GetText() const { return m_text; }
82  wxTreeListColumnInfo& SetText (const wxString& text) { m_text = text; return *this; }
83 
84  int GetWidth() const { return m_shown ? m_width : 0; }
85  wxTreeListColumnInfo& SetWidth (int width) { m_width = width; return *this; }
86 
87  int GetAlignment() const { return m_flag; }
88  wxTreeListColumnInfo& SetAlignment (int flag) { m_flag = flag; return *this; }
89 
90  int GetImage() const { return m_image; }
91  wxTreeListColumnInfo& SetImage (int image) { m_image = image; return *this; }
92 
93  int GetSelectedImage() const { return m_selected_image; }
94  wxTreeListColumnInfo& SetSelectedImage (int image) { m_selected_image = image; return *this; }
95 
96  bool IsEditable() const { return m_edit; }
98  { m_edit = edit; return *this; }
99 
100  wxString GetTooltip() const { return m_tooltip; }
101  wxTreeListColumnInfo& SetTooltip (const wxString& text) { m_tooltip = text; return *this; }
102 
103  bool IsShown() const { return m_shown; }
104  wxTreeListColumnInfo& SetShown(bool shown) { m_shown = shown; return *this; }
105 
106 private:
107  wxString m_text;
108  int m_width;
109  int m_flag;
110  int m_image;
112  bool m_shown;
113  bool m_edit;
114  wxString m_tooltip;
115 };
116 
117 //----------------------------------------------------------------------------
118 // wxTreeListCtrl - the multicolumn tree control
119 //----------------------------------------------------------------------------
120 
121 // modes for navigation
122 const int wxTL_MODE_NAV_FULLTREE = 0x0000; // default
123 const int wxTL_MODE_NAV_EXPANDED = 0x0001;
124 const int wxTL_MODE_NAV_VISIBLE = 0x0002;
125 const int wxTL_MODE_NAV_LEVEL = 0x0004;
126 
127 // modes for FindItem
128 const int wxTL_MODE_FIND_EXACT = 0x0000; // default
129 const int wxTL_MODE_FIND_PARTIAL = 0x0010;
130 const int wxTL_MODE_FIND_NOCASE = 0x0020;
131 
132 // additional flag for HitTest
133 const int wxTREE_HITTEST_ONITEMCOLUMN = 0x2000;
134 extern const wxChar* wxTreeListCtrlNameStr;
135 
136 
137 class wxTreeListCtrl : public wxControl
138 {
140 friend class wxTreeListMainWindow;
141 friend class wxTreeListItem;
142 public:
143 
144  // ---------- creation ----------
145 
148  {}
149 
150  wxTreeListCtrl(wxWindow *parent, wxWindowID id = -1,
151  const wxPoint& pos = wxDefaultPosition,
152  const wxSize& size = wxDefaultSize,
153  long style = wxTR_DEFAULT_STYLE,
154  const wxValidator &validator = wxDefaultValidator,
155  const wxString& name = wxTreeListCtrlNameStr )
157  {
158  Create(parent, id, pos, size, style, validator, name);
159  }
160 
161  virtual ~wxTreeListCtrl() {}
162 
163  bool Create(wxWindow *parent, wxWindowID id = -1,
164  const wxPoint& pos = wxDefaultPosition,
165  const wxSize& size = wxDefaultSize,
166  long style = wxTR_DEFAULT_STYLE,
167  const wxValidator &validator = wxDefaultValidator,
168  const wxString& name = wxTreeListCtrlNameStr );
169 
170  void Refresh(bool erase=TRUE, const wxRect* rect=NULL);
171  void SetFocus();
172 
173 
174  // ---------- general methods ----------
175 
176  // get the total number of items in the control
177  size_t GetCount() const;
178 
179  // indent is the number of pixels the children are indented relative to
180  // the parents position. SetIndent() also redraws the control
181  // immediately.
182  unsigned int GetIndent() const;
183  void SetIndent(unsigned int indent);
184 
185  // line spacing is the space above and below the text on each line
186  unsigned int GetLineSpacing() const;
187  void SetLineSpacing(unsigned int spacing);
188 
189  // image list: these functions allow to associate an image list with
190  // the control and retrieve it. Note that when assigned with
191  // SetImageList, the control does _not_ delete
192  // the associated image list when it's deleted in order to allow image
193  // lists to be shared between different controls. If you use
194  // AssignImageList, the control _does_ delete the image list.
195  //
196  // The normal image list is for the icons which correspond to the
197  // normal tree item state (whether it is selected or not).
198  // Additionally, the application might choose to show a state icon
199  // which corresponds to an app-defined item state (for example,
200  // checked/unchecked) which are taken from the state image list.
201  wxImageList *GetImageList() const;
202  wxImageList *GetStateImageList() const;
203  wxImageList *GetButtonsImageList() const;
204 
205  void SetImageList(wxImageList *imageList);
206  void SetStateImageList(wxImageList *imageList);
207  void SetButtonsImageList(wxImageList *imageList);
208  void AssignImageList(wxImageList *imageList);
209  void AssignStateImageList(wxImageList *imageList);
210  void AssignButtonsImageList(wxImageList *imageList);
211 
212  void SetToolTip(const wxString& tip);
213  void SetToolTip (wxToolTip *tip);
214  void SetItemToolTip(const wxTreeItemId& item, const wxString &tip);
215 
216  // ---------- Functions to work with columns ----------
217 
218  // adds a column
219  void AddColumn (const wxString& text,
220  int width = DEFAULT_COL_WIDTH,
221  int flag = wxALIGN_LEFT,
222  int image = -1,
223  bool shown = true,
224  bool edit = false,
225  const wxString& tooltip = wxEmptyString) {
226  AddColumn (wxTreeListColumnInfo (text, width, flag, image, shown, edit, tooltip));
227  }
228  void AddColumn (const wxTreeListColumnInfo& colInfo);
229 
230  // inserts a column before the given one
231  void InsertColumn (int before,
232  const wxString& text,
233  int width = DEFAULT_COL_WIDTH,
234  int flag = wxALIGN_LEFT,
235  int image = -1,
236  bool shown = true,
237  bool edit = false,
238  const wxString& tooltip = wxEmptyString) {
239  InsertColumn (before,
240  wxTreeListColumnInfo (text, width, flag, image, shown, edit, tooltip));
241  }
242  void InsertColumn (int before, const wxTreeListColumnInfo& colInfo);
243 
244  // deletes the given column - does not delete the corresponding column
245  void RemoveColumn (int column);
246 
247  // returns the number of columns in the ctrl
248  int GetColumnCount() const;
249 
250  // tells which column is the "main" one, i.e. the "threaded" one
251  void SetMainColumn (int column);
252  int GetMainColumn() const;
253 
254  void SetColumn (int column, const wxTreeListColumnInfo& colInfo);
255  wxTreeListColumnInfo GetColumn (int column);
256  const wxTreeListColumnInfo& GetColumn (int column) const;
257 
258  void SetColumnText (int column, const wxString& text);
259  wxString GetColumnText (int column) const;
260 
261  void SetColumnWidth (int column, int width);
262  int GetColumnWidth (int column) const;
263 
264  void SetColumnAlignment (int column, int flag);
265  int GetColumnAlignment (int column) const;
266 
267  void SetColumnImage (int column, int image);
268  int GetColumnImage (int column) const;
269 
270  void SetColumnShown (int column, bool shown = true);
271  bool IsColumnShown (int column) const;
272 
273  void SetColumnEditable (int column, bool edit = true);
274  bool IsColumnEditable (int column) const;
275 
276  // ---------- Functions to work with items. ----------
277 
278  // accessors (most properties have a default at row/item level)
279  // ---------
280 
281  wxString GetItemText (const wxTreeItemId& item) const { return GetItemText (item, GetMainColumn()); };
282  wxString GetItemText (const wxTreeItemId& item, int column) const;
283 
284  int GetItemImage (const wxTreeItemId& item, wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
285  int GetItemImage (const wxTreeItemId& item, int column) const;
286 
287  wxTreeItemData *GetItemData (const wxTreeItemId& item) const;
288  wxTreeItemData *GetItemData (const wxTreeItemId& item, int column) const;
289 
290  bool GetItemBold (const wxTreeItemId& item) const;
291  bool GetItemBold (const wxTreeItemId& item, int column) const;
292 
293  wxColour GetItemTextColour (const wxTreeItemId& item) const;
294  wxColour GetItemTextColour (const wxTreeItemId& item, int column) const;
295 
296  wxColour GetItemBackgroundColour (const wxTreeItemId& item) const;
297  wxColour GetItemBackgroundColour (const wxTreeItemId& item, int column) const;
298 
299  wxFont GetItemFont (const wxTreeItemId& item) const;
300  wxFont GetItemFont (const wxTreeItemId& item, int column) const;
301 
302  // modifiers (most properties have a default at row/item level)
303  // ---------
304 
305  void SetItemText (const wxTreeItemId& item, const wxString& text);
306  void SetItemText (const wxTreeItemId& item, int column, const wxString& text);
307 
308  // the which parameter is ignored for all columns but the main one
309  void SetItemImage (const wxTreeItemId& item, int image, wxTreeItemIcon which = wxTreeItemIcon_Normal);
310  void SetItemImage (const wxTreeItemId& item, int column, int image);
311 
312  void SetItemData (const wxTreeItemId& item, wxTreeItemData *data);
313  void SetItemData (const wxTreeItemId& item, int column, wxTreeItemData *data);
314 
315  void SetItemBold (const wxTreeItemId& item, bool bold = true);
316  void SetItemBold (const wxTreeItemId& item, int column, bool bold = true);
317 
318  void SetItemTextColour (const wxTreeItemId& item, const wxColour& colour);
319  void SetItemTextColour (const wxTreeItemId& item, int column, const wxColour& colour);
320 
321  void SetItemBackgroundColour (const wxTreeItemId& item, const wxColour& colour);
322  void SetItemBackgroundColour (const wxTreeItemId& item, int column, const wxColour& colour);
323 
324  // font should be of the same height for all items
325  void SetItemFont (const wxTreeItemId& item, const wxFont& font);
326  void SetItemFont (const wxTreeItemId& item, int column, const wxFont& font);
327 
328  // force appearance of [+] button near the item. This is useful to
329  // allow the user to expand the items which don't have any children now
330  // - but instead add them only when needed, thus minimizing memory
331  // usage and loading time.
332  void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
333 
334  // item status inquiries
335  // ---------------------
336 
337  // is the item visible (it might be outside the view or not expanded)?
338  bool IsVisible (const wxTreeItemId& item, bool fullRow = false, bool within = true) const;
339  // does the item has any children?
340  bool HasChildren (const wxTreeItemId& item) const;
341  // is the item expanded (only makes sense if HasChildren())?
342  bool IsExpanded (const wxTreeItemId& item) const;
343  // is this item currently selected (the same as has focus)?
344  bool IsSelected (const wxTreeItemId& item) const;
345  // is item text in bold font?
346  bool IsBold (const wxTreeItemId& item) const { return IsBold(item, GetMainColumn()); };
347  bool IsBold (const wxTreeItemId& item, int column) const { return GetItemBold(item, column); };
348  // does the layout include space for a button?
349 
350 
351  // set the window font
352  virtual bool SetFont ( const wxFont &font );
353 
354  // set the styles.
355  virtual void SetWindowStyleFlag (long styles);
356  virtual long GetWindowStyleFlag() const;
357 
358  // number of children
359  // ------------------
360 
361  // if 'recursively' is FALSE, only immediate children count, otherwise
362  // the returned number is the number of all items in this branch
363  size_t GetChildrenCount (const wxTreeItemId& item, bool recursively = true);
364 
365  // navigation
366  // ----------
367 
368  // wxTreeItemId.IsOk() will return FALSE if there is no such item
369 
370  // get the root tree item
371  wxTreeItemId GetRootItem() const;
372 
373  // get the item currently selected (may return NULL if no selection)
374  wxTreeItemId GetSelection() const;
375 
376  // get the items currently selected, return the number of such item
377  size_t GetSelections (wxArrayTreeItemIds&) const;
378 
379  // get the parent of this item (may return NULL if root)
380  wxTreeItemId GetItemParent (const wxTreeItemId& item) const;
381 
382  // for this enumeration function you must pass in a "cookie" parameter
383  // which is opaque for the application but is necessary for the library
384  // to make these functions reentrant (i.e. allow more than one
385  // enumeration on one and the same object simultaneously). Of course,
386  // the "cookie" passed to GetFirstChild() and GetNextChild() should be
387  // the same!
388 
389  // get child of this item
390  wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
391  wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
392  wxTreeItemId GetPrevChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
393  wxTreeItemId GetLastChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
394 
395  // get sibling of this item
396  wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
397  wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
398 
399  // get item in the full tree (currently only for internal use)
400  wxTreeItemId GetNext(const wxTreeItemId& item) const;
401  wxTreeItemId GetPrev(const wxTreeItemId& item) const;
402 
403  // get expanded item, see IsExpanded()
404  wxTreeItemId GetFirstExpandedItem() const;
405  wxTreeItemId GetNextExpanded(const wxTreeItemId& item) const;
406  wxTreeItemId GetPrevExpanded(const wxTreeItemId& item) const;
407 
408  // get visible item, see IsVisible()
409  wxTreeItemId GetFirstVisibleItem( bool fullRow = false) const;
410  wxTreeItemId GetFirstVisible( bool fullRow = false, bool within = true) const;
411  wxTreeItemId GetNextVisible (const wxTreeItemId& item, bool fullRow = false, bool within = true) const;
412  wxTreeItemId GetPrevVisible (const wxTreeItemId& item, bool fullRow = false, bool within = true) const;
413  wxTreeItemId GetLastVisible ( bool fullRow = false, bool within = true) const;
414 
415  // operations
416  // ----------
417 
418  // add the root node to the tree
419  wxTreeItemId AddRoot (const wxString& text,
420  int image = -1, int selectedImage = -1,
421  wxTreeItemData *data = NULL);
422 
423  // insert a new item in as the first child of the parent
424  wxTreeItemId PrependItem (const wxTreeItemId& parent,
425  const wxString& text,
426  int image = -1, int selectedImage = -1,
427  wxTreeItemData *data = NULL);
428 
429  // insert a new item after a given one
430  wxTreeItemId InsertItem (const wxTreeItemId& parent,
431  const wxTreeItemId& idPrevious,
432  const wxString& text,
433  int image = -1, int selectedImage = -1,
434  wxTreeItemData *data = NULL);
435 
436  // insert a new item before the one with the given index
437  wxTreeItemId InsertItem (const wxTreeItemId& parent,
438  size_t index,
439  const wxString& text,
440  int image = -1, int selectedImage = -1,
441  wxTreeItemData *data = NULL);
442 
443  // insert a new item in as the last child of the parent
444  wxTreeItemId AppendItem (const wxTreeItemId& parent,
445  const wxString& text,
446  int image = -1, int selectedImage = -1,
447  wxTreeItemData *data = NULL);
448 
449  // delete this item (except root) + children and associated data if any
450  void Delete (const wxTreeItemId& item);
451  // delete all children (but don't delete the item itself)
452  void DeleteChildren (const wxTreeItemId& item);
453  // delete the root and all its children from the tree
454  void DeleteRoot();
455 
456  // change item's parent (return previous parent)
457  void SetItemParent(const wxTreeItemId& parent, const wxTreeItemId& item);
458 
459  // expand this item
460  void Expand (const wxTreeItemId& item);
461  // expand this item and all subitems recursively
462  void ExpandAll (const wxTreeItemId& item);
463  // collapse the item without removing its children
464  void Collapse (const wxTreeItemId& item);
465  // collapse the item and remove all children
466  void CollapseAndReset(const wxTreeItemId& item); //? TODO ???
467  // toggles the current state
468  void Toggle (const wxTreeItemId& item);
469 
470  // set cursor item (indicated by black rectangle)
471  void SetCurrentItem(const wxTreeItemId& item = (wxTreeItemId*)NULL);
472 
473  // remove the selection from currently selected item (if any)
474  void Unselect();
475  void UnselectAll();
476  // select this item - return true if selection was allowed (no veto)
477  bool SelectItem (const wxTreeItemId& item,
478  const wxTreeItemId& last = (wxTreeItemId*)NULL,
479  bool unselect_others = true);
480  // select all items in the expanded tree
481  void SelectAll();
482  // make sure this item is visible (expanding the parent item and/or
483  // scrolling to this item if necessary)
484  void EnsureVisible (const wxTreeItemId& item);
485  // scroll to this item (but don't expand its parent)
486  void ScrollTo (const wxTreeItemId& item);
487 
488  // The first function is more portable (because easier to implement
489  // on other platforms), but the second one returns some extra info.
490  wxTreeItemId HitTest (const wxPoint& point)
491  { int flags; int column; return HitTest (point, flags, column); }
492  wxTreeItemId HitTest (const wxPoint& point, int& flags)
493  { int column; return HitTest (point, flags, column); }
494  wxTreeItemId HitTest (const wxPoint& point, int& flags, int& column);
495 
496  // get the bounding rectangle of the item (or of its label only)
497  bool GetBoundingRect (const wxTreeItemId& item, wxRect& rect,
498  bool textOnly = false) const;
499 
500  // Start editing the item label: this (temporarily) replaces the item
501  // with a one line edit control. The item will be selected if it hadn't
502  // been before.
503  void EditLabel (const wxTreeItemId& item)
504  { EditLabel (item, GetMainColumn()); }
505  // edit item's label of the given column
506  void EditLabel (const wxTreeItemId& item, int column);
507  void EndEdit(bool isCancelled);
508 
509  // virtual mode
510  virtual wxString OnGetItemText( wxTreeItemData* item, long column ) const;
511 
512  // sorting
513  // this function is called to compare 2 items and should return -1, 0
514  // or +1 if the first item is less than, equal to or greater than the
515  // second one. The base class version performs alphabetic comparaison
516  // of item labels (GetText)
517  virtual int OnCompareItems (const wxTreeItemId& item1, const wxTreeItemId& item2);
518  virtual int OnCompareItems (const wxTreeItemId& item1, const wxTreeItemId& item2, int column);
519  // sort the children of this item using OnCompareItems
520  // NB: this function is not reentrant and not MT-safe (TODO)!
521  void SortChildren(const wxTreeItemId& item, int column = -1, bool reverseOrder = false);
522 
523  // searching (by column only)
524  wxTreeItemId FindItem (const wxTreeItemId& item, const wxString& str, int mode = 0) { return FindItem(item, -1, str, mode); };
525  wxTreeItemId FindItem (const wxTreeItemId& item, int column, const wxString& str, int mode = 0);
526 
527  // overridden base class virtuals
528  virtual bool SetBackgroundColour (const wxColour& colour);
529  virtual bool SetForegroundColour (const wxColour& colour);
530 
531  // drop over item
532  void SetDragItem (const wxTreeItemId& item = (wxTreeItemId*)NULL);
533 
534 
535  virtual wxSize DoGetBestSize() const;
536 
537 protected:
538  // header window, responsible for column visualization and manipulation
540  { return m_header_win; }
541  wxTreeListHeaderWindow* m_header_win; // future cleanup: make private or remove GetHeaderWindow()
542 
543  // main window, the "true" tree ctrl
545  { return m_main_win; }
546  wxTreeListMainWindow* m_main_win; // future cleanup: make private or remove GetMainWindow()
547 
548  int GetHeaderHeight() const { return m_headerHeight; }
549 
551  void DoHeaderLayout();
552  void OnSize(wxSizeEvent& event);
553 
554 private:
556 
557  DECLARE_EVENT_TABLE()
558  DECLARE_DYNAMIC_CLASS(wxTreeListCtrl)
559 };
560 
561 
562 //----------------------------------------------------------------------------
563 // wxTreeListCtrlXmlHandler - XRC support for wxTreeListCtrl
564 //----------------------------------------------------------------------------
565 
566 #if wxUSE_XRC
567 
568 class wxTreeListCtrlXmlHandler : public wxXmlResourceHandler {
569  DECLARE_DYNAMIC_CLASS(wxTreeListCtrlXmlHandler)
570 public:
571  wxTreeListCtrlXmlHandler();
572  virtual wxObject *DoCreateResource();
573  virtual bool CanHandle(wxXmlNode *node);
574 };
575 
576 #endif /* wxUSE_XRC */
577 
578 } // namespace wxcode
579 
580 
582 #endif /* TREELISTCTRL_H */
583 
wxFont GetItemFont(const wxTreeItemId &item) const
void Refresh(bool erase=TRUE, const wxRect *rect=NULL)
void SetItemFont(const wxTreeItemId &item, const wxFont &font)
void AssignButtonsImageList(wxImageList *imageList)
wxTreeListColumnInfo GetColumn(int column)
unsigned int GetLineSpacing() const
wxString GetTooltip() const
Definition: treelistctrl.h:100
void CollapseAndReset(const wxTreeItemId &item)
wxTreeItemId GetNextVisible(const wxTreeItemId &item, bool fullRow=false, bool within=true) const
void OnSize(wxSizeEvent &event)
void EnsureVisible(const wxTreeItemId &item)
virtual long GetWindowStyleFlag() const
wxTreeItemId GetPrev(const wxTreeItemId &item) const
size_t GetChildrenCount(const wxTreeItemId &item, bool recursively=true)
const int wxTREE_HITTEST_ONITEMCOLUMN
Definition: treelistctrl.h:133
wxTreeListColumnInfo & SetEditable(bool edit)
Definition: treelistctrl.h:97
wxTreeItemId HitTest(const wxPoint &point, int &flags)
Definition: treelistctrl.h:492
void SetItemBackgroundColour(const wxTreeItemId &item, const wxColour &colour)
wxTreeListColumnInfo & SetTooltip(const wxString &text)
Definition: treelistctrl.h:101
const int wxTL_MODE_FIND_EXACT
Definition: treelistctrl.h:128
void ScrollTo(const wxTreeItemId &item)
wxTreeListColumnInfo(const wxTreeListColumnInfo &other)
Definition: treelistctrl.h:67
void AssignStateImageList(wxImageList *imageList)
void SetColumnWidth(int column, int width)
const int wxTL_MODE_NAV_EXPANDED
Definition: treelistctrl.h:123
wxTreeListColumnInfo & SetSelectedImage(int image)
Definition: treelistctrl.h:94
wxTreeItemId FindItem(const wxTreeItemId &item, const wxString &str, int mode=0)
Definition: treelistctrl.h:524
wxTreeItemId GetRootItem() const
void Toggle(const wxTreeItemId &item)
void SetItemData(const wxTreeItemId &item, wxTreeItemData *data)
void SetColumnImage(int column, int image)
virtual bool SetBackgroundColour(const wxColour &colour)
void SortChildren(const wxTreeItemId &item, int column=-1, bool reverseOrder=false)
void SetLineSpacing(unsigned int spacing)
wxTreeItemId GetPrevSibling(const wxTreeItemId &item) const
void Collapse(const wxTreeItemId &item)
wxTreeItemId AppendItem(const wxTreeItemId &parent, const wxString &text, int image=-1, int selectedImage=-1, wxTreeItemData *data=NULL)
bool SelectItem(const wxTreeItemId &item, const wxTreeItemId &last=(wxTreeItemId *) NULL, bool unselect_others=true)
void SetItemParent(const wxTreeItemId &parent, const wxTreeItemId &item)
void SetColumnShown(int column, bool shown=true)
wxTreeItemData * GetItemData(const wxTreeItemId &item) const
void EndEdit(bool isCancelled)
wxTreeItemId AddRoot(const wxString &text, int image=-1, int selectedImage=-1, wxTreeItemData *data=NULL)
void SetColumnAlignment(int column, int flag)
void DeleteChildren(const wxTreeItemId &item)
wxTreeItemId GetPrevExpanded(const wxTreeItemId &item) const
const int wxTL_MODE_FIND_NOCASE
Definition: treelistctrl.h:130
void AssignImageList(wxImageList *imageList)
void SetColumnEditable(int column, bool edit=true)
wxTreeItemId GetLastChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
wxTreeItemId GetItemParent(const wxTreeItemId &item) const
bool IsVisible(const wxTreeItemId &item, bool fullRow=false, bool within=true) const
wxTreeItemId GetNextSibling(const wxTreeItemId &item) const
wxTreeItemId GetFirstChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
bool IsColumnShown(int column) const
int GetColumnAlignment(int column) const
wxTreeItemId HitTest(const wxPoint &point)
Definition: treelistctrl.h:490
const int wxTL_MODE_NAV_LEVEL
Definition: treelistctrl.h:125
wxTreeItemId GetFirstExpandedItem() const
size_t GetCount() const
void SetItemHasChildren(const wxTreeItemId &item, bool has=true)
wxTreeListColumnInfo(const wxString &text=wxEmptyString, int width=DEFAULT_COL_WIDTH, int flag=wxALIGN_LEFT, int image=-1, bool shown=true, bool edit=false, const wxString &tooltip=wxEmptyString)
Definition: treelistctrl.h:50
void SetMainColumn(int column)
wxTreeItemId GetLastVisible(bool fullRow=false, bool within=true) const
bool IsColumnEditable(int column) const
wxTreeItemId GetNext(const wxTreeItemId &item) const
void SetItemImage(const wxTreeItemId &item, int image, wxTreeItemIcon which=wxTreeItemIcon_Normal)
wxTreeListColumnInfo & SetWidth(int width)
Definition: treelistctrl.h:85
bool IsSelected(const wxTreeItemId &item) const
void SetIndent(unsigned int indent)
void InsertColumn(int before, const wxString &text, int width=DEFAULT_COL_WIDTH, int flag=wxALIGN_LEFT, int image=-1, bool shown=true, bool edit=false, const wxString &tooltip=wxEmptyString)
Definition: treelistctrl.h:231
wxTreeListColumnInfo & SetText(const wxString &text)
Definition: treelistctrl.h:82
wxImageList * GetImageList() const
wxTreeItemId PrependItem(const wxTreeItemId &parent, const wxString &text, int image=-1, int selectedImage=-1, wxTreeItemData *data=NULL)
int GetHeaderHeight() const
Definition: treelistctrl.h:548
bool HasChildren(const wxTreeItemId &item) const
virtual void SetWindowStyleFlag(long styles)
void SetItemBold(const wxTreeItemId &item, bool bold=true)
void AddColumn(const wxString &text, int width=DEFAULT_COL_WIDTH, int flag=wxALIGN_LEFT, int image=-1, bool shown=true, bool edit=false, const wxString &tooltip=wxEmptyString)
Definition: treelistctrl.h:219
wxColour GetItemTextColour(const wxTreeItemId &item) const
wxTreeItemId GetNextChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
void Expand(const wxTreeItemId &item)
options wxIntPtr item2
wxTreeItemId GetFirstVisible(bool fullRow=false, bool within=true) const
void SetItemToolTip(const wxTreeItemId &item, const wxString &tip)
const int wxTL_MODE_NAV_FULLTREE
Definition: treelistctrl.h:122
const wxChar * wxTreeListCtrlNameStr
bool Create(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTR_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxTreeListCtrlNameStr)
bool GetItemBold(const wxTreeItemId &item) const
wxColour GetItemBackgroundColour(const wxTreeItemId &item) const
void SetColumn(int column, const wxTreeListColumnInfo &colInfo)
wxTreeItemId InsertItem(const wxTreeItemId &parent, const wxTreeItemId &idPrevious, const wxString &text, int image=-1, int selectedImage=-1, wxTreeItemData *data=NULL)
const int wxTL_MODE_FIND_PARTIAL
Definition: treelistctrl.h:129
void SetColumnText(int column, const wxString &text)
void SetCurrentItem(const wxTreeItemId &item=(wxTreeItemId *) NULL)
void RemoveColumn(int column)
virtual wxString OnGetItemText(wxTreeItemData *item, long column) const
wxString GetText() const
Definition: treelistctrl.h:81
void SetItemTextColour(const wxTreeItemId &item, const wxColour &colour)
wxTreeListColumnInfo & SetImage(int image)
Definition: treelistctrl.h:91
int GetColumnImage(int column) const
virtual bool SetForegroundColour(const wxColour &colour)
options wxIntPtr wxIntPtr sortData std::vector< PanoInfo > * data
virtual wxSize DoGetBestSize() const
wxTreeItemId GetFirstVisibleItem(bool fullRow=false) const
void SetDragItem(const wxTreeItemId &item=(wxTreeItemId *) NULL)
void SetToolTip(const wxString &tip)
int GetItemImage(const wxTreeItemId &item, wxTreeItemIcon which=wxTreeItemIcon_Normal) const
wxTreeListColumnInfo & SetShown(bool shown)
Definition: treelistctrl.h:104
wxTreeListMainWindow * m_main_win
Definition: treelistctrl.h:546
wxTreeItemId GetSelection() const
wxString GetColumnText(int column) const
wxTreeListColumnInfo & SetAlignment(int flag)
Definition: treelistctrl.h:88
size_t GetSelections(wxArrayTreeItemIds &) const
bool IsBold(const wxTreeItemId &item, int column) const
Definition: treelistctrl.h:347
virtual bool SetFont(const wxFont &font)
bool IsBold(const wxTreeItemId &item) const
Definition: treelistctrl.h:346
void SetImageList(wxImageList *imageList)
void ExpandAll(const wxTreeItemId &item)
wxTreeListCtrl(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTR_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxTreeListCtrlNameStr)
Definition: treelistctrl.h:150
const int wxTL_MODE_NAV_VISIBLE
Definition: treelistctrl.h:124
bool GetBoundingRect(const wxTreeItemId &item, wxRect &rect, bool textOnly=false) const
wxTreeItemId GetPrevVisible(const wxTreeItemId &item, bool fullRow=false, bool within=true) const
void SetButtonsImageList(wxImageList *imageList)
wxTreeListMainWindow * GetMainWindow() const
Definition: treelistctrl.h:544
static uint16_t flags
wxTreeItemId GetNextExpanded(const wxTreeItemId &item) const
virtual int OnCompareItems(const wxTreeItemId &item1, const wxTreeItemId &item2)
wxString GetItemText(const wxTreeItemId &item) const
Definition: treelistctrl.h:281
wxImageList * GetStateImageList() const
wxImageList * GetButtonsImageList() const
unsigned int GetIndent() const
wxTreeListHeaderWindow * GetHeaderWindow() const
Definition: treelistctrl.h:539
bool IsExpanded(const wxTreeItemId &item) const
wxTreeItemId GetPrevChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
void SetItemText(const wxTreeItemId &item, const wxString &text)
void EditLabel(const wxTreeItemId &item)
Definition: treelistctrl.h:503
void SetStateImageList(wxImageList *imageList)
wxTreeListHeaderWindow * m_header_win
Definition: treelistctrl.h:541
void Delete(const wxTreeItemId &item)
int GetColumnWidth(int column) const