treelistctrl.h

Go to the documentation of this file.
00001 
00002 // Name:        treelistctrl.h
00003 // Purpose:     wxTreeListCtrl class
00004 // Created:     01/02/97
00005 // Author:      Robert Roebling
00006 // Maintainer:  Ronan Chartois (pgriddev)
00007 // Version:     $Id: treelistctrl.h 3022 2012-05-28 14:14:48Z pgriddev $
00008 // Copyright:   (c) 2004-2011 Robert Roebling, Julian Smart, Alberto Griggio,
00009 //              Vadim Zeitlin, Otto Wyss, Ronan Chartois
00010 // Licence:     wxWindows
00012 
00013 
00014 #ifndef TREELISTCTRL_H
00015 #define TREELISTCTRL_H
00016 
00017 #if defined(__GNUG__) && !defined(__APPLE__)
00018     #pragma interface "treelistctrl.h"
00019 #endif
00020 
00021 #include <wx/treectrl.h>
00022 #include <wx/control.h>
00023 #include <wx/pen.h>
00024 #include <wx/listctrl.h> // for wxListEvent
00025 
00026 class wxTreeListItem;
00027 class wxTreeListHeaderWindow;
00028 class wxTreeListMainWindow;
00029 
00030 #define wxTR_COLUMN_LINES 0x1000 // put border around items
00031 #define wxTR_VIRTUAL      0x4000 // The application provides items text on demand.
00032 
00033 // Using this typedef removes an ambiguity when calling Remove()
00034 #ifdef __WXMSW__
00035 #if !wxCHECK_VERSION(2, 5, 0)
00036 typedef long wxTreeItemIdValue;
00037 #else
00038 typedef void *wxTreeItemIdValue;
00039 #endif
00040 #endif
00041 
00042 //-----------------------------------------------------------------------------
00043 // wxTreeListColumnAttrs
00044 //-----------------------------------------------------------------------------
00045 
00046 enum {
00047     DEFAULT_COL_WIDTH = 100
00048 };
00049 
00050 class wxTreeListColumnInfo: public wxObject {
00051 
00052 public:
00053     wxTreeListColumnInfo (const wxString &text = wxEmptyString,
00054                           int width = DEFAULT_COL_WIDTH,
00055                           int flag = wxALIGN_LEFT,
00056                           int image = -1,
00057                           bool shown = true,
00058                           bool edit = false,
00059                           const wxString &tooltip = wxEmptyString) {
00060         m_text = text;
00061         m_width = width;
00062         m_flag = flag;
00063         m_image = image;
00064         m_selected_image = -1;
00065         m_shown = shown;
00066         m_edit = edit;
00067         m_tooltip = tooltip;
00068     }
00069 
00070     wxTreeListColumnInfo (const wxTreeListColumnInfo& other) {
00071         m_text = other.m_text;
00072         m_width = other.m_width;
00073         m_flag = other.m_flag;
00074         m_image = other.m_image;
00075         m_selected_image = other.m_selected_image;
00076         m_shown = other.m_shown;
00077         m_edit = other.m_edit;
00078         m_tooltip = other.m_tooltip;
00079     }
00080 
00081     ~wxTreeListColumnInfo() {}
00082 
00083     // get/set
00084     wxString GetText() const { return m_text; }
00085     wxTreeListColumnInfo& SetText (const wxString& text) { m_text = text; return *this; }
00086 
00087     int GetWidth() const { return m_shown ? m_width : 0; }
00088     wxTreeListColumnInfo& SetWidth (int width) { m_width = width; return *this; }
00089 
00090     int GetAlignment() const { return m_flag; }
00091     wxTreeListColumnInfo& SetAlignment (int flag) { m_flag = flag; return *this; }
00092 
00093     int GetImage() const { return m_image; }
00094     wxTreeListColumnInfo& SetImage (int image) { m_image = image; return *this; }
00095 
00096     int GetSelectedImage() const { return m_selected_image; }
00097     wxTreeListColumnInfo& SetSelectedImage (int image) { m_selected_image = image; return *this; }
00098 
00099     bool IsEditable() const { return m_edit; }
00100     wxTreeListColumnInfo& SetEditable (bool edit)
00101         { m_edit = edit; return *this; }
00102 
00103     wxString GetTooltip() const { return m_tooltip; }
00104     wxTreeListColumnInfo& SetTooltip (const wxString& text) { m_tooltip = text; return *this; }
00105 
00106     bool IsShown() const { return m_shown; }
00107     wxTreeListColumnInfo& SetShown(bool shown) { m_shown = shown; return *this; }
00108 
00109 private:
00110     wxString m_text;
00111     int m_width;
00112     int m_flag;
00113     int m_image;
00114     int m_selected_image;
00115     bool m_shown;
00116     bool m_edit;
00117     wxString m_tooltip;
00118 };
00119 
00120 //----------------------------------------------------------------------------
00121 // wxTreeListCtrl - the multicolumn tree control
00122 //----------------------------------------------------------------------------
00123 
00124 // modes for navigation
00125 const int wxTL_MODE_NAV_FULLTREE = 0x0000; // default
00126 const int wxTL_MODE_NAV_EXPANDED = 0x0001;
00127 const int wxTL_MODE_NAV_VISIBLE  = 0x0002;
00128 const int wxTL_MODE_NAV_LEVEL    = 0x0004;
00129 
00130 // modes for FindItem
00131 const int wxTL_MODE_FIND_EXACT   = 0x0000; // default
00132 const int wxTL_MODE_FIND_PARTIAL = 0x0010;
00133 const int wxTL_MODE_FIND_NOCASE  = 0x0020;
00134 
00135 // additional flag for HitTest
00136 const int wxTREE_HITTEST_ONITEMCOLUMN = 0x2000;
00137 extern const wxChar* wxTreeListCtrlNameStr;
00138 
00139 
00140 class wxTreeListCtrl : public wxControl
00141 {
00142 friend class wxTreeListHeaderWindow;
00143 friend class wxTreeListMainWindow;
00144 friend class wxTreeListItem;
00145 public:
00146 
00147     // ---------- creation ----------
00148 
00149     wxTreeListCtrl()
00150         : m_header_win(0), m_main_win(0), m_headerHeight(0)
00151     {}
00152 
00153     wxTreeListCtrl(wxWindow *parent, wxWindowID id = -1,
00154                const wxPoint& pos = wxDefaultPosition,
00155                const wxSize& size = wxDefaultSize,
00156                long style = wxTR_DEFAULT_STYLE,
00157                const wxValidator &validator = wxDefaultValidator,
00158                const wxString& name = wxTreeListCtrlNameStr )
00159         : m_header_win(0), m_main_win(0), m_headerHeight(0)
00160     {
00161         Create(parent, id, pos, size, style, validator, name);
00162     }
00163 
00164     virtual ~wxTreeListCtrl() {}
00165 
00166     bool Create(wxWindow *parent, wxWindowID id = -1,
00167                 const wxPoint& pos = wxDefaultPosition,
00168                 const wxSize& size = wxDefaultSize,
00169                 long style = wxTR_DEFAULT_STYLE,
00170                 const wxValidator &validator = wxDefaultValidator,
00171                 const wxString& name = wxTreeListCtrlNameStr );
00172 
00173     void Refresh(bool erase=TRUE, const wxRect* rect=NULL);
00174     void SetFocus();
00175 
00176 
00177     // ---------- general methods ----------
00178 
00179     // get the total number of items in the control
00180     size_t GetCount() const;
00181 
00182     // indent is the number of pixels the children are indented relative to
00183     // the parents position. SetIndent() also redraws the control
00184     // immediately.
00185     unsigned int GetIndent() const;
00186     void SetIndent(unsigned int indent);
00187 
00188     // line spacing is the space above and below the text on each line
00189     unsigned int GetLineSpacing() const;
00190     void SetLineSpacing(unsigned int spacing);
00191 
00192     // image list: these functions allow to associate an image list with
00193     // the control and retrieve it. Note that when assigned with
00194     // SetImageList, the control does _not_ delete
00195     // the associated image list when it's deleted in order to allow image
00196     // lists to be shared between different controls. If you use
00197     // AssignImageList, the control _does_ delete the image list.
00198     //
00199     // The normal image list is for the icons which correspond to the
00200     // normal tree item state (whether it is selected or not).
00201     // Additionally, the application might choose to show a state icon
00202     // which corresponds to an app-defined item state (for example,
00203     // checked/unchecked) which are taken from the state image list.
00204     wxImageList *GetImageList() const;
00205     wxImageList *GetStateImageList() const;
00206     wxImageList *GetButtonsImageList() const;
00207 
00208     void SetImageList(wxImageList *imageList);
00209     void SetStateImageList(wxImageList *imageList);
00210     void SetButtonsImageList(wxImageList *imageList);
00211     void AssignImageList(wxImageList *imageList);
00212     void AssignStateImageList(wxImageList *imageList);
00213     void AssignButtonsImageList(wxImageList *imageList);
00214 
00215     void SetToolTip(const wxString& tip);
00216     void SetToolTip (wxToolTip *tip);
00217     void SetItemToolTip(const wxTreeItemId& item, const wxString &tip);
00218 
00219     // ---------- Functions to work with columns ----------
00220 
00221     // adds a column
00222     void AddColumn (const wxString& text,
00223                     int width = DEFAULT_COL_WIDTH,
00224                     int flag = wxALIGN_LEFT,
00225                     int image = -1,
00226                     bool shown = true,
00227                     bool edit = false,
00228                     const wxString& tooltip = wxEmptyString) {
00229         AddColumn (wxTreeListColumnInfo (text, width, flag, image, shown, edit, tooltip));
00230     }
00231     void AddColumn (const wxTreeListColumnInfo& colInfo);
00232 
00233     // inserts a column before the given one
00234     void InsertColumn (int before,
00235                        const wxString& text,
00236                        int width = DEFAULT_COL_WIDTH,
00237                        int flag = wxALIGN_LEFT,
00238                        int image = -1,
00239                        bool shown = true,
00240                        bool edit = false,
00241                        const wxString& tooltip = wxEmptyString) {
00242         InsertColumn (before,
00243                       wxTreeListColumnInfo (text, width, flag, image, shown, edit, tooltip));
00244     }
00245     void InsertColumn (int before, const wxTreeListColumnInfo& colInfo);
00246 
00247     // deletes the given column - does not delete the corresponding column
00248     void RemoveColumn (int column);
00249 
00250     // returns the number of columns in the ctrl
00251     int GetColumnCount() const;
00252 
00253     // tells which column is the "main" one, i.e. the "threaded" one
00254     void SetMainColumn (int column);
00255     int GetMainColumn() const;
00256 
00257     void SetColumn (int column, const wxTreeListColumnInfo& colInfo);
00258     wxTreeListColumnInfo GetColumn (int column);
00259     const wxTreeListColumnInfo& GetColumn (int column) const;
00260 
00261     void SetColumnText (int column, const wxString& text);
00262     wxString GetColumnText (int column) const;
00263 
00264     void SetColumnWidth (int column, int width);
00265     int GetColumnWidth (int column) const;
00266 
00267     void SetColumnAlignment (int column, int flag);
00268     int GetColumnAlignment (int column) const;
00269 
00270     void SetColumnImage (int column, int image);
00271     int GetColumnImage (int column) const;
00272 
00273     void SetColumnShown (int column, bool shown = true);
00274     bool IsColumnShown (int column) const;
00275 
00276     void SetColumnEditable (int column, bool edit = true);
00277     bool IsColumnEditable (int column) const;
00278 
00279     // ----------  Functions to work with items. ----------
00280 
00281     // accessors (most properties have a default at row/item level)
00282     // ---------
00283 
00284     wxString GetItemText (const wxTreeItemId& item)             const { return GetItemText (item, GetMainColumn()); };
00285     wxString GetItemText (const wxTreeItemId& item, int column) const;
00286 
00287     int GetItemImage (const wxTreeItemId& item, wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
00288     int GetItemImage (const wxTreeItemId& item, int column) const;
00289 
00290     wxTreeItemData *GetItemData (const wxTreeItemId& item)             const;
00291     wxTreeItemData *GetItemData (const wxTreeItemId& item, int column) const;
00292 
00293     bool GetItemBold (const wxTreeItemId& item)             const;
00294     bool GetItemBold (const wxTreeItemId& item, int column) const;
00295 
00296     wxColour GetItemTextColour (const wxTreeItemId& item)             const;
00297     wxColour GetItemTextColour (const wxTreeItemId& item, int column) const;
00298 
00299     wxColour GetItemBackgroundColour (const wxTreeItemId& item)             const;
00300     wxColour GetItemBackgroundColour (const wxTreeItemId& item, int column) const;
00301 
00302     wxFont GetItemFont (const wxTreeItemId& item)             const;
00303     wxFont GetItemFont (const wxTreeItemId& item, int column) const;
00304 
00305     // modifiers (most properties have a default at row/item level)
00306     // ---------
00307 
00308     void SetItemText (const wxTreeItemId& item,             const wxString& text);
00309     void SetItemText (const wxTreeItemId& item, int column, const wxString& text);
00310 
00311     // the which parameter is ignored for all columns but the main one
00312     void SetItemImage (const wxTreeItemId& item, int image, wxTreeItemIcon which = wxTreeItemIcon_Normal);
00313     void SetItemImage (const wxTreeItemId& item, int column, int image);
00314 
00315     void SetItemData (const wxTreeItemId& item,             wxTreeItemData *data);
00316     void SetItemData (const wxTreeItemId& item, int column, wxTreeItemData *data);
00317 
00318     void SetItemBold (const wxTreeItemId& item,             bool bold = true);
00319     void SetItemBold (const wxTreeItemId& item, int column, bool bold = true);
00320 
00321     void SetItemTextColour (const wxTreeItemId& item,             const wxColour& colour);
00322     void SetItemTextColour (const wxTreeItemId& item, int column, const wxColour& colour);
00323 
00324     void SetItemBackgroundColour (const wxTreeItemId& item,             const wxColour& colour);
00325     void SetItemBackgroundColour (const wxTreeItemId& item, int column, const wxColour& colour);
00326 
00327     // font should be of the same height for all items
00328     void SetItemFont (const wxTreeItemId& item,             const wxFont& font);
00329     void SetItemFont (const wxTreeItemId& item, int column, const wxFont& font);
00330 
00331     // force appearance of [+] button near the item. This is useful to
00332     // allow the user to expand the items which don't have any children now
00333     // - but instead add them only when needed, thus minimizing memory
00334     // usage and loading time.
00335     void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
00336 
00337     // item status inquiries
00338     // ---------------------
00339 
00340     // is the item visible (it might be outside the view or not expanded)?
00341     bool IsVisible (const wxTreeItemId& item, bool fullRow = false, bool within = true) const;
00342     // does the item has any children?
00343     bool HasChildren (const wxTreeItemId& item) const;
00344     // is the item expanded (only makes sense if HasChildren())?
00345     bool IsExpanded (const wxTreeItemId& item) const;
00346     // is this item currently selected (the same as has focus)?
00347     bool IsSelected (const wxTreeItemId& item) const;
00348     // is item text in bold font?
00349     bool IsBold (const wxTreeItemId& item)             const { return IsBold(item, GetMainColumn()); };
00350     bool IsBold (const wxTreeItemId& item, int column) const { return GetItemBold(item, column); };
00351     // does the layout include space for a button?
00352 
00353 
00354     // set the window font
00355     virtual bool SetFont ( const wxFont &font );
00356 
00357     // set the styles.
00358     void SetWindowStyle (const long styles);
00359     long GetWindowStyle() const;
00360     long GetWindowStyleFlag () const { return GetWindowStyle(); }
00361 
00362     // number of children
00363     // ------------------
00364 
00365     // if 'recursively' is FALSE, only immediate children count, otherwise
00366     // the returned number is the number of all items in this branch
00367     size_t GetChildrenCount (const wxTreeItemId& item, bool recursively = true);
00368 
00369     // navigation
00370     // ----------
00371 
00372     // wxTreeItemId.IsOk() will return FALSE if there is no such item
00373 
00374     // get the root tree item
00375     wxTreeItemId GetRootItem() const;
00376 
00377     // get the item currently selected (may return NULL if no selection)
00378     wxTreeItemId GetSelection() const;
00379 
00380     // get the items currently selected, return the number of such item
00381     size_t GetSelections (wxArrayTreeItemIds&) const;
00382 
00383     // get the parent of this item (may return NULL if root)
00384     wxTreeItemId GetItemParent (const wxTreeItemId& item) const;
00385 
00386     // for this enumeration function you must pass in a "cookie" parameter
00387     // which is opaque for the application but is necessary for the library
00388     // to make these functions reentrant (i.e. allow more than one
00389     // enumeration on one and the same object simultaneously). Of course,
00390     // the "cookie" passed to GetFirstChild() and GetNextChild() should be
00391     // the same!
00392 
00393     // get child of this item
00394 #if !wxCHECK_VERSION(2, 5, 0)
00395     wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const;
00396     wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const;
00397     wxTreeItemId GetPrevChild(const wxTreeItemId& item, long& cookie) const;
00398     wxTreeItemId GetLastChild(const wxTreeItemId& item, long& cookie) const;
00399 #else
00400     wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
00401     wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
00402     wxTreeItemId GetPrevChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
00403     wxTreeItemId GetLastChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
00404 #endif
00405 
00406     // get sibling of this item
00407     wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
00408     wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
00409 
00410     // get item in the full tree (currently only for internal use)
00411     wxTreeItemId GetNext(const wxTreeItemId& item) const;
00412     wxTreeItemId GetPrev(const wxTreeItemId& item) const;
00413 
00414     // get expanded item, see IsExpanded()
00415     wxTreeItemId GetFirstExpandedItem() const;
00416     wxTreeItemId GetNextExpanded(const wxTreeItemId& item) const;
00417     wxTreeItemId GetPrevExpanded(const wxTreeItemId& item) const;
00418 
00419     // get visible item, see IsVisible()
00420     wxTreeItemId GetFirstVisibleItem(                      bool fullRow = false) const;
00421     wxTreeItemId GetFirstVisible(                          bool fullRow = false, bool within = true) const;
00422     wxTreeItemId GetNextVisible (const wxTreeItemId& item, bool fullRow = false, bool within = true) const;
00423     wxTreeItemId GetPrevVisible (const wxTreeItemId& item, bool fullRow = false, bool within = true) const;
00424     wxTreeItemId GetLastVisible (                          bool fullRow = false, bool within = true) const;
00425 
00426     // operations
00427     // ----------
00428 
00429     // add the root node to the tree
00430     wxTreeItemId AddRoot (const wxString& text,
00431                           int image = -1, int selectedImage = -1,
00432                           wxTreeItemData *data = NULL);
00433 
00434     // insert a new item in as the first child of the parent
00435     wxTreeItemId PrependItem (const wxTreeItemId& parent,
00436                               const wxString& text,
00437                               int image = -1, int selectedImage = -1,
00438                               wxTreeItemData *data = NULL);
00439 
00440     // insert a new item after a given one
00441     wxTreeItemId InsertItem (const wxTreeItemId& parent,
00442                              const wxTreeItemId& idPrevious,
00443                              const wxString& text,
00444                              int image = -1, int selectedImage = -1,
00445                              wxTreeItemData *data = NULL);
00446 
00447     // insert a new item before the one with the given index
00448     wxTreeItemId InsertItem (const wxTreeItemId& parent,
00449                              size_t index,
00450                              const wxString& text,
00451                              int image = -1, int selectedImage = -1,
00452                              wxTreeItemData *data = NULL);
00453 
00454     // insert a new item in as the last child of the parent
00455     wxTreeItemId AppendItem (const wxTreeItemId& parent,
00456                              const wxString& text,
00457                              int image = -1, int selectedImage = -1,
00458                              wxTreeItemData *data = NULL);
00459 
00460     // delete this item (except root) + children and associated data if any
00461     void Delete (const wxTreeItemId& item);
00462     // delete all children (but don't delete the item itself)
00463     void DeleteChildren (const wxTreeItemId& item);
00464     // delete the root and all its children from the tree
00465     void DeleteRoot();
00466 
00467     //  change item's parent (return previous parent)
00468     void SetItemParent(const wxTreeItemId& parent, const wxTreeItemId& item);
00469 
00470     // expand this item
00471     void Expand (const wxTreeItemId& item);
00472     // expand this item and all subitems recursively
00473     void ExpandAll (const wxTreeItemId& item);
00474     // collapse the item without removing its children
00475     void Collapse (const wxTreeItemId& item);
00476     // collapse the item and remove all children
00477     void CollapseAndReset(const wxTreeItemId& item); //? TODO ???
00478     // toggles the current state
00479     void Toggle (const wxTreeItemId& item);
00480 
00481     // set cursor item (indicated by black rectangle)
00482     void SetCurrentItem(const wxTreeItemId& item = (wxTreeItemId*)NULL);
00483 
00484     // remove the selection from currently selected item (if any)
00485     void Unselect();
00486     void UnselectAll();
00487     // select this item - return true if selection was allowed (no veto)
00488     bool SelectItem (const wxTreeItemId& item,
00489                      const wxTreeItemId& last = (wxTreeItemId*)NULL,
00490                      bool unselect_others = true);
00491     // select all items in the expanded tree
00492     void SelectAll();
00493     // make sure this item is visible (expanding the parent item and/or
00494     // scrolling to this item if necessary)
00495     void EnsureVisible (const wxTreeItemId& item);
00496     // scroll to this item (but don't expand its parent)
00497     void ScrollTo (const wxTreeItemId& item);
00498 
00499     // The first function is more portable (because easier to implement
00500     // on other platforms), but the second one returns some extra info.
00501     wxTreeItemId HitTest (const wxPoint& point)
00502         { int flags; int column; return HitTest (point, flags, column); }
00503     wxTreeItemId HitTest (const wxPoint& point, int& flags)
00504         { int column; return HitTest (point, flags, column); }
00505     wxTreeItemId HitTest (const wxPoint& point, int& flags, int& column);
00506 
00507     // get the bounding rectangle of the item (or of its label only)
00508     bool GetBoundingRect (const wxTreeItemId& item, wxRect& rect,
00509                           bool textOnly = false) const;
00510 
00511     // Start editing the item label: this (temporarily) replaces the item
00512     // with a one line edit control. The item will be selected if it hadn't
00513     // been before.
00514     void EditLabel (const wxTreeItemId& item)
00515         { EditLabel (item, GetMainColumn()); }
00516     // edit item's label of the given column
00517     void EditLabel (const wxTreeItemId& item, int column);
00518     void EndEdit(bool isCancelled);
00519 
00520     // virtual mode
00521     virtual wxString OnGetItemText( wxTreeItemData* item, long column ) const;
00522 
00523     // sorting
00524     // this function is called to compare 2 items and should return -1, 0
00525     // or +1 if the first item is less than, equal to or greater than the
00526     // second one. The base class version performs alphabetic comparaison
00527     // of item labels (GetText)
00528     virtual int OnCompareItems (const wxTreeItemId& item1, const wxTreeItemId& item2);
00529     virtual int OnCompareItems (const wxTreeItemId& item1, const wxTreeItemId& item2, int column);
00530     // sort the children of this item using OnCompareItems
00531     // NB: this function is not reentrant and not MT-safe (TODO)!
00532     void SortChildren(const wxTreeItemId& item, int column = -1, bool reverseOrder = false);
00533 
00534     // searching (by column only)
00535     wxTreeItemId FindItem (const wxTreeItemId& item,             const wxString& str, int mode = 0) { return FindItem(item, -1, str, mode); };
00536     wxTreeItemId FindItem (const wxTreeItemId& item, int column, const wxString& str, int mode = 0);
00537 
00538     // overridden base class virtuals
00539     virtual bool SetBackgroundColour (const wxColour& colour);
00540     virtual bool SetForegroundColour (const wxColour& colour);
00541 
00542     // drop over item
00543     void SetDragItem (const wxTreeItemId& item = (wxTreeItemId*)NULL);
00544 
00545 
00546     virtual wxSize DoGetBestSize() const;
00547 
00548 protected:
00549     // header window, responsible for column visualization and manipulation
00550     wxTreeListHeaderWindow* GetHeaderWindow() const
00551         { return m_header_win; }
00552     wxTreeListHeaderWindow* m_header_win;  // future cleanup: make private or remove GetHeaderWindow()
00553 
00554     // main window, the "true" tree ctrl
00555     wxTreeListMainWindow* GetMainWindow() const
00556         { return m_main_win; }
00557     wxTreeListMainWindow* m_main_win;  // future cleanup: make private or remove GetMainWindow()
00558 
00559     int GetHeaderHeight() const { return m_headerHeight; }
00560 
00561     void CalculateAndSetHeaderHeight();
00562     void DoHeaderLayout();
00563     void OnSize(wxSizeEvent& event);
00564 
00565 private:
00566     int m_headerHeight;
00567 
00568     DECLARE_EVENT_TABLE()
00569     DECLARE_DYNAMIC_CLASS(wxTreeListCtrl)
00570 };
00571 
00572 
00573 //----------------------------------------------------------------------------
00574 // wxTreeListCtrlXmlHandler - XRC support for wxTreeListCtrl
00575 //----------------------------------------------------------------------------
00576 
00577 #if wxUSE_XRC
00578 
00579 #include "wx/xrc/xmlres.h"
00580 
00581 class wxTreeListCtrlXmlHandler : public wxXmlResourceHandler {
00582         DECLARE_DYNAMIC_CLASS(wxTreeListCtrlXmlHandler)
00583 public:
00584         wxTreeListCtrlXmlHandler();
00585         virtual wxObject *DoCreateResource();
00586         virtual bool CanHandle(wxXmlNode *node);
00587 };
00588 
00589 #endif /* wxUSE_XRC */
00590 
00591 
00592 
00594 #endif /* TREELISTCTRL_H */
00595 

Generated on 25 Oct 2014 for Hugintrunk by  doxygen 1.4.7