]>
git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/overviews/grid.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: topic overview
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @page grid_overview wxGrid classes overview
15 @ref simplewxgridexample_overview
16 @ref complexwxgridexample_overview
17 @ref gridclassesrelations_overview
18 @ref keyboardandmouseinwxgrid_overview
21 @section introductiontowxgrid Introduction
23 wxGrid and its related classes are used for displaying and editing tabular data.
25 @section simplewxgridexample Getting started: a simple example
27 For simple applications you need only refer to the wxGrid class in your
28 code. This example shows how you might create a grid in a frame or
29 dialog constructor and illustrates some of the formatting functions.
32 // Create a wxGrid object
34 grid = new wxGrid( this,
39 // Then we call CreateGrid to set the dimensions of the grid
40 // (100 rows and 10 columns in this example)
41 grid-CreateGrid( 100, 10 );
43 // We can set the sizes of individual rows and columns
45 grid-SetRowSize( 0, 60 );
46 grid-SetColSize( 0, 120 );
48 // And set grid cell contents as strings
49 grid-SetCellValue( 0, 0, "wxGrid is good" );
51 // We can specify that some cells are read-only
52 grid-SetCellValue( 0, 3, "This is read-only" );
53 grid-SetReadOnly( 0, 3 );
55 // Colours can be specified for grid cell contents
56 grid-SetCellValue(3, 3, "green on grey");
57 grid-SetCellTextColour(3, 3, *wxGREEN);
58 grid-SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
60 // We can specify the some cells will store numeric
61 // values rather than strings. Here we set grid column 5
62 // to hold floating point values displayed with width of 6
64 grid-SetColFormatFloat(5, 6, 2);
65 grid-SetCellValue(0, 6, "3.1415");
69 @section complexwxgridexample A more complex example
73 @section wxgridclassesrelations How the wxGrid classes relate to each other
77 @section keyboardandmouseinwxgrid Keyboard and mouse actions