source: filezilla/trunk/fuentes/src/interface/treectrlex.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 1.5 KB
Line 
1#ifndef __TREECTRLEX_H__
2#define __TREECTRLEX_H__
3
4#include <wx/dnd.h>
5#include "filelistctrl.h"
6
7class wxTreeCtrlEx : public wxNavigationEnabled<wxTreeCtrl>
8{
9        DECLARE_DYNAMIC_CLASS(wxTreeCtrlEx)
10
11public:
12        typedef wxTreeItemId Item;
13
14        wxTreeCtrlEx();
15        wxTreeCtrlEx(wxWindow *parent, wxWindowID id = wxID_ANY,
16                           const wxPoint& pos = wxDefaultPosition,
17                           const wxSize& size = wxDefaultSize,
18                           long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT);
19        void SafeSelectItem(const wxTreeItemId& item);
20
21        // Small wrappers to make wxTreeCtrl(Ex) API more similar to wxListCtrl(ex).
22        int GetItemCount() const { return GetCount(); }
23        wxTreeItemId GetTopItem() const { return GetFirstVisibleItem(); }
24        bool GetItemRect(wxTreeItemId const& item, wxRect &rect) const { return GetBoundingRect(item, rect); }
25
26        wxRect GetActualClientRect() const { return GetClientRect(); }
27
28        bool Valid(wxTreeItemId const& i) const { return i.IsOk(); }
29
30        wxWindow* GetMainWindow() { return this; }
31
32        // Items with a collapsed ancestor are not included
33        wxTreeItemId GetFirstItem() const;
34        wxTreeItemId GetLastItem() const;
35        wxTreeItemId GetBottomItem() const;
36
37        wxTreeItemId GetNextItemSimple(wxTreeItemId const& item) const;
38        wxTreeItemId GetPrevItemSimple(wxTreeItemId const& item) const;
39
40protected:
41
42        bool m_setSelection{};
43
44#ifdef __WXMAC__
45        DECLARE_EVENT_TABLE()
46        void OnChar(wxKeyEvent& event);
47#endif
48
49        virtual int OnCompareItems(wxTreeItemId const& item1, wxTreeItemId const& item2);
50
51        CFileListCtrlSortBase::NameSortMode m_nameSortMode;
52};
53
54#endif //__TREECTRLEX_H__
Note: See TracBrowser for help on using the repository browser.