File: grid.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (2021 lines) | stat: -rw-r--r-- 65,494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name:        grid.tex
%% Purpose:     wxGrid
%% Author:
%% Modified by: Santiago Palacios
%% Created:
%% RCS-ID:      $Id: grid.tex 50204 2007-11-24 01:23:05Z VZ $
%% Copyright:   (c) wxWidgets
%% License:     wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{\class{wxGrid}}\label{wxgrid}

wxGrid and its related classes are used for displaying and editing tabular
data. They provide a rich set of features for display, editing, and
interacting with a variety of data sources. For simple applications, and to
help you get started, wxGrid is the only class you need to refer to
directly. It will set up default instances of the other classes and manage
them for you. For more complex applications you can derive your own
classes for custom grid views, grid data tables, cell editors and
renderers. The \helpref{wxGrid classes overview}{gridoverview} has
examples of simple and more complex applications, explains the
relationship between the various grid classes and has a summary of the
keyboard shortcuts and mouse functions provided by wxGrid.

wxGrid has been greatly expanded and redesigned for wxWidgets 2.2
onwards. If you have been using the old wxGrid class you will probably
want to have a look at the \helpref{wxGrid classes overview}{gridoverview} to see
how things have changed. The new grid classes are reasonably backward-compatible
but there are some exceptions. There are also easier ways of doing many things compared to
the previous implementation.

\wxheading{Derived from}

\helpref{wxScrolledWindow}{wxscrolledwindow}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/grid.h>

\wxheading{Window styles}

There are presently no specific window styles for wxGrid.

\wxheading{Event handling}

\input gridevt.inc

The event handler for the following functions takes a
 \helpref{wxGridSizeEvent}{wxgridsizeevent} parameter.
The ...\_CMD\_... variants also take a window identifier.

\twocolwidtha{7cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_GRID\_COL\_SIZE(func)}}{The user resized a column by dragging it. Processes a wxEVT\_GRID\_COL\_SIZE.}
\twocolitem{{\bf EVT\_GRID\_ROW\_SIZE(func)}}{The user resized a row by dragging it. Processes a wxEVT\_GRID\_ROW\_SIZE.}
\twocolitem{{\bf EVT\_GRID\_CMD\_COL\_SIZE(func)}}{The user resized a column by dragging it; variant taking a window identifier. Processes a wxEVT\_GRID\_COL\_SIZE.}
\twocolitem{{\bf EVT\_GRID\_CMD\_ROW\_SIZE(func)}}{The user resized a row by dragging it; variant taking a window identifier. Processes a wxEVT\_GRID\_ROW\_SIZE.}
\end{twocollist}%

The event handler for the following functions takes a
 \helpref{wxGridRangeSelectEvent}{wxgridrangeselectevent} parameter.
The ...\_CMD\_... variant also takes a window identifier.

\twocolwidtha{7cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_GRID\_RANGE\_SELECT(func)}}{The user selected a group of contiguous cells. Processes a wxEVT\_GRID\_RANGE\_SELECT.}
\twocolitem{{\bf EVT\_GRID\_CMD\_RANGE\_SELECT(id, func)}}{The user selected a group of contiguous cells; variant taking a window identifier. Processes a wxEVT\_GRID\_RANGE\_SELECT.}
\end{twocollist}%

The event handler for the following functions takes a
 \helpref{wxGridEditorCreatedEvent}{wxgrideditorcreatedevent} parameter.
The ...\_CMD\_... variant also takes a window identifier.

\twocolwidtha{7cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_GRID\_EDITOR\_CREATED(func)}}{The editor for a cell was created. Processes a wxEVT\_GRID\_EDITOR\_CREATED.}
\twocolitem{{\bf EVT\_GRID\_CMD\_EDITOR\_CREATED(id, func)}}{The editor for a cell was created; variant taking a window identifier. Processes a wxEVT\_GRID\_EDITOR\_CREATED.}
\end{twocollist}%

\wxheading{See also}

\helpref{wxGrid overview}{gridoverview}

%%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
\latexignore{\rtfignore{\wxheading{Function groups}}}



\membersection{Constructors and initialization}\label{wxgridconstructors}

\helpref{wxGrid}{wxgridctor}\\
\helpref{\destruct{wxGrid}}{wxgriddtor}\\
\helpref{CreateGrid}{wxgridcreategrid}\\
\helpref{SetTable}{wxgridsettable}



\membersection{Display format}\label{wxgriddisplayformat}



\membersection{Selection functions}\label{wxgridselectionfunctions}

