]>
git.saurik.com Git - wxWidgets.git/blob - samples/newgrid/griddemo.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Grid control wxWindows sample
4 // Author: Michael Bedward
7 // Copyright: (c) Michael Bedward, Julian Smart
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
15 #if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID)
16 #error "This sample requires the new wxGrid class."
21 class GridApp
: public wxApp
28 class GridFrame
: public wxFrame
32 wxLogTextCtrl
*logger
;
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
& );
48 void SetCellFgColour(wxCommandEvent
&);
49 void SetCellBgColour(wxCommandEvent
&);
51 void InsertRow( wxCommandEvent
& );
52 void InsertCol( wxCommandEvent
& );
53 void DeleteSelectedRows( wxCommandEvent
& );
54 void DeleteSelectedCols( wxCommandEvent
& );
55 void ClearGrid( wxCommandEvent
& );
57 void OnLabelLeftClick( wxGridEvent
& );
58 void OnCellLeftClick( wxGridEvent
& );
59 void OnRowSize( wxGridSizeEvent
& );
60 void OnColSize( wxGridSizeEvent
& );
61 void OnSelectCell( wxGridEvent
& );
62 void OnRangeSelected( wxGridRangeSelectEvent
& );
63 void OnCellValueChanged( wxGridEvent
& );
69 void OnQuit( wxCommandEvent
& );
70 void About( wxCommandEvent
& );
71 void OnVTable( wxCommandEvent
& );
75 ID_TOGGLEROWLABELS
= 100,
79 ID_SETLABELTEXTCOLOUR
,
81 ID_ROWLABELHORIZALIGN
,
84 ID_COLLABELHORIZALIGN
,
92 ID_SET_CELL_FG_COLOUR
,
93 ID_SET_CELL_BG_COLOUR
,
100 DECLARE_EVENT_TABLE()
103 class MyGridCellRenderer
: public wxGridCellStringRenderer
106 virtual void Draw(wxGrid
& grid
,
107 wxGridCellAttr
& attr
,
115 class BigGridTable
: public wxGridTableBase
{
117 long GetNumberRows() { return 10000; }
118 long GetNumberCols() { return 10000; }
120 wxString
GetValue( int row
, int col
) {
122 str
.Printf("(%d, %d)", row
, col
);
126 void SetValue( int , int , const wxString
& ) {}
127 bool IsEmptyCell( int , int ) { return FALSE
; }
130 class BigGridFrame
: public wxFrame
{
136 BigGridTable
* m_table
;