ToolMap
Loading...
Searching...
No Matches
datalistreportctrl.h
1/***************************************************************************
2 datalistreportctrl.h
3 -------------------
4 copyright : (C) 2010 CREALP Lucien Schreiber
5 ***************************************************************************/
6
7#ifndef _DATALISTREPORTCTRL_H_
8#define _DATALISTREPORTCTRL_H_
9
10// wxWidgets include
11#include <wx/wxprec.h>
12
13#ifndef WX_PRECOMP
14#include <wx/wx.h>
15#endif
16
17#include <wx/dcgraph.h>
18#include <wx/listctrl.h>
19#include <wx/renderer.h>
20
21enum DATALIST_COLTYPE {
22 DATALIST_COLTYPE_TEXT = 0,
23 DATALIST_COLTYPE_NUMBER,
24 DATALIST_COLTYPE_COLOUR,
25 DATALIST_COLTYPE_IMAGE,
26 DATALIST_COLTYPE_DATE,
27 DATALIST_COLTYPE_TIME
28};
29
30class DataListReportCtrl : public wxListCtrl {
31 private:
32 int _Compare(DATALIST_COLTYPE coltype, const wxString& text1, const wxString& text2, bool ascending);
33
34 wxString _GetTextSpecial(long index, int col, DATALIST_COLTYPE typecol);
35
36 wxColour m_ColourNormal;
37
38 wxColour m_ColourGrayed;
39
40 void _Init();
41
42 public:
43 DataListReportCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize, long style = wxLC_REPORT);
45
46 bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize, long style = wxLC_REPORT);
48
49 virtual ~DataListReportCtrl();
50
51 long GetSelectedFirst();
52
53 int GetSelectedAll(wxArrayLong& selected_index);
54
55 wxString GetText(long index, int col = 0);
56
57 void SetText(long index, const wxString& text, int col = 0);
58
59 int GetItemColumnImage(long index, int col = 0);
60
61 void SetColumnImage(int imageindex, int col);
62
63 // compare functions
64 void SortList(int col, int lowindex, int highindex, DATALIST_COLTYPE typecol, bool ascending = true);
65
66 void SwapRow(int row1, int row2);
67
68 // bitmap creation function
69 wxBitmap CreateArrowDown(const wxSize& size = wxSize(16, 16));
70
71 wxBitmap CreateArrowUp(const wxSize& size = wxSize(16, 16));
72
73 wxColour GetTextColorNormal() {
74 return m_ColourNormal;
75 }
76
77 wxColour GetTextColorGrayed() {
78 return m_ColourGrayed;
79 }
80};
81
82#endif
Definition datalistreportctrl.h:30