1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %% Modified by: Santiago Palacios
8 %% Copyright: (c) wxWidgets
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxGrid
}}\label{wxgrid
}
14 wxGrid and its related classes are used for displaying and editing tabular
15 data. They provide a rich set of features for display, editing, and
16 interacting with a variety of data sources. For simple applications, and to
17 help you get started, wxGrid is the only class you need to refer to
18 directly. It will set up default instances of the other classes and manage
19 them for you. For more complex applications you can derive your own
20 classes for custom grid views, grid data tables, cell editors and
21 renderers. The
\helpref{wxGrid classes overview
}{gridoverview
} has
22 examples of simple and more complex applications, explains the
23 relationship between the various grid classes and has a summary of the
24 keyboard shortcuts and mouse functions provided by wxGrid.
26 wxGrid has been greatly expanded and redesigned for wxWidgets
2.2
27 onwards. The new grid classes are reasonably backward-compatible
28 but there are some exceptions. There are also easier ways of doing many things compared to
29 the previous implementation.
31 A
\helpref{wxGridTableBase
}{wxgridtablebase
} class holds the actual
32 data to be displayed by a wxGrid class. One or more wxGrid classes
33 may act as a view for one table class.
34 The default table class is called wxGridStringTable and
35 holds an array of strings. An instance of such a class is created
36 by
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}.
38 \helpref{wxGridCellRenderer
}{wxgridcellrenderer
} is the abstract base
39 class for rendereing contents in a cell. The following renderers are
41 \helpref{wxGridCellStringRenderer
}{wxgridcellstringrenderer
},
42 \helpref{wxGridCellBoolRenderer
}{wxgridcellboolrenderer
},
43 \helpref{wxGridCellFloatRenderer
}{wxgridcellfloatrenderer
},
44 \helpref{wxGridCellNumberRenderer
}{wxgridcellnumberrenderer
}. The
45 look of a cell can be further defined using
\helpref{wxGridCellAttr
}{wxgridcellattr
}.
46 An object of this type may be returned by
\helpref{wxGridTableBase::GetAttr
}{wxgridtablebasegetattr
}.
48 \helpref{wxGridCellEditor
}{wxgridcelleditor
} is the abstract base
49 class for editing the value of a cell. The following editors are
51 \helpref{wxGridCellTextEditor
}{wxgridcelltexteditor
}
52 \helpref{wxGridCellBoolEditor
}{wxgridcellbooleditor
}
53 \helpref{wxGridCellChoiceEditor
}{wxgridcellchoiceeditor
}
54 \helpref{wxGridCellNumberEditor
}{wxgridcellnumbereditor
}.
57 \wxheading{Derived from
}
59 \helpref{wxScrolledWindow
}{wxscrolledwindow
}\\
60 \helpref{wxPanel
}{wxpanel
}\\
61 \helpref{wxWindow
}{wxwindow
}\\
62 \helpref{wxEvtHandler
}{wxevthandler
}\\
63 \helpref{wxObject
}{wxobject
}
65 \wxheading{Include files
}
71 \helpref{wxAdv
}{librarieslist
}
73 \wxheading{Window styles
}
75 There are presently no specific window styles for wxGrid.
77 \wxheading{Event handling
}
81 The event handler for the following functions takes a
82 \helpref{wxGridSizeEvent
}{wxgridsizeevent
} parameter.
83 The ...
\_CMD\_... variants also take a window identifier.
86 \begin{twocollist
}\itemsep=
0pt
87 \twocolitem{{\bf EVT
\_GRID\_COL\_SIZE(func)
}}{The user resized a column by dragging it. Processes a wxEVT
\_GRID\_COL\_SIZE.
}
88 \twocolitem{{\bf EVT
\_GRID\_COL\_MOVE(func)
}}{The user moved a column by dragging it. Processes a wxEVT
\_GRID\_COL\_MOVE.
}
89 \twocolitem{{\bf EVT
\_GRID\_ROW\_SIZE(func)
}}{The user resized a row by dragging it. Processes a wxEVT
\_GRID\_ROW\_SIZE.
}
90 \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.
}
91 \twocolitem{{\bf EVT
\_GRID\_CMD\_COL\_MOVE(func)
}}{The user moved a column by dragging it; variant taking a window identifier. Processes a wxEVT
\_GRID\_COL\_MOVE.
}
92 \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.
}
95 The event handler for the following functions takes a
96 \helpref{wxGridRangeSelectEvent
}{wxgridrangeselectevent
} parameter.
97 The ...
\_CMD\_... variant also takes a window identifier.
100 \begin{twocollist
}\itemsep=
0pt
101 \twocolitem{{\bf EVT
\_GRID\_RANGE\_SELECT(func)
}}{The user selected a group of contiguous cells. Processes a wxEVT
\_GRID\_RANGE\_SELECT.
}
102 \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.
}
105 The event handler for the following functions takes a
106 \helpref{wxGridEditorCreatedEvent
}{wxgrideditorcreatedevent
} parameter.
107 The ...
\_CMD\_... variant also takes a window identifier.
110 \begin{twocollist
}\itemsep=
0pt
111 \twocolitem{{\bf EVT
\_GRID\_EDITOR\_CREATED(func)
}}{The editor for a cell was created. Processes a wxEVT
\_GRID\_EDITOR\_CREATED.
}
112 \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.
}
117 \helpref{wxGrid overview
}{gridoverview
}
119 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
120 \latexignore{\rtfignore{\wxheading{Function groups
}}}
124 \membersection{Constructors and initialization
}\label{wxgridconstructors
}
126 \helpref{wxGrid
}{wxgridctor
}\\
127 \helpref{\destruct{wxGrid
}}{wxgriddtor
}\\
128 \helpref{CreateGrid
}{wxgridcreategrid
}\\
129 \helpref{SetTable
}{wxgridsettable
}
132 \membersection{Cursor movement
}\label{wxgridcursormovement
}
134 \helpref{wxGrid::MoveCursorUp
}{wxgridmovecursorup
}\\
135 \helpref{wxGrid::MoveCursorDown
}{wxgridmovecursordown
}\\
136 \helpref{wxGrid::MoveCursorLeft
}{wxgridmovecursorleft
}\\
137 \helpref{wxGrid::MoveCursorRight
}{wxgridmovecursorright
}\\
138 \helpref{wxGrid::MoveCursorPageUp
}{wxgridmovecursorup
}\\
139 \helpref{wxGrid::MoveCursorPageDown
}{wxgridmovecursordown
}\\
140 \helpref{wxGrid::MoveCursorUpBlock
}{wxgridmovecursorupblock
}\\
141 \helpref{wxGrid::MoveCursorDownBlock
}{wxgridmovecursordownblock
}\\
142 \helpref{wxGrid::MoveCursorLeftBlock
}{wxgridmovecursorleftblock
}\\
143 \helpref{wxGrid::MoveCursorRightBlock
}{wxgridmovecursorrightblock
}
146 \membersection{Grid line formatting
}\label{wxgridlineformatting
}
148 \helpref{wxGrid::EnableGridLines
}{wxgridenablegridlines
}\\
149 \helpref{wxGrid::GridLinesEnabled
}{wxgridgridlinesenabled
}\\
150 \helpref{wxGrid::SetGridLineColour
}{wxgridsetgridlinecolour
}\\
151 \helpref{wxGrid::GetGridLineColour
}{wxgridgetgridlinecolour
}\\
152 \helpref{wxGrid::GetDefaultGridLinePen
}{wxgridgetdefaultgridlinepen
}\\
153 \helpref{wxGrid::GetRowGridLinePen
}{wxgridgetrowgridlinepen
}\\
154 \helpref{wxGrid::GetColGridLinePen
}{wxgridgetcolgridlinepen
}
156 \membersection{Row and column label value and format
}\label{wxgridrowcoulmlabelformat
}
158 \helpref{wxGrid::SetRowLabelValue
}{wxgridsetrowlabelvalue
}\\
159 \helpref{wxGrid::SetColLabelValue
}{wxgridsetcollabelvalue
}\\
160 \helpref{wxGrid::GetRowLabelValue
}{wxgridgetrowlabelvalue
}\\
161 \helpref{wxGrid::GetColLabelValue
}{wxgridgetcollabelvalue
}\\
162 \helpref{wxGrid::SetUseNativeColLabels
}{wxgridsetsenativecollabels
}\\
163 \helpref{wxGrid::HideColLabels
}{wxgridhidecollabels
}\\
164 \helpref{wxGrid::HideRowLabels
}{wxgridhiderowlabels
}\\
165 \helpref{wxGrid::SetRowLabelSize
}{wxgridsetrowlabelsize
}\\
166 \helpref{wxGrid::SetColLabelSize
}{wxgridsetcollabelsize
}\\
167 \helpref{wxGrid::GetRowLabelSize
}{wxgridgetrowlabelsize
}\\
168 \helpref{wxGrid::GetColLabelSize
}{wxgridgetcollabelsize
}\\
169 \helpref{wxGrid::AutoSizeRowLabelSize
}{wxgridautosizerowlabelsize
}\\
170 \helpref{wxGrid::AutoSizeColLabelSize
}{wxgridautosizecollabelsize
}\\
171 \helpref{wxGrid::GetDefaultRowLabelSize
}{wxgridgetdefaultrowlabelsize
}\\
172 \helpref{wxGrid::GetDefaultColLabelSize
}{wxgridgetdefaultcollabelsize
}\\
173 \helpref{wxGrid::SetRowLabelAlignment
}{wxgridsetrowlabelalignment
}\\
174 \helpref{wxGrid::SetColLabelAlignment
}{wxgridsetcollabelalignment
}\\
175 \helpref{wxGrid::GetRowLabelAlignment
}{wxgridgetrowlabelalignment
}\\
176 \helpref{wxGrid::GetColLabelAlignment
}{wxgridgetcollabelalignment
}\\
177 \helpref{wxGrid::SetLabelFont
}{wxgridsetlabelfont
}\\
178 \helpref{wxGrid::SetLabelTextColour
}{wxgridsetlabeltextcolour
}\\
179 \helpref{wxGrid::SetLabelBackgroundColour
}{wxgridsetlabelbackgroundcolour
}\\
180 \helpref{wxGrid::GetLabelFont
}{wxgridgetlabelfont
}\\
181 \helpref{wxGrid::GetLabelBackgroundColour
}{wxgridgetlabelbackgroundcolour
}\\
182 \helpref{wxGrid::GetLabelTextColour
}{wxgridgetlabeltextcolour
}\\
183 %\helpref{wxGrid::SetColLabelTextOrientation}{wxgridsetcollabeltextorientation}\\
184 %\helpref{wxGrid::GetColLabelTextOrientation}{wxgridgetcollabeltextorientation}
185 wxGrid::SetColLabelTextOrientation\\
186 wxGrid::GetColLabelTextOrientation
188 \membersection{Cell, row and column user-resizing and dragging
}\label{wxgridcellrowcolresizing
}
190 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}\\
191 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}\\
192 \helpref{wxGrid::CanDragRowSize
}{wxgridcandragrowsize
}\\
193 \helpref{wxGrid::CanDragColSize
}{wxgridcandragcolsize
}\\
194 \helpref{wxGrid::EnableDragColMove
}{wxgridenabledragcolmove
}\\
195 \helpref{wxGrid::CanDragColMove
}{wxgridcandragcolmove
}\\
196 \helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}\\
197 \helpref{wxGrid::CanDragGridSize
}{wxgridcandraggridsize
}\\
198 \helpref{wxGrid::GetColAt
}{wxgridgetcolat
}\\
199 \helpref{wxGrid::SetColPos
}{wxgridsetcolpos
}\\
200 \helpref{wxGrid::GetColPos
}{wxgridgetcolpos
}\\
201 %\helpref{wxGrid::EnableDragCell}{wxgridenabledragcell}\\
202 %\helpref{wxGrid::CanDragCell}{wxgridcandragcell}
203 wxGrid::EnableDragCell\\
206 \membersection{Autoresizing and cell size constraints
}\label{wxgridautoresizingandcellconstriants
}
208 \helpref{wxGrid::AutoSizeColumn
}{wxgridautosizecolumn
}\\
209 \helpref{wxGrid::AutoSizeRow
}{wxgridautosizerow
}\\
210 \helpref{wxGrid::AutoSizeColumns
}{wxgridautosizecolumns
}\\
211 \helpref{wxGrid::AutoSizeRows
}{wxgridautosizerows
}\\
212 \helpref{wxGrid::AutoSize
}{wxgridautosize
}\\
213 \helpref{wxGrid::SetColMinimalWidth
}{wxgridsetcolminimalwidth
}\\
214 \helpref{wxGrid::SetRowMinimalHeight
}{wxgridsetrowminimalheight
}\\
215 \helpref{wxGrid::SetColMinimalAcceptableWidth
}{wxgridsetcolminimalacceptablewidth
}\\
216 \helpref{wxGrid::SetRowMinimalAcceptableHeight
}{wxgridsetrowminimalacceptableheight
}\\
217 \helpref{wxGrid::GetColMinimalAcceptableWidth
}{wxgridgetcolminimalacceptablewidth
}\\
218 \helpref{wxGrid::GetRowMinimalAcceptableHeight
}{wxgridgetrowminimalacceptableheight
}
220 \membersection{Selection functions
}\label{wxgridselectionfunctions
}
222 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
}\\
223 \helpref{wxGrid::IsSelection
}{wxgridisselection
}\\
224 \helpref{wxGrid::SelectAll
}{wxgridselectall
}\\
225 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
}\\
226 \helpref{wxGrid::SelectCol
}{wxgridselectcol
}\\
227 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
229 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
230 \helponly{\insertatlevel{2}{
238 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
240 \func{}{wxGrid
}{\void}
244 \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
}}
246 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
247 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
252 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
254 \func{}{\destruct{wxGrid
}}{\void}
256 Destructor. This will also destroy the associated grid table unless you passed a table
257 object to the grid and specified that the grid should not take ownership of the
258 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
262 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
264 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
266 Appends one or more new columns to the right of the grid and returns true if
267 successful. The updateLabels argument is not used at present.
269 If you are using a derived grid table class you will need to override
270 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
271 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
275 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
277 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
279 Appends one or more new rows to the bottom of the grid and returns true if
280 successful. The updateLabels argument is not used at present.
282 If you are using a derived grid table class you will need to override
283 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
284 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
288 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
290 \func{void
}{AutoSize
}{\void}
292 Automatically sets the height and width of all rows and columns to fit their contents.
295 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
296 The memory requirements for this could become prohibitive if your grid is very large.
300 \membersection{wxGrid::AutoSizeColLabelSize
}\label{wxgridautosizecollabelsize
}
302 \func{void
}{AutoSizeColLabelSize
}{\param{int
}{col
}}
304 Automatically adjusts width of the column to fit its label.
308 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
310 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = true
}}
312 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
313 also be set as the minimal width for the column.
316 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
317 The memory requirements for this could become prohibitive if your grid is very large.
321 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
323 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = true
}}
325 Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
326 also be set as the minimal widths for the columns.
329 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
330 The memory requirements for this could become prohibitive if your grid is very large.
334 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
336 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = true
}}
338 Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
339 also be set as the minimal height for the row.
342 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
343 The memory requirements for this could become prohibitive if your grid is very large.
347 \membersection{wxGrid::AutoSizeRowLabelSize
}\label{wxgridautosizerowlabelsize
}
349 \func{void
}{AutoSizeRowLabelSize
}{\param{int
}{col
}}
351 Automatically adjusts height of the row to fit its label.
355 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
357 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = true
}}
359 Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
360 also be set as the minimal heights for the rows.
363 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
364 The memory requirements for this could become prohibitive if your grid is very large.
368 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
370 \func{void
}{BeginBatch
}{\void}
372 Increments the grid's batch count. When the count is greater than zero repainting of
373 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
374 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
375 modification can be enclosed between BeginBatch and EndBatch calls to avoid
376 screen flicker. The final EndBatch will cause the grid to be repainted.
380 \helpref{wxGridUpdateLocker
}{wxgridupdatelocker
}
384 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
386 \constfunc{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
388 This function returns the rectangle that encloses the block of cells
389 limited by TopLeft and BottomRight cell in device coords and clipped
390 to the client size of the grid window.
394 \membersection{wxGrid::CanDragColMove
}\label{wxgridcandragcolmove
}
396 \constfunc{bool
}{CanDragColMove
}{\void}
398 Returns true if columns can be moved by dragging with the mouse. Columns can be moved
399 by dragging on their labels.
403 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
405 \constfunc{bool
}{CanDragColSize
}{\void}
407 Returns true if columns can be resized by dragging with the mouse. Columns can be resized
408 by dragging the edges of their labels. If grid line dragging is enabled they can also be
409 resized by dragging the right edge of the column in the grid cell area
410 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
414 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
416 \constfunc{bool
}{CanDragRowSize
}{\void}
418 Returns true if rows can be resized by dragging with the mouse. Rows can be resized
419 by dragging the edges of their labels. If grid line dragging is enabled they can also be
420 resized by dragging the lower edge of the row in the grid cell area
421 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
425 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
427 \constfunc{bool
}{CanDragGridSize
}{\void}
429 Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
433 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
435 \constfunc{bool
}{CanEnableCellControl
}{\void}
437 Returns true if the in-place edit control for the current grid cell can be used and
438 false otherwise (e.g. if the current cell is read-only).
442 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
444 \constfunc{bool
}{CanHaveAttributes
}{\void}
446 Do we have some place to store attributes in?
450 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
452 \constfunc{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
454 \constfunc{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
456 Return the rectangle corresponding to the grid cell's size and position in logical
461 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
463 \func{void
}{ClearGrid
}{\void}
465 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
466 this function. If you are using a derived table class then you need to override
467 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
471 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
473 \func{void
}{ClearSelection
}{\void}
475 Deselects all cells that are currently selected.
479 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
481 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
483 Creates a grid with the specified initial number of rows and columns.
484 Call this directly after the grid constructor. When you use this
485 function wxGrid will create and manage a simple table of string values
486 for you. All of the grid data will be stored in memory.
488 For applications with more complex data types or relationships, or for
489 dealing with very large datasets, you should derive your own grid table
490 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
494 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
496 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
498 Deletes one or more columns from a grid starting at the specified position and returns
499 true if successful. The updateLabels argument is not used at present.
501 If you are using a derived grid table class you will need to override
502 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
503 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
507 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
509 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
511 Deletes one or more rows from a grid starting at the specified position and returns
512 true if successful. The updateLabels argument is not used at present.
514 If you are using a derived grid table class you will need to override
515 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
516 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
520 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
522 \func{void
}{DisableCellEditControl
}{\void}
524 Disables in-place editing of grid cells.
525 Equivalent to calling EnableCellEditControl(false).
529 \membersection{wxGrid::DisableDragColMove
}\label{wxgriddisabledragcolmove
}
531 \func{void
}{DisableDragColMove
}{\void}
533 Disables column moving by dragging with the mouse. Equivalent to passing false to
534 \helpref{wxGrid::EnableDragColMove
}{wxgridenabledragcolmove
}.
538 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
540 \func{void
}{DisableDragColSize
}{\void}
542 Disables column sizing by dragging with the mouse. Equivalent to passing false to
543 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
547 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
549 \func{void
}{DisableDragGridSize
}{\void}
551 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
552 false to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
556 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
558 \func{void
}{DisableDragRowSize
}{\void}
560 Disables row sizing by dragging with the mouse. Equivalent to passing false to
561 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
565 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
567 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = true
}}
569 Enables or disables in-place editing of grid cell data. The grid will issue either a
570 wxEVT
\_GRID\_EDITOR\_SHOWN or wxEVT
\_GRID\_EDITOR\_HIDDEN event.
574 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
576 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = true
}}
578 Enables or disables column sizing by dragging with the mouse.
582 \membersection{wxGrid::EnableDragColMove
}\label{wxgridenabledragcolmove
}
584 \func{void
}{EnableDragColMove
}{\param{bool
}{enable = true
}}
586 Enables or disables column moving by dragging with the mouse.
590 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
592 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = true
}}
594 Enables or disables row and column resizing by dragging gridlines with the mouse.
598 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
600 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = true
}}
602 Enables or disables row sizing by dragging with the mouse.
606 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
608 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
610 If the edit argument is false this function sets the whole grid as read-only. If the
611 argument is true the grid is set to the default state where cells may be editable. In the
612 default state you can set single grid cells and whole rows and columns to be editable or
614 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
615 cells you can also use the shortcut function
616 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
618 For more information about controlling grid cell attributes see the
619 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
620 \helpref{wxGrid classes overview
}{gridoverview
}.
624 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
626 \func{void
}{EnableGridLines
}{\param{bool
}{enable = true
}}
628 Turns the drawing of grid lines on or off.
632 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
634 \func{void
}{EndBatch
}{\void}
636 Decrements the grid's batch count. When the count is greater than zero repainting of
637 the grid is suppressed. Each previous call to
638 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
639 EndBatch. Code that does a lot of grid modification can be enclosed between
640 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
641 cause the grid to be repainted.
645 \helpref{wxGridUpdateLocker
}{wxgridupdatelocker
}
649 \membersection{wxGrid::Fit
}\label{wxgridfit
}
651 \func{void
}{Fit
}{\void}
653 Overridden wxWindow method.
657 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
659 \func{void
}{ForceRefresh
}{\void}
661 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
665 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
667 \constfunc{int
}{GetBatchCount
}{\void}
669 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
670 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
671 the grid's batch count is greater than zero the display will not be updated.
675 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
677 \constfunc{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
679 Sets the arguments to the horizontal and vertical text alignment values for the
680 grid cell at the specified location.
682 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
683 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
685 \perlnote{This method only takes the parameters
{\tt row
} and
{\tt col
} and
686 returns a
2-element list
{\tt ( horiz, vert )
}.
}
690 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
692 \constfunc{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
694 Returns the background colour of the cell at the specified location.
698 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
700 \constfunc{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
702 Returns a pointer to the editor for the cell at the specified location.
704 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
705 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
709 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
711 \constfunc{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
713 Returns the font for text in the grid cell at the specified location.
717 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
719 \constfunc{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
721 Returns a pointer to the renderer for the grid cell at the specified location.
723 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
724 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
728 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
730 \constfunc{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
732 Returns the text colour for the grid cell at the specified location.
736 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
738 \constfunc{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
740 \constfunc{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
742 Returns the string contained in the cell at the specified location. For simple applications where a
743 grid object automatically uses a default grid table of string values you use this function together
744 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
746 For more complex applications where you have derived your own grid table class that contains
747 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
748 function for those cells that contain string values.
750 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
751 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
755 \membersection{wxGrid::GetColAt
}\label{wxgridgetcolat
}
757 \constfunc{int
}{GetColAt
}{\param{int
}{colPos
}}
759 Returns the column ID of the specified column position.
762 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
764 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
768 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
770 \constfunc{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
772 Sets the arguments to the current column label alignment values.
774 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.\\
775 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
777 \perlnote{This method takes no parameters and
778 returns a
2-element list
{\tt ( horiz, vert )
}.
}
782 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
784 \constfunc{int
}{GetColLabelSize
}{\void}
786 Returns the current height of the column labels.
790 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
792 \constfunc{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
794 Returns the specified column label. The default grid table class provides column labels of
795 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
796 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
801 \membersection{wxGrid::GetColMinimalAcceptableWidth
}\label{wxgridgetcolminimalacceptablewidth
}
803 \constfunc{int
}{GetColMinimalAcceptableWidth
}{}
805 This returns the value of the lowest column width that can be handled correctly. See
806 member
\helpref{SetColMinimalAcceptableWidth
}{wxgridsetcolminimalacceptablewidth
} for details.
810 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
812 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
814 Get the minimal width of the given column/row.
818 \membersection{wxGrid::GetColPos
}\label{wxgridgetcolpos
}
820 \constfunc{int
}{GetColPos
}{\param{int
}{colID
}}
822 Returns the position of the specified column.
826 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
828 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
832 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
834 \constfunc{int
}{GetColSize
}{\param{int
}{col
}}
836 Returns the width of the specified column.
840 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
842 \constfunc{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
844 Sets the arguments to the current default horizontal and vertical text alignment
847 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
848 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
852 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
854 \constfunc{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
856 Returns the current default background colour for grid cells.
860 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
862 \constfunc{wxFont
}{GetDefaultCellFont
}{\void}
864 Returns the current default font for grid cell text.
868 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
870 \constfunc{wxColour
}{GetDefaultCellTextColour
}{\void}
872 Returns the current default colour for grid cell text.
876 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
878 \constfunc{int
}{GetDefaultColLabelSize
}{\void}
880 Returns the default height for column labels.
884 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
886 \constfunc{int
}{GetDefaultColSize
}{\void}
888 Returns the current default width for grid columns.
892 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
894 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
896 Returns a pointer to the current default grid cell editor.
898 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
899 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
903 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
905 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
907 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
911 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
913 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
917 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
919 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
921 Returns a pointer to the current default grid cell renderer.
923 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
924 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
928 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
930 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
934 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
936 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
940 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
942 \constfunc{int
}{GetDefaultRowLabelSize
}{\void}
944 Returns the default width for the row labels.
948 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
950 \constfunc{int
}{GetDefaultRowSize
}{\void}
952 Returns the current default height for grid rows.
956 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
958 \constfunc{int
}{GetGridCursorCol
}{\void}
960 Returns the current grid cell column position.
964 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
966 \constfunc{int
}{GetGridCursorRow
}{\void}
968 Returns the current grid cell row position.
972 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
974 \constfunc{wxColour
}{GetGridLineColour
}{\void}
976 Returns the colour used for grid lines.
980 \helpref{GetDefaultGridLinePen()
}{wxgridgetdefaultgridlinepen
}
983 \membersection{wxGrid::GetDefaultGridLinePen
}\label{wxgridgetdefaultgridlinepen
}
985 \func{wxPen
}{GetDefaultGridLinePen
}{\void}
987 Returns the pen used for grid lines. This virtual function may be overridden in
988 derived classes in order to change the appearance of grid lines. Note that
989 currently the pen width must be $
1$.
993 \helpref{GetColGridLinePen()
}{wxgridgetcolgridlinepen
},\\
994 \helpref{GetRowGridLinePen()
}{wxgridgetrowgridlinepen
}
999 \membersection{wxGrid::GetRowGridLinePen
}\label{wxgridgetrowgridlinepen
}
1001 \func{wxPen
}{GetRowGridLinePen
}{\param{int
}{row
}}
1003 Returns the pen used for horizontal grid lines. This virtual function may be
1004 overridden in derived classes in order to change the appearance of individual
1005 grid line for the given row
\arg{row
}.
1010 // in a grid displaying music notation, use a solid black pen between
1011 // octaves (C0=row
127, C1=row
115 etc.)
1012 wxPen MidiGrid::GetRowGridLinePen(int row)
1015 return wxPen
(*wxBLACK, 1, wxSOLID);
1017 return GetDefaultGridLinePen();
1023 \membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen}
1025 \func{wxPen}{GetColGridLinePen}{\param{int }{col}}
1027 Returns the pen used for vertical grid lines. This virtual function may be
1028 overridden in derived classes in order to change the appearance of individual
1029 grid lines for the given column \arg{col}.
1031 See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example.
1036 \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}
1038 \constfunc{bool}{GridLinesEnabled}{\void}
1040 Returns true if drawing of grid lines is turned on, false otherwise.
1044 \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
1046 \constfunc{wxColour}{GetLabelBackgroundColour}{\void}
1048 Returns the colour used for the background of row and column labels.
1052 \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
1054 \constfunc{wxFont}{GetLabelFont}{\void}
1056 Returns the font used for row and column labels.
1060 \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
1062 \constfunc{wxColour}{GetLabelTextColour}{\void}
1064 Returns the colour used for row and column label text.
1068 \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
1070 \constfunc{int}{GetNumberCols}{\void}
1072 Returns the total number of grid columns (actually the number of columns in the underlying grid
1077 \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
1079 \constfunc{int}{GetNumberRows}{\void}
1081 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
1085 \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
1087 \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}
1091 \membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}
1093 \constfunc{int}{GetRowMinimalAcceptableHeight}{}
1095 This returns the value of the lowest row width that can be handled correctly. See
1096 member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.
1100 \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
1102 \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
1106 \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
1108 \constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
1110 Sets the arguments to the current row label alignment values.
1112 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
1113 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
1115 \perlnote{This method takes no parameters and
1116 returns a 2-element list {\tt ( horiz, vert )}.}
1120 \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
1122 \constfunc{int}{GetRowLabelSize}{\void}
1124 Returns the current width of the row labels.
1128 \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
1130 \constfunc{wxString}{GetRowLabelValue}{\param{int }{row}}
1132 Returns the specified row label. The default grid table class provides numeric row labels.
1133 If you are using a custom grid table you can override
1134 \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
1139 \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
1141 \constfunc{int}{GetRowSize}{\param{int }{row}}
1143 Returns the height of the specified row.
1147 \membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex}
1149 \constfunc{int}{GetScrollLineX}{\void}
1151 Returns the number of pixels per horizontal scroll increment. The default is 15.
1153 \wxheading{See also}
1155 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1156 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1157 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1161 \membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney}
1163 \constfunc{int}{GetScrollLineY}{\void}
1165 Returns the number of pixels per vertical scroll increment. The default is 15.
1167 \wxheading{See also}
1169 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1170 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1171 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1175 \membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}
1177 \constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}
1179 Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.
1183 \membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}
1185 \constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}
1187 Returns an array of singly selected cells.
1191 \membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}
1193 \constfunc{wxArrayInt}{GetSelectedCols}{\void}
1195 Returns an array of selected cols.
1199 \membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}
1201 \constfunc{wxArrayInt}{GetSelectedRows}{\void}
1203 Returns an array of selected rows.
1207 \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
1209 \constfunc{wxColour}{GetSelectionBackground}{\void}
1211 Access or update the selection fore/back colours
1215 \membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}
1217 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}
1219 Returns an array of the top left corners of blocks of selected cells,
1220 see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.
1224 \membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}
1226 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}
1228 Returns an array of the bottom right corners of blocks of selected cells,
1229 see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.
1233 \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
1235 \constfunc{wxColour}{GetSelectionForeground}{\void}
1239 \membersection{wxGrid::GetTable}\label{wxgridgettable}
1241 \constfunc{wxGridTableBase *}{GetTable}{\void}
1243 Returns a base pointer to the current table object.
1247 \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
1249 \constfunc{int}{GetViewWidth}{\void}
1251 Returned number of whole cols visible.
1255 \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
1257 \func{void}{HideCellEditControl}{\void}
1259 Hides the in-place cell edit control.
1262 \membersection{wxGrid::HideColLabels}\label{wxgridhidecollabels}
1264 \func{void}{HideColLabels}{\void}
1266 Hides the column labels by calling \helpref{SetColLabelSize}{wxgridsetcollabelsize}
1267 with a size of 0. Show labels again by calling that method with
1268 a width greater than 0.
1271 \membersection{wxGrid::HideRowLabels}\label{wxgridhiderowlabels}
1273 \func{void}{HideRowLabels}{\void}
1275 Hides the row labels by calling \helpref{SetRowLabelSize}{wxgridsetrowlabelsize}
1276 with a size of 0. Show labels again by calling that method with
1277 a width greater than 0.
1280 \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
1282 \func{void}{InitColWidths}{\void}
1284 Init the m\_colWidths/Rights arrays
1288 \membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
1290 \func{void}{InitRowHeights}{\void}
1292 NB: {\it never} access m\_row/col arrays directly because they are created
1293 on demand, {\it always} use accessor functions instead!
1295 Init the m\_rowHeights/Bottoms arrays with default values.
1299 \membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
1301 \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
1303 Inserts one or more new columns into a grid with the first new column at the
1304 specified position and returns true if successful. The updateLabels argument is not
1307 The sequence of actions begins with the grid object requesting the underlying grid
1308 table to insert new columns. If this is successful the table notifies the grid and the
1309 grid updates the display. For a default grid (one where you have called
1310 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1311 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1312 then you must override
1313 \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
1318 \membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
1320 \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
1322 Inserts one or more new rows into a grid with the first new row at the specified
1323 position and returns true if successful. The updateLabels argument is not used at
1326 The sequence of actions begins with the grid object requesting the underlying grid
1327 table to insert new rows. If this is successful the table notifies the grid and the
1328 grid updates the display. For a default grid (one where you have called
1329 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1330 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1331 then you must override
1332 \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
1337 \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}
1339 \constfunc{bool}{IsCellEditControlEnabled}{\void}
1341 Returns true if the in-place edit control is currently enabled.
1345 \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}
1347 \constfunc{bool}{IsCurrentCellReadOnly}{\void}
1349 Returns true if the current cell has been set to read-only
1350 (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).
1354 \membersection{wxGrid::IsEditable}\label{wxgridiseditable}
1356 \constfunc{bool}{IsEditable}{\void}
1358 Returns false if the whole grid has been set as read-only or true otherwise.
1359 See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
1360 controlling the editing status of grid cells.
1364 \membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
1366 \constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
1368 \constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
1370 Is this cell currently selected.
1374 \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}
1376 \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}
1378 Returns true if the cell at the specified location can't be edited.
1379 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1383 \membersection{wxGrid::IsSelection}\label{wxgridisselection}
1385 \constfunc{bool}{IsSelection}{\void}
1387 Returns true if there are currently rows, columns or blocks of cells selected.
1391 \membersection{wxGrid::IsVisible}\label{wxgridisvisible}
1393 \constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}
1395 \constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}
1397 Returns true if a cell is either wholly visible (the default) or at least partially
1398 visible in the grid window.
1402 \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
1404 \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
1406 \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
1408 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
1409 nothing if the cell is already visible.
1413 \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
1415 \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
1417 Moves the grid cursor down by one row. If a block of cells was previously selected it
1418 will expand if the argument is true or be cleared if the argument is false.
1420 \wxheading{Keyboard}\\
1421 This function is called for Down cursor key presses or Shift+Down to expand a selection.
1425 \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
1427 \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
1429 Moves the grid cursor left by one column. If a block of cells was previously selected it
1430 will expand if the argument is true or be cleared if the argument is false.
1432 \wxheading{Keyboard}\\
1433 This function is called for Left cursor key presses or Shift+Left to expand a selection.
1437 \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
1439 \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
1441 Moves the grid cursor right by one column. If a block of cells was previously selected it
1442 will expand if the argument is true or be cleared if the argument is false.
1444 \wxheading{Keyboard}\\
1445 This function is called for Right cursor key presses or Shift+Right to expand a selection.
1449 \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
1451 \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
1453 Moves the grid cursor up by one row. If a block of cells was previously selected it
1454 will expand if the argument is true or be cleared if the argument is false.
1456 \wxheading{Keyboard}\\
1457 This function is called for Up cursor key presses or Shift+Up to expand a selection.
1461 \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
1463 \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
1465 Moves the grid cursor down in the current column such that it skips to the beginning or
1466 end of a block of non-empty cells. If a block of cells was previously selected it
1467 will expand if the argument is true or be cleared if the argument is false.
1469 \wxheading{Keyboard}\\
1470 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
1474 \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
1476 \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
1478 Moves the grid cursor left in the current row such that it skips to the beginning or
1479 end of a block of non-empty cells. If a block of cells was previously selected it
1480 will expand if the argument is true or be cleared if the argument is false.
1482 \wxheading{Keyboard}\\
1483 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
1487 \membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}
1489 \func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}
1491 Moves the grid cursor right in the current row such that it skips to the beginning or
1492 end of a block of non-empty cells. If a block of cells was previously selected it
1493 will expand if the argument is true or be cleared if the argument is false.
1495 \wxheading{Keyboard}\\
1496 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1500 \membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}
1502 \func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}
1504 Moves the grid cursor up in the current column such that it skips to the beginning or
1505 end of a block of non-empty cells. If a block of cells was previously selected it
1506 will expand if the argument is true or be cleared if the argument is false.
1508 \wxheading{Keyboard}\\
1509 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1513 \membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}
1515 \func{bool}{MovePageDown}{\void}
1517 Moves the grid cursor down by some number of rows so that the previous bottom visible row
1518 becomes the top visible row.
1520 \wxheading{Keyboard}\\
1521 This function is called for PgDn keypresses.
1525 \membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}
1527 \func{bool}{MovePageUp}{\void}
1529 Moves the grid cursor up by some number of rows so that the previous top visible row
1530 becomes the bottom visible row.
1532 \wxheading{Keyboard}\\
1533 This function is called for PgUp keypresses.
1537 \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1539 \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1541 Methods for a registry for mapping data types to Renderers/Editors
1545 \membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}
1547 \func{void}{SaveEditControlValue}{\void}
1549 Sets the value of the current grid cell to the current in-place edit control value.
1550 This is called automatically when the grid cursor moves from the current cell to a
1551 new cell. It is also a good idea to call this function when closing a grid since
1552 any edits to the final cell location will not be saved otherwise.
1556 \membersection{wxGrid::SelectAll}\label{wxgridselectall}
1558 \func{void}{SelectAll}{\void}
1560 Selects all cells in the grid.
1564 \membersection{wxGrid::SelectBlock}\label{wxgridselectblock}
1566 \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
1567 \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}
1569 \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
1570 \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}
1572 Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
1573 deselected; if true the column will be added to the existing selection.
1577 \membersection{wxGrid::SelectCol}\label{wxgridselectcol}
1579 \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}
1581 Selects the specified column. If addToSelected is false then any existing selection will be
1582 deselected; if true the column will be added to the existing selection.
1586 \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1588 \constfunc{wxRect}{SelectionToDeviceRect}{\void}
1590 This function returns the rectangle that encloses the selected cells
1591 in device coords and clipped to the client size of the grid window.
1595 \membersection{wxGrid::SelectRow}\label{wxgridselectrow}
1597 \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}
1599 Selects the specified row. If addToSelected is false then any existing selection will be
1600 deselected; if true the row will be added to the existing selection.
1604 \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1606 \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
1608 \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1610 Sets the horizontal and vertical alignment for grid cell text at the specified location.
1612 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
1613 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1617 \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1619 \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1623 \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
1625 \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
1627 Sets the editor for the grid cell at the specified location.
1628 The grid will take ownership of the pointer.
1630 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1631 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1635 \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
1637 \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}
1639 Sets the font for text in the grid cell at the specified location.
1643 \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
1645 \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
1647 Sets the renderer for the grid cell at the specified location.
1648 The grid will take ownership of the pointer.
1650 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1651 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1655 \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1657 \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1659 \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1661 \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}
1663 Sets the text colour for the grid cell at the specified location.
1667 \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1669 \func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
1671 \func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
1673 \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1675 Sets the string value for the cell at the specified location. For simple applications where a
1676 grid object automatically uses a default grid table of string values you use this function together
1677 with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
1679 For more complex applications where you have derived your own grid table class that contains
1680 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
1681 function for those cells that contain string values.
1683 The last form is for backward compatibility only.
1685 See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
1686 and the \helpref{wxGrid overview}{gridoverview} for more information.
1690 \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
1692 \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
1694 Sets the cell attributes for all cells in the specified column.
1696 For more information about controlling grid cell attributes see the
1697 \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
1698 \helpref{wxGrid classes overview}{gridoverview}.
1702 \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
1704 \func{void}{SetColFormatBool}{\param{int }{col}}
1706 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
1710 \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
1712 \func{void}{SetColFormatNumber}{\param{int }{col}}
1714 Sets the specified column to display integer values.
1718 \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
1720 \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
1722 Sets the specified column to display floating point values with the given width and precision.
1726 \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
1728 \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
1730 Sets the specified column to display data in a custom format.
1731 See the \helpref{wxGrid overview}{gridoverview} for more information on working
1732 with custom data types.
1736 \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
1738 \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1740 Sets the horizontal and vertical alignment of column label text.
1742 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1744 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1748 \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
1750 \func{void}{SetColLabelSize}{\param{int }{height}}
1752 Sets the height of the column labels.
1754 If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically
1755 so that no label is truncated. Note that this could be slow for a large table.
1759 \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
1761 \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}
1763 Set the value for the given column label. If you are using a derived grid table you must
1764 override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
1765 for this to have any effect.
1769 \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
1771 \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
1773 Sets the minimal width for the specified column. This should normally be called when creating the grid
1774 because it will not resize a column that is already narrower than the minimal width.
1775 The width argument must be higher than the minimimal acceptable column width, see
1776 \helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.
1780 \membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}
1782 \func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}
1784 This modifies the minimum column width that can be handled correctly. Specifying a low value here
1785 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1786 than the actual minimum size will incur a performance penalty in the functions which perform
1787 grid cell index lookup on the basis of screen coordinates.
1788 This should normally be called when creating the grid because it will not resize existing columns
1789 with sizes smaller than the value specified here.
1793 \membersection{wxGrid::SetColPos}\label{wxgridsetcolpos}
1795 \func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}}
1797 Sets the position of the specified column.
1801 \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
1803 \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
1805 Sets the width of the specified column.
1807 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1808 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1810 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1811 also be set as the minimal width for the column.
1814 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1815 The memory requirements for this could become prohibitive if your grid is very large.
1819 \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1821 \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1823 Sets the default horizontal and vertical alignment for grid cell text.
1825 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1827 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1831 \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1833 \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}
1835 Sets the default background colour for grid cells.
1839 \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1841 \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}
1843 Sets the default font to be used for grid cell text.
1847 \membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}
1849 \func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}
1851 Sets the current default colour for grid cell text.
1855 \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1857 \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1859 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1861 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1862 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1866 \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1868 \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1870 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1872 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1873 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1877 \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
1879 \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}
1881 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1882 the grid unless resizeExistingCols is true.
1886 \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1888 \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}
1890 Sets the default height for rows in the grid. This will only affect rows subsequently added
1891 to the grid unless resizeExistingRows is true.
1895 \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1897 \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
1899 Set the grid cursor to the specified cell.
1900 This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
1904 \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
1906 \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}
1908 Sets the colour used to draw grid lines.
1912 \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1914 \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}
1916 Sets the background colour for row and column labels.
1920 \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
1922 \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}
1924 Sets the font for row and column labels.
1928 \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1930 \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}
1932 Sets the colour for row and column label text.
1936 \membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1938 \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1940 A grid may occupy more space than needed for its rows/columns. This
1941 function allows to set how big this extra space is
1945 \membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1947 \func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1949 Common part of AutoSizeColumn/Row() and GetBestSize()
1953 \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1955 \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1959 \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1961 \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}
1963 Makes the cell at the specified location read-only or editable.
1964 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1968 \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
1970 \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
1972 Sets the cell attributes for all cells in the specified row.
1973 See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1974 about controlling cell attributes.
1978 \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
1980 \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1982 Sets the horizontal and vertical alignment of row label text.
1984 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1986 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1990 \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
1992 \func{void}{SetRowLabelSize}{\param{int }{width}}
1994 Sets the width of the row labels.
1996 If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically
1997 so that no label is truncated. Note that this could be slow for a large table.
2001 \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
2003 \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}
2005 Set the value for the given row label. If you are using a derived grid table you must
2006 override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
2007 for this to have any effect.
2011 \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
2013 \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}
2015 Sets the minimal height for the specified row. This should normally be called when creating the grid
2016 because it will not resize a row that is already shorter than the minimal height.
2017 The height argument must be higher than the minimimal acceptable row height, see
2018 \helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.
2022 \membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}
2024 \func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}
2026 This modifies the minimum row width that can be handled correctly. Specifying a low value here
2027 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
2028 than the actual minimum size will incur a performance penalty in the functions which perform
2029 grid cell index lookup on the basis of screen coordinates.
2030 This should normally be called when creating the grid because it will not resize existing rows
2031 with sizes smaller than the value specified here.
2035 \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
2037 \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
2039 Sets the height of the specified row.
2041 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
2042 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
2044 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
2045 also be set as the minimal width for the column.
2049 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
2050 The memory requirements for this could become prohibitive if your grid is very large.
2054 \membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex}
2056 \func{void}{SetScrollLineX}{\param{int }{x}}
2058 Sets the number of pixels per horizontal scroll increment. The default is 15.
2059 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
2060 errors: setting this to 1 can help.
2062 \wxheading{See also}
2064 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
2065 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
2066 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
2070 \membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney}
2072 \func{void}{SetScrollLineY}{\param{int }{y}}
2074 Sets the number of pixels per vertical scroll increment. The default is 15.
2075 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
2076 errors: setting this to 1 can help.
2078 \wxheading{See also}
2080 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
2081 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
2082 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex}
2086 \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
2088 \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
2092 \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
2094 \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
2098 \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
2100 \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}
2102 Set the selection behaviour of the grid.
2104 \wxheading{Parameters}
2106 \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
2108 \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
2110 \docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}
2114 \membersection{wxGrid::SetTable}\label{wxgridsettable}
2116 \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
2118 Passes a pointer to a custom grid table to be used by the grid. This should be called
2119 after the grid constructor and before using the grid object. If takeOwnership is set to
2120 true then the table will be deleted by the wxGrid destructor.
2122 Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
2123 application involves complex or non-string data or data sets that are too large to fit
2127 \membersection{wxGrid::SetUseNativeColLabels}\label{wxgridsetsenativecollabels}
2129 \func{void}{SetUseNativeColLabels}{\param{bool }{native= true}}
2131 Call this in order to make the column labels use a native look by using
2132 \helpref{wxRenderer::DrawHeaderButton}{wxrenderernativedrawheaderbutton}
2133 internally. There is no equivalent method for drawing row columns as
2134 there is not native look for that. This option is useful when using
2135 wxGrid for displaying tables and not as a spread-sheet.
2137 \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
2139 \func{void}{ShowCellEditControl}{\void}
2141 Displays the in-place cell edit control for the current cell.
2145 \membersection{wxGrid::XToCol}\label{wxgridxtocol}
2147 \constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}}
2149 \wxheading{Parameters}
2150 \docparam{x}{The x position to evaluate.}
2151 \docparam{clipToMinMax}{If true, rather than returning wxNOT\_FOUND, it returns either the first or last column depending on whether x is too far to the left or right respectively.}
2153 \wxheading{Return value}
2154 The grid column that corresponds to the logical x coordinate. Returns
2155 {\tt wxNOT\_FOUND} if there is no column at the x position.
2159 \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
2161 \constfunc{int}{XToEdgeOfCol}{\param{int }{x}}
2163 Returns the column whose right hand edge is close to the given logical x position.
2164 If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.
2168 \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
2170 \constfunc{int}{YToEdgeOfRow}{\param{int }{y}}
2172 Returns the row whose bottom edge is close to the given logical y position.
2173 If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.
2177 \membersection{wxGrid::YToRow}\label{wxgridytorow}
2179 \constfunc{int}{YToRow}{\param{int }{y}}
2181 Returns the grid row that corresponds to the logical y coordinate. Returns
2182 {\tt wxNOT\_FOUND} if there is no row at the y position.