\helpref{wxGrid::ClearSelection}{wxgridclearselection}\\
\helpref{wxGrid::IsSelection}{wxgridisselection}\\
\helpref{wxGrid::SelectAll}{wxgridselectall}\\
\helpref{wxGrid::SelectBlock}{wxgridselectblock}\\
\helpref{wxGrid::SelectCol}{wxgridselectcol}\\
\helpref{wxGrid::SelectRow}{wxgridselectrow}

%%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
\helponly{\insertatlevel{2}{

\wxheading{Members}

}}



\membersection{wxGrid::wxGrid}\label{wxgridctor}

\func{}{wxGrid}{\void}

Default constructor

\func{}{wxGrid}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxWANTS\_CHARS}, \param{const wxString\& }{name = wxPanelNameStr}}

Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or
\helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using
it.



\membersection{wxGrid::\destruct{wxGrid}}\label{wxgriddtor}

\func{}{\destruct{wxGrid}}{\void}

Destructor. This will also destroy the associated grid table unless you passed a table
object to the grid and specified that the grid should not take ownership of the
table (see \helpref{wxGrid::SetTable}{wxgridsettable}).



\membersection{wxGrid::AppendCols}\label{wxgridappendcols}

\func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = true}}

Appends one or more new columns to the right of the grid and returns true if
successful. The updateLabels argument is not used at present.

If you are using a derived grid table class you will need to override
\helpref{wxGridTableBase::AppendCols}{wxgridtablebaseappendcols}. See
\helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.



\membersection{wxGrid::AppendRows}\label{wxgridappendrows}

\func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = true}}

Appends one or more new rows to the bottom of the grid and returns true if
successful. The updateLabels argument is not used at present.

If you are using a derived grid table class you will need to override
\helpref{wxGridTableBase::AppendRows}{wxgridtablebaseappendrows}. See
\helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.



\membersection{wxGrid::AutoSize}\label{wxgridautosize}

\func{void}{AutoSize}{\void}

Automatically sets the height and width of all rows and columns to fit their contents.

\wxheading{Note}\\
wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn}

\func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = true}}

Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
also be set as the minimal width for the column.

\wxheading{Note}\\
wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns}

\func{void}{AutoSizeColumns}{\param{bool }{setAsMin = true}}

Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
also be set as the minimal widths for the columns.

\wxheading{Note}\\
wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow}

\func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = true}}

Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
also be set as the minimal height for the row.

\wxheading{Note}\\
wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows}

\func{void}{AutoSizeRows}{\param{bool }{setAsMin = true}}

Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
also be set as the minimal heights for the rows.

\wxheading{Note}\\
wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch}

\func{void}{BeginBatch}{\void}

Increments the grid's batch count. When the count is greater than zero repainting of
the grid is suppressed. Each call to BeginBatch must be matched by a later call to
\helpref{wxGrid::EndBatch}{wxgridendbatch}. Code that does a lot of grid
modification can be enclosed between BeginBatch and EndBatch calls to avoid
screen flicker. The final EndBatch will cause the grid to be repainted.



\membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect}

\func{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}}

This function returns the rectangle that encloses the block of cells
limited by TopLeft and BottomRight cell in device coords and clipped
to the client size of the grid window.



\membersection{wxGrid::CanDragColMove}\label{wxgridcandragcolmove}

\func{bool}{CanDragColMove}{\void}

Returns true if columns can be moved by dragging with the mouse. Columns can be moved
by dragging on their labels.



\membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize}

\func{bool}{CanDragColSize}{\void}

Returns true if columns can be resized by dragging with the mouse. Columns can be resized
by dragging the edges of their labels. If grid line dragging is enabled they can also be
resized by dragging the right edge of the column in the grid cell area
(see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).



\membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize}

\func{bool}{CanDragRowSize}{\void}

Returns true if rows can be resized by dragging with the mouse. Rows can be resized
by dragging the edges of their labels. If grid line dragging is enabled they can also be
resized by dragging the lower edge of the row in the grid cell area
(see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).



\membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize}

\func{bool}{CanDragGridSize}{\void}

Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.



\membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol}

\constfunc{bool}{CanEnableCellControl}{\void}

Returns true if the in-place edit control for the current grid cell can be used and
false otherwise (e.g. if the current cell is read-only).



\membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes}

\func{bool}{CanHaveAttributes}{\void}

Do we have some place to store attributes in?



\membersection{wxGrid::CellToRect}\label{wxgridcelltorect}

\func{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}}

\func{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}}

Return the rectangle corresponding to the grid cell's size and position in logical
coordinates.



\membersection{wxGrid::ClearGrid}\label{wxgridcleargrid}

