// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_TREECTRL_H_
-#define _WX_TREECTRL_H_
+#ifndef _WX_MSW_TREECTRL_H_
+#define _WX_MSW_TREECTRL_H_
// ----------------------------------------------------------------------------
// headers
class WXDLLEXPORT wxDragImage;
struct WXDLLEXPORT wxTreeViewItem;
-// NB: all the following flags are for compatbility only and will be removed in the
-// next versions
-
-// flags for deprecated InsertItem() variant (their values are the same as of
-// TVI_FIRST and TVI_LAST)
-#define wxTREE_INSERT_FIRST 0xFFFF0001
-#define wxTREE_INSERT_LAST 0xFFFF0002
+#if WXWIN_COMPATIBILITY_2_6
+ // NB: all the following flags are for compatbility only and will be removed in the
+ // next versions
+ // flags for deprecated InsertItem() variant (their values are the same as of
+ // TVI_FIRST and TVI_LAST)
+ #define wxTREE_INSERT_FIRST 0xFFFF0001
+ #define wxTREE_INSERT_LAST 0xFFFF0002
+#endif
// hash storing attributes for our items
WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
// implement base class pure virtuals
// ----------------------------------
- virtual size_t GetCount() const;
+ virtual unsigned int GetCount() const;
virtual unsigned int GetIndent() const;
virtual void SetIndent(unsigned int indent);
// Use base class GetImageList()
wxDEPRECATED( void SetImageList(wxImageList *imageList, int) );
- // use Set/GetItemImage directly
+ // use Set/GetItemImage directly
wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const );
wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) );
virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
+ virtual bool MSWShouldPreProcessMessage(WXMSG* msg);
// override some base class virtuals
virtual bool SetBackgroundColour(const wxColour &colour);
// end edit label
void DoEndEditLabel(bool discardChanges = false);
-
- // data used only while editing the item label:
- wxTextCtrl *m_textCtrl; // text control in which it is edited
- wxTreeItemId m_idEdited; // the item being edited
-
virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
size_t pos,
const wxString& text,
const wxString& text,
int image = -1, int selImage = -1,
wxTreeItemData *data = NULL);
- virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags);
+ virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const;
+
+ // obtain the user data for the lParam member of TV_ITEM
+ class wxTreeItemParam *GetItemParam(const wxTreeItemId& item) const;
+
+
+ // data used only while editing the item label:
+ wxTextCtrl *m_textCtrl; // text control in which it is edited
+ wxTreeItemId m_idEdited; // the item being edited
private:
// the common part of all ctors
inline void DoExpand(const wxTreeItemId& item, int flag);
- int DoGetItemImageFromData(const wxTreeItemId& item,
- wxTreeItemIcon which) const;
- void DoSetItemImageFromData(const wxTreeItemId& item,
- int image,
- wxTreeItemIcon which) const;
- void DoSetItemImages(const wxTreeItemId& item, int image, int imageSel);
-
void DeleteTextCtrl();
- // support for additional item images which we implement using
- // wxTreeItemIndirectData technique - see the comments in msw/treectrl.cpp
- void SetIndirectItemData(const wxTreeItemId& item,
- class wxTreeItemIndirectData *data);
- bool HasIndirectData(const wxTreeItemId& item) const;
- bool IsDataIndirect(wxTreeItemData *data) const
- { return data && data->GetId().m_pItem == 0; }
+ // return true if the item is the hidden root one (i.e. it's the root item
+ // and the tree has wxTR_HIDE_ROOT style)
+ bool IsHiddenRoot(const wxTreeItemId& item) const;
+
// the hash storing the items attributes (indexed by item ids)
wxMapTreeAttr m_attrs;
#endif // wxUSE_TREECTRL
-#endif
- // _WX_TREECTRL_H_
+#endif // _WX_MSW_TREECTRL_H_