]> Creatis software - creaImageIO.git/blob - src2/creaImageIOWxTreeView.h
a7935830070898011ec489f7b2f44a2619a1499e
[creaImageIO.git] / src2 / creaImageIOWxTreeView.h
1 #ifndef __creaImageIOWxTreeView_h_INCLUDED__
2 #define __creaImageIOWxTreeView_h_INCLUDED__
3
4 #ifdef USE_WXWIDGETS
5
6 #include <creaImageIOTreeView.h>
7 #include <creaWx.h>
8
9 #include <wx/listctrl.h>
10 //#include <vector>
11
12 namespace creaImageIO
13 {
14   /**
15    * \ingroup View
16    */
17   //=====================================================================
18   
19   //=====================================================================
20   /// Abstract class that handles the view of a Tree through its TreeHandler
21   class WxTreeView : public wxPanel, virtual public TreeView
22     {
23     public:
24       /// Ctor
25       WxTreeView(TreeHandler*, wxWindow* parent, const wxWindowID id);
26       /// Virtual destructor
27       virtual ~WxTreeView();
28
29       
30       /// Updates the view of a level given the selected items of upper level
31       virtual void UpdateLevel( int );
32       
33       /// Callback for selection change
34       void OnSelected(wxListEvent& event);
35
36
37     private:
38       /// The struct holding the data for one level
39       /// Holds the wx control and other data
40       /// such as the vector of attribute keys corresponding to the columns
41       struct LevelType
42       {
43         // The
44         wxListCtrl* wxCtrl;
45         std::vector<std::string> key;
46       };
47       /// The vector of levels : one for each level of the tree      
48       std::vector<LevelType> mLevelList;
49       
50       /// return the wxListCtrl of one level
51       wxListCtrl* GetCtrl(int l) { return mLevelList[l].wxCtrl; }
52  
53
54       DECLARE_EVENT_TABLE()
55     };
56     // EO class WxTreeView
57     //=====================================================================
58   
59 } // EO namespace creaImageIO
60
61
62 #endif // USE_WIDGETS
63 // EOF
64 #endif