\func{void}{ClearGrid}{\void}

Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
this function. If you are using a derived table class then you need to override
\helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect.



\membersection{wxGrid::ClearSelection}\label{wxgridclearselection}

\func{void}{ClearSelection}{\void}

Deselects all cells that are currently selected.



\membersection{wxGrid::CreateGrid}\label{wxgridcreategrid}

\func{bool}{CreateGrid}{\param{int }{numRows}, \param{int }{numCols}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}

Creates a grid with the specified initial number of rows and columns.
Call this directly after the grid constructor. When you use this
function wxGrid will create and manage a simple table of string values
for you. All of the grid data will be stored in memory.

For applications with more complex data types or relationships, or for
dealing with very large datasets, you should derive your own grid table
class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}.



\membersection{wxGrid::DeleteCols}\label{wxgriddeletecols}

\func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}

Deletes one or more columns from a grid starting at the specified position and returns
true if successful. The updateLabels argument is not used at present.

If you are using a derived grid table class you will need to override
\helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See
\helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.



\membersection{wxGrid::DeleteRows}\label{wxgriddeleterows}

\func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}

Deletes one or more rows from a grid starting at the specified position and returns
true if successful. The updateLabels argument is not used at present.

If you are using a derived grid table class you will need to override
\helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See
\helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.



\membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol}

\func{void}{DisableCellEditControl}{\void}

Disables in-place editing of grid cells.
Equivalent to calling EnableCellEditControl(false).



\membersection{wxGrid::DisableDragColMove}\label{wxgriddisabledragcolmove}

\func{void}{DisableDragColMove}{\void}

Disables column moving by dragging with the mouse. Equivalent to passing false to
\helpref{wxGrid::EnableDragColMove}{wxgridenabledragcolmove}.



\membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize}

\func{void}{DisableDragColSize}{\void}

Disables column sizing by dragging with the mouse. Equivalent to passing false to
\helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}.



\membersection{wxGrid::DisableDragGridSize}\label{wxgriddisabledraggridsize}

\func{void}{DisableDragGridSize}{\void}

Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
false to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}



\membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize}

\func{void}{DisableDragRowSize}{\void}

Disables row sizing by dragging with the mouse. Equivalent to passing false to
\helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}.



\membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol}

\func{void}{EnableCellEditControl}{\param{bool }{enable = true}}

Enables or disables in-place editing of grid cell data. The grid will issue either a
wxEVT\_GRID\_EDITOR\_SHOWN or wxEVT\_GRID\_EDITOR\_HIDDEN event.



\membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize}

\func{void}{EnableDragColSize}{\param{bool }{enable = true}}

Enables or disables column sizing by dragging with the mouse.



\membersection{wxGrid::EnableDragColMove}\label{wxgridenabledragcolmove}

\func{void}{EnableDragColMove}{\param{bool }{enable = true}}

Enables or disables column moving by dragging with the mouse.



\membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize}

\func{void}{EnableDragGridSize}{\param{bool }{enable = true}}

Enables or disables row and column resizing by dragging gridlines with the mouse.



\membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize}

\func{void}{EnableDragRowSize}{\param{bool }{enable = true}}

Enables or disables row sizing by dragging with the mouse.



\membersection{wxGrid::EnableEditing}\label{wxgridenableediting}

\func{void}{EnableEditing}{\param{bool }{edit}}

If the edit argument is false this function sets the whole grid as read-only. If the
argument is true the grid is set to the default state where cells may be editable. In the
default state you can set single grid cells and whole rows and columns to be editable or
read-only via
\helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single
cells you can also use the shortcut function
\helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}.

For more information about controlling grid cell attributes see the
\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
\helpref{wxGrid classes overview}{gridoverview}.



\membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines}

\func{void}{EnableGridLines}{\param{bool }{enable = true}}

Turns the drawing of grid lines on or off.



\membersection{wxGrid::EndBatch}\label{wxgridendbatch}

\func{void}{EndBatch}{\void}

Decrements the grid's batch count. When the count is greater than zero repainting of
the grid is suppressed. Each previous call to
\helpref{wxGrid::BeginBatch}{wxgridbeginbatch} must be matched by a later call to
EndBatch. Code that does a lot of grid modification can be enclosed between
BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
cause the grid to be repainted.



\membersection{wxGrid::Fit}\label{wxgridfit}

\func{void}{Fit}{\void}

Overridden wxWindow method.



\membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh}

\func{void}{ForceRefresh}{\void}

Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.



\membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}

