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