]>
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 overview_grid wxGrid Overview
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
25 @section overview_grid_intro Introduction
27 wxGrid and its related classes are used for displaying and editing tabular data.
30 @section overview_grid_simpleexample Getting started: a simple example
32 For simple applications you need only refer to the wxGrid class in your
33 code. This example shows how you might create a grid in a frame or
34 dialog constructor and illustrates some of the formatting functions.
37 // Create a wxGrid object
39 grid = new wxGrid( this,
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 );
48 // We can set the sizes of individual rows and columns
50 grid->SetRowSize( 0, 60 );
51 grid->SetColSize( 0, 120 );
53 // And set grid cell contents as strings
54 grid->SetCellValue( 0, 0, "wxGrid is good" );
56 // We can specify that some cells are read->only
57 grid->SetCellValue( 0, 3, "This is read->only" );
58 grid->SetReadOnly( 0, 3 );
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);
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
69 grid->SetColFormatFloat(5, 6, 2);
70 grid->SetCellValue(0, 6, "3.1415");
74 @section overview_grid_complexexample A more complex example
76 @todo Yet to be written
79 @section overview_grid_classrelations How the wxGrid classes relate to each other
81 @todo Yet to be written
84 @section overview_grid_keyboardmouse Keyboard and mouse actions
86 @todo Yet to be written