\func{int}{GetBatchCount}{\void}

Returns the number of times that \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} has been called
without (yet) matching calls to \helpref{wxGrid::EndBatch}{wxgridendbatch}. While
the grid's batch count is greater than zero the display will not be updated.



\membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}

\func{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}}

Sets the arguments to the horizontal and vertical text alignment values for the
grid cell at the specified location.

Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.

\perlnote{This method only takes the parameters {\tt row} and {\tt col} and
returns a 2-element list {\tt ( horiz, vert )}.}



\membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}

\func{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}}

Returns the background colour of the cell at the specified location.



\membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor}

\func{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}}

Returns a pointer to the editor for the cell at the specified location.

See \helpref{wxGridCellEditor}{wxgridcelleditor} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont}

\func{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}}

Returns the font for text in the grid cell at the specified location.



\membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer}

\func{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}}

Returns a pointer to the renderer for the grid cell at the specified location.

See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}

\func{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}}

Returns the text colour for the grid cell at the specified location.



\membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue}

\func{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}}

\func{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}}

Returns the string contained in the cell at the specified location. For simple applications where a
grid object automatically uses a default grid table of string values you use this function together
with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values.

For more complex applications where you have derived your own grid table class that contains
various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
function for those cells that contain string values.

See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas}
and the \helpref{wxGrid overview}{gridoverview} for more information.



\membersection{wxGrid::GetColAt}\label{wxgridgetcolat}

\constfunc{int}{GetColAt}{\param{int }{colPos}}

Returns the column ID of the specified column position.


\membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft}

\constfunc{int}{GetColLeft}{\param{int }{col}}



\membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment}

\func{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}

Sets the arguments to the current column label alignment values.

Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.\\
Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.

\perlnote{This method takes no parameters and
returns a 2-element list {\tt ( horiz, vert )}.}



\membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize}

\func{int}{GetColLabelSize}{\void}

Returns the current height of the column labels.



\membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue}

\func{wxString}{GetColLabelValue}{\param{int }{col}}

Returns the specified column label. The default grid table class provides column labels of
the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
\helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide
your own labels.



\membersection{wxGrid::GetColMinimalAcceptableWidth}\label{wxgridgetcolminimalacceptablewidth}

\func{int}{GetColMinimalAcceptableWidth}{}

This returns the value of the lowest column width that can be handled correctly. See
member \helpref{SetColMinimalAcceptableWidth}{wxgridsetcolminimalacceptablewidth} for details.



\membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth}

\constfunc{int}{GetColMinimalWidth}{\param{int }{col}}

Get the minimal width of the given column/row.



\membersection{wxGrid::GetColPos}\label{wxgridgetcolpos}

\constfunc{int}{GetColPos}{\param{int }{colID}}

Returns the position of the specified column.



\membersection{wxGrid::GetColRight}\label{wxgridgetcolright}

\constfunc{int}{GetColRight}{\param{int }{col}}



\membersection{wxGrid::GetColSize}\label{wxgridgetcolsize}

\func{int}{GetColSize}{\param{int }{col}}

Returns the width of the specified column.



\membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment}

\func{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}}

Sets the arguments to the current default horizontal and vertical text alignment
values.

Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.



\membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour}

\func{wxColour}{GetDefaultCellBackgroundColour}{\void}

Returns the current default background colour for grid cells.



\membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont}

\func{wxFont}{GetDefaultCellFont}{\void}

Returns the current default font for grid cell text.



\membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour}

\func{wxColour}{GetDefaultCellTextColour}{\void}

Returns the current default colour for grid cell text.



\membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize}

\func{int}{GetDefaultColLabelSize}{\void}

Returns the default height for column labels.



\membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize}

\func{int}{GetDefaultColSize}{\void}

Returns the current default width for grid columns.



\membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor}

\constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void}

Returns a pointer to the current default grid cell editor.

See \helpref{wxGridCellEditor}{wxgridcelleditor} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell}

\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}}

\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}}



\membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype}

\constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}}



\membersection{wxGrid::GetDefaultRenderer}\label{wxgridgetdefaultrenderer}

\constfunc{wxGridCellRenderer*}{GetDefaultRenderer}{\void}

Returns a pointer to the current default grid cell renderer.

See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell}

\constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}}



\membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype}

\constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}}



\membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize}

\func{int}{GetDefaultRowLabelSize}{\void}

Returns the default width for the row labels.



\membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize}

\func{int}{GetDefaultRowSize}{\void}

Returns the current default height for grid rows.



\membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol}

\func{int}{GetGridCursorCol}{\void}

Returns the current grid cell column position.



\membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow}

\func{int}{GetGridCursorRow}{\void}

Returns the current grid cell row position.



\membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour}

\func{wxColour}{GetGridLineColour}{\void}

Returns the colour used for grid lines.

\wxheading{See also}

\helpref{GetDefaultGridLinePen()}{wxgridgetdefaultgridlinepen}


\membersection{wxGrid::GetDefaultGridLinePen}\label{wxgridgetdefaultgridlinepen}

\func{wxPen}{GetDefaultGridLinePen}{\void}

Returns the pen used for grid lines. This virtual function may be overridden in
derived classes in order to change the appearance of grid lines. Note that
currently the pen width must be $1$.

\wxheading{See also}

\helpref{GetColGridLinePen()}{wxgridgetcolgridlinepen},\\
\helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen}




\membersection{wxGrid::GetRowGridLinePen}\label{wxgridgetrowgridlinepen}

\func{wxPen}{GetRowGridLinePen}{\param{int }{row}}

Returns the pen used for horizontal grid lines. This virtual function may be
overridden in derived classes in order to change the appearance of individual
grid line for the given row \arg{row}.

Example: \\
\\
\begin{verbatim}
   // in a grid displaying music notation, use a solid black pen between
   // octaves (C0=row 127, C1=row 115 etc.)
   wxPen MidiGrid::GetRowGridLinePen(int row)
   {
       if ( row%12 == 7 )
          return wxPen(*wxBLACK, 1, wxSOLID);
       else 
          return GetDefaultGridLinePen();
   }
\end{verbatim}



\membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen}

\func{wxPen}{GetColGridLinePen}{\param{int }{col}}

Returns the pen used for vertical grid lines. This virtual function may be
overridden in derived classes in order to change the appearance of individual
grid lines for the given column \arg{col}.

See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example.




\membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}

\func{bool}{GridLinesEnabled}{\void}

Returns true if drawing of grid lines is turned on, false otherwise.



\membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}

\func{wxColour}{GetLabelBackgroundColour}{\void}

Returns the colour used for the background of row and column labels.



\membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}

\func{wxFont}{GetLabelFont}{\void}

Returns the font used for row and column labels.



\membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}

\func{wxColour}{GetLabelTextColour}{\void}

Returns the colour used for row and column label text.



\membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}

\func{int}{GetNumberCols}{\void}

Returns the total number of grid columns (actually the number of columns in the underlying grid
table).



\membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}

\func{int}{GetNumberRows}{\void}

Returns the total number of grid rows (actually the number of rows in the underlying grid table).



\membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}

\constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}



\membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}

\func{int}{GetRowMinimalAcceptableHeight}{}

This returns the value of the lowest row width that can be handled correctly. See
member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.



\membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}

\constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}



\membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}

\func{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}

Sets the arguments to the current row label alignment values.

Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.

\perlnote{This method takes no parameters and
returns a 2-element list {\tt ( horiz, vert )}.}



\membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}

\func{int}{GetRowLabelSize}{\void}

Returns the current width of the row labels.



\membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}

\func{wxString}{GetRowLabelValue}{\param{int }{row}}

Returns the specified row label. The default grid table class provides numeric row labels.
If you are using a custom grid table you can override
\helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
your own labels.



\membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}

\func{int}{GetRowSize}{\param{int }{row}}

Returns the height of the specified row.



\membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex}

\constfunc{int}{GetScrollLineX}{\void}

Returns the number of pixels per horizontal scroll increment. The default is 15.

\wxheading{See also}

\helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
\helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
\helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}



\membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney}

\constfunc{int}{GetScrollLineY}{\void}

Returns the number of pixels per vertical scroll increment. The default is 15.

\wxheading{See also}

\helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
\helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
\helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}



\membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}

\constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}

Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.



\membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}

\constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}

Returns an array of singly selected cells.



\membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}

\constfunc{wxArrayInt}{GetSelectedCols}{\void}

Returns an array of selected cols.



\membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}

\constfunc{wxArrayInt}{GetSelectedRows}{\void}

Returns an array of selected rows.



\membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}

\constfunc{wxColour}{GetSelectionBackground}{\void}

Access or update the selection fore/back colours



\membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}

\constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}

Returns an array of the top left corners of blocks of selected cells,
see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.



\membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}

\constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}

Returns an array of the bottom right corners of blocks of selected cells,
see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.



\membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}

