]>
Commit | Line | Data |
---|---|---|
15b6757b | 1 | ///////////////////////////////////////////////////////////////////////////// |
c33e257b | 2 | // Name: grid.h |
15b6757b FM |
3 | // Purpose: topic overview |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /*! | |
36c9828f | 10 | |
c33e257b | 11 | @page overview_grid wxGrid classes overview |
36c9828f | 12 | |
15b6757b | 13 | Classes: #wxGrid |
36c9828f | 14 | |
c33e257b FM |
15 | @li @ref overview_grid_intro |
16 | @li @ref overview_grid_simpleexample | |
17 | @li @ref overview_grid_complexexample | |
18 | @li @ref overview_grid_classrelations | |
19 | @li @ref overview_grid_keyboardmouse | |
36c9828f | 20 | |
c33e257b FM |
21 | |
22 | <hr> | |
23 | ||
24 | ||
25 | @section overview_grid_intro Introduction | |
36c9828f | 26 | |
15b6757b | 27 | wxGrid and its related classes are used for displaying and editing tabular data. |
36c9828f | 28 | |
c33e257b FM |
29 | |
30 | @section overview_grid_simpleexample Getting started: a simple example | |
36c9828f | 31 | |
15b6757b | 32 | For simple applications you need only refer to the wxGrid class in your |
c33e257b | 33 | code. This example shows how you might create a grid in a frame or |
36c9828f FM |
34 | dialog constructor and illustrates some of the formatting functions. |
35 | ||
15b6757b | 36 | @code |
c33e257b | 37 | // Create a wxGrid object |
36c9828f | 38 | |
15b6757b FM |
39 | grid = new wxGrid( this, |
40 | -1, | |
41 | wxPoint( 0, 0 ), | |
42 | wxSize( 400, 300 ) ); | |
36c9828f | 43 | |
15b6757b FM |
44 | // Then we call CreateGrid to set the dimensions of the grid |
45 | // (100 rows and 10 columns in this example) | |
46 | grid-CreateGrid( 100, 10 ); | |
36c9828f | 47 | |
15b6757b FM |
48 | // We can set the sizes of individual rows and columns |
49 | // in pixels | |
50 | grid-SetRowSize( 0, 60 ); | |
51 | grid-SetColSize( 0, 120 ); | |
36c9828f | 52 | |
15b6757b FM |
53 | // And set grid cell contents as strings |
54 | grid-SetCellValue( 0, 0, "wxGrid is good" ); | |
36c9828f | 55 | |
15b6757b FM |
56 | // We can specify that some cells are read-only |
57 | grid-SetCellValue( 0, 3, "This is read-only" ); | |
58 | grid-SetReadOnly( 0, 3 ); | |
36c9828f | 59 | |
15b6757b FM |
60 | // Colours can be specified for grid cell contents |
61 | grid-SetCellValue(3, 3, "green on grey"); | |
62 | grid-SetCellTextColour(3, 3, *wxGREEN); | |
63 | grid-SetCellBackgroundColour(3, 3, *wxLIGHT_GREY); | |
36c9828f FM |
64 | |
65 | // We can specify the some cells will store numeric | |
66 | // values rather than strings. Here we set grid column 5 | |
67 | // to hold floating point values displayed with width of 6 | |
15b6757b FM |
68 | // and precision of 2 |
69 | grid-SetColFormatFloat(5, 6, 2); | |
70 | grid-SetCellValue(0, 6, "3.1415"); | |
71 | @endcode | |
36c9828f FM |
72 | |
73 | ||
c33e257b | 74 | @section overview_grid_complexexample A more complex example |
36c9828f | 75 | |
15b6757b | 76 | Yet to be written |
36c9828f | 77 | |
c33e257b FM |
78 | |
79 | @section overview_grid_classrelations How the wxGrid classes relate to each other | |
36c9828f | 80 | |
15b6757b | 81 | Yet to be written |
36c9828f | 82 | |
36c9828f | 83 | |
c33e257b | 84 | @section overview_grid_keyboardmouse Keyboard and mouse actions |
36c9828f | 85 | |
c33e257b | 86 | Yet to be written |
36c9828f | 87 | |
c33e257b | 88 | */ |
36c9828f | 89 |