]> git.saurik.com Git - wxWidgets.git/blob - samples/newgrid/griddemo.h
cell attributes added (doesn't quite work, work in progress, beware, don't use, ...
[wxWidgets.git] / samples / newgrid / griddemo.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: griddemo.h
3 // Purpose: Grid control wxWindows sample
4 // Author: Michael Bedward
5 // Modified by:
6 // RCS-ID: $Id$
7 // Copyright: (c) Michael Bedward, Julian Smart
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef griddemo_h
13 #define griddemo_h
14
15 #if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID)
16 #error "This sample requires the new wxGrid class."
17 #endif
18
19 class wxGrid;
20
21 class GridApp : public wxApp
22 {
23 public:
24 bool OnInit();
25 };
26
27
28 class GridFrame : public wxFrame
29 {
30 wxGrid *grid;
31 wxTextCtrl *logWin;
32 wxLogTextCtrl *logger;
33 wxString logBuf;
34
35 void SetDefaults();
36
37 void ToggleRowLabels( wxCommandEvent& );
38 void ToggleColLabels( wxCommandEvent& );
39 void ToggleEditing( wxCommandEvent& );
40 void SetLabelColour( wxCommandEvent& );
41 void SetLabelTextColour( wxCommandEvent& );
42 void SetRowLabelHorizAlignment( wxCommandEvent& );
43 void SetRowLabelVertAlignment( wxCommandEvent& );
44 void SetColLabelHorizAlignment( wxCommandEvent& );
45 void SetColLabelVertAlignment( wxCommandEvent& );
46 void SetGridLineColour( wxCommandEvent& );
47
48 void InsertRow( wxCommandEvent& );
49 void InsertCol( wxCommandEvent& );
50 void DeleteSelectedRows( wxCommandEvent& );
51 void DeleteSelectedCols( wxCommandEvent& );
52 void ClearGrid( wxCommandEvent& );
53
54 void OnLabelLeftClick( wxGridEvent& );
55 void OnCellLeftClick( wxGridEvent& );
56 void OnRowSize( wxGridSizeEvent& );
57 void OnColSize( wxGridSizeEvent& );
58 void OnSelectCell( wxGridEvent& );
59 void OnRangeSelected( wxGridRangeSelectEvent& );
60 void OnCellValueChanged( wxGridEvent& );
61
62 public:
63 GridFrame();
64 ~GridFrame();
65
66 void OnQuit( wxCommandEvent& );
67 void About( wxCommandEvent& );
68
69 enum { ID_TOGGLEROWLABELS = 100,
70 ID_TOGGLECOLLABELS,
71 ID_TOGGLEEDIT,
72 ID_SETLABELCOLOUR,
73 ID_SETLABELTEXTCOLOUR,
74 ID_ROWLABELALIGN,
75 ID_ROWLABELHORIZALIGN,
76 ID_ROWLABELVERTALIGN,
77 ID_COLLABELALIGN,
78 ID_COLLABELHORIZALIGN,
79 ID_COLLABELVERTALIGN,
80 ID_GRIDLINECOLOUR,
81 ID_INSERTROW,
82 ID_INSERTCOL,
83 ID_DELETEROW,
84 ID_DELETECOL,
85 ID_CLEARGRID,
86 ID_ABOUT,
87
88 ID_TESTFUNC };
89
90 DECLARE_EVENT_TABLE()
91 };
92
93
94 #endif
95