]> Creatis software - creaImageIO.git/blob - src2/creaImageIOWxTreeView.h
Impemented Remove Function
[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           ///Removes selected nodes on given level
34           virtual void RemoveSelected( int );
35
36       /// Callback for selection change
37       void OnSelected(wxListEvent& event);
38
39
40     private:
41       /// The struct holding the data for one level
42       /// Holds the wx control and other data
43       /// such as the vector of attribute keys corresponding to the columns
44       struct LevelType
45       {
46         // The
47         wxListCtrl* wxCtrl;
48         std::vector<std::string> key;
49       };
50       /// The vector of levels : one for each level of the tree      
51       std::vector<LevelType> mLevelList;
52       
53       /// return the wxListCtrl of one level
54       wxListCtrl* GetCtrl(int l) { return mLevelList[l].wxCtrl; }
55
56           std::vector<tree::Node*>GetSelected(int level);
57   
58  
59
60       DECLARE_EVENT_TABLE()
61     };
62     // EO class WxTreeView
63     //=====================================================================
64   
65 } // EO namespace creaImageIO
66
67
68 #endif // USE_WIDGETS
69 // EOF
70 #endif