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 wxWidgets
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.
43 The ...
\_CMD\_... variants also take a window identifier.
46 \begin{twocollist
}\itemsep=
0pt
47 \twocolitem{{\bf EVT
\_GRID\_COL\_SIZE(func)
}}{The user resized a column by dragging it. Processes a wxEVT
\_GRID\_COL\_SIZE.
}
48 \twocolitem{{\bf EVT
\_GRID\_ROW\_SIZE(func)
}}{The user resized a row by dragging it. Processes a wxEVT
\_GRID\_ROW\_SIZE.
}
49 \twocolitem{{\bf EVT
\_GRID\_CMD\_COL\_SIZE(func)
}}{The user resized a column by dragging it; variant taking a window identifier. Processes a wxEVT
\_GRID\_COL\_SIZE.
}
50 \twocolitem{{\bf EVT
\_GRID\_CMD\_ROW\_SIZE(func)
}}{The user resized a row by dragging it; variant taking a window identifier. Processes a wxEVT
\_GRID\_ROW\_SIZE.
}
53 The event handler for the following functions takes a
54 \helpref{wxGridRangeSelectEvent
}{wxgridrangeselectevent
} parameter.
55 The ...
\_CMD\_... variant also takes a window identifier.
58 \begin{twocollist
}\itemsep=
0pt
59 \twocolitem{{\bf EVT
\_GRID\_RANGE\_SELECT(func)
}}{The user selected a group of contiguous cells. Processes a wxEVT
\_GRID\_RANGE\_SELECT.
}
60 \twocolitem{{\bf EVT
\_GRID\_CMD\_RANGE\_SELECT(id, func)
}}{The user selected a group of contiguous cells; variant taking a window identifier. Processes a wxEVT
\_GRID\_RANGE\_SELECT.
}
63 The event handler for the following functions takes a
64 \helpref{wxGridEditorCreatedEvent
}{wxgrideditorcreatedevent
} parameter.
65 The ...
\_CMD\_... variant also takes a window identifier.
68 \begin{twocollist
}\itemsep=
0pt
69 \twocolitem{{\bf EVT
\_GRID\_EDITOR\_CREATED(func)
}}{The editor for a cell was created. Processes a wxEVT
\_GRID\_EDITOR\_CREATED.
}
70 \twocolitem{{\bf EVT
\_GRID\_CMD\_EDITOR\_CREATED(id, func)
}}{The editor for a cell was created; variant taking a window identifier. Processes a wxEVT
\_GRID\_EDITOR\_CREATED.
}
75 \helpref{wxGrid overview
}{gridoverview
}
77 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
78 \latexignore{\rtfignore{\wxheading{Function groups
}}}
80 \membersection{Constructors and initialization
}\label{wxgridconstructors
}
82 \helpref{wxGrid
}{wxgridctor
}\\
83 \helpref{\destruct{wxGrid
}}{wxgriddtor
}\\
84 \helpref{CreateGrid
}{wxgridcreategrid
}\\
85 \helpref{SetTable
}{wxgridsettable
}
87 \membersection{Display format
}\label{wxgriddisplayformat
}
89 \membersection{Selection functions
}\label{wxgridselectionfunctions
}
91 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
}\\
92 \helpref{wxGrid::IsSelection
}{wxgridisselection
}\\
93 \helpref{wxGrid::SelectAll
}{wxgridselectall
}\\
94 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
}\\
95 \helpref{wxGrid::SelectCol
}{wxgridselectcol
}\\
96 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
98 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
99 \helponly{\insertatlevel{2}{
105 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
107 \func{}{wxGrid
}{\void}
111 \func{}{wxGrid
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxWANTS
\_CHARS},
\param{const wxString\&
}{name = wxPanelNameStr
}}
113 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
114 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
117 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
119 \func{}{\destruct{wxGrid
}}{\void}
121 Destructor. This will also destroy the associated grid table unless you passed a table
122 object to the grid and specified that the grid should not take ownership of the
123 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
125 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
127 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
129 Appends one or more new columns to the right of the grid and returns true if
130 successful. The updateLabels argument is not used at present.
132 If you are using a derived grid table class you will need to override
133 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
134 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
136 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
138 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
140 Appends one or more new rows to the bottom of the grid and returns true if
141 successful. The updateLabels argument is not used at present.
143 If you are using a derived grid table class you will need to override
144 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
145 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
147 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
149 \func{void
}{AutoSize
}{\void}
151 Automatically sets the height and width of all rows and columns to fit their contents.
154 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
155 The memory requirements for this could become prohibitive if your grid is very large.
157 \membersection{wxGrid::AutoSizeColOrRow
}\label{wxgridautosizecolorrow
}
159 \func{void
}{AutoSizeColOrRow
}{\param{int
}{n
},
\param{bool
}{setAsMin
},
\param{bool
}{column
}}
161 Common part of AutoSizeColumn/Row() or row?
163 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
165 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = true
}}
167 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
168 also be set as the minimal width for the column.
171 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
172 The memory requirements for this could become prohibitive if your grid is very large.
174 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
176 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = true
}}
178 Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
179 also be set as the minimal widths for the columns.
182 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
183 The memory requirements for this could become prohibitive if your grid is very large.
185 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
187 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = true
}}
189 Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
190 also be set as the minimal height for the row.
193 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
194 The memory requirements for this could become prohibitive if your grid is very large.
196 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
198 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = true
}}
200 Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
201 also be set as the minimal heights for the rows.
204 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
205 The memory requirements for this could become prohibitive if your grid is very large.
207 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
209 \func{void
}{BeginBatch
}{\void}
211 Increments the grid's batch count. When the count is greater than zero repainting of
212 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
213 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
214 modification can be enclosed between BeginBatch and EndBatch calls to avoid
215 screen flicker. The final EndBatch will cause the grid to be repainted.
217 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
219 \func{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
221 This function returns the rectangle that encloses the block of cells
222 limited by TopLeft and BottomRight cell in device coords and clipped
223 to the client size of the grid window.
226 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
228 \func{bool
}{CanDragColSize
}{\void}
230 Returns true if columns can be resized by dragging with the mouse. Columns can be resized
231 by dragging the edges of their labels. If grid line dragging is enabled they can also be
232 resized by dragging the right edge of the column in the grid cell area
233 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
235 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
237 \func{bool
}{CanDragRowSize
}{\void}
239 Returns true if rows can be resized by dragging with the mouse. Rows can be resized
240 by dragging the edges of their labels. If grid line dragging is enabled they can also be
241 resized by dragging the lower edge of the row in the grid cell area
242 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
244 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
246 \func{bool
}{CanDragGridSize
}{\void}
248 Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
250 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
252 \constfunc{bool
}{CanEnableCellControl
}{\void}
254 Returns true if the in-place edit control for the current grid cell can be used and
255 false otherwise (e.g. if the current cell is read-only).
257 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
259 \func{bool
}{CanHaveAttributes
}{\void}
261 Do we have some place to store attributes in?
263 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
265 \func{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
267 \func{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
269 Return the rectangle corresponding to the grid cell's size and position in logical
272 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
274 \func{void
}{ClearGrid
}{\void}
276 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
277 this function. If you are using a derived table class then you need to override
278 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
280 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
282 \func{void
}{ClearSelection
}{\void}
284 Deselects all cells that are currently selected.
286 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
288 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
290 Creates a grid with the specified initial number of rows and columns.
291 Call this directly after the grid constructor. When you use this
292 function wxGrid will create and manage a simple table of string values
293 for you. All of the grid data will be stored in memory.
295 For applications with more complex data types or relationships, or for
296 dealing with very large datasets, you should derive your own grid table
297 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
299 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
301 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
303 Deletes one or more columns from a grid starting at the specified position and returns
304 true if successful. The updateLabels argument is not used at present.
306 If you are using a derived grid table class you will need to override
307 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
308 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
310 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
312 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
314 Deletes one or more rows from a grid starting at the specified position and returns
315 true if successful. The updateLabels argument is not used at present.
317 If you are using a derived grid table class you will need to override
318 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
319 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
321 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
323 \func{void
}{DisableCellEditControl
}{\void}
325 Disables in-place editing of grid cells.
326 Equivalent to calling EnableCellEditControl(false).
328 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
330 \func{void
}{DisableDragColSize
}{\void}
332 Disables column sizing by dragging with the mouse. Equivalent to passing false to
333 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
335 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
337 \func{void
}{DisableDragGridSize
}{\void}
339 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
340 false to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
342 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
344 \func{void
}{DisableDragRowSize
}{\void}
346 Disables row sizing by dragging with the mouse. Equivalent to passing false to
347 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
349 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
351 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = true
}}
353 Enables or disables in-place editing of grid cell data. The grid will issue either a
354 wxEVT
\_GRID\_EDITOR\_SHOWN or wxEVT
\_GRID\_EDITOR\_HIDDEN event.
356 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
358 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = true
}}
360 Enables or disables column sizing by dragging with the mouse.
362 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
364 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = true
}}
366 Enables or disables row and column resizing by dragging gridlines with the mouse.
368 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
370 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = true
}}
372 Enables or disables row sizing by dragging with the mouse.
374 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
376 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
378 If the edit argument is false this function sets the whole grid as read-only. If the
379 argument is true the grid is set to the default state where cells may be editable. In the
380 default state you can set single grid cells and whole rows and columns to be editable or
382 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
383 cells you can also use the shortcut function
384 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
386 For more information about controlling grid cell attributes see the
387 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
388 \helpref{wxGrid classes overview
}{gridoverview
}.
390 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
392 \func{void
}{EnableGridLines
}{\param{bool
}{enable = true
}}
394 Turns the drawing of grid lines on or off.
396 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
398 \func{void
}{EndBatch
}{\void}
400 Decrements the grid's batch count. When the count is greater than zero repainting of
401 the grid is suppressed. Each previous call to
402 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
403 EndBatch. Code that does a lot of grid modification can be enclosed between
404 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
405 cause the grid to be repainted.
407 \membersection{wxGrid::Fit
}\label{wxgridfit
}
409 \func{void
}{Fit
}{\void}
411 Overridden wxWindow method.
413 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
415 \func{void
}{ForceRefresh
}{\void}
417 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
419 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
421 \func{int
}{GetBatchCount
}{\void}
423 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
424 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
425 the grid's batch count is greater than zero the display will not be updated.
427 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
429 \func{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
431 Sets the arguments to the horizontal and vertical text alignment values for the
432 grid cell at the specified location.
434 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
435 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
437 \perlnote{This method only takes the parameters
{\tt row
} and
{\tt col
} and
438 returns a
2-element list
{\tt ( horiz, vert )
}.
}
440 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
442 \func{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
444 Returns the background colour of the cell at the specified location.
446 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
448 \func{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
450 Returns a pointer to the editor for the cell at the specified location.
452 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
453 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
455 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
457 \func{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
459 Returns the font for text in the grid cell at the specified location.
461 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
463 \func{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
465 Returns a pointer to the renderer for the grid cell at the specified location.
467 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
468 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
470 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
472 \func{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
474 Returns the text colour for the grid cell at the specified location.
476 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
478 \func{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
480 \func{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
482 Returns the string contained in the cell at the specified location. For simple applications where a
483 grid object automatically uses a default grid table of string values you use this function together
484 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
486 For more complex applications where you have derived your own grid table class that contains
487 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
488 function for those cells that contain string values.
490 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
491 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
494 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
496 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
498 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
500 \func{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
502 Sets the arguments to the current column label alignment values.
504 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.\\
505 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
507 \perlnote{This method takes no parameters and
508 returns a
2-element list
{\tt ( horiz, vert )
}.
}
510 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
512 \func{int
}{GetColLabelSize
}{\void}
514 Returns the current height of the column labels.
516 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
518 \func{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
520 Returns the specified column label. The default grid table class provides column labels of
521 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
522 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
525 \membersection{wxGrid::GetColMinimalAcceptableWidth
}\label{wxgridgetcolminimalacceptablewidth
}
527 \func{int
}{GetColMinimalAcceptableWidth
}{}
529 This returns the value of the lowest column width that can be handled correctly. See
530 member
\helpref{SetColMinimalAcceptableWidth
}{wxgridsetcolminimalacceptablewidth
} for details.
532 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
534 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
536 Get the minimal width of the given column/row.
539 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
541 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
543 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
545 \func{int
}{GetColSize
}{\param{int
}{col
}}
547 Returns the width of the specified column.
549 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
551 \func{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
553 Sets the arguments to the current default horizontal and vertical text alignment
556 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
557 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
559 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
561 \func{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
563 Returns the current default background colour for grid cells.
565 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
567 \func{wxFont
}{GetDefaultCellFont
}{\void}
569 Returns the current default font for grid cell text.
571 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
573 \func{wxColour
}{GetDefaultCellTextColour
}{\void}
575 Returns the current default colour for grid cell text.
577 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
579 \func{int
}{GetDefaultColLabelSize
}{\void}
581 Returns the default height for column labels.
583 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
585 \func{int
}{GetDefaultColSize
}{\void}
587 Returns the current default width for grid columns.
589 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
591 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
593 Returns a pointer to the current default grid cell editor.
595 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
596 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
598 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
600 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
602 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
605 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
607 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
610 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
612 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
614 Returns a pointer to the current default grid cell renderer.
616 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
617 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
619 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
621 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
623 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
625 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
629 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
631 \func{int
}{GetDefaultRowLabelSize
}{\void}
633 Returns the default width for the row labels.
635 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
637 \func{int
}{GetDefaultRowSize
}{\void}
639 Returns the current default height for grid rows.
641 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
643 \func{int
}{GetGridCursorCol
}{\void}
645 Returns the current grid cell column position.
647 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
649 \func{int
}{GetGridCursorRow
}{\void}
651 Returns the current grid cell row position.
653 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
655 \func{wxColour
}{GetGridLineColour
}{\void}
657 Returns the colour used for grid lines.
659 \membersection{wxGrid::GridLinesEnabled
}\label{wxgridgridlinesenabled
}
661 \func{bool
}{GridLinesEnabled
}{\void}
663 Returns true if drawing of grid lines is turned on, false otherwise.
665 \membersection{wxGrid::GetLabelBackgroundColour
}\label{wxgridgetlabelbackgroundcolour
}
667 \func{wxColour
}{GetLabelBackgroundColour
}{\void}
669 Returns the colour used for the background of row and column labels.
671 \membersection{wxGrid::GetLabelFont
}\label{wxgridgetlabelfont
}
673 \func{wxFont
}{GetLabelFont
}{\void}
675 Returns the font used for row and column labels.
677 \membersection{wxGrid::GetLabelTextColour
}\label{wxgridgetlabeltextcolour
}
679 \func{wxColour
}{GetLabelTextColour
}{\void}
681 Returns the colour used for row and column label text.
683 \membersection{wxGrid::GetNumberCols
}\label{wxgridgetnumbercols
}
685 \func{int
}{GetNumberCols
}{\void}
687 Returns the total number of grid columns (actually the number of columns in the underlying grid
690 \membersection{wxGrid::GetNumberRows
}\label{wxgridgetnumberrows
}
692 \func{int
}{GetNumberRows
}{\void}
694 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
696 \membersection{wxGrid::GetOrCreateCellAttr
}\label{wxgridgetorcreatecellattr
}
698 \constfunc{wxGridCellAttr*
}{GetOrCreateCellAttr
}{\param{int
}{row
},
\param{int
}{col
}}
700 \membersection{wxGrid::GetRowMinimalAcceptableHeight
}\label{wxgridgetrowminimalacceptableheight
}
702 \func{int
}{GetRowMinimalAcceptableHeight
}{}
704 This returns the value of the lowest row width that can be handled correctly. See
705 member
\helpref{SetRowMinimalAcceptableHeight
}{wxgridsetrowminimalacceptableheight
} for details.
708 \membersection{wxGrid::GetRowMinimalHeight
}\label{wxgridgetrowminimalheight
}
710 \constfunc{int
}{GetRowMinimalHeight
}{\param{int
}{col
}}
712 \membersection{wxGrid::GetRowLabelAlignment
}\label{wxgridgetrowlabelalignment
}
714 \func{void
}{GetRowLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
716 Sets the arguments to the current row label alignment values.
718 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
719 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
721 \perlnote{This method takes no parameters and
722 returns a
2-element list
{\tt ( horiz, vert )
}.
}
724 \membersection{wxGrid::GetRowLabelSize
}\label{wxgridgetrowlabelsize
}
726 \func{int
}{GetRowLabelSize
}{\void}
728 Returns the current width of the row labels.
730 \membersection{wxGrid::GetRowLabelValue
}\label{wxgridgetrowlabelvalue
}
732 \func{wxString
}{GetRowLabelValue
}{\param{int
}{row
}}
734 Returns the specified row label. The default grid table class provides numeric row labels.
735 If you are using a custom grid table you can override
736 \helpref{wxGridTableBase::GetRowLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
739 \membersection{wxGrid::GetRowSize
}\label{wxgridgetrowsize
}
741 \func{int
}{GetRowSize
}{\param{int
}{row
}}
743 Returns the height of the specified row.
745 \membersection{wxGrid::GetScrollLinesX
}\label{wxgridgetscrolllinesx
}
747 \constfunc{int
}{GetScrollLinesX
}{\void}
749 Returns the number of pixels per horizontal scroll increment. The default is
15.
751 \membersection{wxGrid::GetScrollLinesY
}\label{wxgridgetscrolllinesy
}
753 \constfunc{int
}{GetScrollLinesY
}{\void}
755 Returns the number of pixels per vertical scroll increment. The default is
15.
757 \membersection{wxGrid::GetSelectionMode
}\label{wxgridgetselectionmode
}
759 \constfunc{wxGrid::wxGridSelectionModes
}{GetSelectionMode
}{\void}
761 Returns the current selection mode, see
\helpref{wxGrid::SetSelectionMode
}{wxgridsetselectionmode
}.
763 \membersection{wxGrid::GetSelectedCells
}\label{wxgridgetselectedcells
}
765 \constfunc{wxGridCellCoordsArray
}{GetSelectedCells
}{\void}
767 Returns an array of singly selected cells.
769 \membersection{wxGrid::GetSelectedCols
}\label{wxgridgetselectedcols
}
771 \constfunc{wxArrayInt
}{GetSelectedCols
}{\void}
773 Returns an array of selected cols.
775 \membersection{wxGrid::GetSelectedRows
}\label{wxgridgetselectedrows
}
777 \constfunc{wxArrayInt
}{GetSelectedRows
}{\void}
779 Returns an array of selected rows.
781 \membersection{wxGrid::GetSelectionBackground
}\label{wxgridgetselectionbackground
}
783 \constfunc{wxColour
}{GetSelectionBackground
}{\void}
785 Access or update the selection fore/back colours
788 \membersection{wxGrid::GetSelectionBlockTopLeft
}\label{wxgridgetselectionblocktopleft
}
790 \constfunc{wxGridCellCoordsArray
}{GetSelectionBlockTopLeft
}{\void}
792 Returns an array of the top left corners of blocks of selected cells,
793 see
\helpref{wxGrid::GetSelectionBlockBottomRight
}{wxgridgetselectionblockbottomright
}.
795 \membersection{wxGrid::GetSelectionBlockBottomRight
}\label{wxgridgetselectionblockbottomright
}
797 \constfunc{wxGridCellCoordsArray
}{GetSelectionBlockBottomRight
}{\void}
799 Returns an array of the bottom right corners of blocks of selected cells,
800 see
\helpref{wxGrid::GetSelectionBlockTopLeft
}{wxgridgetselectionblocktopleft
}.
802 \membersection{wxGrid::GetSelectionForeground
}\label{wxgridgetselectionforeground
}
804 \constfunc{wxColour
}{GetSelectionForeground
}{\void}
807 \membersection{wxGrid::GetTable
}\label{wxgridgettable
}
809 \constfunc{wxGridTableBase *
}{GetTable
}{\void}
811 Returns a base pointer to the current table object.
813 \membersection{wxGrid::GetViewWidth
}\label{wxgridgetviewwidth
}
815 \func{int
}{GetViewWidth
}{\void}
817 Returned number of whole cols visible.
819 \membersection{wxGrid::HideCellEditControl
}\label{wxgridhidecelleditcontrol
}
821 \func{void
}{HideCellEditControl
}{\void}
823 Hides the in-place cell edit control.
825 \membersection{wxGrid::InitColWidths
}\label{wxgridinitcolwidths
}
827 \func{void
}{InitColWidths
}{\void}
829 Init the m
\_colWidths/Rights arrays
831 \membersection{wxGrid::InitRowHeights
}\label{wxgridinitrowheights
}
833 \func{void
}{InitRowHeights
}{\void}
835 NB:
{\it never
} access m
\_row/col arrays directly because they are created
836 on demand,
{\it always
} use accessor functions instead!
838 Init the m
\_rowHeights/Bottoms arrays with default values.
840 \membersection{wxGrid::InsertCols
}\label{wxgridinsertcols
}
842 \func{bool
}{InsertCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
844 Inserts one or more new columns into a grid with the first new column at the
845 specified position and returns true if successful. The updateLabels argument is not
848 The sequence of actions begins with the grid object requesting the underlying grid
849 table to insert new columns. If this is successful the table notifies the grid and the
850 grid updates the display. For a default grid (one where you have called
851 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
852 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
853 then you must override
854 \helpref{wxGridTableBase::InsertCols
}{wxgridtablebaseinsertcols
} in your derived
857 \membersection{wxGrid::InsertRows
}\label{wxgridinsertrows
}
859 \func{bool
}{InsertRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
861 Inserts one or more new rows into a grid with the first new row at the specified
862 position and returns true if successful. The updateLabels argument is not used at
865 The sequence of actions begins with the grid object requesting the underlying grid
866 table to insert new rows. If this is successful the table notifies the grid and the
867 grid updates the display. For a default grid (one where you have called
868 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
869 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
870 then you must override
871 \helpref{wxGridTableBase::InsertRows
}{wxgridtablebaseinsertrows
} in your derived
874 \membersection{wxGrid::IsCellEditControlEnabled
}\label{wxgridiscelleditcontrolenabled
}
876 \constfunc{bool
}{IsCellEditControlEnabled
}{\void}
878 Returns true if the in-place edit control is currently enabled.
880 \membersection{wxGrid::IsCurrentCellReadOnly
}\label{wxgridiscurrentcellreadonly
}
882 \constfunc{bool
}{IsCurrentCellReadOnly
}{\void}
884 Returns true if the current cell has been set to read-only
885 (see
\helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}).
887 \membersection{wxGrid::IsEditable
}\label{wxgridiseditable
}
889 \func{bool
}{IsEditable
}{\void}
891 Returns false if the whole grid has been set as read-only or true otherwise.
892 See
\helpref{wxGrid::EnableEditing
}{wxgridenableediting
} for more information about
893 controlling the editing status of grid cells.
895 \membersection{wxGrid::IsInSelection
}\label{wxgridisinselection
}
897 \constfunc{bool
}{IsInSelection
}{\param{int
}{row
},
\param{int
}{col
}}
899 \constfunc{bool
}{IsInSelection
}{\param{const wxGridCellCoords\&
}{coords
}}
901 Is this cell currently selected.
903 \membersection{wxGrid::IsReadOnly
}\label{wxgridisreadonly
}
905 \constfunc{bool
}{IsReadOnly
}{\param{int
}{row
},
\param{int
}{col
}}
907 Returns true if the cell at the specified location can't be edited.
908 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
910 \membersection{wxGrid::IsSelection
}\label{wxgridisselection
}
912 \func{bool
}{IsSelection
}{\void}
914 Returns true if there are currently rows, columns or blocks of cells selected.
916 \membersection{wxGrid::IsVisible
}\label{wxgridisvisible
}
918 \func{bool
}{IsVisible
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{wholeCellVisible = true
}}
920 \func{bool
}{IsVisible
}{\param{const wxGridCellCoords\&
}{coords
},
\param{bool
}{wholeCellVisible = true
}}
922 Returns true if a cell is either wholly visible (the default) or at least partially
923 visible in the grid window.
925 \membersection{wxGrid::MakeCellVisible
}\label{wxgridmakecellvisible
}
927 \func{void
}{MakeCellVisible
}{\param{int
}{row
},
\param{int
}{col
}}
929 \func{void
}{MakeCellVisible
}{\param{const wxGridCellCoords\&
}{coords
}}
931 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
932 nothing if the cell is already visible.
934 \membersection{wxGrid::MoveCursorDown
}\label{wxgridmovecursordown
}
936 \func{bool
}{MoveCursorDown
}{\param{bool
}{expandSelection
}}
938 Moves the grid cursor down by one row. If a block of cells was previously selected it
939 will expand if the argument is true or be cleared if the argument is false.
941 \wxheading{Keyboard
}\\
942 This function is called for Down cursor key presses or Shift+Down to expand a selection.
944 \membersection{wxGrid::MoveCursorLeft
}\label{wxgridmovecursorleft
}
946 \func{bool
}{MoveCursorLeft
}{\param{bool
}{expandSelection
}}
948 Moves the grid cursor left by one column. If a block of cells was previously selected it
949 will expand if the argument is true or be cleared if the argument is false.
951 \wxheading{Keyboard
}\\
952 This function is called for Left cursor key presses or Shift+Left to expand a selection.
954 \membersection{wxGrid::MoveCursorRight
}\label{wxgridmovecursorright
}
956 \func{bool
}{MoveCursorRight
}{\param{bool
}{expandSelection
}}
958 Moves the grid cursor right by one column. If a block of cells was previously selected it
959 will expand if the argument is true or be cleared if the argument is false.
961 \wxheading{Keyboard
}\\
962 This function is called for Right cursor key presses or Shift+Right to expand a selection.
964 \membersection{wxGrid::MoveCursorUp
}\label{wxgridmovecursorup
}
966 \func{bool
}{MoveCursorUp
}{\param{bool
}{expandSelection
}}
968 Moves the grid cursor up by one row. If a block of cells was previously selected it
969 will expand if the argument is true or be cleared if the argument is false.
971 \wxheading{Keyboard
}\\
972 This function is called for Up cursor key presses or Shift+Up to expand a selection.
974 \membersection{wxGrid::MoveCursorDownBlock
}\label{wxgridmovecursordownblock
}
976 \func{bool
}{MoveCursorDownBlock
}{\param{bool
}{expandSelection
}}
978 Moves the grid cursor down in the current column such that it skips to the beginning or
979 end of a block of non-empty cells. If a block of cells was previously selected it
980 will expand if the argument is true or be cleared if the argument is false.
982 \wxheading{Keyboard
}\\
983 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
985 \membersection{wxGrid::MoveCursorLeftBlock
}\label{wxgridmovecursorleftblock
}
987 \func{bool
}{MoveCursorLeftBlock
}{\param{bool
}{expandSelection
}}
989 Moves the grid cursor left in the current row such that it skips to the beginning or
990 end of a block of non-empty cells. If a block of cells was previously selected it
991 will expand if the argument is true or be cleared if the argument is false.
993 \wxheading{Keyboard
}\\
994 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
996 \membersection{wxGrid::MoveCursorRightBlock
}\label{wxgridmovecursorrightblock
}
998 \func{bool
}{MoveCursorRightBlock
}{\param{bool
}{expandSelection
}}
1000 Moves the grid cursor right in the current row such that it skips to the beginning or
1001 end of a block of non-empty cells. If a block of cells was previously selected it
1002 will expand if the argument is true or be cleared if the argument is false.
1004 \wxheading{Keyboard
}\\
1005 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1007 \membersection{wxGrid::MoveCursorUpBlock
}\label{wxgridmovecursorupblock
}
1009 \func{bool
}{MoveCursorUpBlock
}{\param{bool
}{expandSelection
}}
1011 Moves the grid cursor up in the current column such that it skips to the beginning or
1012 end of a block of non-empty cells. If a block of cells was previously selected it
1013 will expand if the argument is true or be cleared if the argument is false.
1015 \wxheading{Keyboard
}\\
1016 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1018 \membersection{wxGrid::MovePageDown
}\label{wxgridmovepagedown
}
1020 \func{bool
}{MovePageDown
}{\void}
1022 Moves the grid cursor down by some number of rows so that the previous bottom visible row
1023 becomes the top visible row.
1025 \wxheading{Keyboard
}\\
1026 This function is called for PgDn keypresses.
1028 \membersection{wxGrid::MovePageUp
}\label{wxgridmovepageup
}
1030 \func{bool
}{MovePageUp
}{\void}
1032 Moves the grid cursor up by some number of rows so that the previous top visible row
1033 becomes the bottom visible row.
1035 \wxheading{Keyboard
}\\
1036 This function is called for PgUp keypresses.
1038 \membersection{wxGrid::RegisterDataType
}\label{wxgridregisterdatatype
}
1040 \func{void
}{RegisterDataType
}{\param{const wxString\&
}{typeName
},
\param{wxGridCellRenderer*
}{renderer
},
\param{wxGridCellEditor*
}{editor
}}
1042 Methods for a registry for mapping data types to Renderers/Editors
1044 \membersection{wxGrid::SaveEditControlValue
}\label{wxgridsaveeditcontrolvalue
}
1046 \func{void
}{SaveEditControlValue
}{\void}
1048 Sets the value of the current grid cell to the current in-place edit control value.
1049 This is called automatically when the grid cursor moves from the current cell to a
1050 new cell. It is also a good idea to call this function when closing a grid since
1051 any edits to the final cell location will not be saved otherwise.
1053 \membersection{wxGrid::SelectAll
}\label{wxgridselectall
}
1055 \func{void
}{SelectAll
}{\void}
1057 Selects all cells in the grid.
1059 \membersection{wxGrid::SelectBlock
}\label{wxgridselectblock
}
1061 \func{void
}{SelectBlock
}{\param{int
}{topRow
},
\param{int
}{leftCol
},
1062 \param{int
}{bottomRow
},
\param{int
}{rightCol
},
\param{bool
}{addToSelected = false
}}
1064 \func{void
}{SelectBlock
}{\param{const wxGridCellCoords\&
}{topLeft
},
1065 \param{const wxGridCellCoords\&
}{bottomRight
},
\param{bool
}{addToSelected = false
}}
1067 Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
1068 deselected; if true the column will be added to the existing selection.
1070 \membersection{wxGrid::SelectCol
}\label{wxgridselectcol
}
1072 \func{void
}{SelectCol
}{\param{int
}{col
},
\param{bool
}{addToSelected = false
}}
1074 Selects the specified column. If addToSelected is false then any existing selection will be
1075 deselected; if true the column will be added to the existing selection.
1077 \membersection{wxGrid::SelectionToDeviceRect
}\label{wxgridselectiontodevicerect
}
1079 \func{wxRect
}{SelectionToDeviceRect
}{\void}
1081 This function returns the rectangle that encloses the selected cells
1082 in device coords and clipped to the client size of the grid window.
1085 \membersection{wxGrid::SelectRow
}\label{wxgridselectrow
}
1087 \func{void
}{SelectRow
}{\param{int
}{row
},
\param{bool
}{addToSelected = false
}}
1089 Selects the specified row. If addToSelected is false then any existing selection will be
1090 deselected; if true the row will be added to the existing selection.
1092 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
1094 \func{void
}{SetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int
}{horiz
},
\param{int
}{vert
}}
1096 \func{void
}{SetCellAlignment
}{\param{int
}{align
},
\param{int
}{row
},
\param{int
}{col
}}
1098 Sets the horizontal and vertical alignment for grid cell text at the specified location.
1100 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
1101 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1103 \membersection{wxGrid::SetCellBackgroundColour
}\label{wxgridsetcellbackgroundcolour
}
1105 \func{void
}{SetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxColour\&
}{ colour
}}
1108 \membersection{wxGrid::SetCellEditor
}\label{wxgridsetcelleditor
}
1110 \func{void
}{SetCellEditor
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellEditor*
}{editor
}}
1112 Sets the editor for the grid cell at the specified location.
1113 The grid will take ownership of the pointer.
1115 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
1116 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1118 \membersection{wxGrid::SetCellFont
}\label{wxgridsetcellfont
}
1120 \func{void
}{SetCellFont
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxFont\&
}{ font
}}
1122 Sets the font for text in the grid cell at the specified location.
1124 \membersection{wxGrid::SetCellRenderer
}\label{wxgridsetcellrenderer
}
1126 \func{void
}{SetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellRenderer*
}{renderer
}}
1128 Sets the renderer for the grid cell at the specified location.
1129 The grid will take ownership of the pointer.
1131 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
1132 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1134 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
1136 \func{void
}{SetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxColour\&
}{ colour
}}
1138 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
1140 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{colour
}}
1142 Sets the text colour for the grid cell at the specified location.
1144 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
1146 \func{void
}{SetCellValue
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxString\&
}{s
}}
1148 \func{void
}{SetCellValue
}{\param{const wxGridCellCoords\&
}{coords
},
\param{const wxString\&
}{s
}}
1150 \func{void
}{SetCellValue
}{\param{const wxString\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
1152 Sets the string value for the cell at the specified location. For simple applications where a
1153 grid object automatically uses a default grid table of string values you use this function together
1154 with
\helpref{wxGrid::GetCellValue
}{wxgridgetcellvalue
} to access cell values.
1156 For more complex applications where you have derived your own grid table class that contains
1157 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
1158 function for those cells that contain string values.
1160 The last form is for backward compatibility only.
1162 See
\helpref{wxGridTableBase::CanSetValueAs
}{wxgridtablebasecangetvalueas
}
1163 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
1165 \membersection{wxGrid::SetColAttr
}\label{wxgridsetcolattr
}
1167 \func{void
}{SetColAttr
}{\param{int
}{col
},
\param{wxGridCellAttr*
}{attr
}}
1169 Sets the cell attributes for all cells in the specified column.
1171 For more information about controlling grid cell attributes see the
1172 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
1173 \helpref{wxGrid classes overview
}{gridoverview
}.
1175 \membersection{wxGrid::SetColFormatBool
}\label{wxgridsetcolformatbool
}
1177 \func{void
}{SetColFormatBool
}{\param{int
}{col
}}
1179 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
1181 \membersection{wxGrid::SetColFormatNumber
}\label{wxgridsetcolformatnumber
}
1183 \func{void
}{SetColFormatNumber
}{\param{int
}{col
}}
1185 Sets the specified column to display integer values.
1187 \membersection{wxGrid::SetColFormatFloat
}\label{wxgridsetcolformatfloat
}
1189 \func{void
}{SetColFormatFloat
}{\param{int
}{col
},
\param{int
}{width = -
1},
\param{int
}{precision = -
1}}
1191 Sets the specified column to display floating point values with the given width and precision.
1193 \membersection{wxGrid::SetColFormatCustom
}\label{wxgridsetcolformatcustom
}
1195 \func{void
}{SetColFormatCustom
}{\param{int
}{col
},
\param{const wxString\&
}{typeName
}}
1197 Sets the specified column to display data in a custom format.
1198 See the
\helpref{wxGrid overview
}{gridoverview
} for more information on working
1199 with custom data types.
1201 \membersection{wxGrid::SetColLabelAlignment
}\label{wxgridsetcollabelalignment
}
1203 \func{void
}{SetColLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1205 Sets the horizontal and vertical alignment of column label text.
1207 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.
1209 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1211 \membersection{wxGrid::SetColLabelSize
}\label{wxgridsetcollabelsize
}
1213 \func{void
}{SetColLabelSize
}{\param{int
}{height
}}
1215 Sets the height of the column labels.
1217 \membersection{wxGrid::SetColLabelValue
}\label{wxgridsetcollabelvalue
}
1219 \func{void
}{SetColLabelValue
}{\param{int
}{col
},
\param{const wxString\&
}{ value
}}
1221 Set the value for the given column label. If you are using a derived grid table you must
1222 override
\helpref{wxGridTableBase::SetColLabelValue
}{wxgridtablebasesetcollabelvalue
}
1223 for this to have any effect.
1225 \membersection{wxGrid::SetColMinimalWidth
}\label{wxgridsetcolminimalwidth
}
1227 \func{void
}{SetColMinimalWidth
}{\param{int
}{col
},
\param{int
}{width
}}
1229 Sets the minimal width for the specified column. This should normally be called when creating the grid
1230 because it will not resize a column that is already narrower than the minimal width.
1231 The width argument must be higher than the minimimal acceptable column width, see
1232 \helpref{wxGrid::GetColMinimalAcceptableWidth
}{wxgridgetcolminimalacceptablewidth
}.
1234 \membersection{wxGrid::SetColMinimalAcceptableWidth
}\label{wxgridsetcolminimalacceptablewidth
}
1236 \func{void
}{SetColMinimalAcceptableWidth
}{\param{int
}{width
}}
1238 This modifies the minimum column width that can be handled correctly. Specifying a low value here
1239 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1240 than the actual minimum size will incur a performance penalty in the functions which perform
1241 grid cell index lookup on the basis of screen coordinates.
1242 This should normally be called when creating the grid because it will not resize existing columns
1243 with sizes smaller than the value specified here.
1245 \membersection{wxGrid::SetColSize
}\label{wxgridsetcolsize
}
1247 \func{void
}{SetColSize
}{\param{int
}{col
},
\param{int
}{width
}}
1249 Sets the width of the specified column.
1251 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1252 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1254 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1255 also be set as the minimal width for the column.
1258 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1259 The memory requirements for this could become prohibitive if your grid is very large.
1261 \membersection{wxGrid::SetDefaultCellAlignment
}\label{wxgridsetdefaultcellalignment
}
1263 \func{void
}{SetDefaultCellAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1265 Sets the default horizontal and vertical alignment for grid cell text.
1267 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.
1269 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1271 \membersection{wxGrid::SetDefaultCellBackgroundColour
}\label{wxgridsetdefaultcellbackgroundcolour
}
1273 \func{void
}{SetDefaultCellBackgroundColour
}{\param{const wxColour\&
}{ colour
}}
1275 Sets the default background colour for grid cells.
1277 \membersection{wxGrid::SetDefaultCellFont
}\label{wxgridsetdefaultcellfont
}
1279 \func{void
}{SetDefaultCellFont
}{\param{const wxFont\&
}{ font
}}
1281 Sets the default font to be used for grid cell text.
1283 \membersection{wxGrid::SetDefaultCellTextColour
}\label{wxgridsetdefaultcelltextcolour
}
1285 \func{void
}{SetDefaultCellTextColour
}{\param{const wxColour\&
}{ colour
}}
1287 Sets the current default colour for grid cell text.
1289 \membersection{wxGrid::SetDefaultEditor
}\label{wxgridsetdefaulteditor
}
1291 \func{void
}{SetDefaultEditor
}{\param{wxGridCellEditor*
}{editor
}}
1293 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1295 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
1296 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1298 \membersection{wxGrid::SetDefaultRenderer
}\label{wxgridsetdefaultrenderer
}
1300 \func{void
}{SetDefaultRenderer
}{\param{wxGridCellRenderer*
}{renderer
}}
1302 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1304 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
1305 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1307 \membersection{wxGrid::SetDefaultColSize
}\label{wxgridsetdefaultcolsize
}
1309 \func{void
}{SetDefaultColSize
}{\param{int
}{width
},
\param{bool
}{resizeExistingCols = false
}}
1311 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1312 the grid unless resizeExistingCols is true.
1314 \membersection{wxGrid::SetDefaultRowSize
}\label{wxgridsetdefaultrowsize
}
1316 \func{void
}{SetDefaultRowSize
}{\param{int
}{height
},
\param{bool
}{resizeExistingRows = false
}}
1318 Sets the default height for rows in the grid. This will only affect rows subsequently added
1319 to the grid unless resizeExistingRows is true.
1321 \membersection{wxGrid::SetGridCursor
}\label{wxgridsetgridcursor
}
1323 \func{void
}{SetGridCursor
}{\param{int
}{row
},
\param{int
}{col
}}
1325 Set the grid cursor to the specified cell.
1326 This function calls
\helpref{wxGrid::MakeCellVisible
}{wxgridmakecellvisible
}.
1328 \membersection{wxGrid::SetGridLineColour
}\label{wxgridsetgridlinecolour
}
1330 \func{void
}{SetGridLineColour
}{\param{const wxColour\&
}{colour
}}
1332 Sets the colour used to draw grid lines.
1334 \membersection{wxGrid::SetLabelBackgroundColour
}\label{wxgridsetlabelbackgroundcolour
}
1336 \func{void
}{SetLabelBackgroundColour
}{\param{const wxColour\&
}{ colour
}}
1338 Sets the background colour for row and column labels.
1340 \membersection{wxGrid::SetLabelFont
}\label{wxgridsetlabelfont
}
1342 \func{void
}{SetLabelFont
}{\param{const wxFont\&
}{ font
}}
1344 Sets the font for row and column labels.
1346 \membersection{wxGrid::SetLabelTextColour
}\label{wxgridsetlabeltextcolour
}
1348 \func{void
}{SetLabelTextColour
}{\param{const wxColour\&
}{ colour
}}
1350 Sets the colour for row and column label text.
1352 \membersection{wxGrid::SetMargins
}\label{wxgridsetmargins
}
1354 \func{void
}{SetMargins
}{\param{int
}{extraWidth
},
\param{int
}{extraHeight
}}
1356 A grid may occupy more space than needed for its rows/columns. This
1357 function allows to set how big this extra space is
1359 \membersection{wxGrid::SetOrCalcColumnSizes
}\label{wxgridsetorcalccolumnsizes
}
1361 \func{int
}{SetOrCalcColumnSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = true
}}
1363 Common part of AutoSizeColumn/Row() and GetBestSize()
1365 \membersection{wxGrid::SetOrCalcRowSizes
}\label{wxgridsetorcalcrowsizes
}
1367 \func{int
}{SetOrCalcRowSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = true
}}
1369 \membersection{wxGrid::SetReadOnly
}\label{wxgridsetreadonly
}
1371 \func{void
}{SetReadOnly
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{isReadOnly = true
}}
1373 Makes the cell at the specified location read-only or editable.
1374 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
1376 \membersection{wxGrid::SetRowAttr
}\label{wxgridsetrowattr
}
1378 \func{void
}{SetRowAttr
}{\param{int
}{row
},
\param{wxGridCellAttr*
}{attr
}}
1380 Sets the cell attributes for all cells in the specified row.
1381 See the
\helpref{wxGridCellAttr
}{wxgridcellattr
} class for more information
1382 about controlling cell attributes.
1384 \membersection{wxGrid::SetRowLabelAlignment
}\label{wxgridsetrowlabelalignment
}
1386 \func{void
}{SetRowLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1388 Sets the horizontal and vertical alignment of row label text.
1390 Horizontal alignment should be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.
1392 Vertical alignment should be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
1394 \membersection{wxGrid::SetRowLabelSize
}\label{wxgridsetrowlabelsize
}
1396 \func{void
}{SetRowLabelSize
}{\param{int
}{width
}}
1398 Sets the width of the row labels.
1400 \membersection{wxGrid::SetRowLabelValue
}\label{wxgridsetrowlabelvalue
}
1402 \func{void
}{SetRowLabelValue
}{\param{int
}{row
},
\param{const wxString\&
}{ value
}}
1404 Set the value for the given row label. If you are using a derived grid table you must
1405 override
\helpref{wxGridTableBase::SetRowLabelValue
}{wxgridtablebasesetrowlabelvalue
}
1406 for this to have any effect.
1408 \membersection{wxGrid::SetRowMinimalHeight
}\label{wxgridsetrowminimalheight
}
1410 \func{void
}{SetRowMinimalHeight
}{\param{int
}{row
},
\param{int
}{height
}}
1412 Sets the minimal height for the specified row. This should normally be called when creating the grid
1413 because it will not resize a row that is already shorter than the minimal height.
1414 The height argument must be higher than the minimimal acceptable row height, see
1415 \helpref{wxGrid::GetRowMinimalAcceptableHeight
}{wxgridgetrowminimalacceptableheight
}.
1417 \membersection{wxGrid::SetRowMinimalAcceptableHeight
}\label{wxgridsetrowminimalacceptableheight
}
1419 \func{void
}{SetRowMinimalAcceptableHeight
}{\param{int
}{height
}}
1421 This modifies the minimum row width that can be handled correctly. Specifying a low value here
1422 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1423 than the actual minimum size will incur a performance penalty in the functions which perform
1424 grid cell index lookup on the basis of screen coordinates.
1425 This should normally be called when creating the grid because it will not resize existing rows
1426 with sizes smaller than the value specified here.
1428 \membersection{wxGrid::SetRowSize
}\label{wxgridsetrowsize
}
1430 \func{void
}{SetRowSize
}{\param{int
}{row
},
\param{int
}{height
}}
1432 Sets the height of the specified row.
1434 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1435 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1437 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1438 also be set as the minimal width for the column.
1442 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1443 The memory requirements for this could become prohibitive if your grid is very large.
1445 \membersection{wxGrid::SetScrollLinesX
}\label{wxgridsetscrolllinesx
}
1447 \func{void
}{SetScrollLinesX
}{\param{int
}{x
}}
1449 Sets the number of pixels per horizontal scroll increment. The default is
15.
1450 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1451 errors: setting this to
1 can help.
1453 \membersection{wxGrid::SetScrollLinesY
}\label{wxgridsetscrolllinesy
}
1455 \func{void
}{SetScrollLinesY
}{\param{int
}{y
}}
1457 Sets the number of pixels per vertical scroll increment. The default is
15.
1458 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1459 errors: setting this to
1 can help.
1461 \membersection{wxGrid::SetSelectionBackground
}\label{wxgridsetselectionbackground
}
1463 \func{void
}{SetSelectionBackground
}{\param{const wxColour\&
}{c
}}
1466 \membersection{wxGrid::SetSelectionForeground
}\label{wxgridsetselectionforeground
}
1468 \func{void
}{SetSelectionForeground
}{\param{const wxColour\&
}{c
}}
1471 \membersection{wxGrid::SetSelectionMode
}\label{wxgridsetselectionmode
}
1473 \func{void
}{SetSelectionMode
}{\param{wxGrid::wxGridSelectionModes
}{ selmode
}}
1475 Set the selection behaviour of the grid.
1477 \wxheading{Parameters
}
1479 \docparam{wxGrid::wxGridSelectCells
}{The default mode where individual cells are selected.
}
1481 \docparam{wxGrid::wxGridSelectRows
}{Selections will consist of whole rows.
}
1483 \docparam{wxGrid::wxGridSelectColumns
}{Selections will consist of whole columns.
}
1485 \membersection{wxGrid::SetTable
}\label{wxgridsettable
}
1487 \func{bool
}{SetTable
}{\param{wxGridTableBase*
}{table
},
\param{bool
}{takeOwnership = false
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
1489 Passes a pointer to a custom grid table to be used by the grid. This should be called
1490 after the grid constructor and before using the grid object. If takeOwnership is set to
1491 true then the table will be deleted by the wxGrid destructor.
1493 Use this function instead of
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} when your
1494 application involves complex or non-string data or data sets that are too large to fit
1497 \membersection{wxGrid::ShowCellEditControl
}\label{wxgridshowcelleditcontrol
}
1499 \func{void
}{ShowCellEditControl
}{\void}
1501 Displays the in-place cell edit control for the current cell.
1503 \membersection{wxGrid::XToCol
}\label{wxgridxtocol
}
1505 \func{int
}{XToCol
}{\param{int
}{x
}}
1507 Returns the grid column that corresponds to the logical x coordinate. Returns
1508 {\tt wxNOT
\_FOUND} if there is no column at the x position.
1510 \membersection{wxGrid::XToEdgeOfCol
}\label{wxgridxtoedgeofcol
}
1512 \func{int
}{XToEdgeOfCol
}{\param{int
}{x
}}
1514 Returns the column whose right hand edge is close to the given logical x position.
1515 If no column edge is near to this position
{\tt wxNOT
\_FOUND} is returned.
1517 \membersection{wxGrid::YToEdgeOfRow
}\label{wxgridytoedgeofrow
}
1519 \func{int
}{YToEdgeOfRow
}{\param{int
}{y
}}
1521 Returns the row whose bottom edge is close to the given logical y position.
1522 If no row edge is near to this position
{\tt wxNOT
\_FOUND} is returned.
1524 \membersection{wxGrid::YToRow
}\label{wxgridytorow
}
1526 \func{int
}{YToRow
}{\param{int
}{y
}}
1528 Returns the grid row that corresponds to the logical y coordinate. Returns
1529 {\tt wxNOT
\_FOUND} if there is no row at the y position.