]> git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/overviews/grid.h
added wxWidgets samples
[wxWidgets.git] / docs / doxygen / overviews / grid.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: grid
3 // Purpose: topic overview
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /*!
10
11 @page grid_overview wxGrid classes overview
12
13 Classes: #wxGrid
14 #Introduction
15 @ref simplewxgridexample_overview
16 @ref complexwxgridexample_overview
17 @ref gridclassesrelations_overview
18 @ref keyboardandmouseinwxgrid_overview
19
20
21 @section introductiontowxgrid Introduction
22
23 wxGrid and its related classes are used for displaying and editing tabular data.
24
25 @section simplewxgridexample Getting started: a simple example
26
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.
30
31 @code
32 // Create a wxGrid object
33
34 grid = new wxGrid( this,
35 -1,
36 wxPoint( 0, 0 ),
37 wxSize( 400, 300 ) );
38
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 );
42
43 // We can set the sizes of individual rows and columns
44 // in pixels
45 grid-SetRowSize( 0, 60 );
46 grid-SetColSize( 0, 120 );
47
48 // And set grid cell contents as strings
49 grid-SetCellValue( 0, 0, "wxGrid is good" );
50
51 // We can specify that some cells are read-only
52 grid-SetCellValue( 0, 3, "This is read-only" );
53 grid-SetReadOnly( 0, 3 );
54
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);
59
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
63 // and precision of 2
64 grid-SetColFormatFloat(5, 6, 2);
65 grid-SetCellValue(0, 6, "3.1415");
66 @endcode
67
68
69 @section complexwxgridexample A more complex example
70
71 Yet to be written
72
73 @section wxgridclassesrelations How the wxGrid classes relate to each other
74
75 Yet to be written
76
77 @section keyboardandmouseinwxgrid Keyboard and mouse actions
78
79 Yet to be written
80
81 */
82
83