]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/grid.tex
Renamed existing wxGrid::SelectBlock to HighlightBlock.
[wxWidgets.git] / docs / latex / wx / grid.tex
CommitLineData
a660d684
KB
1\section{\class{wxGrid}}\label{wxgrid}
2
78c49c58
MB
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.
a660d684 22
fa482912 23
a660d684
KB
24\wxheading{Derived from}
25
5c69031c
MB
26% UNCOMMENT THIS BEFORE COMMITTING TO CVS
27\begin{comment}
78c49c58 28\helpref{wxScrolledWindow}{wxscrolledwindow}\\
a660d684
KB
29\helpref{wxWindow}{wxwindow}\\
30\helpref{wxEvtHandler}{wxevthandler}\\
31\helpref{wxObject}{wxobject}
5c69031c 32\end{comment}
a660d684 33
954b8ae6
JS
34\wxheading{Include files}
35
36<wx/grid.h>
37
a660d684
KB
38\wxheading{Window styles}
39
78c49c58 40There are presently no specific window styles for wxGrid.
a660d684 41
78c49c58 42\wxheading{Event handling}
a660d684
KB
43
44\wxheading{See also}
45
78c49c58 46\helpref{wxGrid overview}{gridoverview}
a660d684 47
78c49c58
MB
48%%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
49\latexignore{\rtfignore{\wxheading{Function groups}}}
a660d684 50
78c49c58 51\membersection{Constructors and initialization}
a660d684 52
78c49c58
MB
53\helpref{wxGrid}{wxgridctor} \\
54\helpref{\destruct{wxGrid}}{wxgriddtor} \\
55\helpref{CreateGrid}{wxgridcreategrid} \\
56\helpref{SetTable}{wxgridsettable}
a660d684 57
78c49c58 58\membersection{Display format}
a660d684 59
78c49c58 60\membersection{Selection functions}
a660d684 61
5c69031c
MB
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
78c49c58
MB
69%%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
70\helponly{\insertatlevel{2}{
a660d684 71
78c49c58
MB
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}).
a660d684
KB
95
96\membersection{wxGrid::AppendCols}\label{wxgridappendcols}
97
78c49c58
MB
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.
a660d684 102
78c49c58
MB
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.
a660d684
KB
106
107\membersection{wxGrid::AppendRows}\label{wxgridappendrows}
108
78c49c58
MB
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.
a660d684 127
78c49c58
MB
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.
a660d684
KB
171
172\membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch}
173
174\func{void}{BeginBatch}{\void}
175
78c49c58
MB
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.
a660d684 181
78c49c58 182\membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize}
a660d684 183
78c49c58 184\func{bool}{CanDragColSize}{\void}
a660d684 185
78c49c58
MB
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}).
a660d684 190
78c49c58 191\membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize}
a660d684 192
78c49c58 193\func{bool}{CanDragRowSize}{\void}
a660d684 194
78c49c58
MB
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}).
a660d684 199
78c49c58 200\membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize}
a660d684 201
78c49c58 202\func{bool}{CanDragGridSize}{\void}
a660d684 203
78c49c58 204Return TRUE if the dragging of grid lines to resize rows and columns is enabled or FALSE otherwise.
21f280f4 205
78c49c58 206\membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol}
a660d684 207
78c49c58 208\constfunc{bool}{CanEnableCellControl}{\void}
a660d684 209
78c49c58
MB
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
5c69031c
MB
230\membersection{wxGrid::ClearSelection}\label{wxgridclearselection}
231
232\func{void}{ClearSelection}{\void}
233
234Deselects all cells that are currently selected.
235
78c49c58
MB
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}.
a660d684
KB
248
249\membersection{wxGrid::DeleteCols}\label{wxgriddeletecols}
250
78c49c58 251\func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = TRUE}}
a660d684 252
78c49c58
MB
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.
a660d684
KB
259
260\membersection{wxGrid::DeleteRows}\label{wxgriddeleterows}
261
78c49c58
MB
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}}
a660d684 309
78c49c58
MB
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.
a660d684
KB
345
346\membersection{wxGrid::EndBatch}\label{wxgridendbatch}
347
348\func{void}{EndBatch}{\void}
349
78c49c58
MB
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}
a660d684 358
78c49c58
MB
359\func{void}{ForceRefresh}{\void}
360
361Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
a660d684
KB
362
363\membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}
364
78c49c58 365\func{int}{GetBatchCount}{\void}
a660d684 366
78c49c58
MB
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.
a660d684 370
78c49c58 371\membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}
a660d684 372
78c49c58 373\func{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}}
a660d684 374
78c49c58
MB
375Sets the arguments to the horizontal and vertical text alignment values for the
376grid cell at the specified location.
a660d684 377
78c49c58
MB
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.
a660d684 380
78c49c58 381\membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}
a660d684 382
78c49c58 383\func{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}}
a660d684 384
78c49c58 385Returns the background colour of the cell at the specified location.
a660d684 386
78c49c58 387\membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor}
a660d684 388
78c49c58 389\func{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}}
a660d684 390
78c49c58 391Returns a pointer to the editor for the cell at the specified location.
21f280f4 392
78c49c58
MB
393See \helpref{wxGridCellEditor}{wxgridcelleditor} and
394the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
a660d684 395
78c49c58 396\membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont}
a660d684 397
78c49c58 398\func{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}}
a660d684 399
78c49c58 400Returns the font for text in the grid cell at the specified location.
a660d684 401
78c49c58 402\membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer}
21f280f4 403
78c49c58 404\func{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}}
a660d684 405
78c49c58 406Returns a pointer to the renderer for the grid cell at the specified location.
a660d684 407
78c49c58
MB
408See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
409the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
a660d684
KB
410
411\membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}
412
78c49c58 413\func{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}}
a660d684 414
78c49c58 415Returns the text colour for the grid cell at the specified location.
a660d684 416
5c69031c
MB
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
78c49c58 434\membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment}
a660d684 435
78c49c58 436\func{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
21f280f4 437
78c49c58 438Sets the arguments to the current column label alignment values.
a660d684 439
78c49c58
MB
440Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
441Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
a660d684 442
78c49c58 443\membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize}
a660d684 444
78c49c58 445\func{int}{GetColLabelSize}{\void}
a660d684 446
78c49c58 447Returns the current height of the column labels.
21f280f4 448
78c49c58 449\membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue}
a660d684 450
78c49c58 451\func{wxString}{GetColLabelValue}{\param{int }{col}}
a660d684 452
78c49c58
MB
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.
a660d684 457
78c49c58 458\membersection{wxGrid::GetColSize}\label{wxgridgetcolsize}
a660d684 459
78c49c58 460\func{int}{GetColSize}{\param{int }{col}}
a660d684 461
78c49c58 462Returns the width of the specified column.
a660d684 463
78c49c58 464\membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment}
a660d684 465
78c49c58 466\func{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
a660d684 467
78c49c58
MB
468Sets the arguments to the current default horizontal and vertical text alignment
469values.
a660d684 470
78c49c58
MB
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.
a660d684 473
78c49c58 474\membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour}
a660d684 475
78c49c58 476\func{wxColour}{GetDefaultCellBackgroundColour}{\void}
a660d684 477
78c49c58 478Returns the current default background colour for grid cells.
a660d684 479
78c49c58 480\membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont}
a660d684 481
78c49c58 482\func{wxFont}{GetDefaultCellFont}{\void}
a660d684 483
78c49c58 484Returns the current default font for grid cell text.
a660d684 485
78c49c58 486\membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour}
a660d684 487
78c49c58 488\func{wxColour}{GetDefaultCellTextColour}{\void}
a660d684 489
78c49c58 490Returns the current default colour for grid cell text.
a660d684 491
78c49c58 492\membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize}
a660d684 493
78c49c58 494\func{int}{GetDefaultColLabelSize}{\void}
a660d684 495
78c49c58 496Returns the default height for column labels.
c0b042fc 497
78c49c58 498\membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize}
c0b042fc 499
78c49c58 500\func{int}{GetDefaultColSize}{\void}
c0b042fc 501
78c49c58 502Returns the current default width for grid columns.
a660d684 503
78c49c58 504\membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor}
a660d684 505
78c49c58 506\constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void}
a660d684 507
78c49c58
MB
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.
a660d684 521
78c49c58 522\membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize}
a660d684 523
78c49c58
MB
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.
a660d684
KB
557
558\membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
559
78c49c58 560\func{wxColour}{GetLabelBackgroundColour}{\void}
a660d684 561
78c49c58 562Returns the colour used for the background of row and column labels.
a660d684 563
78c49c58 564\membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
a660d684 565
78c49c58 566\func{wxFont}{GetLabelFont}{\void}
a660d684 567
78c49c58 568Returns the font used for row and column labels.
a660d684
KB
569
570\membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
571
78c49c58 572\func{wxColour}{GetLabelTextColour}{\void}
a660d684 573
78c49c58 574Returns the colour used for row and column label text.
a660d684 575
78c49c58 576\membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
a660d684 577
78c49c58 578\func{int}{GetNumberCols}{\void}
a660d684 579
78c49c58
MB
580Returns the total number of grid columns (actually the number of columns in the underlying grid
581table).
a660d684 582
78c49c58 583\membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
a660d684 584
78c49c58 585\func{int}{GetNumberRows}{\void}
a660d684 586
78c49c58 587Returns the total number of grid rows (actually the number of rows in the underlying grid table).
a660d684 588
78c49c58 589\membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
a660d684 590
78c49c58 591\func{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
a660d684 592
78c49c58 593Sets the arguments to the current row label alignment values.
a660d684 594
78c49c58
MB
595Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
596Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
a660d684 597
78c49c58 598\membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
a660d684 599
78c49c58 600\func{int}{GetRowLabelSize}{\void}
a660d684 601
78c49c58 602Returns the current width of the row labels.
a660d684 603
78c49c58 604\membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
a660d684 605
78c49c58 606\func{wxString}{GetRowLabelValue}{\param{int }{row}}
a660d684 607
78c49c58
MB
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.
a660d684 612
78c49c58 613\membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
a660d684 614
78c49c58 615\func{int}{GetRowSize}{\param{int }{row}}
a660d684 616
78c49c58 617Returns the height of the specified row.
a660d684 618
78c49c58 619\membersection{wxGrid::GetTable}\label{wxgridgettable}
a660d684 620
78c49c58 621\constfunc{wxGridTableBase *}{GetTable}{\void}
a660d684 622
78c49c58 623Returns a base pointer to the current table object.
a660d684 624
78c49c58 625\membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
a660d684 626
78c49c58
MB
627\func{void}{HideCellEditControl}{\void}
628
629Hides the in-place cell edit control.
a660d684
KB
630
631\membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
632
78c49c58
MB
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.
a660d684 638
78c49c58
MB
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.
a660d684
KB
647
648\membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
649
78c49c58 650\func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = TRUE}}
a660d684 651
78c49c58
MB
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.
a660d684 655
78c49c58
MB
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}
a660d684 679
78c49c58 680\func{bool}{IsEditable}{\void}
a660d684 681
78c49c58
MB
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.
a660d684 685
5c69031c
MB
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
78c49c58 699\membersection{wxGrid::IsVisible}\label{wxgridisvisible}
a660d684 700
78c49c58
MB
701\func{bool}{IsVisible}{\param{int }{row}, \param{int }{col},
702\param{bool }{wholeCellVisible = TRUE}
a660d684 703
78c49c58
MB
704\func{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords},
705\param{bool }{wholeCellVisible = TRUE}}
a660d684 706
78c49c58
MB
707Returns TRUE if a cell is either wholly visible (the default) or at least partially
708visible in the grid window.
a660d684 709
78c49c58 710\membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
a660d684 711
78c49c58 712\func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
a660d684 713
78c49c58 714\func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
a660d684 715
78c49c58
MB
716Brings the specified cell into the visible grid cell area with minimal scrolling. Does
717nothing if the cell is already visible.
a660d684 718
78c49c58 719\membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
a660d684 720
78c49c58 721\func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
a660d684 722
78c49c58
MB
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.
a660d684 725
78c49c58
MB
726\wxheading{Keyboard}\\
727This function is called for Down cursor key presses or Shift+Down to expand a selection.
a660d684 728
78c49c58 729\membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
a660d684 730
78c49c58 731\func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
a660d684 732
78c49c58
MB
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.
a660d684 735
78c49c58
MB
736\wxheading{Keyboard}\\
737This function is called for Left cursor key presses or Shift+Left to expand a selection.
a660d684 738
78c49c58 739\membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
a660d684 740
78c49c58 741\func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
a660d684 742
78c49c58
MB
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.
a660d684 745
78c49c58
MB
746\wxheading{Keyboard}\\
747This function is called for Right cursor key presses or Shift+Right to expand a selection.
a660d684 748
78c49c58 749\membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
a660d684 750
78c49c58 751\func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
a660d684 752
78c49c58
MB
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.
a660d684 755
78c49c58
MB
756\wxheading{Keyboard}\\
757This function is called for Up cursor key presses or Shift+Up to expand a selection.
a660d684 758
78c49c58 759\membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
a660d684 760
78c49c58 761\func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
a660d684 762
78c49c58
MB
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.
a660d684 766
78c49c58
MB
767\wxheading{Keyboard}\\
768This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
a660d684 769
78c49c58 770\membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
a660d684 771
78c49c58 772\func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
a660d684 773
78c49c58
MB
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.
a660d684 777
78c49c58
MB
778\wxheading{Keyboard}\\
779This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
a660d684 780
78c49c58
MB
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.
a660d684 831
5c69031c
MB
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}, \param{int }{bottomRow}, \param{int }{rightCol}}
841
842\func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft}, \param{const wxGridCellCoords\& }{bottomRight}}
843
844Highlights a rectangular block of cells but does not select it !
845
846\wxheading{Note} \\ This is obviously inconsistent with the other wxGrid::SelectXXX functions, each
847of which call the corresponding wxGridSelection function whereas wxGrid::SelectBlock is only
848responsible for highlighting a block of cells. There is presently no way to add a block to the
849selection programmatically. This will probably be changed soon so that the existing SelectBlock
850function is renamed to HighlightBlock and a new SelectBlock function introduced to call
851wxGridSelection::SelectBlock.
852
853\membersection{wxGrid::SelectCol}\label{wxgridselectcol}
854
855\func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = FALSE}}
856
857Selects the specified column. If addToSelected is FALSE then any existing selection will be
858deselected; if TRUE the column will be added to the existing selection.
859
860\membersection{wxGrid::SelectRow}\label{wxgridselectrow}
861
862\func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = FALSE}}
863
864Selects the specified row. If addToSelected is FALSE then any existing selection will be
865deselected; if TRUE the row will be added to the existing selection.
866
a660d684
KB
867\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
868
78c49c58 869\func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
a660d684 870
78c49c58 871Sets the horizontal and vertial alignment for grid cell text at the specified location.
a660d684 872
78c49c58
MB
873Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
874Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
a660d684 875
78c49c58 876\membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
21f280f4 877
78c49c58
MB
878\func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
879
880Sets the editor for the grid cell at the specified location.
881The grid will take ownership of the pointer.
882
883See \helpref{wxGridCellEditor}{wxgridcelleditor} and
884the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
885
886\membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
887
888\func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const }{wxFont\&}}
889
890Sets the font for text in the grid cell at the specified location.
a660d684 891
78c49c58 892\membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
a660d684 893
78c49c58 894\func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
a660d684 895
78c49c58
MB
896Sets the renderer for the grid cell at the specified location.
897The grid will take ownership of the pointer.
a660d684 898
78c49c58
MB
899See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
900the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
21f280f4 901
a660d684
KB
902\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
903
78c49c58 904\func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const }{wxColour\&}}
a660d684 905
78c49c58 906Sets the text colour for the grid cell at the specified location.
a660d684 907
5c69031c
MB
908\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
909
910\func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
911
912\func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
913
914Sets the string value for the cell at the specified location. For simple applications where a
915grid object automatically uses a default grid table of string values you use this function together
916with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
917
918For more complex applications where you have derived your own grid table class that contains
919various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
920function for those cells that contain string values.
921
922See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
923and the \helpref{wxGrid overview}{gridoverview} for more information.
924
78c49c58 925\membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
a660d684 926
78c49c58 927\func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
21f280f4 928
78c49c58 929Sets the cell attributes for all cells in the specified column.
a660d684 930
78c49c58
MB
931For more information about controlling grid cell attributes see the
932\helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
933\helpref{wxGrid classes overview}{gridoverview}.
a660d684 934
78c49c58 935\membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
a660d684 936
78c49c58 937\func{void}{SetColFormatBool}{\param{int }{col}}
a660d684 938
78c49c58 939Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
21f280f4 940
78c49c58 941\membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
a660d684 942
78c49c58 943\func{void}{SetColFormatNumber}{\param{int }{col}}
a660d684 944
78c49c58 945Sets the specified column to display integer values.
a660d684 946
78c49c58 947\membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
a660d684 948
78c49c58 949\func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
a660d684 950
78c49c58 951Sets the specified column to display floating point values with the given width and precision.
a660d684 952
78c49c58 953\membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
a660d684 954
78c49c58 955\func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
a660d684 956
78c49c58
MB
957Sets the specified column to display data in a custom format.
958See the \helpref{wxGrid overview}{gridoverview} for more information on working
959with custom data types.
a660d684 960
78c49c58 961\membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
a660d684 962
78c49c58 963\func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
a660d684 964
78c49c58 965Sets the horizontal and vertical alignment of column label text.
a660d684 966
78c49c58
MB
967Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
968Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
969
970\membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
971
972\func{void}{SetColLabelSize}{\param{int }{height}}
973
974Sets the height of the column labels.
975
976\membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
977
978\func{void}{SetColLabelValue}{\param{int }{col}, \param{const }{wxString\&}}
979
980Set the value for the given column label. If you are using a derived grid table you must
981override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
982for this to have any effect.
983
984\membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
985
986\func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
987
988Sets the minimal width for the specified column. This should normally be called when creating the grid
989because it will not resize a column that is already narrower than the minimal width.
990
991\membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
992
993\func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
994
995Sets the width of the specified column.
996
997This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
998block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
999
1000Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1001also be set as the minimal width for the column.
1002
1003\wxheading{Note} \\
1004wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1005The memory requirements for this could become prohibitive if your grid is very large.
1006
1007\membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1008
1009\func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1010
1011Sets the default horizontal and vertial alignment for grid cell text.
1012
1013Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1014Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
1015
1016\membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1017
1018\func{void}{SetDefaultCellBackgroundColour}{\param{const }{wxColour\&}}
1019
1020Sets the default background colour for grid cells.
1021
1022\membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1023
1024\func{void}{SetDefaultCellFont}{\param{const }{wxFont\&}}
1025
1026Sets the default font to be used for grid cell text.
1027
1028\membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1029
1030\func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1031
1032Sets the default editor for grid cells. The grid will take ownership of the pointer.
1033
1034See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1035the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1036
1037\membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1038
1039\func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1040
1041Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1042
1043See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1044the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1045
1046\membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
c0b042fc 1047
78c49c58 1048\func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = FALSE}}
c0b042fc 1049
78c49c58
MB
1050Sets the default width for columns in the grid. This will only affect columns subsequently added to
1051the grid unless resizeExistingCols is TRUE.
1052
1053\membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1054
1055\func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = FALSE}}
1056
1057Sets the default height for rows in the grid. This will only affect rows subsequently added
1058to the grid unless resizeExistingRows is TRUE.
c0b042fc 1059
a660d684
KB
1060\membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1061
78c49c58 1062\func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
a660d684 1063
78c49c58
MB
1064Set the grid cursor to the specified cell.
1065This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
a660d684 1066
78c49c58 1067\membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
a660d684 1068
78c49c58 1069\func{void}{SetGridLineColour}{\param{const }{wxColour\&}}
a660d684 1070
78c49c58 1071Sets the colour used to draw grid lines.
a660d684
KB
1072
1073\membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1074
78c49c58 1075\func{void}{SetLabelBackgroundColour}{\param{const }{wxColour\&}}
a660d684 1076
78c49c58 1077Sets the background colour for row and column labels.
a660d684 1078
78c49c58 1079\membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
a660d684 1080
78c49c58 1081\func{void}{SetLabelFont}{\param{const }{wxFont\&}}
a660d684 1082
78c49c58 1083Sets the font for row and column labels.
a660d684
KB
1084
1085\membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1086
78c49c58 1087\func{void}{SetLabelTextColour}{\param{const }{wxColour\&}}
a660d684 1088
78c49c58 1089Sets the colour for row and column label text.
a660d684 1090
5c69031c
MB
1091\membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1092
1093\func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = TRUE}}
1094
1095Makes the cell at the specified location read-only or editable.
1096See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1097
78c49c58 1098\membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
a660d684 1099
78c49c58 1100\func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
a660d684 1101
78c49c58
MB
1102Sets the cell attributes for all cells in the specified row.
1103See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1104about controlling cell attributes.
a660d684 1105
78c49c58 1106\membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
a660d684 1107
78c49c58 1108\func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
a660d684 1109
78c49c58 1110Sets the horizontal and vertical alignment of row label text.
a660d684 1111
78c49c58
MB
1112Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1113Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
a660d684 1114
78c49c58 1115\membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
a660d684 1116
78c49c58 1117\func{void}{SetRowLabelSize}{\param{int }{width}}
a660d684 1118
78c49c58
MB
1119Sets the width of the row labels.
1120
1121\membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
1122
1123\func{void}{SetRowLabelValue}{\param{int }{row}, \param{const }{wxString\&}}
1124
1125Set the value for the given row label. If you are using a derived grid table you must
1126override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
1127for this to have any effect.
1128
1129\membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
1130
1131\func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{width}}
1132
1133Sets the minimal height for the specified row. This should normally be called when creating the grid
1134because it will not resize a row that is already shorter than the minimal height.
1135
1136\membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
1137
1138\func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
1139
1140Sets the height of the specified row.
1141
1142This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1143block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1144
1145Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1146also be set as the minimal width for the column.
1147
1148\wxheading{Note} \\
1149wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1150The memory requirements for this could become prohibitive if your grid is very large.
1151
1152\membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
1153
1154\func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{selmode}}
1155
1156Set the selection behaviour of the grid.
1157
1158\wxheading{Parameters}
1159
1160\docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
1161
1162\docparam(wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
1163
1164\docparam{wxGrid::wxGridSelectionColumns}{Selections will consist of whole columns.}
1165
1166\membersection{wxGrid::SetTable}\label{wxgridsettable}
1167
1168\func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = FALSE}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
1169
1170Passes a pointer to a custom grid table to be used by the grid. This should be called
1171after the grid constructor and before using the grid object. If takeOwnership is set to
1172TRUE then the table will be deleted by the wxGrid destructor.
1173
1174Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
1175application involves complex or non-string data or data sets that are too large to fit
1176wholly in memory.
1177
1178\membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
1179
1180\func{void}{ShowCellEditControl}{\void}
1181
1182Displays the in-place cell edit control for the current cell.
1183
1184\membersection{wxGrid::XToCol}\label{wxgridxtocol}
1185
1186\func{int}{XToCol}{\param{int }{x}}
1187
1188Returns the grid column that corresponds to the logical x coordinate. Returns
1189wxNOT_FOUND if there is no column at the x position.
1190
1191\membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
1192
1193\func{int}{XToEdgeOfCol}{\param{int }{x}}
1194
1195Returns the column whose right hand edge is close to the given logical x position.
1196If no column edge is near to this position wxNOT_FOUND is returned.
1197
1198\membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
1199
1200\func{int}{YToEdgeOfRow}{\param{int }{y}}
1201
1202Returns the row whose bottom edge is close to the given logical y position.
1203If no row edge is near to this position wxNOT_FOUND is returned.
1204
1205\membersection{wxGrid::YToRow}\label{wxgridytorow}
1206
1207\func{int}{YToRow}{\param{int }{y}}
1208
1209Returns the grid row that corresponds to the logical y coordinate. Returns
1210wxNOT_FOUND if there is no row at the y position.
1211
1212
1213
78c49c58
MB
1214\membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
1215
1216\func{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
1217
1218\func{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
1219
1220
1221\membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect}
1222
1223\func{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}}
1224
1225This function returns the rectangle that encloses the block of cells
1226limited by TopLeft and BottomRight cell in device coords and clipped
1227to the client size of the grid window.
1228
1229
1230\membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1231
1232\func{wxRect}{SelectionToDeviceRect}{\void}
1233
1234This function returns the rectangle that encloses the selected cells
1235in device coords and clipped to the client size of the grid window.
1236
1237
1238\membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
1239
1240\constfunc{wxColour}{GetSelectionBackground}{\void}
1241
1242Access or update the selection fore/back colours
1243
1244
1245\membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
1246
1247\constfunc{wxColour}{GetSelectionForeground}{\void}
1248
1249
1250\membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
1251
1252\func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
1253
1254
1255\membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
1256
1257\func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
1258
1259
1260\membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1261
1262\func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1263
1264Methods for a registry for mapping data types to Renderers/Editors
1265
1266
1267\membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell}
1268
1269\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}}
1270
1271\constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}}
1272
1273
1274\membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell}
1275
1276\constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}}
1277
1278
1279\membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype}
1280
1281\constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}}
1282
1283
1284\membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype}
1285
1286\constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}}
1287
1288
1289\membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1290
1291\func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1292
1293grid may occupy more space than needed for its rows/columns, this
1294function allows to set how big this extra space is
1295
1296
1297\membersection{wxGrid::wxGrid}\label{wxgridwxgrid}
1298
1299\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}}
1300
1301------ For compatibility with previous wxGrid only...
1302
1303** Don't use these in new code because they **
1304** are liable to disappear in a future **
1305** revision **
1306
1307
1308
1309\membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1310
1311\func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1312
1313
1314\membersection{wxGrid::UpdateDimensions}\label{wxgridupdatedimensions}
1315
1316\func{void}{UpdateDimensions}{\void}
1317
1318
1319\membersection{wxGrid::GetRows}\label{wxgridgetrows}
1320
1321\func{int}{GetRows}{\void}
1322
1323
1324\membersection{wxGrid::GetCols}\label{wxgridgetcols}
1325
1326\func{int}{GetCols}{\void}
1327
1328
1329\membersection{wxGrid::GetCursorRow}\label{wxgridgetcursorrow}
1330
1331\func{int}{GetCursorRow}{\void}
1332
1333
1334\membersection{wxGrid::GetCursorColumn}\label{wxgridgetcursorcolumn}
1335
1336\func{int}{GetCursorColumn}{\void}
1337
1338
1339\membersection{wxGrid::GetScrollPosX}\label{wxgridgetscrollposx}
1340
1341\func{int}{GetScrollPosX}{\void}
1342
1343
1344\membersection{wxGrid::GetScrollPosY}\label{wxgridgetscrollposy}
1345
1346\func{int}{GetScrollPosY}{\void}
1347
1348
1349\membersection{wxGrid::SetScrollX}\label{wxgridsetscrollx}
1350
1351\func{void}{SetScrollX}{\param{int }{WXUNUSED(x)}}
1352
1353
1354\membersection{wxGrid::SetScrollY}\label{wxgridsetscrolly}
1355
1356\func{void}{SetScrollY}{\param{int }{WXUNUSED(y)}}
1357
1358
1359\membersection{wxGrid::SetColumnWidth}\label{wxgridsetcolumnwidth}
1360
1361\func{void}{SetColumnWidth}{\param{int }{col}, \param{int }{width}}
1362
1363
1364\membersection{wxGrid::GetColumnWidth}\label{wxgridgetcolumnwidth}
1365
1366\func{int}{GetColumnWidth}{\param{int }{col}}
1367
1368
1369\membersection{wxGrid::SetRowHeight}\label{wxgridsetrowheight}
1370
1371\func{void}{SetRowHeight}{\param{int }{row}, \param{int }{height}}
1372
1373
1374\membersection{wxGrid::GetViewHeight}\label{wxgridgetviewheight}
1375
1376\func{int}{GetViewHeight}{\void}
1377
1378GetRowHeight() is below
1379returned num whole rows visible
1380
1381
1382\membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
1383
1384\func{int}{GetViewWidth}{\void}
1385
1386returned num whole cols visible
1387
1388
1389\membersection{wxGrid::SetLabelSize}\label{wxgridsetlabelsize}
1390
1391\func{void}{SetLabelSize}{\param{int }{orientation}, \param{int }{sz}}
1392
1393
1394\membersection{wxGrid::GetLabelSize}\label{wxgridgetlabelsize}
1395
1396\func{int}{GetLabelSize}{\param{int }{orientation}}
1397
1398
1399\membersection{wxGrid::SetLabelAlignment}\label{wxgridsetlabelalignment}
1400
1401\func{void}{SetLabelAlignment}{\param{int }{orientation}, \param{int }{align}}
1402
1403
1404\membersection{wxGrid::GetLabelAlignment}\label{wxgridgetlabelalignment}
1405
1406\func{int}{GetLabelAlignment}{\param{int }{orientation}, \param{int }{WXUNUSED(align)}}
1407
1408
1409\membersection{wxGrid::SetLabelValue}\label{wxgridsetlabelvalue}
1410
1411\func{void}{SetLabelValue}{\param{int }{orientation}, \param{const wxString\& }{val}, \param{int }{pos}}
1412
1413
1414\membersection{wxGrid::GetLabelValue}\label{wxgridgetlabelvalue}
1415
1416\func{wxString}{GetLabelValue}{\param{int }{orientation}, \param{int }{pos}}
1417
1418
1419\membersection{wxGrid::GetCellTextFont}\label{wxgridgetcelltextfont}
1420
1421\constfunc{wxFont}{GetCellTextFont}{\void}
1422
1423
1424\membersection{wxGrid::GetCellTextFont}\label{wxgridgetcelltextfont}
1425
1426\constfunc{wxFont}{GetCellTextFont}{\param{int }{WXUNUSED(row)}, \param{int }{WXUNUSED(col)}}
1427
1428
1429\membersection{wxGrid::SetCellTextFont}\label{wxgridsetcelltextfont}
1430
1431\func{void}{SetCellTextFont}{\param{const wxFont\& }{fnt}}
1432
1433
1434\membersection{wxGrid::SetCellTextFont}\label{wxgridsetcelltextfont}
1435
1436\func{void}{SetCellTextFont}{\param{const wxFont\& }{fnt}, \param{int }{row}, \param{int }{col}}
1437
1438
1439\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1440
1441\func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1442
1443
1444\membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1445
1446\func{void}{SetCellTextColour}{\param{const wxColour\& }{col}}
1447
1448
1449\membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1450
1451\func{void}{SetCellBackgroundColour}{\param{const wxColour\& }{col}}
1452
1453\func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const }{wxColour\&}}
1454
1455\func{void}{SetCellBackgroundColour}{\param{const wxColour\& }{colour}, \param{int }{row}, \param{int }{col}}
1456
1457
1458\membersection{wxGrid::GetEditable}\label{wxgridgeteditable}
1459
1460\func{bool}{GetEditable}{\void}
1461
1462
1463\membersection{wxGrid::SetEditable}\label{wxgridseteditable}
1464
1465\func{void}{SetEditable}{\param{bool }{edit = TRUE}}
1466
1467
1468\membersection{wxGrid::GetEditInPlace}\label{wxgridgeteditinplace}
1469
1470\func{bool}{GetEditInPlace}{\void}
1471
1472
1473\membersection{wxGrid::SetEditInPlace}\label{wxgridseteditinplace}
1474
1475\func{void}{SetEditInPlace}{\param{bool }{WXUNUSED(edit) = TRUE}}
1476
1477
1478\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1479
1480\func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1481
1482
1483\membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1484
1485\func{void}{SetCellAlignment}{\param{int }{WXUNUSED(align)}}
1486
1487
1488\membersection{wxGrid::SetCellBitmap}\label{wxgridsetcellbitmap}
1489
1490\func{void}{SetCellBitmap}{\param{wxBitmap* }{WXUNUSED(bitmap)}, \param{int }{WXUNUSED(row)}, \param{int }{WXUNUSED(col)}}
1491
1492
1493\membersection{wxGrid::SetDividerPen}\label{wxgridsetdividerpen}
1494
1495\func{void}{SetDividerPen}{\param{const wxPen\& }{WXUNUSED(pen)}}
1496
1497
1498\membersection{wxGrid::GetDividerPen}\label{wxgridgetdividerpen}
1499
1500\constfunc{wxPen\&}{GetDividerPen}{\void}
1501
1502
1503\membersection{wxGrid::OnActivate}\label{wxgridonactivate}
1504
1505\func{void}{OnActivate}{\param{bool }{WXUNUSED(active)}}
1506
1507
1508\membersection{wxGrid::Fit}\label{wxgridfit}
1509
1510\func{void}{Fit}{\void}
1511
1512overridden wxWindow methods
1513
1514
1515\membersection{wxGrid::DoGetBestSize}\label{wxgriddogetbestsize}
1516
1517\constfunc{wxSize}{DoGetBestSize}{\void}
1518
1519
1520\membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
1521
1522\func{void}{InitRowHeights}{\void}
1523
1524NB: *never* access m\_row/col arrays directly because they are created
1525on demand, *always* use accessor functions instead!
1526init the m\_rowHeights/Bottoms arrays with default values
1527
1528
1529\membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
1530
1531\func{void}{InitColWidths}{\void}
1532
1533init the m\_colWidths/Rights arrays
1534
1535
1536\membersection{wxGrid::GetColWidth}\label{wxgridgetcolwidth}
1537
1538\constfunc{int}{GetColWidth}{\param{int }{col}}
1539
1540get the col/row coords
1541
1542
1543\membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft}
1544
1545\constfunc{int}{GetColLeft}{\param{int }{col}}
1546
1547
1548\membersection{wxGrid::GetColRight}\label{wxgridgetcolright}
1549
1550\constfunc{int}{GetColRight}{\param{int }{col}}
1551
1552
1553\membersection{wxGrid::GetRowHeight}\label{wxgridgetrowheight}
1554
1555\constfunc{int}{GetRowHeight}{\param{int }{row}}
1556
1557this function must be public for compatibility...
1558
1559
1560\membersection{wxGrid::GetRowTop}\label{wxgridgetrowtop}
1561
1562\constfunc{int}{GetRowTop}{\param{int }{row}}
1563
1564
1565\membersection{wxGrid::GetRowBottom}\label{wxgridgetrowbottom}
1566
1567\constfunc{int}{GetRowBottom}{\param{int }{row}}
1568
1569
1570\membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1571
1572\func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = TRUE}}
1573
1574common part of AutoSizeColumn/Row() and GetBestSize()
1575
1576
1577\membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1578
1579\func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = TRUE}}
1580
1581
1582\membersection{wxGrid::AutoSizeColOrRow}\label{wxgridautosizecolorrow}
1583
1584\func{void}{AutoSizeColOrRow}{\param{int }{n}, \param{bool }{setAsMin}, \param{bool }{column}}
1585
1586common part of AutoSizeColumn/Row()
1587or row?
1588
1589\membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth}
1590
1591\constfunc{int}{GetColMinimalWidth}{\param{int }{col}}
1592
1593get the minimal width of the given column/row
1594
1595
1596\membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
1597
1598\constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
1599
1600
1601\membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes}
1602
1603\func{bool}{CanHaveAttributes}{\void}
1604
1605do we have some place to store attributes in?
a660d684 1606
a660d684 1607
78c49c58 1608\membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
a660d684 1609
78c49c58 1610\constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}