]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/grid.tex
fix various latex errors
[wxWidgets.git] / docs / latex / wx / grid.tex
... / ...
CommitLineData
1\section{\class{wxGrid}}\label{wxgrid}
2
3wxGrid and its related classes are used for displaying and editing tabular
4data. They provide a rich set of features for display, editing, and
5interacting with a variety of data sources. For simple applications, and to
6help you get started, wxGrid is the only class you need to refer to
7directly. It will set up default instances of the other classes and manage
8them for you. For more complex applications you can derive your own
9classes for custom grid views, grid data tables, cell editors and
10renderers. The \helpref{wxGrid classes overview}{gridoverview} has
11examples of simple and more complex applications, explains the
12relationship between the various grid classes and has a summary of the
13keyboard shortcuts and mouse functions provided by wxGrid.
14
15wxGrid has been greatly expanded and redesigned for wxWidgets 2.2
16onwards. If you have been using the old wxGrid class you will probably
17want to have a look at the \helpref{wxGrid classes overview}{gridoverview} to see
18how things have changed. The new grid classes are reasonably backward-compatible
19but there are some exceptions. There are also easier ways of doing many things compared to
20the previous implementation.
21
22\wxheading{Derived from}
23
24\helpref{wxScrolledWindow}{wxscrolledwindow}\\
25\helpref{wxWindow}{wxwindow}\\
26\helpref{wxEvtHandler}{wxevthandler}\\
27\helpref{wxObject}{wxobject}
28
29\wxheading{Include files}
30
31<wx/grid.h>
32
33\wxheading{Window styles}
34
35There are presently no specific window styles for wxGrid.
36
37\wxheading{Event handling}
38
39\input gridevt.inc
40
41The event handler for the following functions takes a
42 \helpref{wxGridSizeEvent}{wxgridsizeevent} parameter.
43The ...\_CMD\_... variants also take a window identifier.
44
45\twocolwidtha{7cm}
46\begin{twocollist}\itemsep=0pt
47\twocolitem{{\bf EVT\_GRID\_COL\_SIZE(func)}}{The user resized a column by dragging it. Processes a wxEVT\_GRID\_COL\_SIZE.}
48\twocolitem{{\bf EVT\_GRID\_ROW\_SIZE(func)}}{The user resized a row by dragging it. Processes a wxEVT\_GRID\_ROW\_SIZE.}
49\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.}
50\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.}
51\end{twocollist}%
52
53The event handler for the following functions takes a
54 \helpref{wxGridRangeSelectEvent}{wxgridrangeselectevent} parameter.
55The ...\_CMD\_... variant also takes a window identifier.
56
57\twocolwidtha{7cm}
58\begin{twocollist}\itemsep=0pt
59\twocolitem{{\bf EVT\_GRID\_RANGE\_SELECT(func)}}{The user selected a group of contiguous cells. Processes a wxEVT\_GRID\_RANGE\_SELECT.}
60\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.}
61\end{twocollist}%
62
63The event handler for the following functions takes a
64 \helpref{wxGridEditorCreatedEvent}{wxgrideditorcreatedevent} parameter.
65The ...\_CMD\_... variant also takes a window identifier.
66
67\twocolwidtha{7cm}
68\begin{twocollist}\itemsep=0pt
69\twocolitem{{\bf EVT\_GRID\_EDITOR\_CREATED(func)}}{The editor for a cell was created. Processes a wxEVT\_GRID\_EDITOR\_CREATED.}
70\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.}
71\end{twocollist}%
72
73\wxheading{See also}
74
75\helpref{wxGrid overview}{gridoverview}
76
77%%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
78\latexignore{\rtfignore{\wxheading{Function groups}}}
79
80\membersection{Constructors and initialization}\label{wxgridconstructors}
81
82\helpref{wxGrid}{wxgridctor}\\
83\helpref{\destruct{wxGrid}}{wxgriddtor}\\
84\helpref{CreateGrid}{wxgridcreategrid}\\
85\helpref{SetTable}{wxgridsettable}
86
87\membersection{Display format}\label{wxgriddisplayformat}
88
89\membersection{Selection functions}\label{wxgridselectionfunctions}
90
91\helpref{wxGrid::ClearSelection}{wxgridclearselection}\\
92\helpref{wxGrid::IsSelection}{wxgridisselection}\\
93\helpref{wxGrid::SelectAll}{wxgridselectall}\\
94\helpref{wxGrid::SelectBlock}{wxgridselectblock}\\
95\helpref{wxGrid::SelectCol}{wxgridselectcol}\\
96\helpref{wxGrid::SelectRow}{wxgridselectrow}
97
98%%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
99\helponly{\insertatlevel{2}{
100
101\wxheading{Members}
102
103}}
104
105\membersection{wxGrid::wxGrid}\label{wxgridctor}
106
107\func{}{wxGrid}{\void}
108
109Default constructor
110
111\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}}
112
113Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or
114\helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using
115it.
116
117\membersection{wxGrid::\destruct{wxGrid}}\label{wxgriddtor}
118
119\func{}{\destruct{wxGrid}}{\void}
120
121Destructor. This will also destroy the associated grid table unless you passed a table
122object to the grid and specified that the grid should not take ownership of the
123table (see \helpref{wxGrid::SetTable}{wxgridsettable}).
124
125\membersection{wxGrid::AppendCols}\label{wxgridappendcols}
126
127\func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
128
129Appends one or more new columns to the right of the grid and returns true if
130successful. The updateLabels argument is not used at present.
131
132If you are using a derived grid table class you will need to override
133\helpref{wxGridTableBase::AppendCols}{wxgridtablebaseappendcols}. See
134\helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.
135
136\membersection{wxGrid::AppendRows}\label{wxgridappendrows}
137
138\func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
139
140Appends one or more new rows to the bottom of the grid and returns true if
141successful. The updateLabels argument is not used at present.
142
143If you are using a derived grid table class you will need to override
144\helpref{wxGridTableBase::AppendRows}{wxgridtablebaseappendrows}. See
145\helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.
146
147\membersection{wxGrid::AutoSize}\label{wxgridautosize}
148
149\func{void}{AutoSize}{\void}
150
151Automatically sets the height and width of all rows and columns to fit their contents.
152
153\wxheading{Note}\\
154wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
155The memory requirements for this could become prohibitive if your grid is very large.
156
157\membersection{wxGrid::AutoSizeColOrRow}\label{wxgridautosizecolorrow}
158
159\func{void}{AutoSizeColOrRow}{\param{int }{n}, \param{bool }{setAsMin}, \param{bool }{column}}
160
161Common part of AutoSizeColumn/Row() or row?
162
163\membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn}
164
165\func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = true}}
166
167Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
168also be set as the minimal width for the column.
169
170\wxheading{Note}\\
171wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
172The memory requirements for this could become prohibitive if your grid is very large.
173
174\membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns}
175
176\func{void}{AutoSizeColumns}{\param{bool }{setAsMin = true}}
177
178Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
179also be set as the minimal widths for the columns.
180
181\wxheading{Note}\\
182wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
183The memory requirements for this could become prohibitive if your grid is very large.
184
185\membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow}
186
187\func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = true}}
188
189Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
190also be set as the minimal height for the row.
191
192\wxheading{Note}\\
193wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
194The memory requirements for this could become prohibitive if your grid is very large.
195
196\membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows}
197
198\func{void}{AutoSizeRows}{\param{bool }{setAsMin = true}}
199
200Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
201also be set as the minimal heights for the rows.
202
203\wxheading{Note}\\
204wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
205The memory requirements for this could become prohibitive if your grid is very large.
206
207\membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch}
208
209\func{void}{BeginBatch}{\void}
210
211Increments the grid's batch count. When the count is greater than zero repainting of
212the grid is suppressed. Each call to BeginBatch must be matched by a later call to
213\helpref{wxGrid::EndBatch}{wxgridendbatch}. Code that does a lot of grid
214modification can be enclosed between BeginBatch and EndBatch calls to avoid
215screen flicker. The final EndBatch will cause the grid to be repainted.
216
217\membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect}
218
219\func{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}}
220
221This function returns the rectangle that encloses the block of cells
222limited by TopLeft and BottomRight cell in device coords and clipped
223to the client size of the grid window.
224
225
226\membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize}
227
228\func{bool}{CanDragColSize}{\void}
229
230Returns true if columns can be resized by dragging with the mouse. Columns can be resized
231by dragging the edges of their labels. If grid line dragging is enabled they can also be
232resized by dragging the right edge of the column in the grid cell area
233(see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).
234
235\membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize}
236
237\func{bool}{CanDragRowSize}{\void}
238
239Returns true if rows can be resized by dragging with the mouse. Rows can be resized
240by dragging the edges of their labels. If grid line dragging is enabled they can also be
241resized by dragging the lower edge of the row in the grid cell area
242(see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}).
243
244\membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize}
245
246\func{bool}{CanDragGridSize}{\void}
247
248Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
249
250\membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol}
251
252\constfunc{bool}{CanEnableCellControl}{\void}
253
254Returns true if the in-place edit control for the current grid cell can be used and
255false otherwise (e.g. if the current cell is read-only).
256
257\membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes}
258
259\func{bool}{CanHaveAttributes}{\void}
260
261Do we have some place to store attributes in?
262
263\membersection{wxGrid::CellToRect}\label{wxgridcelltorect}
264
265\func{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}}
266
267\func{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}}
268
269Return the rectangle corresponding to the grid cell's size and position in logical
270coordinates.
271
272\membersection{wxGrid::ClearGrid}\label{wxgridcleargrid}
273
274\func{void}{ClearGrid}{\void}
275
276Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
277this function. If you are using a derived table class then you need to override
278\helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect.
279
280\membersection{wxGrid::ClearSelection}\label{wxgridclearselection}
281
282\func{void}{ClearSelection}{\void}
283
284Deselects all cells that are currently selected.
285
286\membersection{wxGrid::CreateGrid}\label{wxgridcreategrid}
287
288\func{bool}{CreateGrid}{\param{int }{numRows}, \param{int }{numCols}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
289
290Creates a grid with the specified initial number of rows and columns.
291Call this directly after the grid constructor. When you use this
292function wxGrid will create and manage a simple table of string values
293for you. All of the grid data will be stored in memory.
294
295For applications with more complex data types or relationships, or for
296dealing with very large datasets, you should derive your own grid table
297class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}.
298
299\membersection{wxGrid::DeleteCols}\label{wxgriddeletecols}
300
301\func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
302
303Deletes one or more columns from a grid starting at the specified position and returns
304true if successful. The updateLabels argument is not used at present.
305
306If you are using a derived grid table class you will need to override
307\helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See
308\helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information.
309
310\membersection{wxGrid::DeleteRows}\label{wxgriddeleterows}
311
312\func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
313
314Deletes one or more rows from a grid starting at the specified position and returns
315true if successful. The updateLabels argument is not used at present.
316
317If you are using a derived grid table class you will need to override
318\helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See
319\helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information.
320
321\membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol}
322
323\func{void}{DisableCellEditControl}{\void}
324
325Disables in-place editing of grid cells.
326Equivalent to calling EnableCellEditControl(false).
327
328\membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize}
329
330\func{void}{DisableDragColSize}{\void}
331
332Disables column sizing by dragging with the mouse. Equivalent to passing false to
333\helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}.
334
335\membersection{wxGrid::DisableDragGridSize}\label{wxgriddisabledraggridsize}
336
337\func{void}{DisableDragGridSize}{\void}
338
339Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
340false to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}
341
342\membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize}
343
344\func{void}{DisableDragRowSize}{\void}
345
346Disables row sizing by dragging with the mouse. Equivalent to passing false to
347\helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}.
348
349\membersection{wxGrid::DoGetBestSize}\label{wxgriddogetbestsize}
350
351\constfunc{wxSize}{DoGetBestSize}{\void}
352
353\membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol}
354
355\func{void}{EnableCellEditControl}{\param{bool }{enable = true}}
356
357Enables or disables in-place editing of grid cell data. The grid will issue either a
358wxEVT\_GRID\_EDITOR\_SHOWN or wxEVT\_GRID\_EDITOR\_HIDDEN event.
359
360\membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize}
361
362\func{void}{EnableDragColSize}{\param{bool }{enable = true}}
363
364Enables or disables column sizing by dragging with the mouse.
365
366\membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize}
367
368\func{void}{EnableDragGridSize}{\param{bool }{enable = true}}
369
370Enables or disables row and column resizing by dragging gridlines with the mouse.
371
372\membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize}
373
374\func{void}{EnableDragRowSize}{\param{bool }{enable = true}}
375
376Enables or disables row sizing by dragging with the mouse.
377
378\membersection{wxGrid::EnableEditing}\label{wxgridenableediting}
379
380\func{void}{EnableEditing}{\param{bool }{edit}}
381
382If the edit argument is false this function sets the whole grid as read-only. If the
383argument is true the grid is set to the default state where cells may be editable. In the
384default state you can set single grid cells and whole rows and columns to be editable or
385read-only via
386\helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single
387cells you can also use the shortcut function
388\helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}.
389
390For more information about controlling grid cell attributes see the
391\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
392\helpref{wxGrid classes overview}{gridoverview}.
393
394\membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines}
395
396\func{void}{EnableGridLines}{\param{bool }{enable = true}}
397
398Turns the drawing of grid lines on or off.
399
400\membersection{wxGrid::EndBatch}\label{wxgridendbatch}
401
402\func{void}{EndBatch}{\void}
403
404Decrements the grid's batch count. When the count is greater than zero repainting of
405the grid is suppressed. Each previous call to
406\helpref{wxGrid::BeginBatch}{wxgridbeginbatch} must be matched by a later call to
407EndBatch. Code that does a lot of grid modification can be enclosed between
408BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
409cause the grid to be repainted.
410
411\membersection{wxGrid::Fit}\label{wxgridfit}
412
413\func{void}{Fit}{\void}
414
415Overridden wxWindow method.
416
417\membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh}
418
419\func{void}{ForceRefresh}{\void}
420
421Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
422
423\membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}
424
425\func{int}{GetBatchCount}{\void}
426
427Returns the number of times that \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} has been called
428without (yet) matching calls to \helpref{wxGrid::EndBatch}{wxgridendbatch}. While
429the grid's batch count is greater than zero the display will not be updated.
430
431\membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}
432
433\func{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}}
434
435Sets the arguments to the horizontal and vertical text alignment values for the
436grid cell at the specified location.
437
438Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
439Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
440
441\perlnote{This method only takes the parameters {\tt row} and {\tt col} and
442returns a 2-element list {\tt ( horiz, vert )}.}
443
444\membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}
445
446\func{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}}
447
448Returns the background colour of the cell at the specified location.
449
450\membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor}
451
452\func{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}}
453
454Returns a pointer to the editor for the cell at the specified location.
455
456See \helpref{wxGridCellEditor}{wxgridcelleditor} and
457the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
458
459\membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont}
460
461\func{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}}
462
463Returns the font for text in the grid cell at the specified location.
464
465\membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer}
466
467\func{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}}
468
469Returns a pointer to the renderer for the grid cell at the specified location.
470
471See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
472the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
473
474\membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}
475
476\func{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}}
477
478Returns the text colour for the grid cell at the specified location.
479
480\membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue}
481
482\func{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}}
483
484\func{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}}
485
486Returns the string contained in the cell at the specified location. For simple applications where a
487grid object automatically uses a default grid table of string values you use this function together
488with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values.
489
490For more complex applications where you have derived your own grid table class that contains
491various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
492function for those cells that contain string values.
493
494See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas}
495and the \helpref{wxGrid overview}{gridoverview} for more information.
496
497
498\membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft}
499
500\constfunc{int}{GetColLeft}{\param{int }{col}}
501
502\membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment}
503
504\func{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
505
506Sets the arguments to the current column label alignment values.
507
508Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.\\
509Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
510
511\perlnote{This method takes no parameters and
512returns a 2-element list {\tt ( horiz, vert )}.}
513
514\membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize}
515
516\func{int}{GetColLabelSize}{\void}
517
518Returns the current height of the column labels.
519
520\membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue}
521
522\func{wxString}{GetColLabelValue}{\param{int }{col}}
523
524Returns the specified column label. The default grid table class provides column labels of
525the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
526\helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide
527your own labels.
528
529\membersection{wxGrid::GetColMinimalAcceptableWidth}\label{wxgridgetcolminimalacceptablewidth}
530
531\func{int}{GetColMinimalAcceptableWidth}{}
532
533This returns the value of the lowest column width that can be handled correctly. See
534member \helpref{SetColMinimalAcceptableWidth}{wxgridsetcolminimalacceptablewidth} for details.
535
536\membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth}
537
538\constfunc{int}{GetColMinimalWidth}{\param{int }{col}}
539
540Get the minimal width of the given column/row.
541
542
543\membersection{wxGrid::GetColRight}\label{wxgridgetcolright}
544
545\constfunc{int}{GetColRight}{\param{int }{col}}
546
547\membersection{wxGrid::GetColSize}\label{wxgridgetcolsize}
548
549\func{int}{GetColSize}{\param{int }{col}}
550
551Returns the width of the specified column.
552
553\membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment}
554
555\func{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
556
557Sets the arguments to the current default horizontal and vertical text alignment
558values.
559
560Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
561Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
562
563\membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour}
564
565\func{wxColour}{GetDefaultCellBackgroundColour}{\void}
566
567Returns the current default background colour for grid cells.
568
569\membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont}
570
571\func{wxFont}{GetDefaultCellFont}{\void}
572
573Returns the current default font for grid cell text.
574
575\membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour}
576
577\func{wxColour}{GetDefaultCellTextColour}{\void}
578
579Returns the current default colour for grid cell text.
580
581\membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize}
582
583\func{int}{GetDefaultColLabelSize}{\void}
584
585Returns the default height for column labels.
586
587\membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize}
588
589\func{int}{GetDefaultColSize}{\void}
590
591Returns the current default width for grid columns.
592
593\membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor}
594
595\constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void}
596
597Returns a pointer to the current default grid cell editor.
598
599See \helpref{wxGridCellEditor}{wxgridcelleditor} and
600the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
601
602\membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell}
603
604\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}}
605
606\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}}
607
608
609\membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype}
610
611\constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}}
612
613
614\membersection{wxGrid::GetDefaultRenderer}\label{wxgridgetdefaultrenderer}
615
616\constfunc{wxGridCellRenderer*}{GetDefaultRenderer}{\void}
617
618Returns a pointer to the current default grid cell renderer.
619
620See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
621the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
622
623\membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell}
624
625\constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}}
626
627\membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype}
628
629\constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}}
630
631
632
633\membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize}
634
635\func{int}{GetDefaultRowLabelSize}{\void}
636
637Returns the default width for the row labels.
638
639\membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize}
640
641\func{int}{GetDefaultRowSize}{\void}
642
643Returns the current default height for grid rows.
644
645\membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol}
646
647\func{int}{GetGridCursorCol}{\void}
648
649Returns the current grid cell column position.
650
651\membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow}
652
653\func{int}{GetGridCursorRow}{\void}
654
655Returns the current grid cell row position.
656
657\membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour}
658
659\func{wxColour}{GetGridLineColour}{\void}
660
661Returns the colour used for grid lines.
662
663\membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}
664
665\func{bool}{GridLinesEnabled}{\void}
666
667Returns true if drawing of grid lines is turned on, false otherwise.
668
669\membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
670
671\func{wxColour}{GetLabelBackgroundColour}{\void}
672
673Returns the colour used for the background of row and column labels.
674
675\membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
676
677\func{wxFont}{GetLabelFont}{\void}
678
679Returns the font used for row and column labels.
680
681\membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
682
683\func{wxColour}{GetLabelTextColour}{\void}
684
685Returns the colour used for row and column label text.
686
687\membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
688
689\func{int}{GetNumberCols}{\void}
690
691Returns the total number of grid columns (actually the number of columns in the underlying grid
692table).
693
694\membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
695
696\func{int}{GetNumberRows}{\void}
697
698Returns the total number of grid rows (actually the number of rows in the underlying grid table).
699
700\membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
701
702\constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}
703
704\membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}
705
706\func{int}{GetRowMinimalAcceptableHeight}{}
707
708This returns the value of the lowest row width that can be handled correctly. See
709member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.
710
711
712\membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
713
714\constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
715
716\membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
717
718\func{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
719
720Sets the arguments to the current row label alignment values.
721
722Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
723Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
724
725\perlnote{This method takes no parameters and
726returns a 2-element list {\tt ( horiz, vert )}.}
727
728\membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
729
730\func{int}{GetRowLabelSize}{\void}
731
732Returns the current width of the row labels.
733
734\membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
735
736\func{wxString}{GetRowLabelValue}{\param{int }{row}}
737
738Returns the specified row label. The default grid table class provides numeric row labels.
739If you are using a custom grid table you can override
740\helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
741your own labels.
742
743\membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
744
745\func{int}{GetRowSize}{\param{int }{row}}
746
747Returns the height of the specified row.
748
749\membersection{wxGrid::GetScrollLinesX}\label{wxgridgetscrolllinesx}
750
751\constfunc{int}{GetScrollLinesX}{\void}
752
753Returns the number of pixels per horizontal scroll increment. The default is 15.
754
755\membersection{wxGrid::GetScrollLinesY}\label{wxgridgetscrolllinesy}
756
757\constfunc{int}{GetScrollLinesY}{\void}
758
759Returns the number of pixels per vertical scroll increment. The default is 15.
760
761\membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}
762
763\constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}
764
765Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.
766
767\membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}
768
769\constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}
770
771Returns an array of singly selected cells.
772
773\membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}
774
775\constfunc{wxArrayInt}{GetSelectedCols}{\void}
776
777Returns an array of selected cols.
778
779\membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}
780
781\constfunc{wxArrayInt}{GetSelectedRows}{\void}
782
783Returns an array of selected rows.
784
785\membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
786
787\constfunc{wxColour}{GetSelectionBackground}{\void}
788
789Access or update the selection fore/back colours
790
791
792\membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}
793
794\constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}
795
796Returns an array of the top left corners of blocks of selected cells,
797see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.
798
799\membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}
800
801\constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}
802
803Returns an array of the bottom right corners of blocks of selected cells,
804see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.
805
806\membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
807
808\constfunc{wxColour}{GetSelectionForeground}{\void}
809
810
811\membersection{wxGrid::GetTable}\label{wxgridgettable}
812
813\constfunc{wxGridTableBase *}{GetTable}{\void}
814
815Returns a base pointer to the current table object.
816
817\membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
818
819\func{int}{GetViewWidth}{\void}
820
821Returned number of whole cols visible.
822
823\membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
824
825\func{void}{HideCellEditControl}{\void}
826
827Hides the in-place cell edit control.
828
829\membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
830
831\func{void}{InitColWidths}{\void}
832
833Init the m\_colWidths/Rights arrays
834
835\membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
836
837\func{void}{InitRowHeights}{\void}
838
839NB: {\it never} access m\_row/col arrays directly because they are created
840on demand, {\it always} use accessor functions instead!
841
842Init the m\_rowHeights/Bottoms arrays with default values.
843
844\membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
845
846\func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
847
848Inserts one or more new columns into a grid with the first new column at the
849specified position and returns true if successful. The updateLabels argument is not
850used at present.
851
852The sequence of actions begins with the grid object requesting the underlying grid
853table to insert new columns. If this is successful the table notifies the grid and the
854grid updates the display. For a default grid (one where you have called
855\helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
856using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
857then you must override
858\helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
859table class.
860
861\membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
862
863\func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
864
865Inserts one or more new rows into a grid with the first new row at the specified
866position and returns true if successful. The updateLabels argument is not used at
867present.
868
869The sequence of actions begins with the grid object requesting the underlying grid
870table to insert new rows. If this is successful the table notifies the grid and the
871grid updates the display. For a default grid (one where you have called
872\helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
873using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
874then you must override
875\helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
876table class.
877
878\membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}
879
880\constfunc{bool}{IsCellEditControlEnabled}{\void}
881
882Returns true if the in-place edit control is currently enabled.
883
884\membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}
885
886\constfunc{bool}{IsCurrentCellReadOnly}{\void}
887
888Returns true if the current cell has been set to read-only
889(see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).
890
891\membersection{wxGrid::IsEditable}\label{wxgridiseditable}
892
893\func{bool}{IsEditable}{\void}
894
895Returns false if the whole grid has been set as read-only or true otherwise.
896See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
897controlling the editing status of grid cells.
898
899\membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
900
901\constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
902
903\constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
904
905Is this cell currently selected.
906
907\membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}
908
909\constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}
910
911Returns true if the cell at the specified location can't be edited.
912See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
913
914\membersection{wxGrid::IsSelection}\label{wxgridisselection}
915
916\func{bool}{IsSelection}{\void}
917
918Returns true if there are currently rows, columns or blocks of cells selected.
919
920\membersection{wxGrid::IsVisible}\label{wxgridisvisible}
921
922\func{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}
923
924\func{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}
925
926Returns true if a cell is either wholly visible (the default) or at least partially
927visible in the grid window.
928
929\membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
930
931\func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
932
933\func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
934
935Brings the specified cell into the visible grid cell area with minimal scrolling. Does
936nothing if the cell is already visible.
937
938\membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
939
940\func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
941
942Moves the grid cursor down by one row. If a block of cells was previously selected it
943will expand if the argument is true or be cleared if the argument is false.
944
945\wxheading{Keyboard}\\
946This function is called for Down cursor key presses or Shift+Down to expand a selection.
947
948\membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
949
950\func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
951
952Moves the grid cursor left by one column. If a block of cells was previously selected it
953will expand if the argument is true or be cleared if the argument is false.
954
955\wxheading{Keyboard}\\
956This function is called for Left cursor key presses or Shift+Left to expand a selection.
957
958\membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
959
960\func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
961
962Moves the grid cursor right by one column. If a block of cells was previously selected it
963will expand if the argument is true or be cleared if the argument is false.
964
965\wxheading{Keyboard}\\
966This function is called for Right cursor key presses or Shift+Right to expand a selection.
967
968\membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
969
970\func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
971
972Moves the grid cursor up by one row. If a block of cells was previously selected it
973will expand if the argument is true or be cleared if the argument is false.
974
975\wxheading{Keyboard}\\
976This function is called for Up cursor key presses or Shift+Up to expand a selection.
977
978\membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
979
980\func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
981
982Moves the grid cursor down in the current column such that it skips to the beginning or
983end of a block of non-empty cells. If a block of cells was previously selected it
984will expand if the argument is true or be cleared if the argument is false.
985
986\wxheading{Keyboard}\\
987This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
988
989\membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
990
991\func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
992
993Moves the grid cursor left in the current row such that it skips to the beginning or
994end of a block of non-empty cells. If a block of cells was previously selected it
995will expand if the argument is true or be cleared if the argument is false.
996
997\wxheading{Keyboard}\\
998This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
999
1000\membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}
1001
1002\func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}
1003
1004Moves the grid cursor right in the current row such that it skips to the beginning or
1005end of a block of non-empty cells. If a block of cells was previously selected it
1006will expand if the argument is true or be cleared if the argument is false.
1007
1008\wxheading{Keyboard}\\
1009This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1010
1011\membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}
1012
1013\func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}
1014
1015Moves the grid cursor up in the current column such that it skips to the beginning or
1016end of a block of non-empty cells. If a block of cells was previously selected it
1017will expand if the argument is true or be cleared if the argument is false.
1018
1019\wxheading{Keyboard}\\
1020This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1021
1022\membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}
1023
1024\func{bool}{MovePageDown}{\void}
1025
1026Moves the grid cursor down by some number of rows so that the previous bottom visible row
1027becomes the top visible row.
1028
1029\wxheading{Keyboard}\\
1030This function is called for PgDn keypresses.
1031
1032\membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}
1033
1034\func{bool}{MovePageUp}{\void}
1035
1036Moves the grid cursor up by some number of rows so that the previous top visible row
1037becomes the bottom visible row.
1038
1039\wxheading{Keyboard}\\
1040This function is called for PgUp keypresses.
1041
1042\membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1043
1044\func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1045
1046Methods for a registry for mapping data types to Renderers/Editors
1047
1048\membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}
1049
1050\func{void}{SaveEditControlValue}{\void}
1051
1052Sets the value of the current grid cell to the current in-place edit control value.
1053This is called automatically when the grid cursor moves from the current cell to a
1054new cell. It is also a good idea to call this function when closing a grid since
1055any edits to the final cell location will not be saved otherwise.
1056
1057\membersection{wxGrid::SelectAll}\label{wxgridselectall}
1058
1059\func{void}{SelectAll}{\void}
1060
1061Selects all cells in the grid.
1062
1063\membersection{wxGrid::SelectBlock}\label{wxgridselectblock}
1064
1065\func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
1066\param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}
1067
1068\func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
1069\param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}
1070
1071Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
1072deselected; if true the column will be added to the existing selection.
1073
1074\membersection{wxGrid::SelectCol}\label{wxgridselectcol}
1075
1076\func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}
1077
1078Selects the specified column. If addToSelected is false then any existing selection will be
1079deselected; if true the column will be added to the existing selection.
1080
1081\membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1082
1083\func{wxRect}{SelectionToDeviceRect}{\void}
1084
1085This function returns the rectangle that encloses the selected cells
1086in device coords and clipped to the client size of the grid window.
1087
1088
1089\membersection{wxGrid::SelectRow}\label{wxgridselectrow}
1090
1091\func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}
1092
1093Selects the specified row. If addToSelected is false then any existing selection will be
1094deselected; if true the row will be added to the existing selection.
1095
1096\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1097
1098\func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
1099
1100\func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1101
1102Sets the horizontal and vertical alignment for grid cell text at the specified location.
1103
1104Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
1105Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1106
1107\membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1108
1109\func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1110
1111
1112\membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
1113
1114\func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
1115
1116Sets the editor for the grid cell at the specified location.
1117The grid will take ownership of the pointer.
1118
1119See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1120the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1121
1122\membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
1123
1124\func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}
1125
1126Sets the font for text in the grid cell at the specified location.
1127
1128\membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
1129
1130\func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
1131
1132Sets the renderer for the grid cell at the specified location.
1133The grid will take ownership of the pointer.
1134
1135See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1136the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1137
1138\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1139
1140\func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1141
1142\func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1143
1144\func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}
1145
1146Sets the text colour for the grid cell at the specified location.
1147
1148\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1149
1150\func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
1151
1152\func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
1153
1154\func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1155
1156Sets the string value for the cell at the specified location. For simple applications where a
1157grid object automatically uses a default grid table of string values you use this function together
1158with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
1159
1160For more complex applications where you have derived your own grid table class that contains
1161various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
1162function for those cells that contain string values.
1163
1164The last form is for backward compatibility only.
1165
1166See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
1167and the \helpref{wxGrid overview}{gridoverview} for more information.
1168
1169\membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
1170
1171\func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
1172
1173Sets the cell attributes for all cells in the specified column.
1174
1175For more information about controlling grid cell attributes see the
1176\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
1177\helpref{wxGrid classes overview}{gridoverview}.
1178
1179\membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
1180
1181\func{void}{SetColFormatBool}{\param{int }{col}}
1182
1183Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
1184
1185\membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
1186
1187\func{void}{SetColFormatNumber}{\param{int }{col}}
1188
1189Sets the specified column to display integer values.
1190
1191\membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
1192
1193\func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
1194
1195Sets the specified column to display floating point values with the given width and precision.
1196
1197\membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
1198
1199\func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
1200
1201Sets the specified column to display data in a custom format.
1202See the \helpref{wxGrid overview}{gridoverview} for more information on working
1203with custom data types.
1204
1205\membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
1206
1207\func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1208
1209Sets the horizontal and vertical alignment of column label text.
1210
1211Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1212
1213Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1214
1215\membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
1216
1217\func{void}{SetColLabelSize}{\param{int }{height}}
1218
1219Sets the height of the column labels.
1220
1221\membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
1222
1223\func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}
1224
1225Set the value for the given column label. If you are using a derived grid table you must
1226override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
1227for this to have any effect.
1228
1229\membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
1230
1231\func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
1232
1233Sets the minimal width for the specified column. This should normally be called when creating the grid
1234because it will not resize a column that is already narrower than the minimal width.
1235The width argument must be higher than the minimimal acceptable column width, see
1236\helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.
1237
1238\membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}
1239
1240\func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}
1241
1242This modifies the minimum column width that can be handled correctly. Specifying a low value here
1243allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1244than the actual minimum size will incur a performance penalty in the functions which perform
1245grid cell index lookup on the basis of screen coordinates.
1246This should normally be called when creating the grid because it will not resize existing columns
1247with sizes smaller than the value specified here.
1248
1249\membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
1250
1251\func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
1252
1253Sets the width of the specified column.
1254
1255This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1256block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1257
1258Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1259also be set as the minimal width for the column.
1260
1261\wxheading{Note}\\
1262wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1263The memory requirements for this could become prohibitive if your grid is very large.
1264
1265\membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1266
1267\func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1268
1269Sets the default horizontal and vertical alignment for grid cell text.
1270
1271Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1272
1273Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1274
1275\membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1276
1277\func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}
1278
1279Sets the default background colour for grid cells.
1280
1281\membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1282
1283\func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}
1284
1285Sets the default font to be used for grid cell text.
1286
1287\membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}
1288
1289\func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}
1290
1291Sets the current default colour for grid cell text.
1292
1293\membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1294
1295\func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1296
1297Sets the default editor for grid cells. The grid will take ownership of the pointer.
1298
1299See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1300the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1301
1302\membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1303
1304\func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1305
1306Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1307
1308See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1309the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1310
1311\membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
1312
1313\func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}
1314
1315Sets the default width for columns in the grid. This will only affect columns subsequently added to
1316the grid unless resizeExistingCols is true.
1317
1318\membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1319
1320\func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}
1321
1322Sets the default height for rows in the grid. This will only affect rows subsequently added
1323to the grid unless resizeExistingRows is true.
1324
1325\membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1326
1327\func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
1328
1329Set the grid cursor to the specified cell.
1330This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
1331
1332\membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
1333
1334\func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}
1335
1336Sets the colour used to draw grid lines.
1337
1338\membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1339
1340\func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}
1341
1342Sets the background colour for row and column labels.
1343
1344\membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
1345
1346\func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}
1347
1348Sets the font for row and column labels.
1349
1350\membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1351
1352\func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}
1353
1354Sets the colour for row and column label text.
1355
1356\membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1357
1358\func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1359
1360A grid may occupy more space than needed for its rows/columns. This
1361function allows to set how big this extra space is
1362
1363\membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1364
1365\func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1366
1367Common part of AutoSizeColumn/Row() and GetBestSize()
1368
1369\membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1370
1371\func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1372
1373\membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1374
1375\func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}
1376
1377Makes the cell at the specified location read-only or editable.
1378See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1379
1380\membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
1381
1382\func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
1383
1384Sets the cell attributes for all cells in the specified row.
1385See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1386about controlling cell attributes.
1387
1388\membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
1389
1390\func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1391
1392Sets the horizontal and vertical alignment of row label text.
1393
1394Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1395
1396Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1397
1398\membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
1399
1400\func{void}{SetRowLabelSize}{\param{int }{width}}
1401
1402Sets the width of the row labels.
1403
1404\membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
1405
1406\func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}
1407
1408Set the value for the given row label. If you are using a derived grid table you must
1409override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
1410for this to have any effect.
1411
1412\membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
1413
1414\func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}
1415
1416Sets the minimal height for the specified row. This should normally be called when creating the grid
1417because it will not resize a row that is already shorter than the minimal height.
1418The height argument must be higher than the minimimal acceptable row height, see
1419\helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.
1420
1421\membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}
1422
1423\func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}
1424
1425This modifies the minimum row width that can be handled correctly. Specifying a low value here
1426allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1427than the actual minimum size will incur a performance penalty in the functions which perform
1428grid cell index lookup on the basis of screen coordinates.
1429This should normally be called when creating the grid because it will not resize existing rows
1430with sizes smaller than the value specified here.
1431
1432\membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
1433
1434\func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
1435
1436Sets the height of the specified row.
1437
1438This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1439block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1440
1441Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1442also be set as the minimal width for the column.
1443
1444\wxheading{Note}
1445
1446wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1447The memory requirements for this could become prohibitive if your grid is very large.
1448
1449\membersection{wxGrid::SetScrollLinesX}\label{wxgridsetscrolllinesx}
1450
1451\func{void}{SetScrollLinesX}{\param{int }{x}}
1452
1453Sets the number of pixels per horizontal scroll increment. The default is 15.
1454Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1455errors: setting this to 1 can help.
1456
1457\membersection{wxGrid::SetScrollLinesY}\label{wxgridsetscrolllinesy}
1458
1459\func{void}{SetScrollLinesY}{\param{int }{y}}
1460
1461Sets the number of pixels per vertical scroll increment. The default is 15.
1462Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1463errors: setting this to 1 can help.
1464
1465\membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
1466
1467\func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
1468
1469
1470\membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
1471
1472\func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
1473
1474
1475\membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
1476
1477\func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}
1478
1479Set the selection behaviour of the grid.
1480
1481\wxheading{Parameters}
1482
1483\docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
1484
1485\docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
1486
1487\docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}
1488
1489\membersection{wxGrid::SetTable}\label{wxgridsettable}
1490
1491\func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
1492
1493Passes a pointer to a custom grid table to be used by the grid. This should be called
1494after the grid constructor and before using the grid object. If takeOwnership is set to
1495true then the table will be deleted by the wxGrid destructor.
1496
1497Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
1498application involves complex or non-string data or data sets that are too large to fit
1499wholly in memory.
1500
1501\membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
1502
1503\func{void}{ShowCellEditControl}{\void}
1504
1505Displays the in-place cell edit control for the current cell.
1506
1507\membersection{wxGrid::XToCol}\label{wxgridxtocol}
1508
1509\func{int}{XToCol}{\param{int }{x}}
1510
1511Returns the grid column that corresponds to the logical x coordinate. Returns
1512{\tt wxNOT\_FOUND} if there is no column at the x position.
1513
1514\membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
1515
1516\func{int}{XToEdgeOfCol}{\param{int }{x}}
1517
1518Returns the column whose right hand edge is close to the given logical x position.
1519If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.
1520
1521\membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
1522
1523\func{int}{YToEdgeOfRow}{\param{int }{y}}
1524
1525Returns the row whose bottom edge is close to the given logical y position.
1526If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.
1527
1528\membersection{wxGrid::YToRow}\label{wxgridytorow}
1529
1530\func{int}{YToRow}{\param{int }{y}}
1531
1532Returns the grid row that corresponds to the logical y coordinate. Returns
1533{\tt wxNOT\_FOUND} if there is no row at the y position.
1534