]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/grid.tex
fix typo
[wxWidgets.git] / docs / latex / wx / grid.tex
CommitLineData
4b39770c
WS
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: grid.tex
3%% Purpose: wxGrid
4%% Author:
d4175745 5%% Modified by: Santiago Palacios
4b39770c
WS
6%% Created:
7%% RCS-ID: $Id$
8%% Copyright: (c) wxWidgets
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
a660d684
KB
12\section{\class{wxGrid}}\label{wxgrid}
13
78c49c58 14wxGrid and its related classes are used for displaying and editing tabular
2eebb742 15data. They provide a rich set of features for display, editing, and
78c49c58
MB
16interacting with a variety of data sources. For simple applications, and to
17help you get started, wxGrid is the only class you need to refer to
2eebb742
JS
18directly. It will set up default instances of the other classes and manage
19them for you. For more complex applications you can derive your own
78c49c58 20classes for custom grid views, grid data tables, cell editors and
2eebb742 21renderers. The \helpref{wxGrid classes overview}{gridoverview} has
78c49c58
MB
22examples of simple and more complex applications, explains the
23relationship between the various grid classes and has a summary of the
24keyboard shortcuts and mouse functions provided by wxGrid.
25
fc2171bd 26wxGrid has been greatly expanded and redesigned for wxWidgets 2.2
78c49c58 27onwards. If you have been using the old wxGrid class you will probably
2eebb742
JS
28want to have a look at the \helpref{wxGrid classes overview}{gridoverview} to see
29how things have changed. The new grid classes are reasonably backward-compatible
30but there are some exceptions. There are also easier ways of doing many things compared to
4b39770c 31the previous implementation.
a660d684
KB
32
33\wxheading{Derived from}
34
78c49c58 35\helpref{wxScrolledWindow}{wxscrolledwindow}\\
a660d684
KB
36\helpref{wxWindow}{wxwindow}\\
37\helpref{wxEvtHandler}{wxevthandler}\\
38\helpref{wxObject}{wxobject}
39
954b8ae6
JS
40\wxheading{Include files}
41
42<wx/grid.h>
43
a660d684
KB
44\wxheading{Window styles}
45
78c49c58 46There are presently no specific window styles for wxGrid.
a660d684 47
78c49c58 48\wxheading{Event handling}
a660d684 49
cbc95b2c
MB
50\input gridevt.inc
51
4b39770c 52The event handler for the following functions takes a
cbc95b2c 53 \helpref{wxGridSizeEvent}{wxgridsizeevent} parameter.
24d70590 54The ...\_CMD\_... variants also take a window identifier.
cbc95b2c
MB
55
56\twocolwidtha{7cm}
57\begin{twocollist}\itemsep=0pt
58\twocolitem{{\bf EVT\_GRID\_COL\_SIZE(func)}}{The user resized a column by dragging it. Processes a wxEVT\_GRID\_COL\_SIZE.}
59\twocolitem{{\bf EVT\_GRID\_ROW\_SIZE(func)}}{The user resized a row by dragging it. Processes a wxEVT\_GRID\_ROW\_SIZE.}
24d70590
JS
60\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.}
61\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.}
cbc95b2c
MB
62\end{twocollist}%
63
4b39770c 64The event handler for the following functions takes a
cbc95b2c 65 \helpref{wxGridRangeSelectEvent}{wxgridrangeselectevent} parameter.
24d70590 66The ...\_CMD\_... variant also takes a window identifier.
cbc95b2c
MB
67
68\twocolwidtha{7cm}
69\begin{twocollist}\itemsep=0pt
70\twocolitem{{\bf EVT\_GRID\_RANGE\_SELECT(func)}}{The user selected a group of contiguous cells. Processes a wxEVT\_GRID\_RANGE\_SELECT.}
24d70590 71\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.}
cbc95b2c
MB
72\end{twocollist}%
73
4b39770c 74The event handler for the following functions takes a
cbc95b2c 75 \helpref{wxGridEditorCreatedEvent}{wxgrideditorcreatedevent} parameter.
24d70590 76The ...\_CMD\_... variant also takes a window identifier.
cbc95b2c
MB
77
78\twocolwidtha{7cm}
79\begin{twocollist}\itemsep=0pt
80\twocolitem{{\bf EVT\_GRID\_EDITOR\_CREATED(func)}}{The editor for a cell was created. Processes a wxEVT\_GRID\_EDITOR\_CREATED.}
24d70590 81\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.}
cbc95b2c
MB
82\end{twocollist}%
83
a660d684
KB
84\wxheading{See also}
85
78c49c58 86\helpref{wxGrid overview}{gridoverview}
a660d684 87
78c49c58
MB
88%%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
89\latexignore{\rtfignore{\wxheading{Function groups}}}
a660d684 90
4b39770c
WS
91
92
f0e8a2d0 93\membersection{Constructors and initialization}\label{wxgridconstructors}
a660d684 94
2eebb742
JS
95\helpref{wxGrid}{wxgridctor}\\
96\helpref{\destruct{wxGrid}}{wxgriddtor}\\
97\helpref{CreateGrid}{wxgridcreategrid}\\
78c49c58 98\helpref{SetTable}{wxgridsettable}
a660d684 99
4b39770c
WS
100
101
f0e8a2d0 102\membersection{Display format}\label{wxgriddisplayformat}
a660d684 103
4b39770c
WS
104
105
f0e8a2d0 106\membersection{Selection functions}\label{wxgridselectionfunctions}
a660d684 107
2eebb742
JS
108\helpref{wxGrid::ClearSelection}{wxgridclearselection}\\
109\helpref{wxGrid::IsSelection}{wxgridisselection}\\
110\helpref{wxGrid::SelectAll}{wxgridselectall}\\
111\helpref{wxGrid::SelectBlock}{wxgridselectblock}\\
112\helpref{wxGrid::SelectCol}{wxgridselectcol}\\
5c69031c
MB
113\helpref{wxGrid::SelectRow}{wxgridselectrow}
114
78c49c58
MB
115%%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
116\helponly{\insertatlevel{2}{
a660d684 117
78c49c58
MB
118\wxheading{Members}
119
120}}
121
4b39770c
WS
122
123
78c49c58
MB
124\membersection{wxGrid::wxGrid}\label{wxgridctor}
125
126\func{}{wxGrid}{\void}
127
128Default constructor
129
130\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}}
131
4b39770c 132Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or
78c49c58 133\helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using
4b39770c
WS
134it.
135
136
78c49c58
MB
137
138\membersection{wxGrid::\destruct{wxGrid}}\label{wxgriddtor}
139
140\func{}{\destruct{wxGrid}}{\void}
141
142Destructor. This will also destroy the associated grid table unless you passed a table
143object to the grid and specified that the grid should not take ownership of the
4b39770c
WS
144table (see \helpref{wxGrid::SetTable}{wxgridsettable}).
145
146
a660d684
KB
147
148\membersection{wxGrid::AppendCols}\label{wxgridappendcols}
149
cc81d32f 150\func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
78c49c58 151
cc81d32f 152Appends one or more new columns to the right of the grid and returns true if
78c49c58 153successful. The updateLabels argument is not used at present.
a660d684 154
4b39770c
WS
155If you are using a derived grid table class you will need to override
156\helpref{wxGridTableBase::AppendCols}{wxgridtablebaseappendcols}. See
157\helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.
158
159
a660d684
KB
160
161\membersection{wxGrid::AppendRows}\label{wxgridappendrows}
162
cc81d32f 163\func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
78c49c58 164
cc81d32f 165Appends one or more new rows to the bottom of the grid and returns true if
78c49c58
MB
166successful. The updateLabels argument is not used at present.
167
4b39770c
WS
168If you are using a derived grid table class you will need to override
169\helpref{wxGridTableBase::AppendRows}{wxgridtablebaseappendrows}. See
170\helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.
171
172
78c49c58
MB
173
174\membersection{wxGrid::AutoSize}\label{wxgridautosize}
175
176\func{void}{AutoSize}{\void}
177
178Automatically sets the height and width of all rows and columns to fit their contents.
179
2eebb742 180\wxheading{Note}\\
78c49c58 181wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c
WS
182The memory requirements for this could become prohibitive if your grid is very large.
183
184
a660d684 185
733f486a 186\membersection{wxGrid::AutoSizeColLabelSize}\label{wxgridautosizecollabelsize}
608754c4 187
733f486a 188\func{void}{AutoSizeColLabelSize}{\param{int }{col}}
608754c4 189
733f486a 190Automatically adjusts width of the column to fit its label.
4b39770c
WS
191
192
608754c4 193
78c49c58
MB
194\membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn}
195
cc81d32f 196\func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = true}}
78c49c58 197
cc81d32f 198Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
78c49c58
MB
199also be set as the minimal width for the column.
200
2eebb742 201\wxheading{Note}\\
78c49c58 202wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c
WS
203The memory requirements for this could become prohibitive if your grid is very large.
204
205
78c49c58
MB
206
207\membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns}
208
cc81d32f 209\func{void}{AutoSizeColumns}{\param{bool }{setAsMin = true}}
78c49c58 210
cc81d32f 211Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
78c49c58
MB
212also be set as the minimal widths for the columns.
213
2eebb742 214\wxheading{Note}\\
78c49c58 215wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c
WS
216The memory requirements for this could become prohibitive if your grid is very large.
217
218
78c49c58
MB
219
220\membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow}
221
cc81d32f 222\func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = true}}
78c49c58 223
cc81d32f 224Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
78c49c58
MB
225also be set as the minimal height for the row.
226
2eebb742 227\wxheading{Note}\\
78c49c58 228wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c
WS
229The memory requirements for this could become prohibitive if your grid is very large.
230
231
78c49c58 232
733f486a
VZ
233\membersection{wxGrid::AutoSizeRowLabelSize}\label{wxgridautosizerowlabelsize}
234
235\func{void}{AutoSizeRowLabelSize}{\param{int }{col}}
236
237Automatically adjusts height of the row to fit its label.
238
239
240
78c49c58
MB
241\membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows}
242
cc81d32f 243\func{void}{AutoSizeRows}{\param{bool }{setAsMin = true}}
78c49c58 244
cc81d32f 245Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
78c49c58
MB
246also be set as the minimal heights for the rows.
247
2eebb742 248\wxheading{Note}\\
78c49c58 249wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c
WS
250The memory requirements for this could become prohibitive if your grid is very large.
251
252
a660d684
KB
253
254\membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch}
255
256\func{void}{BeginBatch}{\void}
257
78c49c58 258Increments the grid's batch count. When the count is greater than zero repainting of
4b39770c 259the grid is suppressed. Each call to BeginBatch must be matched by a later call to
78c49c58
MB
260\helpref{wxGrid::EndBatch}{wxgridendbatch}. Code that does a lot of grid
261modification can be enclosed between BeginBatch and EndBatch calls to avoid
262screen flicker. The final EndBatch will cause the grid to be repainted.
a660d684 263
b62f94ff
VZ
264\wxheading{See also}
265
266\helpref{wxGridUpdateLocker}{wxgridupdatelocker}
267
4b39770c
WS
268
269
608754c4
JS
270\membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect}
271
ef316e23 272\constfunc{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}}
608754c4
JS
273
274This function returns the rectangle that encloses the block of cells
275limited by TopLeft and BottomRight cell in device coords and clipped
276to the client size of the grid window.
277
278
4b39770c 279
d4175745
VZ
280\membersection{wxGrid::CanDragColMove}\label{wxgridcandragcolmove}
281
ef316e23 282\constfunc{bool}{CanDragColMove}{\void}
d4175745
VZ
283
284Returns true if columns can be moved by dragging with the mouse. Columns can be moved
285by dragging on their labels.
286
287
288
78c49c58 289\membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize}
a660d684 290
ef316e23 291\constfunc{bool}{CanDragColSize}{\void}
a660d684 292
cc81d32f 293Returns true if columns can be resized by dragging with the mouse. Columns can be resized
78c49c58 294by dragging the edges of their labels. If grid line dragging is enabled they can also be
4b39770c 295resized by dragging the right edge of the column in the grid cell area
78c49c58 296(see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).
a660d684 297
4b39770c
WS
298
299
78c49c58 300\membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize}
a660d684 301
ef316e23 302\constfunc{bool}{CanDragRowSize}{\void}
a660d684 303
cc81d32f 304Returns true if rows can be resized by dragging with the mouse. Rows can be resized
78c49c58 305by dragging the edges of their labels. If grid line dragging is enabled they can also be
4b39770c 306resized by dragging the lower edge of the row in the grid cell area
78c49c58 307(see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).
a660d684 308
4b39770c
WS
309
310
78c49c58 311\membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize}
a660d684 312
ef316e23 313\constfunc{bool}{CanDragGridSize}{\void}
a660d684 314
cc81d32f 315Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
21f280f4 316
4b39770c
WS
317
318
78c49c58 319\membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol}
a660d684 320
78c49c58 321\constfunc{bool}{CanEnableCellControl}{\void}
a660d684 322
cc81d32f
VS
323Returns true if the in-place edit control for the current grid cell can be used and
324false otherwise (e.g. if the current cell is read-only).
78c49c58 325
4b39770c
WS
326
327
608754c4
JS
328\membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes}
329
ef316e23 330\constfunc{bool}{CanHaveAttributes}{\void}
608754c4
JS
331
332Do we have some place to store attributes in?
333
4b39770c
WS
334
335
78c49c58
MB
336\membersection{wxGrid::CellToRect}\label{wxgridcelltorect}
337
ef316e23 338\constfunc{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}}
78c49c58 339
ef316e23 340\constfunc{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}}
78c49c58
MB
341
342Return the rectangle corresponding to the grid cell's size and position in logical
343coordinates.
344
4b39770c
WS
345
346
78c49c58
MB
347\membersection{wxGrid::ClearGrid}\label{wxgridcleargrid}
348
349\func{void}{ClearGrid}{\void}
350
351Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
4b39770c 352this function. If you are using a derived table class then you need to override
78c49c58
MB
353\helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect.
354
4b39770c
WS
355
356
5c69031c
MB
357\membersection{wxGrid::ClearSelection}\label{wxgridclearselection}
358
359\func{void}{ClearSelection}{\void}
360
361Deselects all cells that are currently selected.
362
4b39770c
WS
363
364
78c49c58
MB
365\membersection{wxGrid::CreateGrid}\label{wxgridcreategrid}
366
367\func{bool}{CreateGrid}{\param{int }{numRows}, \param{int }{numCols}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
368
369Creates a grid with the specified initial number of rows and columns.
370Call this directly after the grid constructor. When you use this
371function wxGrid will create and manage a simple table of string values
372for you. All of the grid data will be stored in memory.
373
374For applications with more complex data types or relationships, or for
375dealing with very large datasets, you should derive your own grid table
4b39770c
WS
376class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}.
377
378
a660d684
KB
379
380\membersection{wxGrid::DeleteCols}\label{wxgriddeletecols}
381
cc81d32f 382\func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
a660d684 383
78c49c58 384Deletes one or more columns from a grid starting at the specified position and returns
cc81d32f 385true if successful. The updateLabels argument is not used at present.
78c49c58 386
4b39770c
WS
387If you are using a derived grid table class you will need to override
388\helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See
78c49c58 389\helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.
a660d684 390
4b39770c
WS
391
392
a660d684
KB
393\membersection{wxGrid::DeleteRows}\label{wxgriddeleterows}
394
cc81d32f 395\func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
78c49c58
MB
396
397Deletes one or more rows from a grid starting at the specified position and returns
cc81d32f 398true if successful. The updateLabels argument is not used at present.
78c49c58 399
4b39770c
WS
400If you are using a derived grid table class you will need to override
401\helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See
78c49c58
MB
402\helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.
403
4b39770c
WS
404
405
78c49c58
MB
406\membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol}
407
408\func{void}{DisableCellEditControl}{\void}
409
4b39770c 410Disables in-place editing of grid cells.
cc81d32f 411Equivalent to calling EnableCellEditControl(false).
78c49c58 412
4b39770c
WS
413
414
d4175745
VZ
415\membersection{wxGrid::DisableDragColMove}\label{wxgriddisabledragcolmove}
416
417\func{void}{DisableDragColMove}{\void}
418
419Disables column moving by dragging with the mouse. Equivalent to passing false to
420\helpref{wxGrid::EnableDragColMove}{wxgridenabledragcolmove}.
421
422
423
78c49c58
MB
424\membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize}
425
426\func{void}{DisableDragColSize}{\void}
427
4b39770c
WS
428Disables column sizing by dragging with the mouse. Equivalent to passing false to
429\helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}.
430
431
78c49c58
MB
432
433\membersection{wxGrid::DisableDragGridSize}\label{wxgriddisabledraggridsize}
434
435\func{void}{DisableDragGridSize}{\void}
436
437Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
cc81d32f 438false to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}
78c49c58 439
4b39770c
WS
440
441
78c49c58
MB
442\membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize}
443
444\func{void}{DisableDragRowSize}{\void}
445
4b39770c
WS
446Disables row sizing by dragging with the mouse. Equivalent to passing false to
447\helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}.
448
449
78c49c58
MB
450
451\membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol}
452
cc81d32f 453\func{void}{EnableCellEditControl}{\param{bool }{enable = true}}
78c49c58
MB
454
455Enables or disables in-place editing of grid cell data. The grid will issue either a
e7240349 456wxEVT\_GRID\_EDITOR\_SHOWN or wxEVT\_GRID\_EDITOR\_HIDDEN event.
78c49c58 457
4b39770c
WS
458
459
78c49c58
MB
460\membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize}
461
cc81d32f 462\func{void}{EnableDragColSize}{\param{bool }{enable = true}}
a660d684 463
78c49c58
MB
464Enables or disables column sizing by dragging with the mouse.
465
4b39770c
WS
466
467
d4175745
VZ
468\membersection{wxGrid::EnableDragColMove}\label{wxgridenabledragcolmove}
469
470\func{void}{EnableDragColMove}{\param{bool }{enable = true}}
471
472Enables or disables column moving by dragging with the mouse.
473
474
475
78c49c58
MB
476\membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize}
477
cc81d32f 478\func{void}{EnableDragGridSize}{\param{bool }{enable = true}}
78c49c58
MB
479
480Enables or disables row and column resizing by dragging gridlines with the mouse.
481
4b39770c
WS
482
483
78c49c58
MB
484\membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize}
485
cc81d32f 486\func{void}{EnableDragRowSize}{\param{bool }{enable = true}}
78c49c58
MB
487
488Enables or disables row sizing by dragging with the mouse.
489
4b39770c
WS
490
491
78c49c58
MB
492\membersection{wxGrid::EnableEditing}\label{wxgridenableediting}
493
494\func{void}{EnableEditing}{\param{bool }{edit}}
495
cc81d32f
VS
496If the edit argument is false this function sets the whole grid as read-only. If the
497argument is true the grid is set to the default state where cells may be editable. In the
78c49c58 498default state you can set single grid cells and whole rows and columns to be editable or
4b39770c 499read-only via
78c49c58 500\helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single
4b39770c
WS
501cells you can also use the shortcut function
502\helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}.
78c49c58 503
4b39770c
WS
504For more information about controlling grid cell attributes see the
505\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
78c49c58
MB
506\helpref{wxGrid classes overview}{gridoverview}.
507
4b39770c
WS
508
509
78c49c58
MB
510\membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines}
511
cc81d32f 512\func{void}{EnableGridLines}{\param{bool }{enable = true}}
78c49c58
MB
513
514Turns the drawing of grid lines on or off.
a660d684 515
4b39770c
WS
516
517
a660d684
KB
518\membersection{wxGrid::EndBatch}\label{wxgridendbatch}
519
520\func{void}{EndBatch}{\void}
521
78c49c58 522Decrements the grid's batch count. When the count is greater than zero repainting of
4b39770c 523the grid is suppressed. Each previous call to
78c49c58
MB
524\helpref{wxGrid::BeginBatch}{wxgridbeginbatch} must be matched by a later call to
525EndBatch. Code that does a lot of grid modification can be enclosed between
526BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
527cause the grid to be repainted.
528
b62f94ff
VZ
529\wxheading{See also}
530
531\helpref{wxGridUpdateLocker}{wxgridupdatelocker}
532
4b39770c
WS
533
534
608754c4
JS
535\membersection{wxGrid::Fit}\label{wxgridfit}
536
537\func{void}{Fit}{\void}
538
539Overridden wxWindow method.
540
4b39770c
WS
541
542
78c49c58 543\membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh}
a660d684 544
78c49c58
MB
545\func{void}{ForceRefresh}{\void}
546
547Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
a660d684 548
4b39770c
WS
549
550
a660d684
KB
551\membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}
552
ef316e23 553\constfunc{int}{GetBatchCount}{\void}
a660d684 554
78c49c58
MB
555Returns the number of times that \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} has been called
556without (yet) matching calls to \helpref{wxGrid::EndBatch}{wxgridendbatch}. While
557the grid's batch count is greater than zero the display will not be updated.
a660d684 558
4b39770c
WS
559
560
78c49c58 561\membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}
a660d684 562
ef316e23 563\constfunc{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}}
a660d684 564
78c49c58
MB
565Sets the arguments to the horizontal and vertical text alignment values for the
566grid cell at the specified location.
a660d684 567
e7240349
GT
568Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
569Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
a660d684 570
9722642d
MB
571\perlnote{This method only takes the parameters {\tt row} and {\tt col} and
572returns a 2-element list {\tt ( horiz, vert )}.}
573
4b39770c
WS
574
575
78c49c58 576\membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}
a660d684 577
ef316e23 578\constfunc{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}}
a660d684 579
78c49c58 580Returns the background colour of the cell at the specified location.
a660d684 581
4b39770c
WS
582
583
78c49c58 584\membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor}
a660d684 585
ef316e23 586\constfunc{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}}
a660d684 587
78c49c58 588Returns a pointer to the editor for the cell at the specified location.
21f280f4 589
78c49c58
MB
590See \helpref{wxGridCellEditor}{wxgridcelleditor} and
591the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
a660d684 592
4b39770c
WS
593
594
78c49c58 595\membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont}
a660d684 596
ef316e23 597\constfunc{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}}
a660d684 598
78c49c58 599Returns the font for text in the grid cell at the specified location.
a660d684 600
4b39770c
WS
601
602
78c49c58 603\membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer}
21f280f4 604
ef316e23 605\constfunc{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}}
a660d684 606
78c49c58 607Returns a pointer to the renderer for the grid cell at the specified location.
a660d684 608
78c49c58
MB
609See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
610the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
a660d684 611
4b39770c
WS
612
613
a660d684
KB
614\membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}
615
ef316e23 616\constfunc{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}}
a660d684 617
78c49c58 618Returns the text colour for the grid cell at the specified location.
a660d684 619
4b39770c
WS
620
621
5c69031c
MB
622\membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue}
623
ef316e23 624\constfunc{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}}
5c69031c 625
ef316e23 626\constfunc{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}}
5c69031c
MB
627
628Returns the string contained in the cell at the specified location. For simple applications where a
629grid object automatically uses a default grid table of string values you use this function together
4b39770c 630with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values.
5c69031c
MB
631
632For more complex applications where you have derived your own grid table class that contains
633various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
4b39770c 634function for those cells that contain string values.
5c69031c
MB
635
636See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas}
637and the \helpref{wxGrid overview}{gridoverview} for more information.
638
608754c4 639
4b39770c 640
d4175745
VZ
641\membersection{wxGrid::GetColAt}\label{wxgridgetcolat}
642
643\constfunc{int}{GetColAt}{\param{int }{colPos}}
644
645Returns the column ID of the specified column position.
646
647
608754c4
JS
648\membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft}
649
650\constfunc{int}{GetColLeft}{\param{int }{col}}
651
4b39770c
WS
652
653
78c49c58 654\membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment}
a660d684 655
ef316e23 656\constfunc{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
21f280f4 657
78c49c58 658Sets the arguments to the current column label alignment values.
a660d684 659
ce994095
JS
660Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.\\
661Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
a660d684 662
9722642d
MB
663\perlnote{This method takes no parameters and
664returns a 2-element list {\tt ( horiz, vert )}.}
665
4b39770c
WS
666
667
78c49c58 668\membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize}
a660d684 669
ef316e23 670\constfunc{int}{GetColLabelSize}{\void}
a660d684 671
78c49c58 672Returns the current height of the column labels.
21f280f4 673
4b39770c
WS
674
675
78c49c58 676\membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue}
a660d684 677
ef316e23 678\constfunc{wxString}{GetColLabelValue}{\param{int }{col}}
a660d684 679
2edb0bde 680Returns the specified column label. The default grid table class provides column labels of
4b39770c 681the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
78c49c58 682\helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide
4b39770c
WS
683your own labels.
684
685
a660d684 686
608754c4
JS
687\membersection{wxGrid::GetColMinimalAcceptableWidth}\label{wxgridgetcolminimalacceptablewidth}
688
ef316e23 689\constfunc{int}{GetColMinimalAcceptableWidth}{}
608754c4
JS
690
691This returns the value of the lowest column width that can be handled correctly. See
692member \helpref{SetColMinimalAcceptableWidth}{wxgridsetcolminimalacceptablewidth} for details.
693
4b39770c
WS
694
695
608754c4
JS
696\membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth}
697
698\constfunc{int}{GetColMinimalWidth}{\param{int }{col}}
699
700Get the minimal width of the given column/row.
701
702
4b39770c 703
d4175745
VZ
704\membersection{wxGrid::GetColPos}\label{wxgridgetcolpos}
705
706\constfunc{int}{GetColPos}{\param{int }{colID}}
707
708Returns the position of the specified column.
709
710
711
608754c4
JS
712\membersection{wxGrid::GetColRight}\label{wxgridgetcolright}
713
714\constfunc{int}{GetColRight}{\param{int }{col}}
715
4b39770c
WS
716
717
78c49c58 718\membersection{wxGrid::GetColSize}\label{wxgridgetcolsize}
a660d684 719
ef316e23 720\constfunc{int}{GetColSize}{\param{int }{col}}
a660d684 721
78c49c58 722Returns the width of the specified column.
a660d684 723
4b39770c
WS
724
725
78c49c58 726\membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment}
a660d684 727
ef316e23 728\constfunc{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
a660d684 729
78c49c58
MB
730Sets the arguments to the current default horizontal and vertical text alignment
731values.
a660d684 732
2eebb742
JS
733Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
734Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
a660d684 735
4b39770c
WS
736
737
78c49c58 738\membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour}
a660d684 739
ef316e23 740\constfunc{wxColour}{GetDefaultCellBackgroundColour}{\void}
a660d684 741
78c49c58 742Returns the current default background colour for grid cells.
a660d684 743
4b39770c
WS
744
745
78c49c58 746\membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont}
a660d684 747
ef316e23 748\constfunc{wxFont}{GetDefaultCellFont}{\void}
a660d684 749
78c49c58 750Returns the current default font for grid cell text.
a660d684 751
4b39770c
WS
752
753
78c49c58 754\membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour}
a660d684 755
ef316e23 756\constfunc{wxColour}{GetDefaultCellTextColour}{\void}
a660d684 757
78c49c58 758Returns the current default colour for grid cell text.
a660d684 759
4b39770c
WS
760
761
78c49c58 762\membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize}
a660d684 763
ef316e23 764\constfunc{int}{GetDefaultColLabelSize}{\void}
a660d684 765
78c49c58 766Returns the default height for column labels.
c0b042fc 767
4b39770c
WS
768
769
78c49c58 770\membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize}
c0b042fc 771
ef316e23 772\constfunc{int}{GetDefaultColSize}{\void}
c0b042fc 773
78c49c58 774Returns the current default width for grid columns.
a660d684 775
4b39770c
WS
776
777
78c49c58 778\membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor}
a660d684 779
78c49c58 780\constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void}
a660d684 781
78c49c58
MB
782Returns a pointer to the current default grid cell editor.
783
784See \helpref{wxGridCellEditor}{wxgridcelleditor} and
785the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
786
4b39770c
WS
787
788
608754c4
JS
789\membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell}
790
791\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}}
792
793\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}}
794
795
4b39770c 796
608754c4
JS
797\membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype}
798
799\constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}}
800
801
4b39770c 802
78c49c58
MB
803\membersection{wxGrid::GetDefaultRenderer}\label{wxgridgetdefaultrenderer}
804
805\constfunc{wxGridCellRenderer*}{GetDefaultRenderer}{\void}
806
807Returns a pointer to the current default grid cell renderer.
808
809See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
810the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
a660d684 811
4b39770c
WS
812
813
608754c4
JS
814\membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell}
815
816\constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}}
817
4b39770c
WS
818
819
608754c4
JS
820\membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype}
821
822\constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}}
823
824
825
78c49c58 826\membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize}
a660d684 827
ef316e23 828\constfunc{int}{GetDefaultRowLabelSize}{\void}
78c49c58
MB
829
830Returns the default width for the row labels.
831
4b39770c
WS
832
833
78c49c58
MB
834\membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize}
835
ef316e23 836\constfunc{int}{GetDefaultRowSize}{\void}
78c49c58
MB
837
838Returns the current default height for grid rows.
839
4b39770c
WS
840
841
78c49c58
MB
842\membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol}
843
ef316e23 844\constfunc{int}{GetGridCursorCol}{\void}
78c49c58
MB
845
846Returns the current grid cell column position.
847
4b39770c
WS
848
849
78c49c58
MB
850\membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow}
851
ef316e23 852\constfunc{int}{GetGridCursorRow}{\void}
78c49c58
MB
853
854Returns the current grid cell row position.
855
4b39770c
WS
856
857
78c49c58
MB
858\membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour}
859
ef316e23 860\constfunc{wxColour}{GetGridLineColour}{\void}
78c49c58
MB
861
862Returns the colour used for grid lines.
863
3d3f3e37
VZ
864\wxheading{See also}
865
866\helpref{GetDefaultGridLinePen()}{wxgridgetdefaultgridlinepen}
867
868
869\membersection{wxGrid::GetDefaultGridLinePen}\label{wxgridgetdefaultgridlinepen}
870
871\func{wxPen}{GetDefaultGridLinePen}{\void}
872
873Returns the pen used for grid lines. This virtual function may be overridden in
874derived classes in order to change the appearance of grid lines. Note that
875currently the pen width must be $1$.
876
877\wxheading{See also}
878
879\helpref{GetColGridLinePen()}{wxgridgetcolgridlinepen},\\
880\helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen}
881
882
883
884
885\membersection{wxGrid::GetRowGridLinePen}\label{wxgridgetrowgridlinepen}
886
887\func{wxPen}{GetRowGridLinePen}{\param{int }{row}}
888
889Returns the pen used for horizontal grid lines. This virtual function may be
890overridden in derived classes in order to change the appearance of individual
891grid line for the given row \arg{row}.
892
893Example: \\
894\\
895\begin{verbatim}
896 // in a grid displaying music notation, use a solid black pen between
897 // octaves (C0=row 127, C1=row 115 etc.)
898 wxPen MidiGrid::GetRowGridLinePen(int row)
899 {
900 if ( row%12 == 7 )
901 return wxPen(*wxBLACK, 1, wxSOLID);
902 else
903 return GetDefaultGridLinePen();
904 }
905\end{verbatim}
906
907
908
909\membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen}
910
911\func{wxPen}{GetColGridLinePen}{\param{int }{col}}
912
913Returns the pen used for vertical grid lines. This virtual function may be
914overridden in derived classes in order to change the appearance of individual
915grid lines for the given column \arg{col}.
916
917See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example.
918
919
4b39770c
WS
920
921
78c49c58
MB
922\membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}
923
ef316e23 924\constfunc{bool}{GridLinesEnabled}{\void}
78c49c58 925
cc81d32f 926Returns true if drawing of grid lines is turned on, false otherwise.
a660d684 927
4b39770c
WS
928
929
a660d684
KB
930\membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
931
ef316e23 932\constfunc{wxColour}{GetLabelBackgroundColour}{\void}
a660d684 933
78c49c58 934Returns the colour used for the background of row and column labels.
a660d684 935
4b39770c
WS
936
937
78c49c58 938\membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
a660d684 939
ef316e23 940\constfunc{wxFont}{GetLabelFont}{\void}
a660d684 941
78c49c58 942Returns the font used for row and column labels.
a660d684 943
4b39770c
WS
944
945
a660d684
KB
946\membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
947
ef316e23 948\constfunc{wxColour}{GetLabelTextColour}{\void}
a660d684 949
78c49c58 950Returns the colour used for row and column label text.
a660d684 951
4b39770c
WS
952
953
78c49c58 954\membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
a660d684 955
ef316e23 956\constfunc{int}{GetNumberCols}{\void}
a660d684 957
78c49c58
MB
958Returns the total number of grid columns (actually the number of columns in the underlying grid
959table).
a660d684 960
4b39770c
WS
961
962
78c49c58 963\membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
a660d684 964
ef316e23 965\constfunc{int}{GetNumberRows}{\void}
a660d684 966
78c49c58 967Returns the total number of grid rows (actually the number of rows in the underlying grid table).
a660d684 968
4b39770c
WS
969
970
608754c4
JS
971\membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
972
973\constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}
974
4b39770c
WS
975
976
608754c4
JS
977\membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}
978
ef316e23 979\constfunc{int}{GetRowMinimalAcceptableHeight}{}
608754c4
JS
980
981This returns the value of the lowest row width that can be handled correctly. See
982member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.
983
984
4b39770c 985
608754c4
JS
986\membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
987
988\constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
989
4b39770c
WS
990
991
78c49c58 992\membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
a660d684 993
ef316e23 994\constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
a660d684 995
78c49c58 996Sets the arguments to the current row label alignment values.
a660d684 997
78c49c58
MB
998Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
999Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
a660d684 1000
9722642d
MB
1001\perlnote{This method takes no parameters and
1002returns a 2-element list {\tt ( horiz, vert )}.}
1003
4b39770c
WS
1004
1005
78c49c58 1006\membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
a660d684 1007
ef316e23 1008\constfunc{int}{GetRowLabelSize}{\void}
a660d684 1009
78c49c58 1010Returns the current width of the row labels.
a660d684 1011
4b39770c
WS
1012
1013
78c49c58 1014\membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
a660d684 1015
ef316e23 1016\constfunc{wxString}{GetRowLabelValue}{\param{int }{row}}
a660d684 1017
2edb0bde 1018Returns the specified row label. The default grid table class provides numeric row labels.
4b39770c 1019If you are using a custom grid table you can override
78c49c58 1020\helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
4b39770c
WS
1021your own labels.
1022
1023
a660d684 1024
78c49c58 1025\membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
a660d684 1026
ef316e23 1027\constfunc{int}{GetRowSize}{\param{int }{row}}
a660d684 1028
78c49c58 1029Returns the height of the specified row.
a660d684 1030
608754c4 1031
4b39770c
WS
1032
1033\membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex}
1034
1035\constfunc{int}{GetScrollLineX}{\void}
608754c4
JS
1036
1037Returns the number of pixels per horizontal scroll increment. The default is 15.
1038
4b39770c
WS
1039\wxheading{See also}
1040
1041\helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1042\helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1043\helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1044
608754c4 1045
4b39770c
WS
1046
1047\membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney}
1048
1049\constfunc{int}{GetScrollLineY}{\void}
608754c4
JS
1050
1051Returns the number of pixels per vertical scroll increment. The default is 15.
1052
4b39770c
WS
1053\wxheading{See also}
1054
1055\helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1056\helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1057\helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1058
1059
1060
aa5b8857
SN
1061\membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}
1062
1063\constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}
1064
1065Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.
1066
4b39770c
WS
1067
1068
aa5b8857
SN
1069\membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}
1070
1071\constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}
1072
1073Returns an array of singly selected cells.
1074
4b39770c
WS
1075
1076
aa5b8857
SN
1077\membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}
1078
1079\constfunc{wxArrayInt}{GetSelectedCols}{\void}
1080
1081Returns an array of selected cols.
1082
4b39770c
WS
1083
1084
aa5b8857
SN
1085\membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}
1086
1087\constfunc{wxArrayInt}{GetSelectedRows}{\void}
1088
1089Returns an array of selected rows.
1090
4b39770c
WS
1091
1092
608754c4
JS
1093\membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
1094
1095\constfunc{wxColour}{GetSelectionBackground}{\void}
1096
1097Access or update the selection fore/back colours
1098
1099
4b39770c 1100
aa5b8857
SN
1101\membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}
1102
1103\constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}
1104
4b39770c 1105Returns an array of the top left corners of blocks of selected cells,
aa5b8857
SN
1106see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.
1107
4b39770c
WS
1108
1109
aa5b8857
SN
1110\membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}
1111
1112\constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}
1113
1114Returns an array of the bottom right corners of blocks of selected cells,
1115see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.
1116
4b39770c
WS
1117
1118
608754c4
JS
1119\membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
1120
1121\constfunc{wxColour}{GetSelectionForeground}{\void}
1122
1123
4b39770c 1124
78c49c58 1125\membersection{wxGrid::GetTable}\label{wxgridgettable}
a660d684 1126
78c49c58 1127\constfunc{wxGridTableBase *}{GetTable}{\void}
a660d684 1128
78c49c58 1129Returns a base pointer to the current table object.
a660d684 1130
4b39770c
WS
1131
1132
608754c4
JS
1133\membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
1134
ef316e23 1135\constfunc{int}{GetViewWidth}{\void}
608754c4
JS
1136
1137Returned number of whole cols visible.
1138
4b39770c
WS
1139
1140
78c49c58 1141\membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
a660d684 1142
78c49c58
MB
1143\func{void}{HideCellEditControl}{\void}
1144
1145Hides the in-place cell edit control.
a660d684 1146
4b39770c
WS
1147
1148
608754c4
JS
1149\membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
1150
1151\func{void}{InitColWidths}{\void}
1152
1153Init the m\_colWidths/Rights arrays
1154
4b39770c
WS
1155
1156
608754c4
JS
1157\membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
1158
1159\func{void}{InitRowHeights}{\void}
1160
1161NB: {\it never} access m\_row/col arrays directly because they are created
1162on demand, {\it always} use accessor functions instead!
1163
1164Init the m\_rowHeights/Bottoms arrays with default values.
1165
4b39770c
WS
1166
1167
a660d684
KB
1168\membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
1169
cc81d32f 1170\func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
78c49c58
MB
1171
1172Inserts one or more new columns into a grid with the first new column at the
cc81d32f 1173specified position and returns true if successful. The updateLabels argument is not
4b39770c 1174used at present.
a660d684 1175
78c49c58
MB
1176The sequence of actions begins with the grid object requesting the underlying grid
1177table to insert new columns. If this is successful the table notifies the grid and the
d4175745 1178grid updates the display. For a default grid (one where you have called
78c49c58 1179\helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
4b39770c 1180using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
d4175745 1181then you must override
78c49c58
MB
1182\helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
1183table class.
a660d684 1184
4b39770c
WS
1185
1186
a660d684
KB
1187\membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
1188
cc81d32f 1189\func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
a660d684 1190
78c49c58 1191Inserts one or more new rows into a grid with the first new row at the specified
cc81d32f 1192position and returns true if successful. The updateLabels argument is not used at
4b39770c 1193present.
a660d684 1194
78c49c58
MB
1195The sequence of actions begins with the grid object requesting the underlying grid
1196table to insert new rows. If this is successful the table notifies the grid and the
d4175745 1197grid updates the display. For a default grid (one where you have called
78c49c58 1198\helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
4b39770c 1199using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
d4175745 1200then you must override
78c49c58
MB
1201\helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
1202table class.
1203
4b39770c
WS
1204
1205
78c49c58
MB
1206\membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}
1207
1208\constfunc{bool}{IsCellEditControlEnabled}{\void}
1209
cc81d32f 1210Returns true if the in-place edit control is currently enabled.
78c49c58 1211
4b39770c
WS
1212
1213
78c49c58
MB
1214\membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}
1215
1216\constfunc{bool}{IsCurrentCellReadOnly}{\void}
1217
cc81d32f 1218Returns true if the current cell has been set to read-only
78c49c58
MB
1219(see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).
1220
4b39770c
WS
1221
1222
78c49c58 1223\membersection{wxGrid::IsEditable}\label{wxgridiseditable}
a660d684 1224
ef316e23 1225\constfunc{bool}{IsEditable}{\void}
a660d684 1226
cc81d32f 1227Returns false if the whole grid has been set as read-only or true otherwise.
78c49c58
MB
1228See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
1229controlling the editing status of grid cells.
a660d684 1230
4b39770c
WS
1231
1232
aa5b8857
SN
1233\membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
1234
1235\constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
1236
1237\constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
1238
1239Is this cell currently selected.
1240
4b39770c
WS
1241
1242
5c69031c
MB
1243\membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}
1244
1245\constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}
1246
cc81d32f 1247Returns true if the cell at the specified location can't be edited.
5c69031c
MB
1248See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1249
4b39770c
WS
1250
1251
5c69031c
MB
1252\membersection{wxGrid::IsSelection}\label{wxgridisselection}
1253
ef316e23 1254\constfunc{bool}{IsSelection}{\void}
5c69031c 1255
cc81d32f 1256Returns true if there are currently rows, columns or blocks of cells selected.
5c69031c 1257
4b39770c
WS
1258
1259
78c49c58 1260\membersection{wxGrid::IsVisible}\label{wxgridisvisible}
a660d684 1261
ef316e23 1262\constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}
a660d684 1263
ef316e23 1264\constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}
a660d684 1265
cc81d32f 1266Returns true if a cell is either wholly visible (the default) or at least partially
78c49c58 1267visible in the grid window.
a660d684 1268
4b39770c
WS
1269
1270
78c49c58 1271\membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
a660d684 1272
78c49c58 1273\func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
a660d684 1274
78c49c58 1275\func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
a660d684 1276
78c49c58 1277Brings the specified cell into the visible grid cell area with minimal scrolling. Does
4b39770c
WS
1278nothing if the cell is already visible.
1279
1280
a660d684 1281
78c49c58 1282\membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
a660d684 1283
78c49c58 1284\func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
a660d684 1285
2eebb742 1286Moves the grid cursor down by one row. If a block of cells was previously selected it
cc81d32f 1287will expand if the argument is true or be cleared if the argument is false.
a660d684 1288
78c49c58
MB
1289\wxheading{Keyboard}\\
1290This function is called for Down cursor key presses or Shift+Down to expand a selection.
a660d684 1291
4b39770c
WS
1292
1293
78c49c58 1294\membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
a660d684 1295
78c49c58 1296\func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
a660d684 1297
78c49c58 1298Moves the grid cursor left by one column. If a block of cells was previously selected it
cc81d32f 1299will expand if the argument is true or be cleared if the argument is false.
a660d684 1300
78c49c58
MB
1301\wxheading{Keyboard}\\
1302This function is called for Left cursor key presses or Shift+Left to expand a selection.
a660d684 1303
4b39770c
WS
1304
1305
78c49c58 1306\membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
a660d684 1307
78c49c58 1308\func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
a660d684 1309
78c49c58 1310Moves the grid cursor right by one column. If a block of cells was previously selected it
cc81d32f 1311will expand if the argument is true or be cleared if the argument is false.
a660d684 1312
78c49c58
MB
1313\wxheading{Keyboard}\\
1314This function is called for Right cursor key presses or Shift+Right to expand a selection.
a660d684 1315
4b39770c
WS
1316
1317
78c49c58 1318\membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
a660d684 1319
78c49c58 1320\func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
a660d684 1321
78c49c58 1322Moves the grid cursor up by one row. If a block of cells was previously selected it
cc81d32f 1323will expand if the argument is true or be cleared if the argument is false.
a660d684 1324
78c49c58
MB
1325\wxheading{Keyboard}\\
1326This function is called for Up cursor key presses or Shift+Up to expand a selection.
a660d684 1327
4b39770c
WS
1328
1329
78c49c58 1330\membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
a660d684 1331
78c49c58 1332\func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
a660d684 1333
78c49c58
MB
1334Moves the grid cursor down in the current column such that it skips to the beginning or
1335end of a block of non-empty cells. If a block of cells was previously selected it
cc81d32f 1336will expand if the argument is true or be cleared if the argument is false.
a660d684 1337
78c49c58
MB
1338\wxheading{Keyboard}\\
1339This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
a660d684 1340
4b39770c
WS
1341
1342
78c49c58 1343\membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
a660d684 1344
78c49c58 1345\func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
a660d684 1346
78c49c58
MB
1347Moves the grid cursor left in the current row such that it skips to the beginning or
1348end of a block of non-empty cells. If a block of cells was previously selected it
cc81d32f 1349will expand if the argument is true or be cleared if the argument is false.
a660d684 1350
78c49c58
MB
1351\wxheading{Keyboard}\\
1352This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
a660d684 1353
4b39770c
WS
1354
1355
78c49c58
MB
1356\membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}
1357
1358\func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}
1359
1360Moves the grid cursor right in the current row such that it skips to the beginning or
1361end of a block of non-empty cells. If a block of cells was previously selected it
cc81d32f 1362will expand if the argument is true or be cleared if the argument is false.
78c49c58
MB
1363
1364\wxheading{Keyboard}\\
1365This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1366
4b39770c
WS
1367
1368
78c49c58
MB
1369\membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}
1370
1371\func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}
1372
1373Moves the grid cursor up in the current column such that it skips to the beginning or
1374end of a block of non-empty cells. If a block of cells was previously selected it
cc81d32f 1375will expand if the argument is true or be cleared if the argument is false.
78c49c58
MB
1376
1377\wxheading{Keyboard}\\
1378This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1379
4b39770c
WS
1380
1381
78c49c58
MB
1382\membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}
1383
1384\func{bool}{MovePageDown}{\void}
1385
1386Moves the grid cursor down by some number of rows so that the previous bottom visible row
1387becomes the top visible row.
1388
1389\wxheading{Keyboard}\\
1390This function is called for PgDn keypresses.
1391
4b39770c
WS
1392
1393
78c49c58
MB
1394\membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}
1395
1396\func{bool}{MovePageUp}{\void}
1397
1398Moves the grid cursor up by some number of rows so that the previous top visible row
1399becomes the bottom visible row.
1400
1401\wxheading{Keyboard}\\
1402This function is called for PgUp keypresses.
1403
4b39770c
WS
1404
1405
608754c4
JS
1406\membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1407
1408\func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1409
1410Methods for a registry for mapping data types to Renderers/Editors
1411
4b39770c
WS
1412
1413
78c49c58
MB
1414\membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}
1415
1416\func{void}{SaveEditControlValue}{\void}
1417
1418Sets the value of the current grid cell to the current in-place edit control value.
1419This is called automatically when the grid cursor moves from the current cell to a
1420new cell. It is also a good idea to call this function when closing a grid since
1421any edits to the final cell location will not be saved otherwise.
a660d684 1422
4b39770c
WS
1423
1424
5c69031c
MB
1425\membersection{wxGrid::SelectAll}\label{wxgridselectall}
1426
1427\func{void}{SelectAll}{\void}
1428
1429Selects all cells in the grid.
1430
4b39770c
WS
1431
1432
5c69031c
MB
1433\membersection{wxGrid::SelectBlock}\label{wxgridselectblock}
1434
4b39770c 1435\func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
cc81d32f 1436\param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}
5c69031c 1437
4b39770c 1438\func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
cc81d32f 1439\param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}
5c69031c 1440
cc81d32f 1441Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
4b39770c
WS
1442deselected; if true the column will be added to the existing selection.
1443
1444
5c69031c
MB
1445
1446\membersection{wxGrid::SelectCol}\label{wxgridselectcol}
1447
cc81d32f 1448\func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}
5c69031c 1449
cc81d32f
VS
1450Selects the specified column. If addToSelected is false then any existing selection will be
1451deselected; if true the column will be added to the existing selection.
5c69031c 1452
4b39770c
WS
1453
1454
608754c4
JS
1455\membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1456
ef316e23 1457\constfunc{wxRect}{SelectionToDeviceRect}{\void}
608754c4
JS
1458
1459This function returns the rectangle that encloses the selected cells
1460in device coords and clipped to the client size of the grid window.
1461
1462
4b39770c 1463
5c69031c
MB
1464\membersection{wxGrid::SelectRow}\label{wxgridselectrow}
1465
cc81d32f 1466\func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}
5c69031c 1467
cc81d32f
VS
1468Selects the specified row. If addToSelected is false then any existing selection will be
1469deselected; if true the row will be added to the existing selection.
5c69031c 1470
4b39770c
WS
1471
1472
a660d684
KB
1473\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1474
78c49c58 1475\func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
a660d684 1476
2eebb742
JS
1477\func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1478
2edb0bde 1479Sets the horizontal and vertical alignment for grid cell text at the specified location.
a660d684 1480
e7240349
GT
1481Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
1482Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
a660d684 1483
4b39770c
WS
1484
1485
608754c4
JS
1486\membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1487
1488\func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1489
1490
4b39770c 1491
78c49c58 1492\membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
21f280f4 1493
78c49c58
MB
1494\func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
1495
4b39770c 1496Sets the editor for the grid cell at the specified location.
78c49c58
MB
1497The grid will take ownership of the pointer.
1498
1499See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1500the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1501
4b39770c
WS
1502
1503
78c49c58
MB
1504\membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
1505
deea56b1 1506\func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}
78c49c58
MB
1507
1508Sets the font for text in the grid cell at the specified location.
a660d684 1509
4b39770c
WS
1510
1511
78c49c58 1512\membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
a660d684 1513
78c49c58 1514\func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
a660d684 1515
4b39770c 1516Sets the renderer for the grid cell at the specified location.
78c49c58 1517The grid will take ownership of the pointer.
a660d684 1518
78c49c58
MB
1519See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1520the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
21f280f4 1521
4b39770c
WS
1522
1523
a660d684
KB
1524\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1525
68f30f26 1526\func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
a660d684 1527
2eebb742
JS
1528\func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1529
deea56b1 1530\func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}
2eebb742 1531
78c49c58 1532Sets the text colour for the grid cell at the specified location.
a660d684 1533
4b39770c
WS
1534
1535
5c69031c
MB
1536\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1537
1538\func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
1539
1540\func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
1541
2eebb742
JS
1542\func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1543
5c69031c
MB
1544Sets the string value for the cell at the specified location. For simple applications where a
1545grid object automatically uses a default grid table of string values you use this function together
4b39770c 1546with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
5c69031c
MB
1547
1548For more complex applications where you have derived your own grid table class that contains
1549various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
2eebb742
JS
1550function for those cells that contain string values.
1551
1552The last form is for backward compatibility only.
5c69031c 1553
d4175745 1554See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
5c69031c
MB
1555and the \helpref{wxGrid overview}{gridoverview} for more information.
1556
4b39770c
WS
1557
1558
78c49c58 1559\membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
a660d684 1560
78c49c58 1561\func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
21f280f4 1562
78c49c58 1563Sets the cell attributes for all cells in the specified column.
a660d684 1564
d4175745
VZ
1565For more information about controlling grid cell attributes see the
1566\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
78c49c58 1567\helpref{wxGrid classes overview}{gridoverview}.
a660d684 1568
4b39770c
WS
1569
1570
78c49c58 1571\membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
a660d684 1572
78c49c58 1573\func{void}{SetColFormatBool}{\param{int }{col}}
a660d684 1574
78c49c58 1575Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
21f280f4 1576
4b39770c
WS
1577
1578
78c49c58 1579\membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
a660d684 1580
78c49c58 1581\func{void}{SetColFormatNumber}{\param{int }{col}}
a660d684 1582
78c49c58 1583Sets the specified column to display integer values.
a660d684 1584
4b39770c
WS
1585
1586
78c49c58 1587\membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
a660d684 1588
78c49c58 1589\func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
a660d684 1590
78c49c58 1591Sets the specified column to display floating point values with the given width and precision.
a660d684 1592
4b39770c
WS
1593
1594
78c49c58 1595\membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
a660d684 1596
78c49c58 1597\func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
a660d684 1598
78c49c58
MB
1599Sets the specified column to display data in a custom format.
1600See the \helpref{wxGrid overview}{gridoverview} for more information on working
1601with custom data types.
a660d684 1602
4b39770c
WS
1603
1604
78c49c58 1605\membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
a660d684 1606
78c49c58 1607\func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
a660d684 1608
78c49c58 1609Sets the horizontal and vertical alignment of column label text.
a660d684 1610
e7240349 1611Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
deea56b1 1612
e7240349 1613Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
78c49c58 1614
4b39770c
WS
1615
1616
78c49c58
MB
1617\membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
1618
1619\func{void}{SetColLabelSize}{\param{int }{height}}
1620
1621Sets the height of the column labels.
1622
c76f52c9 1623If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically
733f486a
VZ
1624so that no label is truncated. Note that this could be slow for a large table.
1625
4b39770c
WS
1626
1627
78c49c58
MB
1628\membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
1629
deea56b1 1630\func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}
78c49c58 1631
4b39770c 1632Set the value for the given column label. If you are using a derived grid table you must
78c49c58
MB
1633override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
1634for this to have any effect.
1635
4b39770c
WS
1636
1637
78c49c58
MB
1638\membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
1639
1640\func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
1641
1642Sets the minimal width for the specified column. This should normally be called when creating the grid
1643because it will not resize a column that is already narrower than the minimal width.
b8d24d4e
RG
1644The width argument must be higher than the minimimal acceptable column width, see
1645\helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.
1646
4b39770c
WS
1647
1648
b8d24d4e
RG
1649\membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}
1650
1651\func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}
1652
1653This modifies the minimum column width that can be handled correctly. Specifying a low value here
1654allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1655than the actual minimum size will incur a performance penalty in the functions which perform
1656grid cell index lookup on the basis of screen coordinates.
1657This should normally be called when creating the grid because it will not resize existing columns
4b39770c
WS
1658with sizes smaller than the value specified here.
1659
1660
b8d24d4e 1661
d4175745
VZ
1662\membersection{wxGrid::SetColPos}\label{wxgridsetcolpos}
1663
1664\func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}}
1665
1666Sets the position of the specified column.
1667
1668
1669
78c49c58
MB
1670\membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
1671
1672\func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
1673
4b39770c 1674Sets the width of the specified column.
78c49c58
MB
1675
1676This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
4b39770c 1677block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
78c49c58 1678
cc81d32f 1679Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
78c49c58
MB
1680also be set as the minimal width for the column.
1681
2eebb742 1682\wxheading{Note}\\
78c49c58 1683wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c
WS
1684The memory requirements for this could become prohibitive if your grid is very large.
1685
1686
78c49c58
MB
1687
1688\membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1689
1690\func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1691
2edb0bde 1692Sets the default horizontal and vertical alignment for grid cell text.
78c49c58 1693
e7240349 1694Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
deea56b1 1695
e7240349 1696Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
78c49c58 1697
4b39770c
WS
1698
1699
78c49c58
MB
1700\membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1701
deea56b1 1702\func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}
78c49c58
MB
1703
1704Sets the default background colour for grid cells.
1705
4b39770c
WS
1706
1707
78c49c58
MB
1708\membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1709
deea56b1 1710\func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}
78c49c58
MB
1711
1712Sets the default font to be used for grid cell text.
1713
4b39770c
WS
1714
1715
f6bb64a6
JS
1716\membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}
1717
1718\func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}
1719
1720Sets the current default colour for grid cell text.
1721
4b39770c
WS
1722
1723
78c49c58
MB
1724\membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1725
1726\func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1727
1728Sets the default editor for grid cells. The grid will take ownership of the pointer.
1729
1730See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1731the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1732
4b39770c
WS
1733
1734
78c49c58
MB
1735\membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1736
1737\func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1738
1739Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1740
1741See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1742the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1743
4b39770c
WS
1744
1745
78c49c58 1746\membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
c0b042fc 1747
cc81d32f 1748\func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}
c0b042fc 1749
78c49c58 1750Sets the default width for columns in the grid. This will only affect columns subsequently added to
4b39770c
WS
1751the grid unless resizeExistingCols is true.
1752
1753
78c49c58
MB
1754
1755\membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1756
cc81d32f 1757\func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}
78c49c58
MB
1758
1759Sets the default height for rows in the grid. This will only affect rows subsequently added
cc81d32f 1760to the grid unless resizeExistingRows is true.
c0b042fc 1761
4b39770c
WS
1762
1763
a660d684
KB
1764\membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1765
78c49c58 1766\func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
a660d684 1767
4b39770c 1768Set the grid cursor to the specified cell.
78c49c58 1769This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
a660d684 1770
4b39770c
WS
1771
1772
78c49c58 1773\membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
a660d684 1774
deea56b1 1775\func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}
a660d684 1776
78c49c58 1777Sets the colour used to draw grid lines.
a660d684 1778
4b39770c
WS
1779
1780
a660d684
KB
1781\membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1782
deea56b1 1783\func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}
a660d684 1784
78c49c58 1785Sets the background colour for row and column labels.
a660d684 1786
4b39770c
WS
1787
1788
78c49c58 1789\membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
a660d684 1790
deea56b1 1791\func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}
a660d684 1792
78c49c58 1793Sets the font for row and column labels.
a660d684 1794
4b39770c
WS
1795
1796
a660d684
KB
1797\membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1798
deea56b1 1799\func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}
a660d684 1800
78c49c58 1801Sets the colour for row and column label text.
a660d684 1802
4b39770c
WS
1803
1804
608754c4
JS
1805\membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1806
1807\func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1808
1809A grid may occupy more space than needed for its rows/columns. This
1810function allows to set how big this extra space is
1811
4b39770c
WS
1812
1813
608754c4
JS
1814\membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1815
1816\func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1817
1818Common part of AutoSizeColumn/Row() and GetBestSize()
1819
4b39770c
WS
1820
1821
608754c4
JS
1822\membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1823
1824\func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1825
4b39770c
WS
1826
1827
5c69031c
MB
1828\membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1829
cc81d32f 1830\func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}
5c69031c
MB
1831
1832Makes the cell at the specified location read-only or editable.
1833See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1834
4b39770c
WS
1835
1836
78c49c58 1837\membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
a660d684 1838
78c49c58 1839\func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
a660d684 1840
78c49c58
MB
1841Sets the cell attributes for all cells in the specified row.
1842See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1843about controlling cell attributes.
a660d684 1844
4b39770c
WS
1845
1846
78c49c58 1847\membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
a660d684 1848
78c49c58 1849\func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
a660d684 1850
78c49c58 1851Sets the horizontal and vertical alignment of row label text.
a660d684 1852
e7240349 1853Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
deea56b1 1854
e7240349 1855Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
a660d684 1856
4b39770c
WS
1857
1858
78c49c58 1859\membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
a660d684 1860
78c49c58 1861\func{void}{SetRowLabelSize}{\param{int }{width}}
a660d684 1862
78c49c58
MB
1863Sets the width of the row labels.
1864
c76f52c9 1865If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically
733f486a
VZ
1866so that no label is truncated. Note that this could be slow for a large table.
1867
4b39770c
WS
1868
1869
78c49c58
MB
1870\membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
1871
deea56b1 1872\func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}
78c49c58 1873
4b39770c
WS
1874Set the value for the given row label. If you are using a derived grid table you must
1875override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
78c49c58
MB
1876for this to have any effect.
1877
4b39770c
WS
1878
1879
78c49c58
MB
1880\membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
1881
b8d24d4e 1882\func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}
78c49c58
MB
1883
1884Sets the minimal height for the specified row. This should normally be called when creating the grid
1885because it will not resize a row that is already shorter than the minimal height.
b8d24d4e
RG
1886The height argument must be higher than the minimimal acceptable row height, see
1887\helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.
1888
4b39770c
WS
1889
1890
b8d24d4e
RG
1891\membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}
1892
1893\func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}
1894
1895This modifies the minimum row width that can be handled correctly. Specifying a low value here
1896allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1897than the actual minimum size will incur a performance penalty in the functions which perform
1898grid cell index lookup on the basis of screen coordinates.
1899This should normally be called when creating the grid because it will not resize existing rows
4b39770c
WS
1900with sizes smaller than the value specified here.
1901
1902
b8d24d4e 1903
78c49c58
MB
1904\membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
1905
1906\func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
1907
4b39770c 1908Sets the height of the specified row.
78c49c58
MB
1909
1910This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
4b39770c 1911block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
78c49c58 1912
cc81d32f 1913Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
78c49c58
MB
1914also be set as the minimal width for the column.
1915
deea56b1
JS
1916\wxheading{Note}
1917
78c49c58 1918wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
4b39770c 1919The memory requirements for this could become prohibitive if your grid is very large.
78c49c58 1920
608754c4 1921
4b39770c
WS
1922
1923\membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex}
1924
1925\func{void}{SetScrollLineX}{\param{int }{x}}
608754c4
JS
1926
1927Sets the number of pixels per horizontal scroll increment. The default is 15.
1928Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1929errors: setting this to 1 can help.
1930
4b39770c
WS
1931\wxheading{See also}
1932
1933\helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1934\helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1935\helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1936
608754c4 1937
4b39770c
WS
1938
1939\membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney}
1940
1941\func{void}{SetScrollLineY}{\param{int }{y}}
608754c4
JS
1942
1943Sets the number of pixels per vertical scroll increment. The default is 15.
1944Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1945errors: setting this to 1 can help.
1946
4b39770c
WS
1947\wxheading{See also}
1948
1949\helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1950\helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1951\helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex}
1952
1953
1954
608754c4
JS
1955\membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
1956
1957\func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
1958
1959
4b39770c 1960
608754c4
JS
1961\membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
1962
1963\func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
1964
1965
4b39770c 1966
78c49c58
MB
1967\membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
1968
deea56b1 1969\func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}
78c49c58
MB
1970
1971Set the selection behaviour of the grid.
1972
1973\wxheading{Parameters}
1974
1975\docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
1976
deea56b1 1977\docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
78c49c58 1978
f6bb64a6 1979\docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}
78c49c58 1980
4b39770c
WS
1981
1982
78c49c58
MB
1983\membersection{wxGrid::SetTable}\label{wxgridsettable}
1984
cc81d32f 1985\func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
78c49c58 1986
2eebb742 1987Passes a pointer to a custom grid table to be used by the grid. This should be called
78c49c58 1988after the grid constructor and before using the grid object. If takeOwnership is set to
4b39770c 1989true then the table will be deleted by the wxGrid destructor.
78c49c58
MB
1990
1991Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
1992application involves complex or non-string data or data sets that are too large to fit
4b39770c
WS
1993wholly in memory.
1994
1995
78c49c58
MB
1996
1997\membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
1998
1999\func{void}{ShowCellEditControl}{\void}
2000
2001Displays the in-place cell edit control for the current cell.
2002
4b39770c
WS
2003
2004
78c49c58
MB
2005\membersection{wxGrid::XToCol}\label{wxgridxtocol}
2006
ef316e23 2007\constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}}
d4175745
VZ
2008
2009\wxheading{Parameters}
2010\docparam{x}{The x position to evaluate.}
2011\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.}
78c49c58 2012
d4175745
VZ
2013\wxheading{Return value}
2014The grid column that corresponds to the logical x coordinate. Returns
a8d08dbd 2015{\tt wxNOT\_FOUND} if there is no column at the x position.
78c49c58 2016
4b39770c
WS
2017
2018
78c49c58
MB
2019\membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
2020
ef316e23 2021\constfunc{int}{XToEdgeOfCol}{\param{int }{x}}
78c49c58
MB
2022
2023Returns the column whose right hand edge is close to the given logical x position.
a8d08dbd 2024If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.
78c49c58 2025
4b39770c
WS
2026
2027
78c49c58
MB
2028\membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
2029
ef316e23 2030\constfunc{int}{YToEdgeOfRow}{\param{int }{y}}
78c49c58
MB
2031
2032Returns the row whose bottom edge is close to the given logical y position.
a8d08dbd 2033If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.
78c49c58 2034
4b39770c
WS
2035
2036
78c49c58
MB
2037\membersection{wxGrid::YToRow}\label{wxgridytorow}
2038
ef316e23 2039\constfunc{int}{YToRow}{\param{int }{y}}
78c49c58 2040
d4175745 2041Returns the grid row that corresponds to the logical y coordinate. Returns
a8d08dbd 2042{\tt wxNOT\_FOUND} if there is no row at the y position.
095e0f91 2043