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