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