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