]> git.saurik.com Git - wxWidgets.git/blame - docs/doxygen/overviews/grid.h
update and complete Unicode overview; add an overview of changes since wx 2.8
[wxWidgets.git] / docs / doxygen / overviews / grid.h
CommitLineData
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
880efa2a 9/**
36c9828f 10
928f1a07 11@page overview_grid wxGrid Overview
36c9828f 12
928f1a07 13Classes: wxGrid
36c9828f 14
928f1a07
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 21
928f1a07 22<hr>
c33e257b
FM
23
24
928f1a07 25@section overview_grid_intro Introduction
36c9828f 26
928f1a07 27wxGrid and its related classes are used for displaying and editing tabular data.
36c9828f 28
c33e257b 29
928f1a07 30@section overview_grid_simpleexample Getting started: a simple example
36c9828f 31
928f1a07
FM
32For simple applications you need only refer to the wxGrid class in your
33code. This example shows how you might create a grid in a frame or
34dialog constructor and illustrates some of the formatting functions.
36c9828f 35
928f1a07
FM
36@code
37 // Create a wxGrid object
36c9828f 38
928f1a07 39 grid = new wxGrid( this,
15b6757b
FM
40 -1,
41 wxPoint( 0, 0 ),
42 wxSize( 400, 300 ) );
36c9828f 43
928f1a07
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
928f1a07
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
928f1a07
FM
53 // And set grid cell contents as strings
54 grid->SetCellValue( 0, 0, "wxGrid is good" );
36c9828f 55
928f1a07
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
928f1a07
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 64
928f1a07
FM
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
68 // and precision of 2
69 grid->SetColFormatFloat(5, 6, 2);
70 grid->SetCellValue(0, 6, "3.1415");
71@endcode
36c9828f
FM
72
73
928f1a07 74@section overview_grid_complexexample A more complex example
36c9828f 75
928f1a07 76@todo Yet to be written
36c9828f 77
c33e257b 78
928f1a07 79@section overview_grid_classrelations How the wxGrid classes relate to each other
36c9828f 80
928f1a07 81@todo Yet to be written
36c9828f 82
36c9828f 83
928f1a07 84@section overview_grid_keyboardmouse Keyboard and mouse actions
36c9828f 85
928f1a07 86@todo Yet to be written
36c9828f 87
c33e257b 88*/
36c9828f 89