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