\constfunc{wxColour}{GetSelectionForeground}{\void}



\membersection{wxGrid::GetTable}\label{wxgridgettable}

\constfunc{wxGridTableBase *}{GetTable}{\void}

Returns a base pointer to the current table object.



\membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}

\func{int}{GetViewWidth}{\void}

Returned number of whole cols visible.



\membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}

\func{void}{HideCellEditControl}{\void}

Hides the in-place cell edit control.



\membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}

\func{void}{InitColWidths}{\void}

Init the m\_colWidths/Rights arrays



\membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}

\func{void}{InitRowHeights}{\void}

NB: {\it never} access m\_row/col arrays directly because they are created
on demand, {\it always} use accessor functions instead!

Init the m\_rowHeights/Bottoms arrays with default values.



\membersection{wxGrid::InsertCols}\label{wxgridinsertcols}

\func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}

Inserts one or more new columns into a grid with the first new column at the
specified position and returns true if successful. The updateLabels argument is not
used at present.

The sequence of actions begins with the grid object requesting the underlying grid
table to insert new columns. If this is successful the table notifies the grid and the
grid updates the display. For a default grid (one where you have called
\helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
then you must override
\helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
table class.



\membersection{wxGrid::InsertRows}\label{wxgridinsertrows}

\func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}

Inserts one or more new rows into a grid with the first new row at the specified
position and returns true if successful. The updateLabels argument is not used at
present.

The sequence of actions begins with the grid object requesting the underlying grid
table to insert new rows. If this is successful the table notifies the grid and the
grid updates the display. For a default grid (one where you have called
\helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
then you must override
\helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
table class.



\membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}

\constfunc{bool}{IsCellEditControlEnabled}{\void}

Returns true if the in-place edit control is currently enabled.



\membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}

\constfunc{bool}{IsCurrentCellReadOnly}{\void}

Returns true if the current cell has been set to read-only
(see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).



\membersection{wxGrid::IsEditable}\label{wxgridiseditable}

\func{bool}{IsEditable}{\void}

Returns false if the whole grid has been set as read-only or true otherwise.
See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
controlling the editing status of grid cells.



\membersection{wxGrid::IsInSelection}\label{wxgridisinselection}

\constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}

\constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}

Is this cell currently selected.



\membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}

\constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}

Returns true if the cell at the specified location can't be edited.
See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.



\membersection{wxGrid::IsSelection}\label{wxgridisselection}

\func{bool}{IsSelection}{\void}

Returns true if there are currently rows, columns or blocks of cells selected.



\membersection{wxGrid::IsVisible}\label{wxgridisvisible}

\func{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}

\func{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}

Returns true if a cell is either wholly visible (the default) or at least partially
visible in the grid window.



\membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}

\func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}

\func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}

Brings the specified cell into the visible grid cell area with minimal scrolling. Does
nothing if the cell is already visible.



\membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}

\func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}

Moves the grid cursor down by one row. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for Down cursor key presses or Shift+Down to expand a selection.



\membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}

\func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}

Moves the grid cursor left by one column. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for Left cursor key presses or Shift+Left to expand a selection.



\membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}

\func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}

Moves the grid cursor right by one column. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for Right cursor key presses or Shift+Right to expand a selection.



\membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}

\func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}

Moves the grid cursor up by one row. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for Up cursor key presses or Shift+Up to expand a selection.



\membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}

\func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}

Moves the grid cursor down in the current column such that it skips to the beginning or
end of a block of non-empty cells. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.



\membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}

\func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}

Moves the grid cursor left in the current row such that it skips to the beginning or
end of a block of non-empty cells. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.



\membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}

\func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}

Moves the grid cursor right in the current row such that it skips to the beginning or
end of a block of non-empty cells. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.



\membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}

\func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}

Moves the grid cursor up in the current column such that it skips to the beginning or
end of a block of non-empty cells. If a block of cells was previously selected it
will expand if the argument is true or be cleared if the argument is false.

\wxheading{Keyboard}\\
This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.



\membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}

\func{bool}{MovePageDown}{\void}

Moves the grid cursor down by some number of rows so that the previous bottom visible row
becomes the top visible row.

\wxheading{Keyboard}\\
This function is called for PgDn keypresses.



\membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}

\func{bool}{MovePageUp}{\void}

Moves the grid cursor up by some number of rows so that the previous top visible row
becomes the bottom visible row.

\wxheading{Keyboard}\\
This function is called for PgUp keypresses.



\membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}

\func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}

Methods for a registry for mapping data types to Renderers/Editors



\membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}

