]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/grid.tex
Fix "depreciated" to "deprecated".
[wxWidgets.git] / docs / latex / wx / grid.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: grid.tex
3 %% Purpose: wxGrid
4 %% Author:
5 %% Modified by: Santiago Palacios
6 %% Created:
7 %% RCS-ID: $Id$
8 %% Copyright: (c) wxWidgets
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 \section{\class{wxGrid}}\label{wxgrid}
13
14 wxGrid and its related classes are used for displaying and editing tabular
15 data. They provide a rich set of features for display, editing, and
16 interacting with a variety of data sources. For simple applications, and to
17 help you get started, wxGrid is the only class you need to refer to
18 directly. It will set up default instances of the other classes and manage
19 them for you. For more complex applications you can derive your own
20 classes for custom grid views, grid data tables, cell editors and
21 renderers. The \helpref{wxGrid classes overview}{gridoverview} has
22 examples of simple and more complex applications, explains the
23 relationship between the various grid classes and has a summary of the
24 keyboard shortcuts and mouse functions provided by wxGrid.
25
26 wxGrid has been greatly expanded and redesigned for wxWidgets 2.2
27 onwards. If you have been using the old wxGrid class you will probably
28 want to have a look at the \helpref{wxGrid classes overview}{gridoverview} to see
29 how things have changed. The new grid classes are reasonably backward-compatible
30 but there are some exceptions. There are also easier ways of doing many things compared to
31 the previous implementation.
32
33 \wxheading{Derived from}
34
35 \helpref{wxScrolledWindow}{wxscrolledwindow}\\
36 \helpref{wxWindow}{wxwindow}\\
37 \helpref{wxEvtHandler}{wxevthandler}\\
38 \helpref{wxObject}{wxobject}
39
40 \wxheading{Include files}
41
42 <wx/grid.h>
43
44 \wxheading{Window styles}
45
46 There are presently no specific window styles for wxGrid.
47
48 \wxheading{Event handling}
49
50 \input gridevt.inc
51
52 The event handler for the following functions takes a
53 \helpref{wxGridSizeEvent}{wxgridsizeevent} parameter.
54 The ...\_CMD\_... variants also take a window identifier.
55
56 \twocolwidtha{7cm}
57 \begin{twocollist}\itemsep=0pt
58 \twocolitem{{\bf EVT\_GRID\_COL\_SIZE(func)}}{The user resized a column by dragging it. Processes a wxEVT\_GRID\_COL\_SIZE.}
59 \twocolitem{{\bf EVT\_GRID\_ROW\_SIZE(func)}}{The user resized a row by dragging it. Processes a wxEVT\_GRID\_ROW\_SIZE.}
60 \twocolitem{{\bf EVT\_GRID\_CMD\_COL\_SIZE(func)}}{The user resized a column by dragging it; variant taking a window identifier. Processes a wxEVT\_GRID\_COL\_SIZE.}
61 \twocolitem{{\bf EVT\_GRID\_CMD\_ROW\_SIZE(func)}}{The user resized a row by dragging it; variant taking a window identifier. Processes a wxEVT\_GRID\_ROW\_SIZE.}
62 \end{twocollist}%
63
64 The event handler for the following functions takes a
65 \helpref{wxGridRangeSelectEvent}{wxgridrangeselectevent} parameter.
66 The ...\_CMD\_... variant also takes a window identifier.
67
68 \twocolwidtha{7cm}
69 \begin{twocollist}\itemsep=0pt
70 \twocolitem{{\bf EVT\_GRID\_RANGE\_SELECT(func)}}{The user selected a group of contiguous cells. Processes a wxEVT\_GRID\_RANGE\_SELECT.}
71 \twocolitem{{\bf EVT\_GRID\_CMD\_RANGE\_SELECT(id, func)}}{The user selected a group of contiguous cells; variant taking a window identifier. Processes a wxEVT\_GRID\_RANGE\_SELECT.}
72 \end{twocollist}%
73
74 The event handler for the following functions takes a
75 \helpref{wxGridEditorCreatedEvent}{wxgrideditorcreatedevent} parameter.
76 The ...\_CMD\_... variant also takes a window identifier.
77
78 \twocolwidtha{7cm}
79 \begin{twocollist}\itemsep=0pt
80 \twocolitem{{\bf EVT\_GRID\_EDITOR\_CREATED(func)}}{The editor for a cell was created. Processes a wxEVT\_GRID\_EDITOR\_CREATED.}
81 \twocolitem{{\bf EVT\_GRID\_CMD\_EDITOR\_CREATED(id, func)}}{The editor for a cell was created; variant taking a window identifier. Processes a wxEVT\_GRID\_EDITOR\_CREATED.}
82 \end{twocollist}%
83
84 \wxheading{See also}
85
86 \helpref{wxGrid overview}{gridoverview}
87
88 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
89 \latexignore{\rtfignore{\wxheading{Function groups}}}
90
91
92
93 \membersection{Constructors and initialization}\label{wxgridconstructors}
94
95 \helpref{wxGrid}{wxgridctor}\\
96 \helpref{\destruct{wxGrid}}{wxgriddtor}\\
97 \helpref{CreateGrid}{wxgridcreategrid}\\
98 \helpref{SetTable}{wxgridsettable}
99
100
101
102 \membersection{Display format}\label{wxgriddisplayformat}
103
104
105
106 \membersection{Selection functions}\label{wxgridselectionfunctions}
107
108 \helpref{wxGrid::ClearSelection}{wxgridclearselection}\\
109 \helpref{wxGrid::IsSelection}{wxgridisselection}\\
110 \helpref{wxGrid::SelectAll}{wxgridselectall}\\
111 \helpref{wxGrid::SelectBlock}{wxgridselectblock}\\
112 \helpref{wxGrid::SelectCol}{wxgridselectcol}\\
113 \helpref{wxGrid::SelectRow}{wxgridselectrow}
114
115 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
116 \helponly{\insertatlevel{2}{
117
118 \wxheading{Members}
119
120 }}
121
122
123
124 \membersection{wxGrid::wxGrid}\label{wxgridctor}
125
126 \func{}{wxGrid}{\void}
127
128 Default constructor
129
130 \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}}
131
132 Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or
133 \helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using
134 it.
135
136
137
138 \membersection{wxGrid::\destruct{wxGrid}}\label{wxgriddtor}
139
140 \func{}{\destruct{wxGrid}}{\void}
141
142 Destructor. This will also destroy the associated grid table unless you passed a table
143 object to the grid and specified that the grid should not take ownership of the
144 table (see \helpref{wxGrid::SetTable}{wxgridsettable}).
145
146
147
148 \membersection{wxGrid::AppendCols}\label{wxgridappendcols}
149
150 \func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
151
152 Appends one or more new columns to the right of the grid and returns true if
153 successful. The updateLabels argument is not used at present.
154
155 If you are using a derived grid table class you will need to override
156 \helpref{wxGridTableBase::AppendCols}{wxgridtablebaseappendcols}. See
157 \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.
158
159
160
161 \membersection{wxGrid::AppendRows}\label{wxgridappendrows}
162
163 \func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
164
165 Appends one or more new rows to the bottom of the grid and returns true if
166 successful. The updateLabels argument is not used at present.
167
168 If you are using a derived grid table class you will need to override
169 \helpref{wxGridTableBase::AppendRows}{wxgridtablebaseappendrows}. See
170 \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.
171
172
173
174 \membersection{wxGrid::AutoSize}\label{wxgridautosize}
175
176 \func{void}{AutoSize}{\void}
177
178 Automatically sets the height and width of all rows and columns to fit their contents.
179
180 \wxheading{Note}\\
181 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
182 The memory requirements for this could become prohibitive if your grid is very large.
183
184
185
186 \membersection{wxGrid::AutoSizeColLabelSize}\label{wxgridautosizecollabelsize}
187
188 \func{void}{AutoSizeColLabelSize}{\param{int }{col}}
189
190 Automatically adjusts width of the column to fit its label.
191
192
193
194 \membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn}
195
196 \func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = true}}
197
198 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
199 also be set as the minimal width for the column.
200
201 \wxheading{Note}\\
202 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
203 The memory requirements for this could become prohibitive if your grid is very large.
204
205
206
207 \membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns}
208
209 \func{void}{AutoSizeColumns}{\param{bool }{setAsMin = true}}
210
211 Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
212 also be set as the minimal widths for the columns.
213
214 \wxheading{Note}\\
215 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
216 The memory requirements for this could become prohibitive if your grid is very large.
217
218
219
220 \membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow}
221
222 \func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = true}}
223
224 Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
225 also be set as the minimal height for the row.
226
227 \wxheading{Note}\\
228 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
229 The memory requirements for this could become prohibitive if your grid is very large.
230
231
232
233 \membersection{wxGrid::AutoSizeRowLabelSize}\label{wxgridautosizerowlabelsize}
234
235 \func{void}{AutoSizeRowLabelSize}{\param{int }{col}}
236
237 Automatically adjusts height of the row to fit its label.
238
239
240
241 \membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows}
242
243 \func{void}{AutoSizeRows}{\param{bool }{setAsMin = true}}
244
245 Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
246 also be set as the minimal heights for the rows.
247
248 \wxheading{Note}\\
249 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
250 The memory requirements for this could become prohibitive if your grid is very large.
251
252
253
254 \membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch}
255
256 \func{void}{BeginBatch}{\void}
257
258 Increments the grid's batch count. When the count is greater than zero repainting of
259 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
260 \helpref{wxGrid::EndBatch}{wxgridendbatch}. Code that does a lot of grid
261 modification can be enclosed between BeginBatch and EndBatch calls to avoid
262 screen flicker. The final EndBatch will cause the grid to be repainted.
263
264 \wxheading{See also}
265
266 \helpref{wxGridUpdateLocker}{wxgridupdatelocker}
267
268
269
270 \membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect}
271
272 \constfunc{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}}
273
274 This function returns the rectangle that encloses the block of cells
275 limited by TopLeft and BottomRight cell in device coords and clipped
276 to the client size of the grid window.
277
278
279
280 \membersection{wxGrid::CanDragColMove}\label{wxgridcandragcolmove}
281
282 \constfunc{bool}{CanDragColMove}{\void}
283
284 Returns true if columns can be moved by dragging with the mouse. Columns can be moved
285 by dragging on their labels.
286
287
288
289 \membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize}
290
291 \constfunc{bool}{CanDragColSize}{\void}
292
293 Returns true if columns can be resized by dragging with the mouse. Columns can be resized
294 by dragging the edges of their labels. If grid line dragging is enabled they can also be
295 resized by dragging the right edge of the column in the grid cell area
296 (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).
297
298
299
300 \membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize}
301
302 \constfunc{bool}{CanDragRowSize}{\void}
303
304 Returns true if rows can be resized by dragging with the mouse. Rows can be resized
305 by dragging the edges of their labels. If grid line dragging is enabled they can also be
306 resized by dragging the lower edge of the row in the grid cell area
307 (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).
308
309
310
311 \membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize}
312
313 \constfunc{bool}{CanDragGridSize}{\void}
314
315 Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
316
317
318
319 \membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol}
320
321 \constfunc{bool}{CanEnableCellControl}{\void}
322
323 Returns true if the in-place edit control for the current grid cell can be used and
324 false otherwise (e.g. if the current cell is read-only).
325
326
327
328 \membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes}
329
330 \constfunc{bool}{CanHaveAttributes}{\void}
331
332 Do we have some place to store attributes in?
333
334
335
336 \membersection{wxGrid::CellToRect}\label{wxgridcelltorect}
337
338 \constfunc{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}}
339
340 \constfunc{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}}
341
342 Return the rectangle corresponding to the grid cell's size and position in logical
343 coordinates.
344
345
346
347 \membersection{wxGrid::ClearGrid}\label{wxgridcleargrid}
348
349 \func{void}{ClearGrid}{\void}
350
351 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
352 this function. If you are using a derived table class then you need to override
353 \helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect.
354
355
356
357 \membersection{wxGrid::ClearSelection}\label{wxgridclearselection}
358
359 \func{void}{ClearSelection}{\void}
360
361 Deselects all cells that are currently selected.
362
363
364
365 \membersection{wxGrid::CreateGrid}\label{wxgridcreategrid}
366
367 \func{bool}{CreateGrid}{\param{int }{numRows}, \param{int }{numCols}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
368
369 Creates a grid with the specified initial number of rows and columns.
370 Call this directly after the grid constructor. When you use this
371 function wxGrid will create and manage a simple table of string values
372 for you. All of the grid data will be stored in memory.
373
374 For applications with more complex data types or relationships, or for
375 dealing with very large datasets, you should derive your own grid table
376 class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}.
377
378
379
380 \membersection{wxGrid::DeleteCols}\label{wxgriddeletecols}
381
382 \func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
383
384 Deletes one or more columns from a grid starting at the specified position and returns
385 true if successful. The updateLabels argument is not used at present.
386
387 If you are using a derived grid table class you will need to override
388 \helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See
389 \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.
390
391
392
393 \membersection{wxGrid::DeleteRows}\label{wxgriddeleterows}
394
395 \func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
396
397 Deletes one or more rows from a grid starting at the specified position and returns
398 true if successful. The updateLabels argument is not used at present.
399
400 If you are using a derived grid table class you will need to override
401 \helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See
402 \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.
403
404
405
406 \membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol}
407
408 \func{void}{DisableCellEditControl}{\void}
409
410 Disables in-place editing of grid cells.
411 Equivalent to calling EnableCellEditControl(false).
412
413
414
415 \membersection{wxGrid::DisableDragColMove}\label{wxgriddisabledragcolmove}
416
417 \func{void}{DisableDragColMove}{\void}
418
419 Disables column moving by dragging with the mouse. Equivalent to passing false to
420 \helpref{wxGrid::EnableDragColMove}{wxgridenabledragcolmove}.
421
422
423
424 \membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize}
425
426 \func{void}{DisableDragColSize}{\void}
427
428 Disables column sizing by dragging with the mouse. Equivalent to passing false to
429 \helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}.
430
431
432
433 \membersection{wxGrid::DisableDragGridSize}\label{wxgriddisabledraggridsize}
434
435 \func{void}{DisableDragGridSize}{\void}
436
437 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
438 false to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}
439
440
441
442 \membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize}
443
444 \func{void}{DisableDragRowSize}{\void}
445
446 Disables row sizing by dragging with the mouse. Equivalent to passing false to
447 \helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}.
448
449
450
451 \membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol}
452
453 \func{void}{EnableCellEditControl}{\param{bool }{enable = true}}
454
455 Enables or disables in-place editing of grid cell data. The grid will issue either a
456 wxEVT\_GRID\_EDITOR\_SHOWN or wxEVT\_GRID\_EDITOR\_HIDDEN event.
457
458
459
460 \membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize}
461
462 \func{void}{EnableDragColSize}{\param{bool }{enable = true}}
463
464 Enables or disables column sizing by dragging with the mouse.
465
466
467
468 \membersection{wxGrid::EnableDragColMove}\label{wxgridenabledragcolmove}
469
470 \func{void}{EnableDragColMove}{\param{bool }{enable = true}}
471
472 Enables or disables column moving by dragging with the mouse.
473
474
475
476 \membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize}
477
478 \func{void}{EnableDragGridSize}{\param{bool }{enable = true}}
479
480 Enables or disables row and column resizing by dragging gridlines with the mouse.
481
482
483
484 \membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize}
485
486 \func{void}{EnableDragRowSize}{\param{bool }{enable = true}}
487
488 Enables or disables row sizing by dragging with the mouse.
489
490
491
492 \membersection{wxGrid::EnableEditing}\label{wxgridenableediting}
493
494 \func{void}{EnableEditing}{\param{bool }{edit}}
495
496 If the edit argument is false this function sets the whole grid as read-only. If the
497 argument is true the grid is set to the default state where cells may be editable. In the
498 default state you can set single grid cells and whole rows and columns to be editable or
499 read-only via
500 \helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single
501 cells you can also use the shortcut function
502 \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}.
503
504 For more information about controlling grid cell attributes see the
505 \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
506 \helpref{wxGrid classes overview}{gridoverview}.
507
508
509
510 \membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines}
511
512 \func{void}{EnableGridLines}{\param{bool }{enable = true}}
513
514 Turns the drawing of grid lines on or off.
515
516
517
518 \membersection{wxGrid::EndBatch}\label{wxgridendbatch}
519
520 \func{void}{EndBatch}{\void}
521
522 Decrements the grid's batch count. When the count is greater than zero repainting of
523 the grid is suppressed. Each previous call to
524 \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} must be matched by a later call to
525 EndBatch. Code that does a lot of grid modification can be enclosed between
526 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
527 cause the grid to be repainted.
528
529 \wxheading{See also}
530
531 \helpref{wxGridUpdateLocker}{wxgridupdatelocker}
532
533
534
535 \membersection{wxGrid::Fit}\label{wxgridfit}
536
537 \func{void}{Fit}{\void}
538
539 Overridden wxWindow method.
540
541
542
543 \membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh}
544
545 \func{void}{ForceRefresh}{\void}
546
547 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
548
549
550
551 \membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}
552
553 \constfunc{int}{GetBatchCount}{\void}
554
555 Returns the number of times that \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} has been called
556 without (yet) matching calls to \helpref{wxGrid::EndBatch}{wxgridendbatch}. While
557 the grid's batch count is greater than zero the display will not be updated.
558
559
560
561 \membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}
562
563 \constfunc{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}}
564
565 Sets the arguments to the horizontal and vertical text alignment values for the
566 grid cell at the specified location.
567
568 Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
569 Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
570
571 \perlnote{This method only takes the parameters {\tt row} and {\tt col} and
572 returns a 2-element list {\tt ( horiz, vert )}.}
573
574
575
576 \membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}
577
578 \constfunc{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}}
579
580 Returns the background colour of the cell at the specified location.
581
582
583
584 \membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor}
585
586 \constfunc{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}}
587
588 Returns a pointer to the editor for the cell at the specified location.
589
590 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
591 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
592
593
594
595 \membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont}
596
597 \constfunc{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}}
598
599 Returns the font for text in the grid cell at the specified location.
600
601
602
603 \membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer}
604
605 \constfunc{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}}
606
607 Returns a pointer to the renderer for the grid cell at the specified location.
608
609 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
610 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
611
612
613
614 \membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}
615
616 \constfunc{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}}
617
618 Returns the text colour for the grid cell at the specified location.
619
620
621
622 \membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue}
623
624 \constfunc{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}}
625
626 \constfunc{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}}
627
628 Returns the string contained in the cell at the specified location. For simple applications where a
629 grid object automatically uses a default grid table of string values you use this function together
630 with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values.
631
632 For more complex applications where you have derived your own grid table class that contains
633 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
634 function for those cells that contain string values.
635
636 See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas}
637 and the \helpref{wxGrid overview}{gridoverview} for more information.
638
639
640
641 \membersection{wxGrid::GetColAt}\label{wxgridgetcolat}
642
643 \constfunc{int}{GetColAt}{\param{int }{colPos}}
644
645 Returns the column ID of the specified column position.
646
647
648 \membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft}
649
650 \constfunc{int}{GetColLeft}{\param{int }{col}}
651
652
653
654 \membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment}
655
656 \constfunc{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
657
658 Sets the arguments to the current column label alignment values.
659
660 Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.\\
661 Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
662
663 \perlnote{This method takes no parameters and
664 returns a 2-element list {\tt ( horiz, vert )}.}
665
666
667
668 \membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize}
669
670 \constfunc{int}{GetColLabelSize}{\void}
671
672 Returns the current height of the column labels.
673
674
675
676 \membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue}
677
678 \constfunc{wxString}{GetColLabelValue}{\param{int }{col}}
679
680 Returns the specified column label. The default grid table class provides column labels of
681 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
682 \helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide
683 your own labels.
684
685
686
687 \membersection{wxGrid::GetColMinimalAcceptableWidth}\label{wxgridgetcolminimalacceptablewidth}
688
689 \constfunc{int}{GetColMinimalAcceptableWidth}{}
690
691 This returns the value of the lowest column width that can be handled correctly. See
692 member \helpref{SetColMinimalAcceptableWidth}{wxgridsetcolminimalacceptablewidth} for details.
693
694
695
696 \membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth}
697
698 \constfunc{int}{GetColMinimalWidth}{\param{int }{col}}
699
700 Get the minimal width of the given column/row.
701
702
703
704 \membersection{wxGrid::GetColPos}\label{wxgridgetcolpos}
705
706 \constfunc{int}{GetColPos}{\param{int }{colID}}
707
708 Returns the position of the specified column.
709
710
711
712 \membersection{wxGrid::GetColRight}\label{wxgridgetcolright}
713
714 \constfunc{int}{GetColRight}{\param{int }{col}}
715
716
717
718 \membersection{wxGrid::GetColSize}\label{wxgridgetcolsize}
719
720 \constfunc{int}{GetColSize}{\param{int }{col}}
721
722 Returns the width of the specified column.
723
724
725
726 \membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment}
727
728 \constfunc{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
729
730 Sets the arguments to the current default horizontal and vertical text alignment
731 values.
732
733 Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
734 Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
735
736
737
738 \membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour}
739
740 \constfunc{wxColour}{GetDefaultCellBackgroundColour}{\void}
741
742 Returns the current default background colour for grid cells.
743
744
745
746 \membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont}
747
748 \constfunc{wxFont}{GetDefaultCellFont}{\void}
749
750 Returns the current default font for grid cell text.
751
752
753
754 \membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour}
755
756 \constfunc{wxColour}{GetDefaultCellTextColour}{\void}
757
758 Returns the current default colour for grid cell text.
759
760
761
762 \membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize}
763
764 \constfunc{int}{GetDefaultColLabelSize}{\void}
765
766 Returns the default height for column labels.
767
768
769
770 \membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize}
771
772 \constfunc{int}{GetDefaultColSize}{\void}
773
774 Returns the current default width for grid columns.
775
776
777
778 \membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor}
779
780 \constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void}
781
782 Returns a pointer to the current default grid cell editor.
783
784 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
785 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
786
787
788
789 \membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell}
790
791 \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}}
792
793 \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}}
794
795
796
797 \membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype}
798
799 \constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}}
800
801
802
803 \membersection{wxGrid::GetDefaultRenderer}\label{wxgridgetdefaultrenderer}
804
805 \constfunc{wxGridCellRenderer*}{GetDefaultRenderer}{\void}
806
807 Returns a pointer to the current default grid cell renderer.
808
809 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
810 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
811
812
813
814 \membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell}
815
816 \constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}}
817
818
819
820 \membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype}
821
822 \constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}}
823
824
825
826 \membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize}
827
828 \constfunc{int}{GetDefaultRowLabelSize}{\void}
829
830 Returns the default width for the row labels.
831
832
833
834 \membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize}
835
836 \constfunc{int}{GetDefaultRowSize}{\void}
837
838 Returns the current default height for grid rows.
839
840
841
842 \membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol}
843
844 \constfunc{int}{GetGridCursorCol}{\void}
845
846 Returns the current grid cell column position.
847
848
849
850 \membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow}
851
852 \constfunc{int}{GetGridCursorRow}{\void}
853
854 Returns the current grid cell row position.
855
856
857
858 \membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour}
859
860 \constfunc{wxColour}{GetGridLineColour}{\void}
861
862 Returns the colour used for grid lines.
863
864 \wxheading{See also}
865
866 \helpref{GetDefaultGridLinePen()}{wxgridgetdefaultgridlinepen}
867
868
869 \membersection{wxGrid::GetDefaultGridLinePen}\label{wxgridgetdefaultgridlinepen}
870
871 \func{wxPen}{GetDefaultGridLinePen}{\void}
872
873 Returns the pen used for grid lines. This virtual function may be overridden in
874 derived classes in order to change the appearance of grid lines. Note that
875 currently the pen width must be $1$.
876
877 \wxheading{See also}
878
879 \helpref{GetColGridLinePen()}{wxgridgetcolgridlinepen},\\
880 \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen}
881
882
883
884
885 \membersection{wxGrid::GetRowGridLinePen}\label{wxgridgetrowgridlinepen}
886
887 \func{wxPen}{GetRowGridLinePen}{\param{int }{row}}
888
889 Returns the pen used for horizontal grid lines. This virtual function may be
890 overridden in derived classes in order to change the appearance of individual
891 grid line for the given row \arg{row}.
892
893 Example: \\
894 \\
895 \begin{verbatim}
896 // in a grid displaying music notation, use a solid black pen between
897 // octaves (C0=row 127, C1=row 115 etc.)
898 wxPen MidiGrid::GetRowGridLinePen(int row)
899 {
900 if ( row%12 == 7 )
901 return wxPen(*wxBLACK, 1, wxSOLID);
902 else
903 return GetDefaultGridLinePen();
904 }
905 \end{verbatim}
906
907
908
909 \membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen}
910
911 \func{wxPen}{GetColGridLinePen}{\param{int }{col}}
912
913 Returns the pen used for vertical grid lines. This virtual function may be
914 overridden in derived classes in order to change the appearance of individual
915 grid lines for the given column \arg{col}.
916
917 See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example.
918
919
920
921
922 \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}
923
924 \constfunc{bool}{GridLinesEnabled}{\void}
925
926 Returns true if drawing of grid lines is turned on, false otherwise.
927
928
929
930 \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
931
932 \constfunc{wxColour}{GetLabelBackgroundColour}{\void}
933
934 Returns the colour used for the background of row and column labels.
935
936
937
938 \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
939
940 \constfunc{wxFont}{GetLabelFont}{\void}
941
942 Returns the font used for row and column labels.
943
944
945
946 \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
947
948 \constfunc{wxColour}{GetLabelTextColour}{\void}
949
950 Returns the colour used for row and column label text.
951
952
953
954 \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
955
956 \constfunc{int}{GetNumberCols}{\void}
957
958 Returns the total number of grid columns (actually the number of columns in the underlying grid
959 table).
960
961
962
963 \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
964
965 \constfunc{int}{GetNumberRows}{\void}
966
967 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
968
969
970
971 \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
972
973 \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}
974
975
976
977 \membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}
978
979 \constfunc{int}{GetRowMinimalAcceptableHeight}{}
980
981 This returns the value of the lowest row width that can be handled correctly. See
982 member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.
983
984
985
986 \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
987
988 \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
989
990
991
992 \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
993
994 \constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
995
996 Sets the arguments to the current row label alignment values.
997
998 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
999 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
1000
1001 \perlnote{This method takes no parameters and
1002 returns a 2-element list {\tt ( horiz, vert )}.}
1003
1004
1005
1006 \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
1007
1008 \constfunc{int}{GetRowLabelSize}{\void}
1009
1010 Returns the current width of the row labels.
1011
1012
1013
1014 \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
1015
1016 \constfunc{wxString}{GetRowLabelValue}{\param{int }{row}}
1017
1018 Returns the specified row label. The default grid table class provides numeric row labels.
1019 If you are using a custom grid table you can override
1020 \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
1021 your own labels.
1022
1023
1024
1025 \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
1026
1027 \constfunc{int}{GetRowSize}{\param{int }{row}}
1028
1029 Returns the height of the specified row.
1030
1031
1032
1033 \membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex}
1034
1035 \constfunc{int}{GetScrollLineX}{\void}
1036
1037 Returns the number of pixels per horizontal scroll increment. The default is 15.
1038
1039 \wxheading{See also}
1040
1041 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1042 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1043 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1044
1045
1046
1047 \membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney}
1048
1049 \constfunc{int}{GetScrollLineY}{\void}
1050
1051 Returns the number of pixels per vertical scroll increment. The default is 15.
1052
1053 \wxheading{See also}
1054
1055 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1056 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1057 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1058
1059
1060
1061 \membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}
1062
1063 \constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}
1064
1065 Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.
1066
1067
1068
1069 \membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}
1070
1071 \constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}
1072
1073 Returns an array of singly selected cells.
1074
1075
1076
1077 \membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}
1078
1079 \constfunc{wxArrayInt}{GetSelectedCols}{\void}
1080
1081 Returns an array of selected cols.
1082
1083
1084
1085 \membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}
1086
1087 \constfunc{wxArrayInt}{GetSelectedRows}{\void}
1088
1089 Returns an array of selected rows.
1090
1091
1092
1093 \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
1094
1095 \constfunc{wxColour}{GetSelectionBackground}{\void}
1096
1097 Access or update the selection fore/back colours
1098
1099
1100
1101 \membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}
1102
1103 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}
1104
1105 Returns an array of the top left corners of blocks of selected cells,
1106 see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.
1107
1108
1109
1110 \membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}
1111
1112 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}
1113
1114 Returns an array of the bottom right corners of blocks of selected cells,
1115 see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.
1116
1117
1118
1119 \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
1120
1121 \constfunc{wxColour}{GetSelectionForeground}{\void}
1122
1123
1124
1125 \membersection{wxGrid::GetTable}\label{wxgridgettable}
1126
1127 \constfunc{wxGridTableBase *}{GetTable}{\void}
1128
1129 Returns a base pointer to the current table object.
1130
1131
1132
1133 \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
1134
1135 \constfunc{int}{GetViewWidth}{\void}
1136
1137 Returned number of whole cols visible.
1138
1139
1140
1141 \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
1142
1143 \func{void}{HideCellEditControl}{\void}
1144
1145 Hides the in-place cell edit control.
1146
1147
1148
1149 \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
1150
1151 \func{void}{InitColWidths}{\void}
1152
1153 Init the m\_colWidths/Rights arrays
1154
1155
1156
1157 \membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
1158
1159 \func{void}{InitRowHeights}{\void}
1160
1161 NB: {\it never} access m\_row/col arrays directly because they are created
1162 on demand, {\it always} use accessor functions instead!
1163
1164 Init the m\_rowHeights/Bottoms arrays with default values.
1165
1166
1167
1168 \membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
1169
1170 \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
1171
1172 Inserts one or more new columns into a grid with the first new column at the
1173 specified position and returns true if successful. The updateLabels argument is not
1174 used at present.
1175
1176 The sequence of actions begins with the grid object requesting the underlying grid
1177 table to insert new columns. If this is successful the table notifies the grid and the
1178 grid updates the display. For a default grid (one where you have called
1179 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1180 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1181 then you must override
1182 \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
1183 table class.
1184
1185
1186
1187 \membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
1188
1189 \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
1190
1191 Inserts one or more new rows into a grid with the first new row at the specified
1192 position and returns true if successful. The updateLabels argument is not used at
1193 present.
1194
1195 The sequence of actions begins with the grid object requesting the underlying grid
1196 table to insert new rows. If this is successful the table notifies the grid and the
1197 grid updates the display. For a default grid (one where you have called
1198 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1199 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1200 then you must override
1201 \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
1202 table class.
1203
1204
1205
1206 \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}
1207
1208 \constfunc{bool}{IsCellEditControlEnabled}{\void}
1209
1210 Returns true if the in-place edit control is currently enabled.
1211
1212
1213
1214 \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}
1215
1216 \constfunc{bool}{IsCurrentCellReadOnly}{\void}
1217
1218 Returns true if the current cell has been set to read-only
1219 (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).
1220
1221
1222
1223 \membersection{wxGrid::IsEditable}\label{wxgridiseditable}
1224
1225 \constfunc{bool}{IsEditable}{\void}
1226
1227 Returns false if the whole grid has been set as read-only or true otherwise.
1228 See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
1229 controlling the editing status of grid cells.
1230
1231
1232
1233 \membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
1234
1235 \constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
1236
1237 \constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
1238
1239 Is this cell currently selected.
1240
1241
1242
1243 \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}
1244
1245 \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}
1246
1247 Returns true if the cell at the specified location can't be edited.
1248 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1249
1250
1251
1252 \membersection{wxGrid::IsSelection}\label{wxgridisselection}
1253
1254 \constfunc{bool}{IsSelection}{\void}
1255
1256 Returns true if there are currently rows, columns or blocks of cells selected.
1257
1258
1259
1260 \membersection{wxGrid::IsVisible}\label{wxgridisvisible}
1261
1262 \constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}
1263
1264 \constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}
1265
1266 Returns true if a cell is either wholly visible (the default) or at least partially
1267 visible in the grid window.
1268
1269
1270
1271 \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
1272
1273 \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
1274
1275 \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
1276
1277 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
1278 nothing if the cell is already visible.
1279
1280
1281
1282 \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
1283
1284 \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
1285
1286 Moves the grid cursor down by one row. If a block of cells was previously selected it
1287 will expand if the argument is true or be cleared if the argument is false.
1288
1289 \wxheading{Keyboard}\\
1290 This function is called for Down cursor key presses or Shift+Down to expand a selection.
1291
1292
1293
1294 \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
1295
1296 \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
1297
1298 Moves the grid cursor left by one column. If a block of cells was previously selected it
1299 will expand if the argument is true or be cleared if the argument is false.
1300
1301 \wxheading{Keyboard}\\
1302 This function is called for Left cursor key presses or Shift+Left to expand a selection.
1303
1304
1305
1306 \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
1307
1308 \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
1309
1310 Moves the grid cursor right by one column. If a block of cells was previously selected it
1311 will expand if the argument is true or be cleared if the argument is false.
1312
1313 \wxheading{Keyboard}\\
1314 This function is called for Right cursor key presses or Shift+Right to expand a selection.
1315
1316
1317
1318 \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
1319
1320 \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
1321
1322 Moves the grid cursor up by one row. If a block of cells was previously selected it
1323 will expand if the argument is true or be cleared if the argument is false.
1324
1325 \wxheading{Keyboard}\\
1326 This function is called for Up cursor key presses or Shift+Up to expand a selection.
1327
1328
1329
1330 \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
1331
1332 \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
1333
1334 Moves the grid cursor down in the current column such that it skips to the beginning or
1335 end of a block of non-empty cells. If a block of cells was previously selected it
1336 will expand if the argument is true or be cleared if the argument is false.
1337
1338 \wxheading{Keyboard}\\
1339 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
1340
1341
1342
1343 \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
1344
1345 \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
1346
1347 Moves the grid cursor left in the current row such that it skips to the beginning or
1348 end of a block of non-empty cells. If a block of cells was previously selected it
1349 will expand if the argument is true or be cleared if the argument is false.
1350
1351 \wxheading{Keyboard}\\
1352 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
1353
1354
1355
1356 \membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}
1357
1358 \func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}
1359
1360 Moves the grid cursor right in the current row such that it skips to the beginning or
1361 end of a block of non-empty cells. If a block of cells was previously selected it
1362 will expand if the argument is true or be cleared if the argument is false.
1363
1364 \wxheading{Keyboard}\\
1365 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1366
1367
1368
1369 \membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}
1370
1371 \func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}
1372
1373 Moves the grid cursor up in the current column such that it skips to the beginning or
1374 end of a block of non-empty cells. If a block of cells was previously selected it
1375 will expand if the argument is true or be cleared if the argument is false.
1376
1377 \wxheading{Keyboard}\\
1378 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1379
1380
1381
1382 \membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}
1383
1384 \func{bool}{MovePageDown}{\void}
1385
1386 Moves the grid cursor down by some number of rows so that the previous bottom visible row
1387 becomes the top visible row.
1388
1389 \wxheading{Keyboard}\\
1390 This function is called for PgDn keypresses.
1391
1392
1393
1394 \membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}
1395
1396 \func{bool}{MovePageUp}{\void}
1397
1398 Moves the grid cursor up by some number of rows so that the previous top visible row
1399 becomes the bottom visible row.
1400
1401 \wxheading{Keyboard}\\
1402 This function is called for PgUp keypresses.
1403
1404
1405
1406 \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1407
1408 \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1409
1410 Methods for a registry for mapping data types to Renderers/Editors
1411
1412
1413
1414 \membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}
1415
1416 \func{void}{SaveEditControlValue}{\void}
1417
1418 Sets the value of the current grid cell to the current in-place edit control value.
1419 This is called automatically when the grid cursor moves from the current cell to a
1420 new cell. It is also a good idea to call this function when closing a grid since
1421 any edits to the final cell location will not be saved otherwise.
1422
1423
1424
1425 \membersection{wxGrid::SelectAll}\label{wxgridselectall}
1426
1427 \func{void}{SelectAll}{\void}
1428
1429 Selects all cells in the grid.
1430
1431
1432
1433 \membersection{wxGrid::SelectBlock}\label{wxgridselectblock}
1434
1435 \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
1436 \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}
1437
1438 \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
1439 \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}
1440
1441 Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
1442 deselected; if true the column will be added to the existing selection.
1443
1444
1445
1446 \membersection{wxGrid::SelectCol}\label{wxgridselectcol}
1447
1448 \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}
1449
1450 Selects the specified column. If addToSelected is false then any existing selection will be
1451 deselected; if true the column will be added to the existing selection.
1452
1453
1454
1455 \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1456
1457 \constfunc{wxRect}{SelectionToDeviceRect}{\void}
1458
1459 This function returns the rectangle that encloses the selected cells
1460 in device coords and clipped to the client size of the grid window.
1461
1462
1463
1464 \membersection{wxGrid::SelectRow}\label{wxgridselectrow}
1465
1466 \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}
1467
1468 Selects the specified row. If addToSelected is false then any existing selection will be
1469 deselected; if true the row will be added to the existing selection.
1470
1471
1472
1473 \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1474
1475 \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
1476
1477 \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1478
1479 Sets the horizontal and vertical alignment for grid cell text at the specified location.
1480
1481 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
1482 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1483
1484
1485
1486 \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1487
1488 \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1489
1490
1491
1492 \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
1493
1494 \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
1495
1496 Sets the editor for the grid cell at the specified location.
1497 The grid will take ownership of the pointer.
1498
1499 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1500 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1501
1502
1503
1504 \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
1505
1506 \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}
1507
1508 Sets the font for text in the grid cell at the specified location.
1509
1510
1511
1512 \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
1513
1514 \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
1515
1516 Sets the renderer for the grid cell at the specified location.
1517 The grid will take ownership of the pointer.
1518
1519 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1520 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1521
1522
1523
1524 \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1525
1526 \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1527
1528 \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1529
1530 \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}
1531
1532 Sets the text colour for the grid cell at the specified location.
1533
1534
1535
1536 \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1537
1538 \func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
1539
1540 \func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
1541
1542 \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1543
1544 Sets the string value for the cell at the specified location. For simple applications where a
1545 grid object automatically uses a default grid table of string values you use this function together
1546 with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
1547
1548 For more complex applications where you have derived your own grid table class that contains
1549 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
1550 function for those cells that contain string values.
1551
1552 The last form is for backward compatibility only.
1553
1554 See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
1555 and the \helpref{wxGrid overview}{gridoverview} for more information.
1556
1557
1558
1559 \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
1560
1561 \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
1562
1563 Sets the cell attributes for all cells in the specified column.
1564
1565 For more information about controlling grid cell attributes see the
1566 \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
1567 \helpref{wxGrid classes overview}{gridoverview}.
1568
1569
1570
1571 \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
1572
1573 \func{void}{SetColFormatBool}{\param{int }{col}}
1574
1575 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
1576
1577
1578
1579 \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
1580
1581 \func{void}{SetColFormatNumber}{\param{int }{col}}
1582
1583 Sets the specified column to display integer values.
1584
1585
1586
1587 \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
1588
1589 \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
1590
1591 Sets the specified column to display floating point values with the given width and precision.
1592
1593
1594
1595 \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
1596
1597 \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
1598
1599 Sets the specified column to display data in a custom format.
1600 See the \helpref{wxGrid overview}{gridoverview} for more information on working
1601 with custom data types.
1602
1603
1604
1605 \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
1606
1607 \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1608
1609 Sets the horizontal and vertical alignment of column label text.
1610
1611 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1612
1613 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1614
1615
1616
1617 \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
1618
1619 \func{void}{SetColLabelSize}{\param{int }{height}}
1620
1621 Sets the height of the column labels.
1622
1623 If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically
1624 so that no label is truncated. Note that this could be slow for a large table.
1625
1626
1627
1628 \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
1629
1630 \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}
1631
1632 Set the value for the given column label. If you are using a derived grid table you must
1633 override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
1634 for this to have any effect.
1635
1636
1637
1638 \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
1639
1640 \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
1641
1642 Sets the minimal width for the specified column. This should normally be called when creating the grid
1643 because it will not resize a column that is already narrower than the minimal width.
1644 The width argument must be higher than the minimimal acceptable column width, see
1645 \helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.
1646
1647
1648
1649 \membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}
1650
1651 \func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}
1652
1653 This modifies the minimum column width that can be handled correctly. Specifying a low value here
1654 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1655 than the actual minimum size will incur a performance penalty in the functions which perform
1656 grid cell index lookup on the basis of screen coordinates.
1657 This should normally be called when creating the grid because it will not resize existing columns
1658 with sizes smaller than the value specified here.
1659
1660
1661
1662 \membersection{wxGrid::SetColPos}\label{wxgridsetcolpos}
1663
1664 \func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}}
1665
1666 Sets the position of the specified column.
1667
1668
1669
1670 \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
1671
1672 \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
1673
1674 Sets the width of the specified column.
1675
1676 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1677 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1678
1679 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1680 also be set as the minimal width for the column.
1681
1682 \wxheading{Note}\\
1683 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1684 The memory requirements for this could become prohibitive if your grid is very large.
1685
1686
1687
1688 \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1689
1690 \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1691
1692 Sets the default horizontal and vertical alignment for grid cell text.
1693
1694 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1695
1696 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1697
1698
1699
1700 \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1701
1702 \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}
1703
1704 Sets the default background colour for grid cells.
1705
1706
1707
1708 \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1709
1710 \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}
1711
1712 Sets the default font to be used for grid cell text.
1713
1714
1715
1716 \membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}
1717
1718 \func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}
1719
1720 Sets the current default colour for grid cell text.
1721
1722
1723
1724 \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1725
1726 \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1727
1728 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1729
1730 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1731 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1732
1733
1734
1735 \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1736
1737 \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1738
1739 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1740
1741 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1742 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1743
1744
1745
1746 \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
1747
1748 \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}
1749
1750 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1751 the grid unless resizeExistingCols is true.
1752
1753
1754
1755 \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1756
1757 \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}
1758
1759 Sets the default height for rows in the grid. This will only affect rows subsequently added
1760 to the grid unless resizeExistingRows is true.
1761
1762
1763
1764 \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1765
1766 \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
1767
1768 Set the grid cursor to the specified cell.
1769 This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
1770
1771
1772
1773 \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
1774
1775 \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}
1776
1777 Sets the colour used to draw grid lines.
1778
1779
1780
1781 \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1782
1783 \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}
1784
1785 Sets the background colour for row and column labels.
1786
1787
1788
1789 \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
1790
1791 \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}
1792
1793 Sets the font for row and column labels.
1794
1795
1796
1797 \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1798
1799 \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}
1800
1801 Sets the colour for row and column label text.
1802
1803
1804
1805 \membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1806
1807 \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1808
1809 A grid may occupy more space than needed for its rows/columns. This
1810 function allows to set how big this extra space is
1811
1812
1813
1814 \membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1815
1816 \func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1817
1818 Common part of AutoSizeColumn/Row() and GetBestSize()
1819
1820
1821
1822 \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1823
1824 \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1825
1826
1827
1828 \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1829
1830 \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}
1831
1832 Makes the cell at the specified location read-only or editable.
1833 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1834
1835
1836
1837 \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
1838
1839 \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
1840
1841 Sets the cell attributes for all cells in the specified row.
1842 See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1843 about controlling cell attributes.
1844
1845
1846
1847 \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
1848
1849 \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1850
1851 Sets the horizontal and vertical alignment of row label text.
1852
1853 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1854
1855 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1856
1857
1858
1859 \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
1860
1861 \func{void}{SetRowLabelSize}{\param{int }{width}}
1862
1863 Sets the width of the row labels.
1864
1865 If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically
1866 so that no label is truncated. Note that this could be slow for a large table.
1867
1868
1869
1870 \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
1871
1872 \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}
1873
1874 Set the value for the given row label. If you are using a derived grid table you must
1875 override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
1876 for this to have any effect.
1877
1878
1879
1880 \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
1881
1882 \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}
1883
1884 Sets the minimal height for the specified row. This should normally be called when creating the grid
1885 because it will not resize a row that is already shorter than the minimal height.
1886 The height argument must be higher than the minimimal acceptable row height, see
1887 \helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.
1888
1889
1890
1891 \membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}
1892
1893 \func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}
1894
1895 This modifies the minimum row width that can be handled correctly. Specifying a low value here
1896 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1897 than the actual minimum size will incur a performance penalty in the functions which perform
1898 grid cell index lookup on the basis of screen coordinates.
1899 This should normally be called when creating the grid because it will not resize existing rows
1900 with sizes smaller than the value specified here.
1901
1902
1903
1904 \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
1905
1906 \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
1907
1908 Sets the height of the specified row.
1909
1910 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1911 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1912
1913 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1914 also be set as the minimal width for the column.
1915
1916 \wxheading{Note}
1917
1918 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1919 The memory requirements for this could become prohibitive if your grid is very large.
1920
1921
1922
1923 \membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex}
1924
1925 \func{void}{SetScrollLineX}{\param{int }{x}}
1926
1927 Sets the number of pixels per horizontal scroll increment. The default is 15.
1928 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1929 errors: setting this to 1 can help.
1930
1931 \wxheading{See also}
1932
1933 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1934 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1935 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1936
1937
1938
1939 \membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney}
1940
1941 \func{void}{SetScrollLineY}{\param{int }{y}}
1942
1943 Sets the number of pixels per vertical scroll increment. The default is 15.
1944 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1945 errors: setting this to 1 can help.
1946
1947 \wxheading{See also}
1948
1949 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1950 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1951 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex}
1952
1953
1954
1955 \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
1956
1957 \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
1958
1959
1960
1961 \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
1962
1963 \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
1964
1965
1966
1967 \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
1968
1969 \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}
1970
1971 Set the selection behaviour of the grid.
1972
1973 \wxheading{Parameters}
1974
1975 \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
1976
1977 \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
1978
1979 \docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}
1980
1981
1982
1983 \membersection{wxGrid::SetTable}\label{wxgridsettable}
1984
1985 \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
1986
1987 Passes a pointer to a custom grid table to be used by the grid. This should be called
1988 after the grid constructor and before using the grid object. If takeOwnership is set to
1989 true then the table will be deleted by the wxGrid destructor.
1990
1991 Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
1992 application involves complex or non-string data or data sets that are too large to fit
1993 wholly in memory.
1994
1995
1996
1997 \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
1998
1999 \func{void}{ShowCellEditControl}{\void}
2000
2001 Displays the in-place cell edit control for the current cell.
2002
2003
2004
2005 \membersection{wxGrid::XToCol}\label{wxgridxtocol}
2006
2007 \constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}}
2008
2009 \wxheading{Parameters}
2010 \docparam{x}{The x position to evaluate.}
2011 \docparam{clipToMinMax}{If true, rather than returning wxNOT\_FOUND, it returns either the first or last column depending on whether x is too far to the left or right respectively.}
2012
2013 \wxheading{Return value}
2014 The grid column that corresponds to the logical x coordinate. Returns
2015 {\tt wxNOT\_FOUND} if there is no column at the x position.
2016
2017
2018
2019 \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
2020
2021 \constfunc{int}{XToEdgeOfCol}{\param{int }{x}}
2022
2023 Returns the column whose right hand edge is close to the given logical x position.
2024 If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.
2025
2026
2027
2028 \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
2029
2030 \constfunc{int}{YToEdgeOfRow}{\param{int }{y}}
2031
2032 Returns the row whose bottom edge is close to the given logical y position.
2033 If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.
2034
2035
2036
2037 \membersection{wxGrid::YToRow}\label{wxgridytorow}
2038
2039 \constfunc{int}{YToRow}{\param{int }{y}}
2040
2041 Returns the grid row that corresponds to the logical y coordinate. Returns
2042 {\tt wxNOT\_FOUND} if there is no row at the y position.
2043