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