\func{void}{SaveEditControlValue}{\void}

Sets the value of the current grid cell to the current in-place edit control value.
This is called automatically when the grid cursor moves from the current cell to a
new cell. It is also a good idea to call this function when closing a grid since
any edits to the final cell location will not be saved otherwise.



\membersection{wxGrid::SelectAll}\label{wxgridselectall}

\func{void}{SelectAll}{\void}

Selects all cells in the grid.



\membersection{wxGrid::SelectBlock}\label{wxgridselectblock}

\func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
\param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}

\func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
\param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}

Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
deselected; if true the column will be added to the existing selection.



\membersection{wxGrid::SelectCol}\label{wxgridselectcol}

\func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}

Selects the specified column. If addToSelected is false then any existing selection will be
deselected; if true the column will be added to the existing selection.



\membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}

\func{wxRect}{SelectionToDeviceRect}{\void}

This function returns the rectangle that encloses the selected cells
in device coords and clipped to the client size of the grid window.



\membersection{wxGrid::SelectRow}\label{wxgridselectrow}

\func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}

Selects the specified row. If addToSelected is false then any existing selection will be
deselected; if true the row will be added to the existing selection.



\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}

\func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}

\func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}

Sets the horizontal and vertical alignment for grid cell text at the specified location.

Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.



\membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}

\func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}



\membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}

\func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}

Sets the editor for the grid cell at the specified location.
The grid will take ownership of the pointer.

See \helpref{wxGridCellEditor}{wxgridcelleditor} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}

\func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}

Sets the font for text in the grid cell at the specified location.



\membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}

\func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}

Sets the renderer for the grid cell at the specified location.
The grid will take ownership of the pointer.

See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}

\func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}

\func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}

\func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}

Sets the text colour for the grid cell at the specified location.



\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}

\func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}

\func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}

\func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}

Sets the string value for the cell at the specified location. For simple applications where a
grid object automatically uses a default grid table of string values you use this function together
with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.

For more complex applications where you have derived your own grid table class that contains
various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
function for those cells that contain string values.

The last form is for backward compatibility only.

See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
and the \helpref{wxGrid overview}{gridoverview} for more information.



\membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}

\func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}

Sets the cell attributes for all cells in the specified column.

For more information about controlling grid cell attributes see the
\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
\helpref{wxGrid classes overview}{gridoverview}.



\membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}

\func{void}{SetColFormatBool}{\param{int }{col}}

Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.



\membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}

\func{void}{SetColFormatNumber}{\param{int }{col}}

Sets the specified column to display integer values.



\membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}

\func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}

Sets the specified column to display floating point values with the given width and precision.



\membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}

\func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}

Sets the specified column to display data in a custom format.
See the \helpref{wxGrid overview}{gridoverview} for more information on working
with custom data types.



\membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}

\func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}

Sets the horizontal and vertical alignment of column label text.

Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.

Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.



\membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}

\func{void}{SetColLabelSize}{\param{int }{height}}

Sets the height of the column labels.

If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated
automatically so that no label is truncated. Note that this could be slow for a
large table. This flag is new since wxWidgets version 2.8.8.



\membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}

\func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}

Set the value for the given column label. If you are using a derived grid table you must
override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
for this to have any effect.



\membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}

\func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}

Sets the minimal width for the specified column. This should normally be called when creating the grid
because it will not resize a column that is already narrower than the minimal width.
The width argument must be higher than the minimimal acceptable column width, see
\helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.



\membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}

\func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}

This modifies the minimum column width that can be handled correctly. Specifying a low value here
allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
than the actual minimum size will incur a performance penalty in the functions which perform
grid cell index lookup on the basis of screen coordinates.
This should normally be called when creating the grid because it will not resize existing columns
with sizes smaller than the value specified here.



\membersection{wxGrid::SetColPos}\label{wxgridsetcolpos}

\func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}}

Sets the position of the specified column.



\membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}

\func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}

Sets the width of the specified column.

This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.

Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
also be set as the minimal width for the column.

\wxheading{Note}\\
wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}

\func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}

Sets the default horizontal and vertical alignment for grid cell text.

Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.

Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.



\membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}

\func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}

Sets the default background colour for grid cells.



\membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}

\func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}

Sets the default font to be used for grid cell text.



\membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}

\func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}

Sets the current default colour for grid cell text.



\membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}

\func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}

Sets the default editor for grid cells. The grid will take ownership of the pointer.

See \helpref{wxGridCellEditor}{wxgridcelleditor} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}

\func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}

Sets the default renderer for grid cells. The grid will take ownership of the pointer.

