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