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