creaContours_lib
wxContour_ListViewPanel.h
Go to the documentation of this file.
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 # pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
15 #
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
20 # liability.
21 #
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25 
26 #ifndef __wxContour_ListViewPanel_h_INCLUDED_H__
27 #define __wxContour_ListViewPanel_h_INCLUDED_H__
28 
29 
30 // -----------------------------------------------------------------------------------------------------------
31 // WX headers inclusion.
32 // For compilers that support precompilation, includes <wx/wx.h>.
33 // -----------------------------------------------------------------------------------------------------------
34 
35 #include <wx/wxprec.h>
36 #ifdef __BORLANDC__
37 #pragma hdrstop
38 #endif
39 #ifndef WX_PRECOMP
40 #include <wx/wx.h>
41 #endif
42 
43 
44 //------------------------------------------------------------------------------------------------------------
45 // Includes
46 //------------------------------------------------------------------------------------------------------------
47 #include <wx/listctrl.h>
48 
49 //------------------------------------------------------------------------------------------------------------
50 // Events declaration
51 //------------------------------------------------------------------------------------------------------------
52 /*BEGIN_DECLARE_EVENT_TYPES()
53  DECLARE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE, -1 )
54 END_DECLARE_EVENT_TYPES()*/
55 
59 //------------------------------------------------------------------------------------------------------------
60 // Class definition
61 //------------------------------------------------------------------------------------------------------------
62 class wxContour_ListViewPanel : public wxListCtrl {
63 
64  public:
65 
66  //------------------------------------------------------------------------------------------------------------
67  // Constructors & Destructors
68  //------------------------------------------------------------------------------------------------------------
69 
70  wxContour_ListViewPanel(wxWindow *parent,const wxWindowID id, const wxPoint& pos,const wxSize& size,long style);
71 
73 
74  //------------------------------------------------------------------------------------------------------------
75  // Methods for capturing events
76  //------------------------------------------------------------------------------------------------------------
77  void InsertItemInReportView(int i);
78 
79  void OnColClick(wxListEvent& event);
80  void OnColRightClick(wxListEvent& event);
81  void OnColBeginDrag(wxListEvent& event);
82  void OnColDragging(wxListEvent& event);
83  void OnColEndDrag(wxListEvent& event);
84  void OnBeginDrag(wxListEvent& event);
85  void OnBeginRDrag(wxListEvent& event);
86  void OnBeginLabelEdit(wxListEvent& event);
87  void OnEndLabelEdit(wxListEvent& event);
88  void OnDeleteItem(wxListEvent& event);
89  void OnDeleteAllItems(wxListEvent& event);
90 
91  void OnGetInfo(wxListEvent& event);
92  void OnSetInfo(wxListEvent& event);
93 
94  void OnSelected(wxListEvent& event);
95  void OnDeselected(wxListEvent& event);
96  void OnListKeyDown(wxListEvent& event);
97  void OnActivated(wxListEvent& event);
98  void OnFocused(wxListEvent& event);
99  void OnCacheHint(wxListEvent& event);
100 
101  void OnChar(wxKeyEvent& event);
102 
103  void OnContextMenu(wxContextMenuEvent& event);
104  void OnRightClick(wxMouseEvent& event);
105 
106  //------------------------------------------------------------------------------------------------------------
107  // Methods for sending events
108  //------------------------------------------------------------------------------------------------------------
109  void sendEnvent( WXTYPE theEventType );
110 
111 
112  //------------------------------------------------------------------------------------------------------------
113  // Attributes getters and setters
114  //------------------------------------------------------------------------------------------------------------
115 
116  void setContainerParent( wxContour_ControlPanel * theBuilder);
117 
118 
119  //------------------------------------------------------------------------------------------------------------
120  // Other functional methods
121  //------------------------------------------------------------------------------------------------------------
122 
123 private:
124  //------------------------------------------------------------------------------------------------------------
125  // Private methods
126  //------------------------------------------------------------------------------------------------------------
127 
128 
129  void ShowContextMenu(const wxPoint& pos);
130  wxLog *m_logOld;
131  void SetColumnImage(int col, int image);
132 
133  /*
134  void LogEvent(const wxListEvent& event, const wxChar *eventName);
135  void LogColEvent(const wxListEvent& event, const wxChar *eventName);
136  */
137 
138  virtual wxString OnGetItemText(long item, long column) const;
139  virtual int OnGetItemColumnImage(long item, long column) const;
140  virtual wxListItemAttr *OnGetItemAttr(long item) const;
141 
142  //------------------------------------------------------------------------------------------------------------
143  // Creational and initialization methods
144  //------------------------------------------------------------------------------------------------------------
145 
146 
147  //------------------------------------------------------------------------------------------------------------
148  // Attributtes
149  //------------------------------------------------------------------------------------------------------------
151 
152  wxListItemAttr itemsStyle;
153 
154 };
155 #endif // __wxContour_ListViewPanel_HEADER_FILE__
156