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