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