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