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 \helpref{wxGrid overview
}{gridoverview
}
43 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
44 \latexignore{\rtfignore{\wxheading{Function groups
}}}
46 \membersection{Constructors and initialization
}
48 \helpref{wxGrid
}{wxgridctor
}\\
49 \helpref{\destruct{wxGrid
}}{wxgriddtor
}\\
50 \helpref{CreateGrid
}{wxgridcreategrid
}\\
51 \helpref{SetTable
}{wxgridsettable
}
53 \membersection{Display format
}
55 \membersection{Selection functions
}
57 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
}\\
58 \helpref{wxGrid::IsSelection
}{wxgridisselection
}\\
59 \helpref{wxGrid::SelectAll
}{wxgridselectall
}\\
60 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
}\\
61 \helpref{wxGrid::SelectCol
}{wxgridselectcol
}\\
62 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
64 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
65 \helponly{\insertatlevel{2}{
71 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
73 \func{}{wxGrid
}{\void}
77 \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
}}
79 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
80 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
83 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
85 \func{}{\destruct{wxGrid
}}{\void}
87 Destructor. This will also destroy the associated grid table unless you passed a table
88 object to the grid and specified that the grid should not take ownership of the
89 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
91 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
93 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
95 Appends one or more new columns to the right of the grid and returns TRUE if
96 successful. The updateLabels argument is not used at present.
98 If you are using a derived grid table class you will need to override
99 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
100 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
102 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
104 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
106 Appends one or more new rows to the bottom of the grid and returns TRUE if
107 successful. The updateLabels argument is not used at present.
109 If you are using a derived grid table class you will need to override
110 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
111 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
113 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
115 \func{void
}{AutoSize
}{\void}
117 Automatically sets the height and width of all rows and columns to fit their contents.
120 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
121 The memory requirements for this could become prohibitive if your grid is very large.
123 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
125 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = TRUE
}}
127 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
128 also be set as the minimal width for the column.
131 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
132 The memory requirements for this could become prohibitive if your grid is very large.
134 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
136 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = TRUE
}}
138 Automatically sizes all columns to fit their contents. If setAsMin is TRUE the calculated widths will
139 also be set as the minimal widths for the columns.
142 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
143 The memory requirements for this could become prohibitive if your grid is very large.
145 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
147 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = TRUE
}}
149 Automatically sizes the row to fit its contents. If setAsMin is TRUE the calculated height will
150 also be set as the minimal height for the row.
153 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
154 The memory requirements for this could become prohibitive if your grid is very large.
156 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
158 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = TRUE
}}
160 Automatically sizes all rows to fit their contents. If setAsMin is TRUE the calculated heights will
161 also be set as the minimal heights for the rows.
164 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
165 The memory requirements for this could become prohibitive if your grid is very large.
167 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
169 \func{void
}{BeginBatch
}{\void}
171 Increments the grid's batch count. When the count is greater than zero repainting of
172 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
173 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
174 modification can be enclosed between BeginBatch and EndBatch calls to avoid
175 screen flicker. The final EndBatch will cause the grid to be repainted.
177 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
179 \func{bool
}{CanDragColSize
}{\void}
181 Returns TRUE if columns can be resized by dragging with the mouse. Columns can be resized
182 by dragging the edges of their labels. If grid line dragging is enabled they can also be
183 resized by dragging the right edge of the column in the grid cell area
184 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
186 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
188 \func{bool
}{CanDragRowSize
}{\void}
190 Returns TRUE if rows can be resized by dragging with the mouse. Rows can be resized
191 by dragging the edges of their labels. If grid line dragging is enabled they can also be
192 resized by dragging the lower edge of the row in the grid cell area
193 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
195 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
197 \func{bool
}{CanDragGridSize
}{\void}
199 Return TRUE if the dragging of grid lines to resize rows and columns is enabled or FALSE otherwise.
201 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
203 \constfunc{bool
}{CanEnableCellControl
}{\void}
205 Returns TRUE if the in-place edit control for the current grid cell can be used and
206 FALSE otherwise (e.g. if the current cell is read-only).
208 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
210 \func{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
212 \func{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
214 Return the rectangle corresponding to the grid cell's size and position in logical
217 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
219 \func{void
}{ClearGrid
}{\void}
221 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
222 this function. If you are using a derived table class then you need to override
223 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
225 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
227 \func{void
}{ClearSelection
}{\void}
229 Deselects all cells that are currently selected.
231 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
233 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
235 Creates a grid with the specified initial number of rows and columns.
236 Call this directly after the grid constructor. When you use this
237 function wxGrid will create and manage a simple table of string values
238 for you. All of the grid data will be stored in memory.
240 For applications with more complex data types or relationships, or for
241 dealing with very large datasets, you should derive your own grid table
242 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
244 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
246 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
248 Deletes one or more columns from a grid starting at the specified position and returns
249 TRUE if successful. The updateLabels argument is not used at present.
251 If you are using a derived grid table class you will need to override
252 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
253 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
255 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
257 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
259 Deletes one or more rows from a grid starting at the specified position and returns
260 TRUE if successful. The updateLabels argument is not used at present.
262 If you are using a derived grid table class you will need to override
263 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
264 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
266 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
268 \func{void
}{DisableCellEditControl
}{\void}
270 Disables in-place editing of grid cells.
271 Equivalent to calling EnableCellEditControl(FALSE).
273 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
275 \func{void
}{DisableDragColSize
}{\void}
277 Disables column sizing by dragging with the mouse. Equivalent to passing FALSE to
278 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
280 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
282 \func{void
}{DisableDragGridSize
}{\void}
284 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
285 FALSE to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
287 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
289 \func{void
}{DisableDragRowSize
}{\void}
291 Disables row sizing by dragging with the mouse. Equivalent to passing FALSE to
292 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
294 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
296 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = TRUE
}}
298 Enables or disables in-place editing of grid cell data. The grid will issue either a
299 wxEVT_GRID_EDITOR_SHOWN or wxEVT_GRID_EDITOR_HIDDEN event.
301 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
303 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = TRUE
}}
305 Enables or disables column sizing by dragging with the mouse.
307 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
309 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = TRUE
}}
311 Enables or disables row and column resizing by dragging gridlines with the mouse.
313 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
315 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = TRUE
}}
317 Enables or disables row sizing by dragging with the mouse.
319 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
321 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
323 If the edit argument is FALSE this function sets the whole grid as read-only. If the
324 argument is TRUE the grid is set to the default state where cells may be editable. In the
325 default state you can set single grid cells and whole rows and columns to be editable or
327 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
328 cells you can also use the shortcut function
329 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
331 For more information about controlling grid cell attributes see the
332 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
333 \helpref{wxGrid classes overview
}{gridoverview
}.
335 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
337 \func{void
}{EnableGridLines
}{\param{bool
}{enable = TRUE
}}
339 Turns the drawing of grid lines on or off.
341 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
343 \func{void
}{EndBatch
}{\void}
345 Decrements the grid's batch count. When the count is greater than zero repainting of
346 the grid is suppressed. Each previous call to
347 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
348 EndBatch. Code that does a lot of grid modification can be enclosed between
349 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
350 cause the grid to be repainted.
352 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
354 \func{void
}{ForceRefresh
}{\void}
356 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
358 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
360 \func{int
}{GetBatchCount
}{\void}
362 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
363 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
364 the grid's batch count is greater than zero the display will not be updated.
366 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
368 \func{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
370 Sets the arguments to the horizontal and vertical text alignment values for the
371 grid cell at the specified location.
373 Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
374 Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
376 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
378 \func{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
380 Returns the background colour of the cell at the specified location.
382 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
384 \func{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
386 Returns a pointer to the editor for the cell at the specified location.
388 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
389 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
391 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
393 \func{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
395 Returns the font for text in the grid cell at the specified location.
397 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
399 \func{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
401 Returns a pointer to the renderer for the grid cell at the specified location.
403 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
404 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
406 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
408 \func{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
410 Returns the text colour for the grid cell at the specified location.
412 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
414 \func{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
416 \func{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
418 Returns the string contained in the cell at the specified location. For simple applications where a
419 grid object automatically uses a default grid table of string values you use this function together
420 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
422 For more complex applications where you have derived your own grid table class that contains
423 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
424 function for those cells that contain string values.
426 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
427 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
429 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
431 \func{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
433 Sets the arguments to the current column label alignment values.
435 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
436 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
438 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
440 \func{int
}{GetColLabelSize
}{\void}
442 Returns the current height of the column labels.
444 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
446 \func{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
448 Returns the specifed column label. The default grid table class provides column labels of
449 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
450 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
453 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
455 \func{int
}{GetColSize
}{\param{int
}{col
}}
457 Returns the width of the specified column.
459 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
461 \func{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
463 Sets the arguments to the current default horizontal and vertical text alignment
466 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
467 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
469 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
471 \func{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
473 Returns the current default background colour for grid cells.
475 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
477 \func{wxFont
}{GetDefaultCellFont
}{\void}
479 Returns the current default font for grid cell text.
481 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
483 \func{wxColour
}{GetDefaultCellTextColour
}{\void}
485 Returns the current default colour for grid cell text.
487 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
489 \func{int
}{GetDefaultColLabelSize
}{\void}
491 Returns the default height for column labels.
493 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
495 \func{int
}{GetDefaultColSize
}{\void}
497 Returns the current default width for grid columns.
499 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
501 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
503 Returns a pointer to the current default grid cell editor.
505 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
506 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
508 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
510 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
512 Returns a pointer to the current default grid cell renderer.
514 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
515 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
517 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
519 \func{int
}{GetDefaultRowLabelSize
}{\void}
521 Returns the default width for the row labels.
523 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
525 \func{int
}{GetDefaultRowSize
}{\void}
527 Returns the current default height for grid rows.
529 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
531 \func{int
}{GetGridCursorCol
}{\void}
533 Returns the current grid cell column position.
535 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
537 \func{int
}{GetGridCursorRow
}{\void}
539 Returns the current grid cell row position.
541 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
543 \func{wxColour
}{GetGridLineColour
}{\void}
545 Returns the colour used for grid lines.
547 \membersection{wxGrid::GridLinesEnabled
}\label{wxgridgridlinesenabled
}
549 \func{bool
}{GridLinesEnabled
}{\void}
551 Returnes TRUE if drawing of grid lines is turned on, FALSE otherwise.
553 \membersection{wxGrid::GetLabelBackgroundColour
}\label{wxgridgetlabelbackgroundcolour
}
555 \func{wxColour
}{GetLabelBackgroundColour
}{\void}
557 Returns the colour used for the background of row and column labels.
559 \membersection{wxGrid::GetLabelFont
}\label{wxgridgetlabelfont
}
561 \func{wxFont
}{GetLabelFont
}{\void}
563 Returns the font used for row and column labels.
565 \membersection{wxGrid::GetLabelTextColour
}\label{wxgridgetlabeltextcolour
}
567 \func{wxColour
}{GetLabelTextColour
}{\void}
569 Returns the colour used for row and column label text.
571 \membersection{wxGrid::GetNumberCols
}\label{wxgridgetnumbercols
}
573 \func{int
}{GetNumberCols
}{\void}
575 Returns the total number of grid columns (actually the number of columns in the underlying grid
578 \membersection{wxGrid::GetNumberRows
}\label{wxgridgetnumberrows
}
580 \func{int
}{GetNumberRows
}{\void}
582 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
584 \membersection{wxGrid::GetRowLabelAlignment
}\label{wxgridgetrowlabelalignment
}
586 \func{void
}{GetRowLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
588 Sets the arguments to the current row label alignment values.
590 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
591 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
593 \membersection{wxGrid::GetRowLabelSize
}\label{wxgridgetrowlabelsize
}
595 \func{int
}{GetRowLabelSize
}{\void}
597 Returns the current width of the row labels.
599 \membersection{wxGrid::GetRowLabelValue
}\label{wxgridgetrowlabelvalue
}
601 \func{wxString
}{GetRowLabelValue
}{\param{int
}{row
}}
603 Returns the specifed row label. The default grid table class provides numeric row labels.
604 If you are using a custom grid table you can override
605 \helpref{wxGridTableBase::GetRowLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
608 \membersection{wxGrid::GetRowSize
}\label{wxgridgetrowsize
}
610 \func{int
}{GetRowSize
}{\param{int
}{row
}}
612 Returns the height of the specified row.
614 \membersection{wxGrid::GetTable
}\label{wxgridgettable
}
616 \constfunc{wxGridTableBase *
}{GetTable
}{\void}
618 Returns a base pointer to the current table object.
620 \membersection{wxGrid::HideCellEditControl
}\label{wxgridhidecelleditcontrol
}
622 \func{void
}{HideCellEditControl
}{\void}
624 Hides the in-place cell edit control.
626 \membersection{wxGrid::InsertCols
}\label{wxgridinsertcols
}
628 \func{bool
}{InsertCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
630 Inserts one or more new columns into a grid with the first new column at the
631 specified position and returns TRUE if successful. The updateLabels argument is not
634 The sequence of actions begins with the grid object requesting the underlying grid
635 table to insert new columns. If this is successful the table notifies the grid and the
636 grid updates the display. For a default grid (one where you have called
637 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
638 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
639 then you must override
640 \helpref{wxGridTableBase::InsertCols
}{wxgridtablebaseinsertcols
} in your derived
643 \membersection{wxGrid::InsertRows
}\label{wxgridinsertrows
}
645 \func{bool
}{InsertRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
647 Inserts one or more new rows into a grid with the first new row at the specified
648 position and returns TRUE if successful. The updateLabels argument is not used at
651 The sequence of actions begins with the grid object requesting the underlying grid
652 table to insert new rows. If this is successful the table notifies the grid and the
653 grid updates the display. For a default grid (one where you have called
654 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
655 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
656 then you must override
657 \helpref{wxGridTableBase::InsertRows
}{wxgridtablebaseinsertrows
} in your derived
660 \membersection{wxGrid::IsCellEditControlEnabled
}\label{wxgridiscelleditcontrolenabled
}
662 \constfunc{bool
}{IsCellEditControlEnabled
}{\void}
664 Returns TRUE if the in-place edit control is currently enabled.
666 \membersection{wxGrid::IsCurrentCellReadOnly
}\label{wxgridiscurrentcellreadonly
}
668 \constfunc{bool
}{IsCurrentCellReadOnly
}{\void}
670 Returns TRUE if the current cell has been set to read-only
671 (see
\helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}).
673 \membersection{wxGrid::IsEditable
}\label{wxgridiseditable
}
675 \func{bool
}{IsEditable
}{\void}
677 Returns FALSE if the whole grid has been set as read-only or TRUE otherwise.
678 See
\helpref{wxGrid::EnableEditing
}{wxgridenableediting
} for more information about
679 controlling the editing status of grid cells.
681 \membersection{wxGrid::IsReadOnly
}\label{wxgridisreadonly
}
683 \constfunc{bool
}{IsReadOnly
}{\param{int
}{row
},
\param{int
}{col
}}
685 Returns TRUE if the cell at the specified location can't be edited.
686 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
688 \membersection{wxGrid::IsSelection
}\label{wxgridisselection
}
690 \func{bool
}{IsSelection
}{\void}
692 Returns TRUE if there are currently rows, columns or blocks of cells selected.
694 \membersection{wxGrid::IsVisible
}\label{wxgridisvisible
}
696 \func{bool
}{IsVisible
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{wholeCellVisible = TRUE
}}
698 \func{bool
}{IsVisible
}{\param{const wxGridCellCoords\&
}{coords
},
\param{bool
}{wholeCellVisible = TRUE
}}
700 Returns TRUE if a cell is either wholly visible (the default) or at least partially
701 visible in the grid window.
703 \membersection{wxGrid::MakeCellVisible
}\label{wxgridmakecellvisible
}
705 \func{void
}{MakeCellVisible
}{\param{int
}{row
},
\param{int
}{col
}}
707 \func{void
}{MakeCellVisible
}{\param{const wxGridCellCoords\&
}{coords
}}
709 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
710 nothing if the cell is already visible.
712 \membersection{wxGrid::MoveCursorDown
}\label{wxgridmovecursordown
}
714 \func{bool
}{MoveCursorDown
}{\param{bool
}{expandSelection
}}
716 Moves the grid cursor down by one row. If a block of cells was previously selected it
717 will expand if the argument is TRUE or be cleared if the argument is FALSE.
719 \wxheading{Keyboard
}\\
720 This function is called for Down cursor key presses or Shift+Down to expand a selection.
722 \membersection{wxGrid::MoveCursorLeft
}\label{wxgridmovecursorleft
}
724 \func{bool
}{MoveCursorLeft
}{\param{bool
}{expandSelection
}}
726 Moves the grid cursor left by one column. If a block of cells was previously selected it
727 will expand if the argument is TRUE or be cleared if the argument is FALSE.
729 \wxheading{Keyboard
}\\
730 This function is called for Left cursor key presses or Shift+Left to expand a selection.
732 \membersection{wxGrid::MoveCursorRight
}\label{wxgridmovecursorright
}
734 \func{bool
}{MoveCursorRight
}{\param{bool
}{expandSelection
}}
736 Moves the grid cursor right by one column. If a block of cells was previously selected it
737 will expand if the argument is TRUE or be cleared if the argument is FALSE.
739 \wxheading{Keyboard
}\\
740 This function is called for Right cursor key presses or Shift+Right to expand a selection.
742 \membersection{wxGrid::MoveCursorUp
}\label{wxgridmovecursorup
}
744 \func{bool
}{MoveCursorUp
}{\param{bool
}{expandSelection
}}
746 Moves the grid cursor up by one row. If a block of cells was previously selected it
747 will expand if the argument is TRUE or be cleared if the argument is FALSE.
749 \wxheading{Keyboard
}\\
750 This function is called for Up cursor key presses or Shift+Up to expand a selection.
752 \membersection{wxGrid::MoveCursorDownBlock
}\label{wxgridmovecursordownblock
}
754 \func{bool
}{MoveCursorDownBlock
}{\param{bool
}{expandSelection
}}
756 Moves the grid cursor down in the current column such that it skips to the beginning or
757 end of a block of non-empty cells. If a block of cells was previously selected it
758 will expand if the argument is TRUE or be cleared if the argument is FALSE.
760 \wxheading{Keyboard
}\\
761 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
763 \membersection{wxGrid::MoveCursorLeftBlock
}\label{wxgridmovecursorleftblock
}
765 \func{bool
}{MoveCursorLeftBlock
}{\param{bool
}{expandSelection
}}
767 Moves the grid cursor left in the current row such that it skips to the beginning or
768 end of a block of non-empty cells. If a block of cells was previously selected it
769 will expand if the argument is TRUE or be cleared if the argument is FALSE.
771 \wxheading{Keyboard
}\\
772 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
774 \membersection{wxGrid::MoveCursorRightBlock
}\label{wxgridmovecursorrightblock
}
776 \func{bool
}{MoveCursorRightBlock
}{\param{bool
}{expandSelection
}}
778 Moves the grid cursor right in the current row such that it skips to the beginning or
779 end of a block of non-empty cells. If a block of cells was previously selected it
780 will expand if the argument is TRUE or be cleared if the argument is FALSE.
782 \wxheading{Keyboard
}\\
783 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
785 \membersection{wxGrid::MoveCursorUpBlock
}\label{wxgridmovecursorupblock
}
787 \func{bool
}{MoveCursorUpBlock
}{\param{bool
}{expandSelection
}}
789 Moves the grid cursor up in the current column such that it skips to the beginning or
790 end of a block of non-empty cells. If a block of cells was previously selected it
791 will expand if the argument is TRUE or be cleared if the argument is FALSE.
793 \wxheading{Keyboard
}\\
794 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
796 \membersection{wxGrid::MovePageDown
}\label{wxgridmovepagedown
}
798 \func{bool
}{MovePageDown
}{\void}
800 Moves the grid cursor down by some number of rows so that the previous bottom visible row
801 becomes the top visible row.
803 \wxheading{Keyboard
}\\
804 This function is called for PgDn keypresses.
806 \membersection{wxGrid::MovePageUp
}\label{wxgridmovepageup
}
808 \func{bool
}{MovePageUp
}{\void}
810 Moves the grid cursor up by some number of rows so that the previous top visible row
811 becomes the bottom visible row.
813 \wxheading{Keyboard
}\\
814 This function is called for PgUp keypresses.
816 \membersection{wxGrid::SaveEditControlValue
}\label{wxgridsaveeditcontrolvalue
}
818 \func{void
}{SaveEditControlValue
}{\void}
820 Sets the value of the current grid cell to the current in-place edit control value.
821 This is called automatically when the grid cursor moves from the current cell to a
822 new cell. It is also a good idea to call this function when closing a grid since
823 any edits to the final cell location will not be saved otherwise.
825 \membersection{wxGrid::SelectAll
}\label{wxgridselectall
}
827 \func{void
}{SelectAll
}{\void}
829 Selects all cells in the grid.
831 \membersection{wxGrid::SelectBlock
}\label{wxgridselectblock
}
833 \func{void
}{SelectBlock
}{\param{int
}{topRow
},
\param{int
}{leftCol
},
834 \param{int
}{bottomRow
},
\param{int
}{rightCol
},
\param{bool
}{addToSelected = FALSE
}}
836 \func{void
}{SelectBlock
}{\param{const wxGridCellCoords\&
}{topLeft
},
837 \param{const wxGridCellCoords\&
}{bottomRight
},
\param{bool
}{addToSelected = FALSE
}}
839 Selects a rectangular block of cells. If addToSelected is FALSE then any existing selection will be
840 deselected; if TRUE the column will be added to the existing selection.
842 \membersection{wxGrid::SelectCol
}\label{wxgridselectcol
}
844 \func{void
}{SelectCol
}{\param{int
}{col
},
\param{bool
}{addToSelected = FALSE
}}
846 Selects the specified column. If addToSelected is FALSE then any existing selection will be
847 deselected; if TRUE the column will be added to the existing selection.
849 \membersection{wxGrid::SelectRow
}\label{wxgridselectrow
}
851 \func{void
}{SelectRow
}{\param{int
}{row
},
\param{bool
}{addToSelected = FALSE
}}
853 Selects the specified row. If addToSelected is FALSE then any existing selection will be
854 deselected; if TRUE the row will be added to the existing selection.
856 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
858 \func{void
}{SetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int
}{horiz
},
\param{int
}{vert
}}
860 \func{void
}{SetCellAlignment
}{\param{int
}{align
},
\param{int
}{row
},
\param{int
}{col
}}
862 \func{void
}{SetCellAlignment
}{\param{int
}{align
}}
864 Sets the horizontal and vertial alignment for grid cell text at the specified location.
866 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
867 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
869 \membersection{wxGrid::SetCellEditor
}\label{wxgridsetcelleditor
}
871 \func{void
}{SetCellEditor
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellEditor*
}{editor
}}
873 Sets the editor for the grid cell at the specified location.
874 The grid will take ownership of the pointer.
876 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
877 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
879 \membersection{wxGrid::SetCellFont
}\label{wxgridsetcellfont
}
881 \func{void
}{SetCellFont
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxFont\&
}}
883 Sets the font for text in the grid cell at the specified location.
885 \membersection{wxGrid::SetCellRenderer
}\label{wxgridsetcellrenderer
}
887 \func{void
}{SetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellRenderer*
}{renderer
}}
889 Sets the renderer for the grid cell at the specified location.
890 The grid will take ownership of the pointer.
892 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
893 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
895 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
897 \func{void
}{SetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxColour\&
}}
899 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
901 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{col
}}
903 Sets the text colour for the grid cell at the specified location.
905 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
907 \func{void
}{SetCellValue
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxString\&
}{s
}}
909 \func{void
}{SetCellValue
}{\param{const wxGridCellCoords\&
}{coords
},
\param{const wxString\&
}{s
}}
911 \func{void
}{SetCellValue
}{\param{const wxString\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
913 Sets the string value for the cell at the specified location. For simple applications where a
914 grid object automatically uses a default grid table of string values you use this function together
915 with
\helpref{wxGrid::GetCellValue
}{wxgridgetcellvalue
} to access cell values.
917 For more complex applications where you have derived your own grid table class that contains
918 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
919 function for those cells that contain string values.
921 The last form is for backward compatibility only.
923 See
\helpref{wxGridTableBase::CanSetValueAs
}{wxgridtablebasecangetvalueas
}
924 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
926 \membersection{wxGrid::SetColAttr
}\label{wxgridsetcolattr
}
928 \func{void
}{SetColAttr
}{\param{int
}{col
},
\param{wxGridCellAttr*
}{attr
}}
930 Sets the cell attributes for all cells in the specified column.
932 For more information about controlling grid cell attributes see the
933 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
934 \helpref{wxGrid classes overview
}{gridoverview
}.
936 \membersection{wxGrid::SetColFormatBool
}\label{wxgridsetcolformatbool
}
938 \func{void
}{SetColFormatBool
}{\param{int
}{col
}}
940 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
942 \membersection{wxGrid::SetColFormatNumber
}\label{wxgridsetcolformatnumber
}
944 \func{void
}{SetColFormatNumber
}{\param{int
}{col
}}
946 Sets the specified column to display integer values.
948 \membersection{wxGrid::SetColFormatFloat
}\label{wxgridsetcolformatfloat
}
950 \func{void
}{SetColFormatFloat
}{\param{int
}{col
},
\param{int
}{width = -
1},
\param{int
}{precision = -
1}}
952 Sets the specified column to display floating point values with the given width and precision.
954 \membersection{wxGrid::SetColFormatCustom
}\label{wxgridsetcolformatcustom
}
956 \func{void
}{SetColFormatCustom
}{\param{int
}{col
},
\param{const wxString\&
}{typeName
}}
958 Sets the specified column to display data in a custom format.
959 See the
\helpref{wxGrid overview
}{gridoverview
} for more information on working
960 with custom data types.
962 \membersection{wxGrid::SetColLabelAlignment
}\label{wxgridsetcollabelalignment
}
964 \func{void
}{SetColLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
966 Sets the horizontal and vertical alignment of column label text.
968 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
969 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
971 \membersection{wxGrid::SetColLabelSize
}\label{wxgridsetcollabelsize
}
973 \func{void
}{SetColLabelSize
}{\param{int
}{height
}}
975 Sets the height of the column labels.
977 \membersection{wxGrid::SetColLabelValue
}\label{wxgridsetcollabelvalue
}
979 \func{void
}{SetColLabelValue
}{\param{int
}{col
},
\param{const
}{wxString\&
}}
981 Set the value for the given column label. If you are using a derived grid table you must
982 override
\helpref{wxGridTableBase::SetColLabelValue
}{wxgridtablebasesetcollabelvalue
}
983 for this to have any effect.
985 \membersection{wxGrid::SetColMinimalWidth
}\label{wxgridsetcolminimalwidth
}
987 \func{void
}{SetColMinimalWidth
}{\param{int
}{col
},
\param{int
}{width
}}
989 Sets the minimal width for the specified column. This should normally be called when creating the grid
990 because it will not resize a column that is already narrower than the minimal width.
992 \membersection{wxGrid::SetColSize
}\label{wxgridsetcolsize
}
994 \func{void
}{SetColSize
}{\param{int
}{col
},
\param{int
}{width
}}
996 Sets the width of the specified column.
998 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
999 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1001 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1002 also be set as the minimal width for the column.
1005 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1006 The memory requirements for this could become prohibitive if your grid is very large.
1008 \membersection{wxGrid::SetDefaultCellAlignment
}\label{wxgridsetdefaultcellalignment
}
1010 \func{void
}{SetDefaultCellAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1012 Sets the default horizontal and vertial alignment for grid cell text.
1014 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1015 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
1017 \membersection{wxGrid::SetDefaultCellBackgroundColour
}\label{wxgridsetdefaultcellbackgroundcolour
}
1019 \func{void
}{SetDefaultCellBackgroundColour
}{\param{const
}{wxColour\&
}}
1021 Sets the default background colour for grid cells.
1023 \membersection{wxGrid::SetDefaultCellFont
}\label{wxgridsetdefaultcellfont
}
1025 \func{void
}{SetDefaultCellFont
}{\param{const
}{wxFont\&
}}
1027 Sets the default font to be used for grid cell text.
1029 \membersection{wxGrid::SetDefaultEditor
}\label{wxgridsetdefaulteditor
}
1031 \func{void
}{SetDefaultEditor
}{\param{wxGridCellEditor*
}{editor
}}
1033 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1035 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
1036 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1038 \membersection{wxGrid::SetDefaultRenderer
}\label{wxgridsetdefaultrenderer
}
1040 \func{void
}{SetDefaultRenderer
}{\param{wxGridCellRenderer*
}{renderer
}}
1042 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1044 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
1045 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1047 \membersection{wxGrid::SetDefaultColSize
}\label{wxgridsetdefaultcolsize
}
1049 \func{void
}{SetDefaultColSize
}{\param{int
}{width
},
\param{bool
}{resizeExistingCols = FALSE
}}
1051 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1052 the grid unless resizeExistingCols is TRUE.
1054 \membersection{wxGrid::SetDefaultRowSize
}\label{wxgridsetdefaultrowsize
}
1056 \func{void
}{SetDefaultRowSize
}{\param{int
}{height
},
\param{bool
}{resizeExistingRows = FALSE
}}
1058 Sets the default height for rows in the grid. This will only affect rows subsequently added
1059 to the grid unless resizeExistingRows is TRUE.
1061 \membersection{wxGrid::SetGridCursor
}\label{wxgridsetgridcursor
}
1063 \func{void
}{SetGridCursor
}{\param{int
}{row
},
\param{int
}{col
}}
1065 Set the grid cursor to the specified cell.
1066 This function calls
\helpref{wxGrid::MakeCellVisible
}{wxgridmakecellvisible
}.
1068 \membersection{wxGrid::SetGridLineColour
}\label{wxgridsetgridlinecolour
}
1070 \func{void
}{SetGridLineColour
}{\param{const
}{wxColour\&
}}
1072 Sets the colour used to draw grid lines.
1074 \membersection{wxGrid::SetLabelBackgroundColour
}\label{wxgridsetlabelbackgroundcolour
}
1076 \func{void
}{SetLabelBackgroundColour
}{\param{const
}{wxColour\&
}}
1078 Sets the background colour for row and column labels.
1080 \membersection{wxGrid::SetLabelFont
}\label{wxgridsetlabelfont
}
1082 \func{void
}{SetLabelFont
}{\param{const
}{wxFont\&
}}
1084 Sets the font for row and column labels.
1086 \membersection{wxGrid::SetLabelTextColour
}\label{wxgridsetlabeltextcolour
}
1088 \func{void
}{SetLabelTextColour
}{\param{const
}{wxColour\&
}}
1090 Sets the colour for row and column label text.
1092 \membersection{wxGrid::SetReadOnly
}\label{wxgridsetreadonly
}
1094 \func{void
}{SetReadOnly
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{isReadOnly = TRUE
}}
1096 Makes the cell at the specified location read-only or editable.
1097 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
1099 \membersection{wxGrid::SetRowAttr
}\label{wxgridsetrowattr
}
1101 \func{void
}{SetRowAttr
}{\param{int
}{row
},
\param{wxGridCellAttr*
}{attr
}}
1103 Sets the cell attributes for all cells in the specified row.
1104 See the
\helpref{wxGridCellAttr
}{wxgridcellattr
} class for more information
1105 about controlling cell attributes.
1107 \membersection{wxGrid::SetRowLabelAlignment
}\label{wxgridsetrowlabelalignment
}
1109 \func{void
}{SetRowLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1111 Sets the horizontal and vertical alignment of row label text.
1113 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1114 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
1116 \membersection{wxGrid::SetRowLabelSize
}\label{wxgridsetrowlabelsize
}
1118 \func{void
}{SetRowLabelSize
}{\param{int
}{width
}}
1120 Sets the width of the row labels.
1122 \membersection{wxGrid::SetRowLabelValue
}\label{wxgridsetrowlabelvalue
}
1124 \func{void
}{SetRowLabelValue
}{\param{int
}{row
},
\param{const
}{wxString\&
}}
1126 Set the value for the given row label. If you are using a derived grid table you must
1127 override
\helpref{wxGridTableBase::SetRowLabelValue
}{wxgridtablebasesetrowlabelvalue
}
1128 for this to have any effect.
1130 \membersection{wxGrid::SetRowMinimalHeight
}\label{wxgridsetrowminimalheight
}
1132 \func{void
}{SetRowMinimalHeight
}{\param{int
}{row
},
\param{int
}{width
}}
1134 Sets the minimal height for the specified row. This should normally be called when creating the grid
1135 because it will not resize a row that is already shorter than the minimal height.
1137 \membersection{wxGrid::SetRowSize
}\label{wxgridsetrowsize
}
1139 \func{void
}{SetRowSize
}{\param{int
}{row
},
\param{int
}{height
}}
1141 Sets the height of the specified row.
1143 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1144 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1146 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1147 also be set as the minimal width for the column.
1150 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1151 The memory requirements for this could become prohibitive if your grid is very large.
1153 \membersection{wxGrid::SetSelectionMode
}\label{wxgridsetselectionmode
}
1155 \func{void
}{SetSelectionMode
}{\param{wxGrid::wxGridSelectionModes
}{selmode
}}
1157 Set the selection behaviour of the grid.
1159 \wxheading{Parameters
}
1161 \docparam{wxGrid::wxGridSelectCells
}{The default mode where individual cells are selected.
}
1163 \docparam(wxGrid::wxGridSelectRows
}{Selections will consist of whole rows.
}
1165 \docparam{wxGrid::wxGridSelectionColumns
}{Selections will consist of whole columns.
}
1167 \membersection{wxGrid::SetTable
}\label{wxgridsettable
}
1169 \func{bool
}{SetTable
}{\param{wxGridTableBase*
}{table
},
\param{bool
}{takeOwnership = FALSE
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
1171 Passes a pointer to a custom grid table to be used by the grid. This should be called
1172 after the grid constructor and before using the grid object. If takeOwnership is set to
1173 TRUE then the table will be deleted by the wxGrid destructor.
1175 Use this function instead of
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} when your
1176 application involves complex or non-string data or data sets that are too large to fit
1179 \membersection{wxGrid::ShowCellEditControl
}\label{wxgridshowcelleditcontrol
}
1181 \func{void
}{ShowCellEditControl
}{\void}
1183 Displays the in-place cell edit control for the current cell.
1185 \membersection{wxGrid::XToCol
}\label{wxgridxtocol
}
1187 \func{int
}{XToCol
}{\param{int
}{x
}}
1189 Returns the grid column that corresponds to the logical x coordinate. Returns
1190 wxNOT_FOUND if there is no column at the x position.
1192 \membersection{wxGrid::XToEdgeOfCol
}\label{wxgridxtoedgeofcol
}
1194 \func{int
}{XToEdgeOfCol
}{\param{int
}{x
}}
1196 Returns the column whose right hand edge is close to the given logical x position.
1197 If no column edge is near to this position wxNOT_FOUND is returned.
1199 \membersection{wxGrid::YToEdgeOfRow
}\label{wxgridytoedgeofrow
}
1201 \func{int
}{YToEdgeOfRow
}{\param{int
}{y
}}
1203 Returns the row whose bottom edge is close to the given logical y position.
1204 If no row edge is near to this position wxNOT_FOUND is returned.
1206 \membersection{wxGrid::YToRow
}\label{wxgridytorow
}
1208 \func{int
}{YToRow
}{\param{int
}{y
}}
1210 Returns the grid row that corresponds to the logical y coordinate. Returns
1211 wxNOT_FOUND if there is no row at the y position.
1215 \membersection{wxGrid::IsInSelection
}\label{wxgridisinselection
}
1217 \func{bool
}{IsInSelection
}{\param{int
}{row
},
\param{int
}{col
}}
1219 \func{bool
}{IsInSelection
}{\param{const wxGridCellCoords\&
}{coords
}}
1222 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
1224 \func{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
1226 This function returns the rectangle that encloses the block of cells
1227 limited by TopLeft and BottomRight cell in device coords and clipped
1228 to the client size of the grid window.
1231 \membersection{wxGrid::SelectionToDeviceRect
}\label{wxgridselectiontodevicerect
}
1233 \func{wxRect
}{SelectionToDeviceRect
}{\void}
1235 This function returns the rectangle that encloses the selected cells
1236 in device coords and clipped to the client size of the grid window.
1239 \membersection{wxGrid::GetSelectionBackground
}\label{wxgridgetselectionbackground
}
1241 \constfunc{wxColour
}{GetSelectionBackground
}{\void}
1243 Access or update the selection fore/back colours
1246 \membersection{wxGrid::GetSelectionForeground
}\label{wxgridgetselectionforeground
}
1248 \constfunc{wxColour
}{GetSelectionForeground
}{\void}
1251 \membersection{wxGrid::SetSelectionBackground
}\label{wxgridsetselectionbackground
}
1253 \func{void
}{SetSelectionBackground
}{\param{const wxColour\&
}{c
}}
1256 \membersection{wxGrid::SetSelectionForeground
}\label{wxgridsetselectionforeground
}
1258 \func{void
}{SetSelectionForeground
}{\param{const wxColour\&
}{c
}}
1261 \membersection{wxGrid::RegisterDataType
}\label{wxgridregisterdatatype
}
1263 \func{void
}{RegisterDataType
}{\param{const wxString\&
}{typeName
},
\param{wxGridCellRenderer*
}{renderer
},
\param{wxGridCellEditor*
}{editor
}}
1265 Methods for a registry for mapping data types to Renderers/Editors
1268 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
1270 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1272 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
1275 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
1277 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1280 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
1282 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
1285 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
1287 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
1290 \membersection{wxGrid::SetMargins
}\label{wxgridsetmargins
}
1292 \func{void
}{SetMargins
}{\param{int
}{extraWidth
},
\param{int
}{extraHeight
}}
1294 grid may occupy more space than needed for its rows/columns, this
1295 function allows to set how big this extra space is
1297 \membersection{wxGrid::wxGrid
}\label{wxgridwxgrid
}
1299 \func{}{wxGrid
}{\param{wxWindow*
}{parent
},
\param{int
}{x
},
\param{int
}{y
},
\param{int
}{w = -
1},
\param{int
}{h = -
1},
\param{long
}{style = wxWANTS
\_CHARS},
\param{const wxString\&
}{name = wxPanelNameStr
}}
1301 Backward compatibility.
1303 \membersection{wxGrid::UpdateDimensions
}\label{wxgridupdatedimensions
}
1305 \func{void
}{UpdateDimensions
}{\void}
1307 Backward compatibility.
1309 \membersection{wxGrid::GetRows
}\label{wxgridgetrows
}
1311 \func{int
}{GetRows
}{\void}
1313 Backward compatibility.
1315 \membersection{wxGrid::GetCols
}\label{wxgridgetcols
}
1317 \func{int
}{GetCols
}{\void}
1319 Backward compatibility.
1321 \membersection{wxGrid::GetCursorRow
}\label{wxgridgetcursorrow
}
1323 \func{int
}{GetCursorRow
}{\void}
1325 Backward compatibility.
1327 \membersection{wxGrid::GetCursorColumn
}\label{wxgridgetcursorcolumn
}
1329 \func{int
}{GetCursorColumn
}{\void}
1331 Backward compatibility.
1333 \membersection{wxGrid::GetScrollPosX
}\label{wxgridgetscrollposx
}
1335 \func{int
}{GetScrollPosX
}{\void}
1337 Backward compatibility.
1339 \membersection{wxGrid::GetScrollPosY
}\label{wxgridgetscrollposy
}
1341 \func{int
}{GetScrollPosY
}{\void}
1343 Backward compatibility.
1345 \membersection{wxGrid::SetScrollX
}\label{wxgridsetscrollx
}
1347 \func{void
}{SetScrollX
}{\param{int
}{x
}}
1349 Backward compatibility.
1351 \membersection{wxGrid::SetScrollY
}\label{wxgridsetscrolly
}
1353 \func{void
}{SetScrollY
}{\param{int
}{y
}}
1355 Backward compatibility.
1357 \membersection{wxGrid::SetColumnWidth
}\label{wxgridsetcolumnwidth
}
1359 \func{void
}{SetColumnWidth
}{\param{int
}{col
},
\param{int
}{width
}}
1361 Backward compatibility.
1363 \membersection{wxGrid::GetColumnWidth
}\label{wxgridgetcolumnwidth
}
1365 \func{int
}{GetColumnWidth
}{\param{int
}{col
}}
1367 Backward compatibility.
1369 \membersection{wxGrid::SetRowHeight
}\label{wxgridsetrowheight
}
1371 \func{void
}{SetRowHeight
}{\param{int
}{row
},
\param{int
}{height
}}
1373 Backward compatibility.
1375 \membersection{wxGrid::GetViewHeight
}\label{wxgridgetviewheight
}
1377 \func{int
}{GetViewHeight
}{\void}
1379 Backward compatibility.
1381 GetRowHeight() is below
1382 returned num whole rows visible.
1384 \membersection{wxGrid::GetViewWidth
}\label{wxgridgetviewwidth
}
1386 \func{int
}{GetViewWidth
}{\void}
1388 Returned number of whole cols visible.
1390 \membersection{wxGrid::SetLabelSize
}\label{wxgridsetlabelsize
}
1392 \func{void
}{SetLabelSize
}{\param{int
}{orientation
},
\param{int
}{sz
}}
1395 \membersection{wxGrid::GetLabelSize
}\label{wxgridgetlabelsize
}
1397 \func{int
}{GetLabelSize
}{\param{int
}{orientation
}}
1400 \membersection{wxGrid::SetLabelAlignment
}\label{wxgridsetlabelalignment
}
1402 \func{void
}{SetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{align
}}
1405 \membersection{wxGrid::GetLabelAlignment
}\label{wxgridgetlabelalignment
}
1407 \func{int
}{GetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{align
}}
1410 \membersection{wxGrid::SetLabelValue
}\label{wxgridsetlabelvalue
}
1412 \func{void
}{SetLabelValue
}{\param{int
}{orientation
},
\param{const wxString\&
}{val
},
\param{int
}{pos
}}
1415 \membersection{wxGrid::GetLabelValue
}\label{wxgridgetlabelvalue
}
1417 \func{wxString
}{GetLabelValue
}{\param{int
}{orientation
},
\param{int
}{pos
}}
1420 \membersection{wxGrid::GetCellTextFont
}\label{wxgridgetcelltextfont
}
1422 \constfunc{wxFont
}{GetCellTextFont
}{\void}
1424 \constfunc{wxFont
}{GetCellTextFont
}{\param{int
}{row
},
\param{int
}{col
}}
1427 \membersection{wxGrid::SetCellTextFont
}\label{wxgridsetcelltextfont
}
1429 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
}}
1431 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
},
\param{int
}{row
},
\param{int
}{col
}}
1434 \membersection{wxGrid::SetCellBackgroundColour
}\label{wxgridsetcellbackgroundcolour
}
1436 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{col
}}
1438 \func{void
}{SetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxColour\&
}}
1440 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{colour
},
\param{int
}{row
},
\param{int
}{col
}}
1443 \membersection{wxGrid::GetEditable
}\label{wxgridgeteditable
}
1445 \func{bool
}{GetEditable
}{\void}
1448 \membersection{wxGrid::SetEditable
}\label{wxgridseteditable
}
1450 \func{void
}{SetEditable
}{\param{bool
}{edit = TRUE
}}
1453 \membersection{wxGrid::GetEditInPlace
}\label{wxgridgeteditinplace
}
1455 \func{bool
}{GetEditInPlace
}{\void}
1458 \membersection{wxGrid::SetEditInPlace
}\label{wxgridseteditinplace
}
1460 \func{void
}{SetEditInPlace
}{\param{bool
}{edit = TRUE
}}
1463 \membersection{wxGrid::SetCellBitmap
}\label{wxgridsetcellbitmap
}
1465 \func{void
}{SetCellBitmap
}{\param{wxBitmap*
}{bitmap
},
\param{int
}{row
},
\param{int
}{col
}}
1468 \membersection{wxGrid::SetDividerPen
}\label{wxgridsetdividerpen
}
1470 \func{void
}{SetDividerPen
}{\param{const wxPen\&
}{pen
}}
1473 \membersection{wxGrid::GetDividerPen
}\label{wxgridgetdividerpen
}
1475 \constfunc{wxPen\&
}{GetDividerPen
}{\void}
1478 \membersection{wxGrid::OnActivate
}\label{wxgridonactivate
}
1480 \func{void
}{OnActivate
}{\param{bool
}{active
}}
1482 \membersection{wxGrid::Fit
}\label{wxgridfit
}
1484 \func{void
}{Fit
}{\void}
1486 Overridden wxWindow methods
1488 \membersection{wxGrid::DoGetBestSize
}\label{wxgriddogetbestsize
}
1490 \constfunc{wxSize
}{DoGetBestSize
}{\void}
1492 \membersection{wxGrid::InitRowHeights
}\label{wxgridinitrowheights
}
1494 \func{void
}{InitRowHeights
}{\void}
1496 NB:
{\it never
} access m
\_row/col arrays directly because they are created
1497 on demand,
{\it always
} use accessor functions instead!
1499 Init the m
\_rowHeights/Bottoms arrays with default values.
1501 \membersection{wxGrid::InitColWidths
}\label{wxgridinitcolwidths
}
1503 \func{void
}{InitColWidths
}{\void}
1505 Init the m
\_colWidths/Rights arrays
1508 \membersection{wxGrid::GetColWidth
}\label{wxgridgetcolwidth
}
1510 \constfunc{int
}{GetColWidth
}{\param{int
}{col
}}
1512 Get the col/row coords
1515 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
1517 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
1520 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
1522 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
1525 \membersection{wxGrid::GetRowHeight
}\label{wxgridgetrowheight
}
1527 \constfunc{int
}{GetRowHeight
}{\param{int
}{row
}}
1529 This function must be public for compatibility.
1531 \membersection{wxGrid::GetRowTop
}\label{wxgridgetrowtop
}
1533 \constfunc{int
}{GetRowTop
}{\param{int
}{row
}}
1536 \membersection{wxGrid::GetRowBottom
}\label{wxgridgetrowbottom
}
1538 \constfunc{int
}{GetRowBottom
}{\param{int
}{row
}}
1541 \membersection{wxGrid::SetOrCalcColumnSizes
}\label{wxgridsetorcalccolumnsizes
}
1543 \func{int
}{SetOrCalcColumnSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1545 Common part of AutoSizeColumn/Row() and GetBestSize()
1547 \membersection{wxGrid::SetOrCalcRowSizes
}\label{wxgridsetorcalcrowsizes
}
1549 \func{int
}{SetOrCalcRowSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1551 \membersection{wxGrid::AutoSizeColOrRow
}\label{wxgridautosizecolorrow
}
1553 \func{void
}{AutoSizeColOrRow
}{\param{int
}{n
},
\param{bool
}{setAsMin
},
\param{bool
}{column
}}
1555 Common part of AutoSizeColumn/Row() or row?
1557 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
1559 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
1561 get the minimal width of the given column/row
1563 \membersection{wxGrid::GetRowMinimalHeight
}\label{wxgridgetrowminimalheight
}
1565 \constfunc{int
}{GetRowMinimalHeight
}{\param{int
}{col
}}
1567 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
1569 \func{bool
}{CanHaveAttributes
}{\void}
1571 Do we have some place to store attributes in?
1573 \membersection{wxGrid::GetOrCreateCellAttr
}\label{wxgridgetorcreatecellattr
}
1575 \constfunc{wxGridCellAttr*
}{GetOrCreateCellAttr
}{\param{int
}{row
},
\param{int
}{col
}}