See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.



\membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}

\func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}

Sets the default width for columns in the grid. This will only affect columns subsequently added to
the grid unless resizeExistingCols is true.



\membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}

\func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}

Sets the default height for rows in the grid. This will only affect rows subsequently added
to the grid unless resizeExistingRows is true.



\membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}

\func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}

Set the grid cursor to the specified cell.
This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.



\membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}

\func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}

Sets the colour used to draw grid lines.



\membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}

\func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}

Sets the background colour for row and column labels.



\membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}

\func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}

Sets the font for row and column labels.



\membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}

\func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}

Sets the colour for row and column label text.



\membersection{wxGrid::SetMargins}\label{wxgridsetmargins}

\func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}

A grid may occupy more space than needed for its rows/columns. This
function allows to set how big this extra space is



\membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}

\func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}

Common part of AutoSizeColumn/Row() and GetBestSize()



\membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}

\func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}



\membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}

\func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}

Makes the cell at the specified location read-only or editable.
See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.



\membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}

\func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}

Sets the cell attributes for all cells in the specified row.
See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
about controlling cell attributes.



\membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}

\func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}

Sets the horizontal and vertical alignment of row label text.

Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.

Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.



\membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}

\func{void}{SetRowLabelSize}{\param{int }{width}}

Sets the width of the row labels.

If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated
automatically so that no label is truncated. Note that this could be slow for a
large table. This flag is new since wxWidgets version 2.8.8.



\membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}

\func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}

Set the value for the given row label. If you are using a derived grid table you must
override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
for this to have any effect.



\membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}

\func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}

Sets the minimal height for the specified row. This should normally be called when creating the grid
because it will not resize a row that is already shorter than the minimal height.
The height argument must be higher than the minimimal acceptable row height, see
\helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.



\membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}

\func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}

This modifies the minimum row width that can be handled correctly. Specifying a low value here
allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
than the actual minimum size will incur a performance penalty in the functions which perform
grid cell index lookup on the basis of screen coordinates.
This should normally be called when creating the grid because it will not resize existing rows
with sizes smaller than the value specified here.



\membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}

\func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}

Sets the height of the specified row.

This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.

Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
also be set as the minimal width for the column.

\wxheading{Note}

wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
The memory requirements for this could become prohibitive if your grid is very large.



\membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex}

\func{void}{SetScrollLineX}{\param{int }{x}}

Sets the number of pixels per horizontal scroll increment. The default is 15.
Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
errors: setting this to 1 can help.

\wxheading{See also}

\helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
\helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
\helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}



\membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney}

\func{void}{SetScrollLineY}{\param{int }{y}}

Sets the number of pixels per vertical scroll increment. The default is 15.
Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
errors: setting this to 1 can help.

\wxheading{See also}

\helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
\helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
\helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex}



\membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}

\func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}



\membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}

\func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}



\membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}

\func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}

Set the selection behaviour of the grid.

\wxheading{Parameters}

\docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}

\docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}

\docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}



\membersection{wxGrid::SetTable}\label{wxgridsettable}

\func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}

Passes a pointer to a custom grid table to be used by the grid. This should be called
after the grid constructor and before using the grid object. If takeOwnership is set to
true then the table will be deleted by the wxGrid destructor.

Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
application involves complex or non-string data or data sets that are too large to fit
wholly in memory.



\membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}

\func{void}{ShowCellEditControl}{\void}

Displays the in-place cell edit control for the current cell.



\membersection{wxGrid::XToCol}\label{wxgridxtocol}

\func{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}}

\wxheading{Parameters}
\docparam{x}{The x position to evaluate.}
\docparam{clipToMinMax}{If true, rather than returning wxNOT\_FOUND, it returns either the first or last column depending on whether x is too far to the left or right respectively.}

\wxheading{Return value}
The grid column that corresponds to the logical x coordinate. Returns
{\tt wxNOT\_FOUND} if there is no column at the x position.



\membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}

\func{int}{XToEdgeOfCol}{\param{int }{x}}

Returns the column whose right hand edge is close to the given logical x position.
If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.



\membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}

\func{int}{YToEdgeOfRow}{\param{int }{y}}

Returns the row whose bottom edge is close to the given logical y position.
If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.



\membersection{wxGrid::YToRow}\label{wxgridytorow}

\func{int}{YToRow}{\param{int }{y}}

Returns the grid row that corresponds to the logical y coordinate. Returns
{\tt wxNOT\_FOUND} if there is no row at the y position.