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