1 \section{wxGrid classes overview
}\label{gridoverview
}
3 Classes:
\helpref{wxGrid
}{wxgrid
}
5 \subsection{Introduction
}
6 wxGrid and its related classes are used for displaying and editing tabular data.
8 \subsection{Getting started: a simple example
}
9 For simple applications you need only refer to the wxGrid class in your
10 code. This example shows how you might create a grid in a frame or
11 dialog constructor and illustrates some of the formatting functions.
15 // Create a wxGrid object
17 grid = new wxGrid( this,
22 // Then we call CreateGrid to set the dimensions of the grid
23 // (
100 rows and
10 columns in this example)
24 grid->CreateGrid(
100,
10 );
26 // We can set the sizes of individual rows and columns
28 grid->SetRowSize(
0,
60 );
29 grid->SetColSize(
0,
120 );
31 // And set grid cell contents as strings
32 grid->SetCellValue(
0,
0, "wxGrid is good" );
34 // We can specify that some cells are read-only
35 grid->SetCellValue(
0,
3, "This is read-only" );
36 grid->SetReadOnly(
0,
3 );
38 // Colours can be specified for grid cell contents
39 grid->SetCellValue(
3,
3, "green on grey");
40 grid->SetCellTextColour(
3,
3, *wxGREEN);
41 grid->SetCellBackgroundColour(
3,
3, *wxLIGHT_GREY);
43 // We can specify the some cells will store numeric
44 // values rather than strings. Here we set grid column
5
45 // to hold floating point values displayed with width of
6
47 grid->SetColFormatFloat(
5,
6,
2);
48 grid->SetCellValue(
0,
6, "
3.1415");
52 \subsection{A more complex example
}
55 \subsection{How the wxGrid classes relate to each other
}
58 \subsection{Keyboard and mouse actions
}