1 \section{\class{wxGrid
}}\label{wxgrid
}
3 wxGrid and its related classes are used for displaying and editing tabular
4 data. They provide a rich set of features for display, editing, and
5 interacting with a variety of data sources. For simple applications, and to
6 help you get started, wxGrid is the only class you need to refer to
7 directly. It will set up default instances of the other classes and manage
8 them for you. For more complex applications you can derive your own
9 classes for custom grid views, grid data tables, cell editors and
10 renderers. The
\helpref{wxGrid classes overview
}{gridoverview
} has
11 examples of simple and more complex applications, explains the
12 relationship between the various grid classes and has a summary of the
13 keyboard shortcuts and mouse functions provided by wxGrid.
15 wxGrid has been greatly expanded and redesigned for wxWindows
2.2
16 onwards. If you have been using the old wxGrid class you will probably
17 want to have a look at the
\helpref{wxGrid classes overview
}{gridoverview
} to see
18 how things have changed. The new grid classes are reasonably backward-compatible
19 but there are some exceptions. There are also easier ways of doing many things compared to
20 the previous implementation.
22 \wxheading{Derived from
}
24 \helpref{wxScrolledWindow
}{wxscrolledwindow
}\\
25 \helpref{wxWindow
}{wxwindow
}\\
26 \helpref{wxEvtHandler
}{wxevthandler
}\\
27 \helpref{wxObject
}{wxobject
}
29 \wxheading{Include files
}
33 \wxheading{Window styles
}
35 There are presently no specific window styles for wxGrid.
37 \wxheading{Event handling
}
41 The event handler for the following functions takes a
42 \helpref{wxGridSizeEvent
}{wxgridsizeevent
} parameter.
45 \begin{twocollist
}\itemsep=
0pt
46 \twocolitem{{\bf EVT
\_GRID\_COL\_SIZE(func)
}}{The user resized a column by dragging it. Processes a wxEVT
\_GRID\_COL\_SIZE.
}
47 \twocolitem{{\bf EVT
\_GRID\_ROW\_SIZE(func)
}}{The user resized a row by dragging it. Processes a wxEVT
\_GRID\_ROW\_SIZE.
}
50 The event handler for the following functions takes a
51 \helpref{wxGridRangeSelectEvent
}{wxgridrangeselectevent
} parameter.
54 \begin{twocollist
}\itemsep=
0pt
55 \twocolitem{{\bf EVT
\_GRID\_RANGE\_SELECT(func)
}}{The user selected a group of contiguous cells. Processes a wxEVT
\_GRID\_RANGE\_SELECT.
}
58 The event handler for the following functions takes a
59 \helpref{wxGridEditorCreatedEvent
}{wxgrideditorcreatedevent
} parameter.
62 \begin{twocollist
}\itemsep=
0pt
63 \twocolitem{{\bf EVT
\_GRID\_EDITOR\_CREATED(func)
}}{The editor for a cell was created. Processes a wxEVT
\_GRID\_EDITOR\_CREATED.
}
68 \helpref{wxGrid overview
}{gridoverview
}
70 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
71 \latexignore{\rtfignore{\wxheading{Function groups
}}}
73 \membersection{Constructors and initialization
}
75 \helpref{wxGrid
}{wxgridctor
}\\
76 \helpref{\destruct{wxGrid
}}{wxgriddtor
}\\
77 \helpref{CreateGrid
}{wxgridcreategrid
}\\
78 \helpref{SetTable
}{wxgridsettable
}
80 \membersection{Display format
}
82 \membersection{Selection functions
}
84 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
}\\
85 \helpref{wxGrid::IsSelection
}{wxgridisselection
}\\
86 \helpref{wxGrid::SelectAll
}{wxgridselectall
}\\
87 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
}\\
88 \helpref{wxGrid::SelectCol
}{wxgridselectcol
}\\
89 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
91 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
92 \helponly{\insertatlevel{2}{
98 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
100 \func{}{wxGrid
}{\void}
104 \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
}}
106 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
107 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
110 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
112 \func{}{\destruct{wxGrid
}}{\void}
114 Destructor. This will also destroy the associated grid table unless you passed a table
115 object to the grid and specified that the grid should not take ownership of the
116 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
118 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
120 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
122 Appends one or more new columns to the right of the grid and returns TRUE if
123 successful. The updateLabels argument is not used at present.
125 If you are using a derived grid table class you will need to override
126 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
127 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
129 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
131 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
133 Appends one or more new rows to the bottom of the grid and returns TRUE if
134 successful. The updateLabels argument is not used at present.
136 If you are using a derived grid table class you will need to override
137 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
138 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
140 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
142 \func{void
}{AutoSize
}{\void}
144 Automatically sets the height and width of all rows and columns to fit their contents.
147 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
148 The memory requirements for this could become prohibitive if your grid is very large.
150 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
152 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = TRUE
}}
154 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
155 also be set as the minimal width for the column.
158 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
159 The memory requirements for this could become prohibitive if your grid is very large.
161 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
163 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = TRUE
}}
165 Automatically sizes all columns to fit their contents. If setAsMin is TRUE the calculated widths will
166 also be set as the minimal widths for the columns.
169 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
170 The memory requirements for this could become prohibitive if your grid is very large.
172 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
174 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = TRUE
}}
176 Automatically sizes the row to fit its contents. If setAsMin is TRUE the calculated height will
177 also be set as the minimal height for the row.
180 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
181 The memory requirements for this could become prohibitive if your grid is very large.
183 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
185 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = TRUE
}}
187 Automatically sizes all rows to fit their contents. If setAsMin is TRUE the calculated heights will
188 also be set as the minimal heights for the rows.
191 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
192 The memory requirements for this could become prohibitive if your grid is very large.
194 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
196 \func{void
}{BeginBatch
}{\void}
198 Increments the grid's batch count. When the count is greater than zero repainting of
199 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
200 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
201 modification can be enclosed between BeginBatch and EndBatch calls to avoid
202 screen flicker. The final EndBatch will cause the grid to be repainted.
204 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
206 \func{bool
}{CanDragColSize
}{\void}
208 Returns TRUE if columns can be resized by dragging with the mouse. Columns can be resized
209 by dragging the edges of their labels. If grid line dragging is enabled they can also be
210 resized by dragging the right edge of the column in the grid cell area
211 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
213 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
215 \func{bool
}{CanDragRowSize
}{\void}
217 Returns TRUE if rows can be resized by dragging with the mouse. Rows can be resized
218 by dragging the edges of their labels. If grid line dragging is enabled they can also be
219 resized by dragging the lower edge of the row in the grid cell area
220 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
222 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
224 \func{bool
}{CanDragGridSize
}{\void}
226 Return TRUE if the dragging of grid lines to resize rows and columns is enabled or FALSE otherwise.
228 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
230 \constfunc{bool
}{CanEnableCellControl
}{\void}
232 Returns TRUE if the in-place edit control for the current grid cell can be used and
233 FALSE otherwise (e.g. if the current cell is read-only).
235 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
237 \func{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
239 \func{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
241 Return the rectangle corresponding to the grid cell's size and position in logical
244 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
246 \func{void
}{ClearGrid
}{\void}
248 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
249 this function. If you are using a derived table class then you need to override
250 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
252 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
254 \func{void
}{ClearSelection
}{\void}
256 Deselects all cells that are currently selected.
258 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
260 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
262 Creates a grid with the specified initial number of rows and columns.
263 Call this directly after the grid constructor. When you use this
264 function wxGrid will create and manage a simple table of string values
265 for you. All of the grid data will be stored in memory.
267 For applications with more complex data types or relationships, or for
268 dealing with very large datasets, you should derive your own grid table
269 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
271 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
273 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
275 Deletes one or more columns from a grid starting at the specified position and returns
276 TRUE if successful. The updateLabels argument is not used at present.
278 If you are using a derived grid table class you will need to override
279 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
280 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
282 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
284 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
286 Deletes one or more rows from a grid starting at the specified position and returns
287 TRUE if successful. The updateLabels argument is not used at present.
289 If you are using a derived grid table class you will need to override
290 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
291 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
293 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
295 \func{void
}{DisableCellEditControl
}{\void}
297 Disables in-place editing of grid cells.
298 Equivalent to calling EnableCellEditControl(FALSE).
300 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
302 \func{void
}{DisableDragColSize
}{\void}
304 Disables column sizing by dragging with the mouse. Equivalent to passing FALSE to
305 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
307 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
309 \func{void
}{DisableDragGridSize
}{\void}
311 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
312 FALSE to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
314 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
316 \func{void
}{DisableDragRowSize
}{\void}
318 Disables row sizing by dragging with the mouse. Equivalent to passing FALSE to
319 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
321 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
323 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = TRUE
}}
325 Enables or disables in-place editing of grid cell data. The grid will issue either a
326 wxEVT
\_GRID\_EDITOR\_SHOWN or wxEVT
\_GRID\_EDITOR\_HIDDEN event.
328 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
330 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = TRUE
}}
332 Enables or disables column sizing by dragging with the mouse.
334 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
336 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = TRUE
}}
338 Enables or disables row and column resizing by dragging gridlines with the mouse.
340 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
342 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = TRUE
}}
344 Enables or disables row sizing by dragging with the mouse.
346 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
348 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
350 If the edit argument is FALSE this function sets the whole grid as read-only. If the
351 argument is TRUE the grid is set to the default state where cells may be editable. In the
352 default state you can set single grid cells and whole rows and columns to be editable or
354 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
355 cells you can also use the shortcut function
356 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
358 For more information about controlling grid cell attributes see the
359 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
360 \helpref{wxGrid classes overview
}{gridoverview
}.
362 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
364 \func{void
}{EnableGridLines
}{\param{bool
}{enable = TRUE
}}
366 Turns the drawing of grid lines on or off.
368 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
370 \func{void
}{EndBatch
}{\void}
372 Decrements the grid's batch count. When the count is greater than zero repainting of
373 the grid is suppressed. Each previous call to
374 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
375 EndBatch. Code that does a lot of grid modification can be enclosed between
376 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
377 cause the grid to be repainted.
379 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
381 \func{void
}{ForceRefresh
}{\void}
383 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
385 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
387 \func{int
}{GetBatchCount
}{\void}
389 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
390 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
391 the grid's batch count is greater than zero the display will not be updated.
393 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
395 \func{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
397 Sets the arguments to the horizontal and vertical text alignment values for the
398 grid cell at the specified location.
400 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
401 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
403 \perlnote{This method only takes the parameters
{\tt row
} and
{\tt col
} and
404 returns a
2-element list
{\tt ( horiz, vert )
}.
}
406 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
408 \func{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
410 Returns the background colour of the cell at the specified location.
412 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
414 \func{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
416 Returns a pointer to the editor for the cell at the specified location.
418 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
419 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
421 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
423 \func{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
425 Returns the font for text in the grid cell at the specified location.
427 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
429 \func{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
431 Returns a pointer to the renderer for the grid cell at the specified location.
433 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
434 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
436 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
438 \func{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
440 Returns the text colour for the grid cell at the specified location.
442 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
444 \func{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
446 \func{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
448 Returns the string contained in the cell at the specified location. For simple applications where a
449 grid object automatically uses a default grid table of string values you use this function together
450 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
452 For more complex applications where you have derived your own grid table class that contains
453 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
454 function for those cells that contain string values.
456 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
457 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
459 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
461 \func{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
463 Sets the arguments to the current column label alignment values.
465 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
466 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
468 \perlnote{This method takes no parameters and
469 returns a
2-element list
{\tt ( horiz, vert )
}.
}
471 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
473 \func{int
}{GetColLabelSize
}{\void}
475 Returns the current height of the column labels.
477 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
479 \func{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
481 Returns the specifed column label. The default grid table class provides column labels of
482 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
483 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
486 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
488 \func{int
}{GetColSize
}{\param{int
}{col
}}
490 Returns the width of the specified column.
492 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
494 \func{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
496 Sets the arguments to the current default horizontal and vertical text alignment
499 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
500 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
502 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
504 \func{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
506 Returns the current default background colour for grid cells.
508 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
510 \func{wxFont
}{GetDefaultCellFont
}{\void}
512 Returns the current default font for grid cell text.
514 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
516 \func{wxColour
}{GetDefaultCellTextColour
}{\void}
518 Returns the current default colour for grid cell text.
520 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
522 \func{int
}{GetDefaultColLabelSize
}{\void}
524 Returns the default height for column labels.
526 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
528 \func{int
}{GetDefaultColSize
}{\void}
530 Returns the current default width for grid columns.
532 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
534 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
536 Returns a pointer to the current default grid cell editor.
538 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
539 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
541 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
543 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
545 Returns a pointer to the current default grid cell renderer.
547 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
548 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
550 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
552 \func{int
}{GetDefaultRowLabelSize
}{\void}
554 Returns the default width for the row labels.
556 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
558 \func{int
}{GetDefaultRowSize
}{\void}
560 Returns the current default height for grid rows.
562 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
564 \func{int
}{GetGridCursorCol
}{\void}
566 Returns the current grid cell column position.
568 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
570 \func{int
}{GetGridCursorRow
}{\void}
572 Returns the current grid cell row position.
574 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
576 \func{wxColour
}{GetGridLineColour
}{\void}
578 Returns the colour used for grid lines.
580 \membersection{wxGrid::GridLinesEnabled
}\label{wxgridgridlinesenabled
}
582 \func{bool
}{GridLinesEnabled
}{\void}
584 Returnes TRUE if drawing of grid lines is turned on, FALSE otherwise.
586 \membersection{wxGrid::GetLabelBackgroundColour
}\label{wxgridgetlabelbackgroundcolour
}
588 \func{wxColour
}{GetLabelBackgroundColour
}{\void}
590 Returns the colour used for the background of row and column labels.
592 \membersection{wxGrid::GetLabelFont
}\label{wxgridgetlabelfont
}
594 \func{wxFont
}{GetLabelFont
}{\void}
596 Returns the font used for row and column labels.
598 \membersection{wxGrid::GetLabelTextColour
}\label{wxgridgetlabeltextcolour
}
600 \func{wxColour
}{GetLabelTextColour
}{\void}
602 Returns the colour used for row and column label text.
604 \membersection{wxGrid::GetNumberCols
}\label{wxgridgetnumbercols
}
606 \func{int
}{GetNumberCols
}{\void}
608 Returns the total number of grid columns (actually the number of columns in the underlying grid
611 \membersection{wxGrid::GetNumberRows
}\label{wxgridgetnumberrows
}
613 \func{int
}{GetNumberRows
}{\void}
615 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
617 \membersection{wxGrid::GetRowLabelAlignment
}\label{wxgridgetrowlabelalignment
}
619 \func{void
}{GetRowLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
621 Sets the arguments to the current row label alignment values.
623 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
624 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
626 \perlnote{This method takes no parameters and
627 returns a
2-element list
{\tt ( horiz, vert )
}.
}
629 \membersection{wxGrid::GetRowLabelSize
}\label{wxgridgetrowlabelsize
}
631 \func{int
}{GetRowLabelSize
}{\void}
633 Returns the current width of the row labels.
635 \membersection{wxGrid::GetRowLabelValue
}\label{wxgridgetrowlabelvalue
}
637 \func{wxString
}{GetRowLabelValue
}{\param{int
}{row
}}
639 Returns the specifed row label. The default grid table class provides numeric row labels.
640 If you are using a custom grid table you can override
641 \helpref{wxGridTableBase::GetRowLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
644 \membersection{wxGrid::GetRowSize
}\label{wxgridgetrowsize
}
646 \func{int
}{GetRowSize
}{\param{int
}{row
}}
648 Returns the height of the specified row.
650 \membersection{wxGrid::GetTable
}\label{wxgridgettable
}
652 \constfunc{wxGridTableBase *
}{GetTable
}{\void}
654 Returns a base pointer to the current table object.
656 \membersection{wxGrid::HideCellEditControl
}\label{wxgridhidecelleditcontrol
}
658 \func{void
}{HideCellEditControl
}{\void}
660 Hides the in-place cell edit control.
662 \membersection{wxGrid::InsertCols
}\label{wxgridinsertcols
}
664 \func{bool
}{InsertCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
666 Inserts one or more new columns into a grid with the first new column at the
667 specified position and returns TRUE if successful. The updateLabels argument is not
670 The sequence of actions begins with the grid object requesting the underlying grid
671 table to insert new columns. If this is successful the table notifies the grid and the
672 grid updates the display. For a default grid (one where you have called
673 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
674 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
675 then you must override
676 \helpref{wxGridTableBase::InsertCols
}{wxgridtablebaseinsertcols
} in your derived
679 \membersection{wxGrid::InsertRows
}\label{wxgridinsertrows
}
681 \func{bool
}{InsertRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
683 Inserts one or more new rows into a grid with the first new row at the specified
684 position and returns TRUE if successful. The updateLabels argument is not used at
687 The sequence of actions begins with the grid object requesting the underlying grid
688 table to insert new rows. If this is successful the table notifies the grid and the
689 grid updates the display. For a default grid (one where you have called
690 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
691 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
692 then you must override
693 \helpref{wxGridTableBase::InsertRows
}{wxgridtablebaseinsertrows
} in your derived
696 \membersection{wxGrid::IsCellEditControlEnabled
}\label{wxgridiscelleditcontrolenabled
}
698 \constfunc{bool
}{IsCellEditControlEnabled
}{\void}
700 Returns TRUE if the in-place edit control is currently enabled.
702 \membersection{wxGrid::IsCurrentCellReadOnly
}\label{wxgridiscurrentcellreadonly
}
704 \constfunc{bool
}{IsCurrentCellReadOnly
}{\void}
706 Returns TRUE if the current cell has been set to read-only
707 (see
\helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}).
709 \membersection{wxGrid::IsEditable
}\label{wxgridiseditable
}
711 \func{bool
}{IsEditable
}{\void}
713 Returns FALSE if the whole grid has been set as read-only or TRUE otherwise.
714 See
\helpref{wxGrid::EnableEditing
}{wxgridenableediting
} for more information about
715 controlling the editing status of grid cells.
717 \membersection{wxGrid::IsReadOnly
}\label{wxgridisreadonly
}
719 \constfunc{bool
}{IsReadOnly
}{\param{int
}{row
},
\param{int
}{col
}}
721 Returns TRUE if the cell at the specified location can't be edited.
722 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
724 \membersection{wxGrid::IsSelection
}\label{wxgridisselection
}
726 \func{bool
}{IsSelection
}{\void}
728 Returns TRUE if there are currently rows, columns or blocks of cells selected.
730 \membersection{wxGrid::IsVisible
}\label{wxgridisvisible
}
732 \func{bool
}{IsVisible
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{wholeCellVisible = TRUE
}}
734 \func{bool
}{IsVisible
}{\param{const wxGridCellCoords\&
}{coords
},
\param{bool
}{wholeCellVisible = TRUE
}}
736 Returns TRUE if a cell is either wholly visible (the default) or at least partially
737 visible in the grid window.
739 \membersection{wxGrid::MakeCellVisible
}\label{wxgridmakecellvisible
}
741 \func{void
}{MakeCellVisible
}{\param{int
}{row
},
\param{int
}{col
}}
743 \func{void
}{MakeCellVisible
}{\param{const wxGridCellCoords\&
}{coords
}}
745 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
746 nothing if the cell is already visible.
748 \membersection{wxGrid::MoveCursorDown
}\label{wxgridmovecursordown
}
750 \func{bool
}{MoveCursorDown
}{\param{bool
}{expandSelection
}}
752 Moves the grid cursor down by one row. If a block of cells was previously selected it
753 will expand if the argument is TRUE or be cleared if the argument is FALSE.
755 \wxheading{Keyboard
}\\
756 This function is called for Down cursor key presses or Shift+Down to expand a selection.
758 \membersection{wxGrid::MoveCursorLeft
}\label{wxgridmovecursorleft
}
760 \func{bool
}{MoveCursorLeft
}{\param{bool
}{expandSelection
}}
762 Moves the grid cursor left by one column. If a block of cells was previously selected it
763 will expand if the argument is TRUE or be cleared if the argument is FALSE.
765 \wxheading{Keyboard
}\\
766 This function is called for Left cursor key presses or Shift+Left to expand a selection.
768 \membersection{wxGrid::MoveCursorRight
}\label{wxgridmovecursorright
}
770 \func{bool
}{MoveCursorRight
}{\param{bool
}{expandSelection
}}
772 Moves the grid cursor right by one column. If a block of cells was previously selected it
773 will expand if the argument is TRUE or be cleared if the argument is FALSE.
775 \wxheading{Keyboard
}\\
776 This function is called for Right cursor key presses or Shift+Right to expand a selection.
778 \membersection{wxGrid::MoveCursorUp
}\label{wxgridmovecursorup
}
780 \func{bool
}{MoveCursorUp
}{\param{bool
}{expandSelection
}}
782 Moves the grid cursor up by one row. If a block of cells was previously selected it
783 will expand if the argument is TRUE or be cleared if the argument is FALSE.
785 \wxheading{Keyboard
}\\
786 This function is called for Up cursor key presses or Shift+Up to expand a selection.
788 \membersection{wxGrid::MoveCursorDownBlock
}\label{wxgridmovecursordownblock
}
790 \func{bool
}{MoveCursorDownBlock
}{\param{bool
}{expandSelection
}}
792 Moves the grid cursor down in the current column such that it skips to the beginning or
793 end of a block of non-empty cells. If a block of cells was previously selected it
794 will expand if the argument is TRUE or be cleared if the argument is FALSE.
796 \wxheading{Keyboard
}\\
797 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
799 \membersection{wxGrid::MoveCursorLeftBlock
}\label{wxgridmovecursorleftblock
}
801 \func{bool
}{MoveCursorLeftBlock
}{\param{bool
}{expandSelection
}}
803 Moves the grid cursor left in the current row such that it skips to the beginning or
804 end of a block of non-empty cells. If a block of cells was previously selected it
805 will expand if the argument is TRUE or be cleared if the argument is FALSE.
807 \wxheading{Keyboard
}\\
808 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
810 \membersection{wxGrid::MoveCursorRightBlock
}\label{wxgridmovecursorrightblock
}
812 \func{bool
}{MoveCursorRightBlock
}{\param{bool
}{expandSelection
}}
814 Moves the grid cursor right in the current row such that it skips to the beginning or
815 end of a block of non-empty cells. If a block of cells was previously selected it
816 will expand if the argument is TRUE or be cleared if the argument is FALSE.
818 \wxheading{Keyboard
}\\
819 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
821 \membersection{wxGrid::MoveCursorUpBlock
}\label{wxgridmovecursorupblock
}
823 \func{bool
}{MoveCursorUpBlock
}{\param{bool
}{expandSelection
}}
825 Moves the grid cursor up in the current column such that it skips to the beginning or
826 end of a block of non-empty cells. If a block of cells was previously selected it
827 will expand if the argument is TRUE or be cleared if the argument is FALSE.
829 \wxheading{Keyboard
}\\
830 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
832 \membersection{wxGrid::MovePageDown
}\label{wxgridmovepagedown
}
834 \func{bool
}{MovePageDown
}{\void}
836 Moves the grid cursor down by some number of rows so that the previous bottom visible row
837 becomes the top visible row.
839 \wxheading{Keyboard
}\\
840 This function is called for PgDn keypresses.
842 \membersection{wxGrid::MovePageUp
}\label{wxgridmovepageup
}
844 \func{bool
}{MovePageUp
}{\void}
846 Moves the grid cursor up by some number of rows so that the previous top visible row
847 becomes the bottom visible row.
849 \wxheading{Keyboard
}\\
850 This function is called for PgUp keypresses.
852 \membersection{wxGrid::SaveEditControlValue
}\label{wxgridsaveeditcontrolvalue
}
854 \func{void
}{SaveEditControlValue
}{\void}
856 Sets the value of the current grid cell to the current in-place edit control value.
857 This is called automatically when the grid cursor moves from the current cell to a
858 new cell. It is also a good idea to call this function when closing a grid since
859 any edits to the final cell location will not be saved otherwise.
861 \membersection{wxGrid::SelectAll
}\label{wxgridselectall
}
863 \func{void
}{SelectAll
}{\void}
865 Selects all cells in the grid.
867 \membersection{wxGrid::SelectBlock
}\label{wxgridselectblock
}
869 \func{void
}{SelectBlock
}{\param{int
}{topRow
},
\param{int
}{leftCol
},
870 \param{int
}{bottomRow
},
\param{int
}{rightCol
},
\param{bool
}{addToSelected = FALSE
}}
872 \func{void
}{SelectBlock
}{\param{const wxGridCellCoords\&
}{topLeft
},
873 \param{const wxGridCellCoords\&
}{bottomRight
},
\param{bool
}{addToSelected = FALSE
}}
875 Selects a rectangular block of cells. If addToSelected is FALSE then any existing selection will be
876 deselected; if TRUE the column will be added to the existing selection.
878 \membersection{wxGrid::SelectCol
}\label{wxgridselectcol
}
880 \func{void
}{SelectCol
}{\param{int
}{col
},
\param{bool
}{addToSelected = FALSE
}}
882 Selects the specified column. If addToSelected is FALSE then any existing selection will be
883 deselected; if TRUE the column will be added to the existing selection.
885 \membersection{wxGrid::SelectRow
}\label{wxgridselectrow
}
887 \func{void
}{SelectRow
}{\param{int
}{row
},
\param{bool
}{addToSelected = FALSE
}}
889 Selects the specified row. If addToSelected is FALSE then any existing selection will be
890 deselected; if TRUE the row will be added to the existing selection.
892 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
894 \func{void
}{SetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int
}{horiz
},
\param{int
}{vert
}}
896 \func{void
}{SetCellAlignment
}{\param{int
}{align
},
\param{int
}{row
},
\param{int
}{col
}}
898 \func{void
}{SetCellAlignment
}{\param{int
}{align
}}
900 Sets the horizontal and vertial alignment for grid cell text at the specified location.
902 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
903 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
905 \membersection{wxGrid::SetCellEditor
}\label{wxgridsetcelleditor
}
907 \func{void
}{SetCellEditor
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellEditor*
}{editor
}}
909 Sets the editor for the grid cell at the specified location.
910 The grid will take ownership of the pointer.
912 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
913 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
915 \membersection{wxGrid::SetCellFont
}\label{wxgridsetcellfont
}
917 \func{void
}{SetCellFont
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxFont\&
}{ font
}}
919 Sets the font for text in the grid cell at the specified location.
921 \membersection{wxGrid::SetCellRenderer
}\label{wxgridsetcellrenderer
}
923 \func{void
}{SetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellRenderer*
}{renderer
}}
925 Sets the renderer for the grid cell at the specified location.
926 The grid will take ownership of the pointer.
928 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
929 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
931 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
933 \func{void
}{SetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxColour\&
}{ colour
}}
935 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
937 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{colour
}}
939 Sets the text colour for the grid cell at the specified location.
941 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
943 \func{void
}{SetCellValue
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxString\&
}{s
}}
945 \func{void
}{SetCellValue
}{\param{const wxGridCellCoords\&
}{coords
},
\param{const wxString\&
}{s
}}
947 \func{void
}{SetCellValue
}{\param{const wxString\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
949 Sets the string value for the cell at the specified location. For simple applications where a
950 grid object automatically uses a default grid table of string values you use this function together
951 with
\helpref{wxGrid::GetCellValue
}{wxgridgetcellvalue
} to access cell values.
953 For more complex applications where you have derived your own grid table class that contains
954 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
955 function for those cells that contain string values.
957 The last form is for backward compatibility only.
959 See
\helpref{wxGridTableBase::CanSetValueAs
}{wxgridtablebasecangetvalueas
}
960 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
962 \membersection{wxGrid::SetColAttr
}\label{wxgridsetcolattr
}
964 \func{void
}{SetColAttr
}{\param{int
}{col
},
\param{wxGridCellAttr*
}{attr
}}
966 Sets the cell attributes for all cells in the specified column.
968 For more information about controlling grid cell attributes see the
969 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
970 \helpref{wxGrid classes overview
}{gridoverview
}.
972 \membersection{wxGrid::SetColFormatBool
}\label{wxgridsetcolformatbool
}
974 \func{void
}{SetColFormatBool
}{\param{int
}{col
}}
976 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
978 \membersection{wxGrid::SetColFormatNumber
}\label{wxgridsetcolformatnumber
}
980 \func{void
}{SetColFormatNumber
}{\param{int
}{col
}}
982 Sets the specified column to display integer values.
984 \membersection{wxGrid::SetColFormatFloat
}\label{wxgridsetcolformatfloat
}
986 \func{void
}{SetColFormatFloat
}{\param{int
}{col
},
\param{int
}{width = -
1},
\param{int
}{precision = -
1}}
988 Sets the specified column to display floating point values with the given width and precision.
990 \membersection{wxGrid::SetColFormatCustom
}\label{wxgridsetcolformatcustom
}
992 \func{void
}{SetColFormatCustom
}{\param{int
}{col
},
\param{const wxString\&
}{typeName
}}
994 Sets the specified column to display data in a custom format.
995 See the
\helpref{wxGrid overview
}{gridoverview
} for more information on working
996 with custom data types.
998 \membersection{wxGrid::SetColLabelAlignment
}\label{wxgridsetcollabelalignment
}
1000 \func{void
}{SetColLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1002 Sets the horizontal and vertical alignment of column label text.
1004 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.
1006 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1008 \membersection{wxGrid::SetColLabelSize
}\label{wxgridsetcollabelsize
}
1010 \func{void
}{SetColLabelSize
}{\param{int
}{height
}}
1012 Sets the height of the column labels.
1014 \membersection{wxGrid::SetColLabelValue
}\label{wxgridsetcollabelvalue
}
1016 \func{void
}{SetColLabelValue
}{\param{int
}{col
},
\param{const wxString\&
}{ value
}}
1018 Set the value for the given column label. If you are using a derived grid table you must
1019 override
\helpref{wxGridTableBase::SetColLabelValue
}{wxgridtablebasesetcollabelvalue
}
1020 for this to have any effect.
1022 \membersection{wxGrid::SetColMinimalWidth
}\label{wxgridsetcolminimalwidth
}
1024 \func{void
}{SetColMinimalWidth
}{\param{int
}{col
},
\param{int
}{width
}}
1026 Sets the minimal width for the specified column. This should normally be called when creating the grid
1027 because it will not resize a column that is already narrower than the minimal width.
1029 \membersection{wxGrid::SetColSize
}\label{wxgridsetcolsize
}
1031 \func{void
}{SetColSize
}{\param{int
}{col
},
\param{int
}{width
}}
1033 Sets the width of the specified column.
1035 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1036 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1038 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1039 also be set as the minimal width for the column.
1042 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1043 The memory requirements for this could become prohibitive if your grid is very large.
1045 \membersection{wxGrid::SetDefaultCellAlignment
}\label{wxgridsetdefaultcellalignment
}
1047 \func{void
}{SetDefaultCellAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1049 Sets the default horizontal and vertial alignment for grid cell text.
1051 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.
1053 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1055 \membersection{wxGrid::SetDefaultCellBackgroundColour
}\label{wxgridsetdefaultcellbackgroundcolour
}
1057 \func{void
}{SetDefaultCellBackgroundColour
}{\param{const wxColour\&
}{ colour
}}
1059 Sets the default background colour for grid cells.
1061 \membersection{wxGrid::SetDefaultCellFont
}\label{wxgridsetdefaultcellfont
}
1063 \func{void
}{SetDefaultCellFont
}{\param{const wxFont\&
}{ font
}}
1065 Sets the default font to be used for grid cell text.
1067 \membersection{wxGrid::SetDefaultEditor
}\label{wxgridsetdefaulteditor
}
1069 \func{void
}{SetDefaultEditor
}{\param{wxGridCellEditor*
}{editor
}}
1071 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1073 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
1074 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1076 \membersection{wxGrid::SetDefaultRenderer
}\label{wxgridsetdefaultrenderer
}
1078 \func{void
}{SetDefaultRenderer
}{\param{wxGridCellRenderer*
}{renderer
}}
1080 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1082 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
1083 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1085 \membersection{wxGrid::SetDefaultColSize
}\label{wxgridsetdefaultcolsize
}
1087 \func{void
}{SetDefaultColSize
}{\param{int
}{width
},
\param{bool
}{resizeExistingCols = FALSE
}}
1089 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1090 the grid unless resizeExistingCols is TRUE.
1092 \membersection{wxGrid::SetDefaultRowSize
}\label{wxgridsetdefaultrowsize
}
1094 \func{void
}{SetDefaultRowSize
}{\param{int
}{height
},
\param{bool
}{resizeExistingRows = FALSE
}}
1096 Sets the default height for rows in the grid. This will only affect rows subsequently added
1097 to the grid unless resizeExistingRows is TRUE.
1099 \membersection{wxGrid::SetGridCursor
}\label{wxgridsetgridcursor
}
1101 \func{void
}{SetGridCursor
}{\param{int
}{row
},
\param{int
}{col
}}
1103 Set the grid cursor to the specified cell.
1104 This function calls
\helpref{wxGrid::MakeCellVisible
}{wxgridmakecellvisible
}.
1106 \membersection{wxGrid::SetGridLineColour
}\label{wxgridsetgridlinecolour
}
1108 \func{void
}{SetGridLineColour
}{\param{const wxColour\&
}{colour
}}
1110 Sets the colour used to draw grid lines.
1112 \membersection{wxGrid::SetLabelBackgroundColour
}\label{wxgridsetlabelbackgroundcolour
}
1114 \func{void
}{SetLabelBackgroundColour
}{\param{const wxColour\&
}{ colour
}}
1116 Sets the background colour for row and column labels.
1118 \membersection{wxGrid::SetLabelFont
}\label{wxgridsetlabelfont
}
1120 \func{void
}{SetLabelFont
}{\param{const wxFont\&
}{ font
}}
1122 Sets the font for row and column labels.
1124 \membersection{wxGrid::SetLabelTextColour
}\label{wxgridsetlabeltextcolour
}
1126 \func{void
}{SetLabelTextColour
}{\param{const wxColour\&
}{ colour
}}
1128 Sets the colour for row and column label text.
1130 \membersection{wxGrid::SetReadOnly
}\label{wxgridsetreadonly
}
1132 \func{void
}{SetReadOnly
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{isReadOnly = TRUE
}}
1134 Makes the cell at the specified location read-only or editable.
1135 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
1137 \membersection{wxGrid::SetRowAttr
}\label{wxgridsetrowattr
}
1139 \func{void
}{SetRowAttr
}{\param{int
}{row
},
\param{wxGridCellAttr*
}{attr
}}
1141 Sets the cell attributes for all cells in the specified row.
1142 See the
\helpref{wxGridCellAttr
}{wxgridcellattr
} class for more information
1143 about controlling cell attributes.
1145 \membersection{wxGrid::SetRowLabelAlignment
}\label{wxgridsetrowlabelalignment
}
1147 \func{void
}{SetRowLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1149 Sets the horizontal and vertical alignment of row label text.
1151 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.
1153 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1155 \membersection{wxGrid::SetRowLabelSize
}\label{wxgridsetrowlabelsize
}
1157 \func{void
}{SetRowLabelSize
}{\param{int
}{width
}}
1159 Sets the width of the row labels.
1161 \membersection{wxGrid::SetRowLabelValue
}\label{wxgridsetrowlabelvalue
}
1163 \func{void
}{SetRowLabelValue
}{\param{int
}{row
},
\param{const wxString\&
}{ value
}}
1165 Set the value for the given row label. If you are using a derived grid table you must
1166 override
\helpref{wxGridTableBase::SetRowLabelValue
}{wxgridtablebasesetrowlabelvalue
}
1167 for this to have any effect.
1169 \membersection{wxGrid::SetRowMinimalHeight
}\label{wxgridsetrowminimalheight
}
1171 \func{void
}{SetRowMinimalHeight
}{\param{int
}{row
},
\param{int
}{width
}}
1173 Sets the minimal height for the specified row. This should normally be called when creating the grid
1174 because it will not resize a row that is already shorter than the minimal height.
1176 \membersection{wxGrid::SetRowSize
}\label{wxgridsetrowsize
}
1178 \func{void
}{SetRowSize
}{\param{int
}{row
},
\param{int
}{height
}}
1180 Sets the height of the specified row.
1182 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1183 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1185 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1186 also be set as the minimal width for the column.
1190 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1191 The memory requirements for this could become prohibitive if your grid is very large.
1193 \membersection{wxGrid::SetSelectionMode
}\label{wxgridsetselectionmode
}
1195 \func{void
}{SetSelectionMode
}{\param{wxGrid::wxGridSelectionModes
}{ selmode
}}
1197 Set the selection behaviour of the grid.
1199 \wxheading{Parameters
}
1201 \docparam{wxGrid::wxGridSelectCells
}{The default mode where individual cells are selected.
}
1203 \docparam{wxGrid::wxGridSelectRows
}{Selections will consist of whole rows.
}
1205 \docparam{wxGrid::wxGridSelectionColumns
}{Selections will consist of whole columns.
}
1207 \membersection{wxGrid::SetTable
}\label{wxgridsettable
}
1209 \func{bool
}{SetTable
}{\param{wxGridTableBase*
}{table
},
\param{bool
}{takeOwnership = FALSE
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
1211 Passes a pointer to a custom grid table to be used by the grid. This should be called
1212 after the grid constructor and before using the grid object. If takeOwnership is set to
1213 TRUE then the table will be deleted by the wxGrid destructor.
1215 Use this function instead of
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} when your
1216 application involves complex or non-string data or data sets that are too large to fit
1219 \membersection{wxGrid::ShowCellEditControl
}\label{wxgridshowcelleditcontrol
}
1221 \func{void
}{ShowCellEditControl
}{\void}
1223 Displays the in-place cell edit control for the current cell.
1225 \membersection{wxGrid::XToCol
}\label{wxgridxtocol
}
1227 \func{int
}{XToCol
}{\param{int
}{x
}}
1229 Returns the grid column that corresponds to the logical x coordinate. Returns
1230 wxNOT
\_FOUND if there is no column at the x position.
1232 \membersection{wxGrid::XToEdgeOfCol
}\label{wxgridxtoedgeofcol
}
1234 \func{int
}{XToEdgeOfCol
}{\param{int
}{x
}}
1236 Returns the column whose right hand edge is close to the given logical x position.
1237 If no column edge is near to this position wxNOT
\_FOUND is returned.
1239 \membersection{wxGrid::YToEdgeOfRow
}\label{wxgridytoedgeofrow
}
1241 \func{int
}{YToEdgeOfRow
}{\param{int
}{y
}}
1243 Returns the row whose bottom edge is close to the given logical y position.
1244 If no row edge is near to this position wxNOT
\_FOUND is returned.
1246 \membersection{wxGrid::YToRow
}\label{wxgridytorow
}
1248 \func{int
}{YToRow
}{\param{int
}{y
}}
1250 Returns the grid row that corresponds to the logical y coordinate. Returns
1251 wxNOT
\_FOUND if there is no row at the y position.
1255 \membersection{wxGrid::IsInSelection
}\label{wxgridisinselection
}
1257 \func{bool
}{IsInSelection
}{\param{int
}{row
},
\param{int
}{col
}}
1259 \func{bool
}{IsInSelection
}{\param{const wxGridCellCoords\&
}{coords
}}
1262 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
1264 \func{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
1266 This function returns the rectangle that encloses the block of cells
1267 limited by TopLeft and BottomRight cell in device coords and clipped
1268 to the client size of the grid window.
1271 \membersection{wxGrid::SelectionToDeviceRect
}\label{wxgridselectiontodevicerect
}
1273 \func{wxRect
}{SelectionToDeviceRect
}{\void}
1275 This function returns the rectangle that encloses the selected cells
1276 in device coords and clipped to the client size of the grid window.
1279 \membersection{wxGrid::GetSelectionBackground
}\label{wxgridgetselectionbackground
}
1281 \constfunc{wxColour
}{GetSelectionBackground
}{\void}
1283 Access or update the selection fore/back colours
1286 \membersection{wxGrid::GetSelectionForeground
}\label{wxgridgetselectionforeground
}
1288 \constfunc{wxColour
}{GetSelectionForeground
}{\void}
1291 \membersection{wxGrid::SetSelectionBackground
}\label{wxgridsetselectionbackground
}
1293 \func{void
}{SetSelectionBackground
}{\param{const wxColour\&
}{c
}}
1296 \membersection{wxGrid::SetSelectionForeground
}\label{wxgridsetselectionforeground
}
1298 \func{void
}{SetSelectionForeground
}{\param{const wxColour\&
}{c
}}
1301 \membersection{wxGrid::RegisterDataType
}\label{wxgridregisterdatatype
}
1303 \func{void
}{RegisterDataType
}{\param{const wxString\&
}{typeName
},
\param{wxGridCellRenderer*
}{renderer
},
\param{wxGridCellEditor*
}{editor
}}
1305 Methods for a registry for mapping data types to Renderers/Editors
1307 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
1309 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1311 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
1314 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
1316 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1319 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
1321 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
1324 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
1326 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
1329 \membersection{wxGrid::SetMargins
}\label{wxgridsetmargins
}
1331 \func{void
}{SetMargins
}{\param{int
}{extraWidth
},
\param{int
}{extraHeight
}}
1333 A grid may occupy more space than needed for its rows/columns. This
1334 function allows to set how big this extra space is
1336 \membersection{wxGrid::wxGrid
}\label{wxgridwxgrid
}
1338 \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
}}
1340 Backward compatibility.
1342 \membersection{wxGrid::UpdateDimensions
}\label{wxgridupdatedimensions
}
1344 \func{void
}{UpdateDimensions
}{\void}
1346 Backward compatibility.
1348 \membersection{wxGrid::GetRows
}\label{wxgridgetrows
}
1350 \func{int
}{GetRows
}{\void}
1352 Backward compatibility.
1354 \membersection{wxGrid::GetCols
}\label{wxgridgetcols
}
1356 \func{int
}{GetCols
}{\void}
1358 Backward compatibility.
1360 \membersection{wxGrid::GetCursorRow
}\label{wxgridgetcursorrow
}
1362 \func{int
}{GetCursorRow
}{\void}
1364 Backward compatibility.
1366 \membersection{wxGrid::GetCursorColumn
}\label{wxgridgetcursorcolumn
}
1368 \func{int
}{GetCursorColumn
}{\void}
1370 Backward compatibility.
1372 \membersection{wxGrid::GetScrollPosX
}\label{wxgridgetscrollposx
}
1374 \func{int
}{GetScrollPosX
}{\void}
1376 Backward compatibility.
1378 \membersection{wxGrid::GetScrollPosY
}\label{wxgridgetscrollposy
}
1380 \func{int
}{GetScrollPosY
}{\void}
1382 Backward compatibility.
1384 \membersection{wxGrid::SetScrollX
}\label{wxgridsetscrollx
}
1386 \func{void
}{SetScrollX
}{\param{int
}{x
}}
1388 Backward compatibility.
1390 \membersection{wxGrid::SetScrollY
}\label{wxgridsetscrolly
}
1392 \func{void
}{SetScrollY
}{\param{int
}{y
}}
1394 Backward compatibility.
1396 \membersection{wxGrid::SetColumnWidth
}\label{wxgridsetcolumnwidth
}
1398 \func{void
}{SetColumnWidth
}{\param{int
}{col
},
\param{int
}{width
}}
1400 Backward compatibility.
1402 \membersection{wxGrid::GetColumnWidth
}\label{wxgridgetcolumnwidth
}
1404 \func{int
}{GetColumnWidth
}{\param{int
}{col
}}
1406 Backward compatibility.
1408 \membersection{wxGrid::SetRowHeight
}\label{wxgridsetrowheight
}
1410 \func{void
}{SetRowHeight
}{\param{int
}{row
},
\param{int
}{height
}}
1412 Backward compatibility.
1414 \membersection{wxGrid::GetViewHeight
}\label{wxgridgetviewheight
}
1416 \func{int
}{GetViewHeight
}{\void}
1418 Backward compatibility.
1420 \membersection{wxGrid::GetViewWidth
}\label{wxgridgetviewwidth
}
1422 \func{int
}{GetViewWidth
}{\void}
1424 Returned number of whole cols visible.
1426 \membersection{wxGrid::SetLabelSize
}\label{wxgridsetlabelsize
}
1428 \func{void
}{SetLabelSize
}{\param{int
}{orientation
},
\param{int
}{sz
}}
1431 \membersection{wxGrid::GetLabelSize
}\label{wxgridgetlabelsize
}
1433 \func{int
}{GetLabelSize
}{\param{int
}{orientation
}}
1436 \membersection{wxGrid::SetLabelAlignment
}\label{wxgridsetlabelalignment
}
1438 \func{void
}{SetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{align
}}
1441 \membersection{wxGrid::GetLabelAlignment
}\label{wxgridgetlabelalignment
}
1443 \func{int
}{GetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{align
}}
1446 \membersection{wxGrid::SetLabelValue
}\label{wxgridsetlabelvalue
}
1448 \func{void
}{SetLabelValue
}{\param{int
}{orientation
},
\param{const wxString\&
}{val
},
\param{int
}{pos
}}
1451 \membersection{wxGrid::GetLabelValue
}\label{wxgridgetlabelvalue
}
1453 \func{wxString
}{GetLabelValue
}{\param{int
}{orientation
},
\param{int
}{pos
}}
1456 \membersection{wxGrid::GetCellTextFont
}\label{wxgridgetcelltextfont
}
1458 \constfunc{wxFont
}{GetCellTextFont
}{\void}
1460 \constfunc{wxFont
}{GetCellTextFont
}{\param{int
}{row
},
\param{int
}{col
}}
1463 \membersection{wxGrid::SetCellTextFont
}\label{wxgridsetcelltextfont
}
1465 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
}}
1467 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
},
\param{int
}{row
},
\param{int
}{col
}}
1470 \membersection{wxGrid::SetCellBackgroundColour
}\label{wxgridsetcellbackgroundcolour
}
1472 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{col
}}
1474 \func{void
}{SetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxColour\&
}{ colour
}}
1476 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{colour
},
\param{int
}{row
},
\param{int
}{col
}}
1479 \membersection{wxGrid::GetEditable
}\label{wxgridgeteditable
}
1481 \func{bool
}{GetEditable
}{\void}
1484 \membersection{wxGrid::SetEditable
}\label{wxgridseteditable
}
1486 \func{void
}{SetEditable
}{\param{bool
}{edit = TRUE
}}
1489 \membersection{wxGrid::GetEditInPlace
}\label{wxgridgeteditinplace
}
1491 \func{bool
}{GetEditInPlace
}{\void}
1494 \membersection{wxGrid::SetEditInPlace
}\label{wxgridseteditinplace
}
1496 \func{void
}{SetEditInPlace
}{\param{bool
}{edit = TRUE
}}
1499 \membersection{wxGrid::SetCellBitmap
}\label{wxgridsetcellbitmap
}
1501 \func{void
}{SetCellBitmap
}{\param{wxBitmap*
}{bitmap
},
\param{int
}{row
},
\param{int
}{col
}}
1504 \membersection{wxGrid::SetDividerPen
}\label{wxgridsetdividerpen
}
1506 \func{void
}{SetDividerPen
}{\param{const wxPen\&
}{pen
}}
1509 \membersection{wxGrid::GetDividerPen
}\label{wxgridgetdividerpen
}
1511 \constfunc{wxPen\&
}{GetDividerPen
}{\void}
1514 \membersection{wxGrid::OnActivate
}\label{wxgridonactivate
}
1516 \func{void
}{OnActivate
}{\param{bool
}{active
}}
1518 \membersection{wxGrid::Fit
}\label{wxgridfit
}
1520 \func{void
}{Fit
}{\void}
1522 Overridden wxWindow methods
1524 \membersection{wxGrid::DoGetBestSize
}\label{wxgriddogetbestsize
}
1526 \constfunc{wxSize
}{DoGetBestSize
}{\void}
1528 \membersection{wxGrid::InitRowHeights
}\label{wxgridinitrowheights
}
1530 \func{void
}{InitRowHeights
}{\void}
1532 NB:
{\it never
} access m
\_row/col arrays directly because they are created
1533 on demand,
{\it always
} use accessor functions instead!
1535 Init the m
\_rowHeights/Bottoms arrays with default values.
1537 \membersection{wxGrid::InitColWidths
}\label{wxgridinitcolwidths
}
1539 \func{void
}{InitColWidths
}{\void}
1541 Init the m
\_colWidths/Rights arrays
1544 \membersection{wxGrid::GetColWidth
}\label{wxgridgetcolwidth
}
1546 \constfunc{int
}{GetColWidth
}{\param{int
}{col
}}
1548 Get the col/row coords
1551 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
1553 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
1556 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
1558 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
1561 \membersection{wxGrid::GetRowHeight
}\label{wxgridgetrowheight
}
1563 \constfunc{int
}{GetRowHeight
}{\param{int
}{row
}}
1565 This function must be public for compatibility.
1567 \membersection{wxGrid::GetRowTop
}\label{wxgridgetrowtop
}
1569 \constfunc{int
}{GetRowTop
}{\param{int
}{row
}}
1572 \membersection{wxGrid::GetRowBottom
}\label{wxgridgetrowbottom
}
1574 \constfunc{int
}{GetRowBottom
}{\param{int
}{row
}}
1577 \membersection{wxGrid::SetOrCalcColumnSizes
}\label{wxgridsetorcalccolumnsizes
}
1579 \func{int
}{SetOrCalcColumnSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1581 Common part of AutoSizeColumn/Row() and GetBestSize()
1583 \membersection{wxGrid::SetOrCalcRowSizes
}\label{wxgridsetorcalcrowsizes
}
1585 \func{int
}{SetOrCalcRowSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1587 \membersection{wxGrid::AutoSizeColOrRow
}\label{wxgridautosizecolorrow
}
1589 \func{void
}{AutoSizeColOrRow
}{\param{int
}{n
},
\param{bool
}{setAsMin
},
\param{bool
}{column
}}
1591 Common part of AutoSizeColumn/Row() or row?
1593 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
1595 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
1597 get the minimal width of the given column/row
1599 \membersection{wxGrid::GetRowMinimalHeight
}\label{wxgridgetrowminimalheight
}
1601 \constfunc{int
}{GetRowMinimalHeight
}{\param{int
}{col
}}
1603 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
1605 \func{bool
}{CanHaveAttributes
}{\void}
1607 Do we have some place to store attributes in?
1609 \membersection{wxGrid::GetOrCreateCellAttr
}\label{wxgridgetorcreatecellattr
}
1611 \constfunc{wxGridCellAttr*
}{GetOrCreateCellAttr
}{\param{int
}{row
},
\param{int
}{col
}}