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

Generated on 31 Aug 2015 for Hugintrunk by  doxygen 1.4.7