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