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. If you have been using the old wxGrid class you will probably
28 want to have a look at the
\helpref{wxGrid classes overview
}{gridoverview
} to see
29 how things have changed. The new grid classes are reasonably backward-compatible
30 but there are some exceptions. There are also easier ways of doing many things compared to
31 the previous implementation.
33 \wxheading{Derived from
}
35 \helpref{wxScrolledWindow
}{wxscrolledwindow
}\\
36 \helpref{wxPanel
}{wxpanel
}\\
37 \helpref{wxWindow
}{wxwindow
}\\
38 \helpref{wxEvtHandler
}{wxevthandler
}\\
39 \helpref{wxObject
}{wxobject
}
41 \wxheading{Include files
}
47 \helpref{wxAdv
}{librarieslist
}
49 \wxheading{Window styles
}
51 There are presently no specific window styles for wxGrid.
53 \wxheading{Event handling
}
57 The event handler for the following functions takes a
58 \helpref{wxGridSizeEvent
}{wxgridsizeevent
} parameter.
59 The ...
\_CMD\_... variants also take a window identifier.
62 \begin{twocollist
}\itemsep=
0pt
63 \twocolitem{{\bf EVT
\_GRID\_COL\_SIZE(func)
}}{The user resized a column by dragging it. Processes a wxEVT
\_GRID\_COL\_SIZE.
}
64 \twocolitem{{\bf EVT
\_GRID\_COL\_MOVE(func)
}}{The user moved a column by dragging it. Processes a wxEVT
\_GRID\_COL\_MOVE.
}
65 \twocolitem{{\bf EVT
\_GRID\_ROW\_SIZE(func)
}}{The user resized a row by dragging it. Processes a wxEVT
\_GRID\_ROW\_SIZE.
}
66 \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.
}
67 \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.
}
68 \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.
}
71 The event handler for the following functions takes a
72 \helpref{wxGridRangeSelectEvent
}{wxgridrangeselectevent
} parameter.
73 The ...
\_CMD\_... variant also takes a window identifier.
76 \begin{twocollist
}\itemsep=
0pt
77 \twocolitem{{\bf EVT
\_GRID\_RANGE\_SELECT(func)
}}{The user selected a group of contiguous cells. Processes a wxEVT
\_GRID\_RANGE\_SELECT.
}
78 \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.
}
81 The event handler for the following functions takes a
82 \helpref{wxGridEditorCreatedEvent
}{wxgrideditorcreatedevent
} parameter.
83 The ...
\_CMD\_... variant also takes a window identifier.
86 \begin{twocollist
}\itemsep=
0pt
87 \twocolitem{{\bf EVT
\_GRID\_EDITOR\_CREATED(func)
}}{The editor for a cell was created. Processes a wxEVT
\_GRID\_EDITOR\_CREATED.
}
88 \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.
}
93 \helpref{wxGrid overview
}{gridoverview
}
95 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
96 \latexignore{\rtfignore{\wxheading{Function groups
}}}
100 \membersection{Constructors and initialization
}\label{wxgridconstructors
}
102 \helpref{wxGrid
}{wxgridctor
}\\
103 \helpref{\destruct{wxGrid
}}{wxgriddtor
}\\
104 \helpref{CreateGrid
}{wxgridcreategrid
}\\
105 \helpref{SetTable
}{wxgridsettable
}
108 \membersection{Cursor movement
}\label{wxgridcursormovement
}
110 \helpref{wxGrid::MoveCursorUp
}{wxgridmovecursorup
}\\
111 \helpref{wxGrid::MoveCursorDown
}{wxgridmovecursordown
}\\
112 \helpref{wxGrid::MoveCursorLeft
}{wxgridmovecursorleft
}\\
113 \helpref{wxGrid::MoveCursorRight
}{wxgridmovecursorright
}\\
114 \helpref{wxGrid::MoveCursorPageUp
}{wxgridmovecursorup
}\\
115 \helpref{wxGrid::MoveCursorPageDown
}{wxgridmovecursordown
}\\
116 \helpref{wxGrid::MoveCursorUpBlock
}{wxgridmovecursorupblock
}\\
117 \helpref{wxGrid::MoveCursorDownBlock
}{wxgridmovecursordownblock
}\\
118 \helpref{wxGrid::MoveCursorLeftBlock
}{wxgridmovecursorleftblock
}\\
119 \helpref{wxGrid::MoveCursorRightBlock
}{wxgridmovecursorrightblock
}
122 \membersection{Grid line formatting
}\label{wxgridlineformatting
}
124 \helpref{wxGrid::EnableGridLines
}{wxgridenablegridlines
}\\
125 \helpref{wxGrid::GridLinesEnabled
}{wxgridgridlinesenabled
}\\
126 \helpref{wxGrid::SetGridLineColour
}{wxgridsetgridlinecolour
}\\
127 \helpref{wxGrid::GetGridLineColour
}{wxgridgetgridlinecolour
}\\
128 \helpref{wxGrid::GetDefaultGridLinePen
}{wxgridgetdefaultgridlinepen
}\\
129 \helpref{wxGrid::GetRowGridLinePen
}{wxgridgetrowgridlinepen
}\\
130 \helpref{wxGrid::GetColGridLinePen
}{wxgridgetcolgridlinepen
}
132 \membersection{Row and column label value and format
}\label{wxgridrowcoulmlabelformat
}
134 \helpref{wxGrid::SetRowLabelValue
}{wxgridsetrowlabelvalue
}\\
135 \helpref{wxGrid::SetColLabelValue
}{wxgridsetcollabelvalue
}\\
136 \helpref{wxGrid::GetRowLabelValue
}{wxgridgetrowlabelvalue
}\\
137 \helpref{wxGrid::GetColLabelValue
}{wxgridgetcollabelvalue
}\\
138 \helpref{wxGrid::SetUseNativeColLabels
}{wxgridsetsenativecollabels
}\\
139 \helpref{wxGrid::HideColLabels
}{wxgridhidecollabels
}\\
140 \helpref{wxGrid::HideRowLabels
}{wxgridhiderowlabels
}\\
141 \helpref{wxGrid::SetRowLabelSize
}{wxgridsetrowlabelsize
}\\
142 \helpref{wxGrid::SetColLabelSize
}{wxgridsetcollabelsize
}\\
143 \helpref{wxGrid::GetRowLabelSize
}{wxgridgetrowlabelsize
}\\
144 \helpref{wxGrid::GetColLabelSize
}{wxgridgetcollabelsize
}\\
145 \helpref{wxGrid::AutoSizeRowLabelSize
}{wxgridautosizerowlabelsize
}\\
146 \helpref{wxGrid::AutoSizeColLabelSize
}{wxgridautosizecollabelsize
}\\
147 \helpref{wxGrid::GetDefaultRowLabelSize
}{wxgridgetdefaultrowlabelsize
}\\
148 \helpref{wxGrid::GetDefaultColLabelSize
}{wxgridgetdefaultcollabelsize
}\\
149 \helpref{wxGrid::SetRowLabelAlignment
}{wxgridsetrowlabelalignment
}\\
150 \helpref{wxGrid::SetColLabelAlignment
}{wxgridsetcollabelalignment
}\\
151 \helpref{wxGrid::GetRowLabelAlignment
}{wxgridgetrowlabelalignment
}\\
152 \helpref{wxGrid::GetColLabelAlignment
}{wxgridgetcollabelalignment
}\\
153 \helpref{wxGrid::SetLabelFont
}{wxgridsetlabelfont
}\\
154 \helpref{wxGrid::SetLabelTextColour
}{wxgridsetlabeltextcolour
}\\
155 \helpref{wxGrid::SetLabelBackgroundColour
}{wxgridsetlabelbackgroundcolour
}\\
156 \helpref{wxGrid::GetLabelFont
}{wxgridgetlabelfont
}\\
157 \helpref{wxGrid::GetLabelBackgroundColour
}{wxgridgetlabelbackgroundcolour
}\\
158 \helpref{wxGrid::GetLabelTextColour
}{wxgridgetlabeltextcolour
}\\
159 %\helpref{wxGrid::SetColLabelTextOrientation}{wxgridsetcollabeltextorientation}\\
160 %\helpref{wxGrid::GetColLabelTextOrientation}{wxgridgetcollabeltextorientation}
161 wxGrid::SetColLabelTextOrientation\\
162 wxGrid::GetColLabelTextOrientation
164 \membersection{Cell, row and column user-resizing and dragging
}\label{wxgridcellrowcolresizing
}
166 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}\\
167 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}\\
168 \helpref{wxGrid::CanDragRowSize
}{wxgridcandragrowsize
}\\
169 \helpref{wxGrid::CanDragColSize
}{wxgridcandragcolsize
}\\
170 \helpref{wxGrid::EnableDragColMove
}{wxgridenabledragcolmove
}\\
171 \helpref{wxGrid::CanDragColMove
}{wxgridcandragcolmove
}\\
172 \helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}\\
173 \helpref{wxGrid::CanDragGridSize
}{wxgridcandraggridsize
}\\
174 \helpref{wxGrid::GetColAt
}{wxgridgetcolat
}\\
175 \helpref{wxGrid::SetColPos
}{wxgridsetcolpos
}\\
176 \helpref{wxGrid::GetColPos
}{wxgridgetcolpos
}\\
177 %\helpref{wxGrid::EnableDragCell}{wxgridenabledragcell}\\
178 %\helpref{wxGrid::CanDragCell}{wxgridcandragcell}
179 wxGrid::EnableDragCell\\
182 \membersection{Autoresizing and cell size constraints
}\label{wxgridautoresizingandcellconstriants
}
184 \helpref{wxGrid::AutoSizeColumn
}{wxgridautosizecolumn
}\\
185 \helpref{wxGrid::AutoSizeRow
}{wxgridautosizerow
}\\
186 \helpref{wxGrid::AutoSizeColumns
}{wxgridautosizecolumns
}\\
187 \helpref{wxGrid::AutoSizeRows
}{wxgridautosizerows
}\\
188 \helpref{wxGrid::AutoSize
}{wxgridautosize
}\\
189 \helpref{wxGrid::SetColMinimalWidth
}{wxgridsetcolminimalwidth
}\\
190 \helpref{wxGrid::SetRowMinimalHeight
}{wxgridsetrowminimalheight
}\\
191 \helpref{wxGrid::SetColMinimalAcceptableWidth
}{wxgridsetcolminimalacceptablewidth
}\\
192 \helpref{wxGrid::SetRowMinimalAcceptableHeight
}{wxgridsetrowminimalacceptableheight
}\\
193 \helpref{wxGrid::GetColMinimalAcceptableWidth
}{wxgridgetcolminimalacceptablewidth
}\\
194 \helpref{wxGrid::GetRowMinimalAcceptableHeight
}{wxgridgetrowminimalacceptableheight
}
196 \membersection{Selection functions
}\label{wxgridselectionfunctions
}
198 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
}\\
199 \helpref{wxGrid::IsSelection
}{wxgridisselection
}\\
200 \helpref{wxGrid::SelectAll
}{wxgridselectall
}\\
201 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
}\\
202 \helpref{wxGrid::SelectCol
}{wxgridselectcol
}\\
203 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
205 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
206 \helponly{\insertatlevel{2}{
214 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
216 \func{}{wxGrid
}{\void}
220 \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
}}
222 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
223 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
228 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
230 \func{}{\destruct{wxGrid
}}{\void}
232 Destructor. This will also destroy the associated grid table unless you passed a table
233 object to the grid and specified that the grid should not take ownership of the
234 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
238 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
240 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
242 Appends one or more new columns to the right of the grid and returns true if
243 successful. The updateLabels argument is not used at present.
245 If you are using a derived grid table class you will need to override
246 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
247 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
251 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
253 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
255 Appends one or more new rows to the bottom of the grid and returns true if
256 successful. The updateLabels argument is not used at present.
258 If you are using a derived grid table class you will need to override
259 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
260 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
264 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
266 \func{void
}{AutoSize
}{\void}
268 Automatically sets the height and width of all rows and columns to fit their contents.
271 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
272 The memory requirements for this could become prohibitive if your grid is very large.
276 \membersection{wxGrid::AutoSizeColLabelSize
}\label{wxgridautosizecollabelsize
}
278 \func{void
}{AutoSizeColLabelSize
}{\param{int
}{col
}}
280 Automatically adjusts width of the column to fit its label.
284 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
286 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = true
}}
288 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
289 also be set as the minimal width for the column.
292 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
293 The memory requirements for this could become prohibitive if your grid is very large.
297 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
299 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = true
}}
301 Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
302 also be set as the minimal widths for the columns.
305 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
306 The memory requirements for this could become prohibitive if your grid is very large.
310 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
312 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = true
}}
314 Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
315 also be set as the minimal height for the row.
318 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
319 The memory requirements for this could become prohibitive if your grid is very large.
323 \membersection{wxGrid::AutoSizeRowLabelSize
}\label{wxgridautosizerowlabelsize
}
325 \func{void
}{AutoSizeRowLabelSize
}{\param{int
}{col
}}
327 Automatically adjusts height of the row to fit its label.
331 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
333 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = true
}}
335 Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
336 also be set as the minimal heights for the rows.
339 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
340 The memory requirements for this could become prohibitive if your grid is very large.
344 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
346 \func{void
}{BeginBatch
}{\void}
348 Increments the grid's batch count. When the count is greater than zero repainting of
349 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
350 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
351 modification can be enclosed between BeginBatch and EndBatch calls to avoid
352 screen flicker. The final EndBatch will cause the grid to be repainted.
356 \helpref{wxGridUpdateLocker
}{wxgridupdatelocker
}
360 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
362 \constfunc{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
364 This function returns the rectangle that encloses the block of cells
365 limited by TopLeft and BottomRight cell in device coords and clipped
366 to the client size of the grid window.
370 \membersection{wxGrid::CanDragColMove
}\label{wxgridcandragcolmove
}
372 \constfunc{bool
}{CanDragColMove
}{\void}
374 Returns true if columns can be moved by dragging with the mouse. Columns can be moved
375 by dragging on their labels.
379 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
381 \constfunc{bool
}{CanDragColSize
}{\void}
383 Returns true if columns can be resized by dragging with the mouse. Columns can be resized
384 by dragging the edges of their labels. If grid line dragging is enabled they can also be
385 resized by dragging the right edge of the column in the grid cell area
386 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
390 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
392 \constfunc{bool
}{CanDragRowSize
}{\void}
394 Returns true if rows can be resized by dragging with the mouse. Rows can be resized
395 by dragging the edges of their labels. If grid line dragging is enabled they can also be
396 resized by dragging the lower edge of the row in the grid cell area
397 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
401 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
403 \constfunc{bool
}{CanDragGridSize
}{\void}
405 Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
409 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
411 \constfunc{bool
}{CanEnableCellControl
}{\void}
413 Returns true if the in-place edit control for the current grid cell can be used and
414 false otherwise (e.g. if the current cell is read-only).
418 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
420 \constfunc{bool
}{CanHaveAttributes
}{\void}
422 Do we have some place to store attributes in?
426 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
428 \constfunc{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
430 \constfunc{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
432 Return the rectangle corresponding to the grid cell's size and position in logical
437 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
439 \func{void
}{ClearGrid
}{\void}
441 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
442 this function. If you are using a derived table class then you need to override
443 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
447 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
449 \func{void
}{ClearSelection
}{\void}
451 Deselects all cells that are currently selected.
455 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
457 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
459 Creates a grid with the specified initial number of rows and columns.
460 Call this directly after the grid constructor. When you use this
461 function wxGrid will create and manage a simple table of string values
462 for you. All of the grid data will be stored in memory.
464 For applications with more complex data types or relationships, or for
465 dealing with very large datasets, you should derive your own grid table
466 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
470 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
472 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
474 Deletes one or more columns from a grid starting at the specified position and returns
475 true if successful. The updateLabels argument is not used at present.
477 If you are using a derived grid table class you will need to override
478 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
479 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
483 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
485 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
487 Deletes one or more rows from a grid starting at the specified position and returns
488 true if successful. The updateLabels argument is not used at present.
490 If you are using a derived grid table class you will need to override
491 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
492 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
496 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
498 \func{void
}{DisableCellEditControl
}{\void}
500 Disables in-place editing of grid cells.
501 Equivalent to calling EnableCellEditControl(false).
505 \membersection{wxGrid::DisableDragColMove
}\label{wxgriddisabledragcolmove
}
507 \func{void
}{DisableDragColMove
}{\void}
509 Disables column moving by dragging with the mouse. Equivalent to passing false to
510 \helpref{wxGrid::EnableDragColMove
}{wxgridenabledragcolmove
}.
514 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
516 \func{void
}{DisableDragColSize
}{\void}
518 Disables column sizing by dragging with the mouse. Equivalent to passing false to
519 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
523 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
525 \func{void
}{DisableDragGridSize
}{\void}
527 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
528 false to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
532 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
534 \func{void
}{DisableDragRowSize
}{\void}
536 Disables row sizing by dragging with the mouse. Equivalent to passing false to
537 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
541 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
543 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = true
}}
545 Enables or disables in-place editing of grid cell data. The grid will issue either a
546 wxEVT
\_GRID\_EDITOR\_SHOWN or wxEVT
\_GRID\_EDITOR\_HIDDEN event.
550 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
552 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = true
}}
554 Enables or disables column sizing by dragging with the mouse.
558 \membersection{wxGrid::EnableDragColMove
}\label{wxgridenabledragcolmove
}
560 \func{void
}{EnableDragColMove
}{\param{bool
}{enable = true
}}
562 Enables or disables column moving by dragging with the mouse.
566 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
568 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = true
}}
570 Enables or disables row and column resizing by dragging gridlines with the mouse.
574 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
576 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = true
}}
578 Enables or disables row sizing by dragging with the mouse.
582 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
584 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
586 If the edit argument is false this function sets the whole grid as read-only. If the
587 argument is true the grid is set to the default state where cells may be editable. In the
588 default state you can set single grid cells and whole rows and columns to be editable or
590 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
591 cells you can also use the shortcut function
592 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
594 For more information about controlling grid cell attributes see the
595 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
596 \helpref{wxGrid classes overview
}{gridoverview
}.
600 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
602 \func{void
}{EnableGridLines
}{\param{bool
}{enable = true
}}
604 Turns the drawing of grid lines on or off.
608 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
610 \func{void
}{EndBatch
}{\void}
612 Decrements the grid's batch count. When the count is greater than zero repainting of
613 the grid is suppressed. Each previous call to
614 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
615 EndBatch. Code that does a lot of grid modification can be enclosed between
616 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
617 cause the grid to be repainted.
621 \helpref{wxGridUpdateLocker
}{wxgridupdatelocker
}
625 \membersection{wxGrid::Fit
}\label{wxgridfit
}
627 \func{void
}{Fit
}{\void}
629 Overridden wxWindow method.
633 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
635 \func{void
}{ForceRefresh
}{\void}
637 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
641 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
643 \constfunc{int
}{GetBatchCount
}{\void}
645 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
646 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
647 the grid's batch count is greater than zero the display will not be updated.
651 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
653 \constfunc{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
655 Sets the arguments to the horizontal and vertical text alignment values for the
656 grid cell at the specified location.
658 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
659 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
661 \perlnote{This method only takes the parameters
{\tt row
} and
{\tt col
} and
662 returns a
2-element list
{\tt ( horiz, vert )
}.
}
666 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
668 \constfunc{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
670 Returns the background colour of the cell at the specified location.
674 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
676 \constfunc{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
678 Returns a pointer to the editor for the cell at the specified location.
680 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
681 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
685 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
687 \constfunc{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
689 Returns the font for text in the grid cell at the specified location.
693 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
695 \constfunc{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
697 Returns a pointer to the renderer for the grid cell at the specified location.
699 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
700 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
704 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
706 \constfunc{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
708 Returns the text colour for the grid cell at the specified location.
712 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
714 \constfunc{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
716 \constfunc{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
718 Returns the string contained in the cell at the specified location. For simple applications where a
719 grid object automatically uses a default grid table of string values you use this function together
720 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
722 For more complex applications where you have derived your own grid table class that contains
723 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
724 function for those cells that contain string values.
726 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
727 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
731 \membersection{wxGrid::GetColAt
}\label{wxgridgetcolat
}
733 \constfunc{int
}{GetColAt
}{\param{int
}{colPos
}}
735 Returns the column ID of the specified column position.
738 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
740 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
744 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
746 \constfunc{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
748 Sets the arguments to the current column label alignment values.
750 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.\\
751 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
753 \perlnote{This method takes no parameters and
754 returns a
2-element list
{\tt ( horiz, vert )
}.
}
758 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
760 \constfunc{int
}{GetColLabelSize
}{\void}
762 Returns the current height of the column labels.
766 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
768 \constfunc{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
770 Returns the specified column label. The default grid table class provides column labels of
771 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
772 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
777 \membersection{wxGrid::GetColMinimalAcceptableWidth
}\label{wxgridgetcolminimalacceptablewidth
}
779 \constfunc{int
}{GetColMinimalAcceptableWidth
}{}
781 This returns the value of the lowest column width that can be handled correctly. See
782 member
\helpref{SetColMinimalAcceptableWidth
}{wxgridsetcolminimalacceptablewidth
} for details.
786 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
788 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
790 Get the minimal width of the given column/row.
794 \membersection{wxGrid::GetColPos
}\label{wxgridgetcolpos
}
796 \constfunc{int
}{GetColPos
}{\param{int
}{colID
}}
798 Returns the position of the specified column.
802 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
804 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
808 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
810 \constfunc{int
}{GetColSize
}{\param{int
}{col
}}
812 Returns the width of the specified column.
816 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
818 \constfunc{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
820 Sets the arguments to the current default horizontal and vertical text alignment
823 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
824 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
828 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
830 \constfunc{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
832 Returns the current default background colour for grid cells.
836 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
838 \constfunc{wxFont
}{GetDefaultCellFont
}{\void}
840 Returns the current default font for grid cell text.
844 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
846 \constfunc{wxColour
}{GetDefaultCellTextColour
}{\void}
848 Returns the current default colour for grid cell text.
852 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
854 \constfunc{int
}{GetDefaultColLabelSize
}{\void}
856 Returns the default height for column labels.
860 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
862 \constfunc{int
}{GetDefaultColSize
}{\void}
864 Returns the current default width for grid columns.
868 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
870 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
872 Returns a pointer to the current default grid cell editor.
874 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
875 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
879 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
881 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
883 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
887 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
889 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
893 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
895 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
897 Returns a pointer to the current default grid cell renderer.
899 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
900 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
904 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
906 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
910 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
912 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
916 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
918 \constfunc{int
}{GetDefaultRowLabelSize
}{\void}
920 Returns the default width for the row labels.
924 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
926 \constfunc{int
}{GetDefaultRowSize
}{\void}
928 Returns the current default height for grid rows.
932 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
934 \constfunc{int
}{GetGridCursorCol
}{\void}
936 Returns the current grid cell column position.
940 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
942 \constfunc{int
}{GetGridCursorRow
}{\void}
944 Returns the current grid cell row position.
948 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
950 \constfunc{wxColour
}{GetGridLineColour
}{\void}
952 Returns the colour used for grid lines.
956 \helpref{GetDefaultGridLinePen()
}{wxgridgetdefaultgridlinepen
}
959 \membersection{wxGrid::GetDefaultGridLinePen
}\label{wxgridgetdefaultgridlinepen
}
961 \func{wxPen
}{GetDefaultGridLinePen
}{\void}
963 Returns the pen used for grid lines. This virtual function may be overridden in
964 derived classes in order to change the appearance of grid lines. Note that
965 currently the pen width must be $
1$.
969 \helpref{GetColGridLinePen()
}{wxgridgetcolgridlinepen
},\\
970 \helpref{GetRowGridLinePen()
}{wxgridgetrowgridlinepen
}
975 \membersection{wxGrid::GetRowGridLinePen
}\label{wxgridgetrowgridlinepen
}
977 \func{wxPen
}{GetRowGridLinePen
}{\param{int
}{row
}}
979 Returns the pen used for horizontal grid lines. This virtual function may be
980 overridden in derived classes in order to change the appearance of individual
981 grid line for the given row
\arg{row
}.
986 // in a grid displaying music notation, use a solid black pen between
987 // octaves (C0=row
127, C1=row
115 etc.)
988 wxPen MidiGrid::GetRowGridLinePen(int row)
991 return wxPen
(*wxBLACK, 1, wxSOLID);
993 return GetDefaultGridLinePen();
999 \membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen}
1001 \func{wxPen}{GetColGridLinePen}{\param{int }{col}}
1003 Returns the pen used for vertical grid lines. This virtual function may be
1004 overridden in derived classes in order to change the appearance of individual
1005 grid lines for the given column \arg{col}.
1007 See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example.
1012 \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}
1014 \constfunc{bool}{GridLinesEnabled}{\void}
1016 Returns true if drawing of grid lines is turned on, false otherwise.
1020 \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
1022 \constfunc{wxColour}{GetLabelBackgroundColour}{\void}
1024 Returns the colour used for the background of row and column labels.
1028 \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
1030 \constfunc{wxFont}{GetLabelFont}{\void}
1032 Returns the font used for row and column labels.
1036 \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
1038 \constfunc{wxColour}{GetLabelTextColour}{\void}
1040 Returns the colour used for row and column label text.
1044 \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
1046 \constfunc{int}{GetNumberCols}{\void}
1048 Returns the total number of grid columns (actually the number of columns in the underlying grid
1053 \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
1055 \constfunc{int}{GetNumberRows}{\void}
1057 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
1061 \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
1063 \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}
1067 \membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}
1069 \constfunc{int}{GetRowMinimalAcceptableHeight}{}
1071 This returns the value of the lowest row width that can be handled correctly. See
1072 member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.
1076 \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
1078 \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
1082 \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
1084 \constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
1086 Sets the arguments to the current row label alignment values.
1088 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
1089 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
1091 \perlnote{This method takes no parameters and
1092 returns a 2-element list {\tt ( horiz, vert )}.}
1096 \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
1098 \constfunc{int}{GetRowLabelSize}{\void}
1100 Returns the current width of the row labels.
1104 \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
1106 \constfunc{wxString}{GetRowLabelValue}{\param{int }{row}}
1108 Returns the specified row label. The default grid table class provides numeric row labels.
1109 If you are using a custom grid table you can override
1110 \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
1115 \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
1117 \constfunc{int}{GetRowSize}{\param{int }{row}}
1119 Returns the height of the specified row.
1123 \membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex}
1125 \constfunc{int}{GetScrollLineX}{\void}
1127 Returns the number of pixels per horizontal scroll increment. The default is 15.
1129 \wxheading{See also}
1131 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1132 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1133 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1137 \membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney}
1139 \constfunc{int}{GetScrollLineY}{\void}
1141 Returns the number of pixels per vertical scroll increment. The default is 15.
1143 \wxheading{See also}
1145 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1146 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1147 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1151 \membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}
1153 \constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}
1155 Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.
1159 \membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}
1161 \constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}
1163 Returns an array of singly selected cells.
1167 \membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}
1169 \constfunc{wxArrayInt}{GetSelectedCols}{\void}
1171 Returns an array of selected cols.
1175 \membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}
1177 \constfunc{wxArrayInt}{GetSelectedRows}{\void}
1179 Returns an array of selected rows.
1183 \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
1185 \constfunc{wxColour}{GetSelectionBackground}{\void}
1187 Access or update the selection fore/back colours
1191 \membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}
1193 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}
1195 Returns an array of the top left corners of blocks of selected cells,
1196 see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.
1200 \membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}
1202 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}
1204 Returns an array of the bottom right corners of blocks of selected cells,
1205 see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.
1209 \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
1211 \constfunc{wxColour}{GetSelectionForeground}{\void}
1215 \membersection{wxGrid::GetTable}\label{wxgridgettable}
1217 \constfunc{wxGridTableBase *}{GetTable}{\void}
1219 Returns a base pointer to the current table object.
1223 \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
1225 \constfunc{int}{GetViewWidth}{\void}
1227 Returned number of whole cols visible.
1231 \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
1233 \func{void}{HideCellEditControl}{\void}
1235 Hides the in-place cell edit control.
1238 \membersection{wxGrid::HideColLabels}\label{wxgridhidecollabels}
1240 \func{void}{HideColLabels}{\void}
1242 Hides the column labels by calling \helpref{SetColLabelSize}{wxgridsetcollabelsize}
1243 with a size of 0. Show labels again by calling that method with
1244 a width greater than 0.
1247 \membersection{wxGrid::HideRowLabels}\label{wxgridhiderowlabels}
1249 \func{void}{HideRowLabels}{\void}
1251 Hides the row labels by calling \helpref{SetRowLabelSize}{wxgridsetrowlabelsize}
1252 with a size of 0. Show labels again by calling that method with
1253 a width greater than 0.
1256 \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
1258 \func{void}{InitColWidths}{\void}
1260 Init the m\_colWidths/Rights arrays
1264 \membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
1266 \func{void}{InitRowHeights}{\void}
1268 NB: {\it never} access m\_row/col arrays directly because they are created
1269 on demand, {\it always} use accessor functions instead!
1271 Init the m\_rowHeights/Bottoms arrays with default values.
1275 \membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
1277 \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
1279 Inserts one or more new columns into a grid with the first new column at the
1280 specified position and returns true if successful. The updateLabels argument is not
1283 The sequence of actions begins with the grid object requesting the underlying grid
1284 table to insert new columns. If this is successful the table notifies the grid and the
1285 grid updates the display. For a default grid (one where you have called
1286 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1287 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1288 then you must override
1289 \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
1294 \membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
1296 \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
1298 Inserts one or more new rows into a grid with the first new row at the specified
1299 position and returns true if successful. The updateLabels argument is not used at
1302 The sequence of actions begins with the grid object requesting the underlying grid
1303 table to insert new rows. If this is successful the table notifies the grid and the
1304 grid updates the display. For a default grid (one where you have called
1305 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1306 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1307 then you must override
1308 \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
1313 \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}
1315 \constfunc{bool}{IsCellEditControlEnabled}{\void}
1317 Returns true if the in-place edit control is currently enabled.
1321 \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}
1323 \constfunc{bool}{IsCurrentCellReadOnly}{\void}
1325 Returns true if the current cell has been set to read-only
1326 (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).
1330 \membersection{wxGrid::IsEditable}\label{wxgridiseditable}
1332 \constfunc{bool}{IsEditable}{\void}
1334 Returns false if the whole grid has been set as read-only or true otherwise.
1335 See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
1336 controlling the editing status of grid cells.
1340 \membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
1342 \constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
1344 \constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
1346 Is this cell currently selected.
1350 \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}
1352 \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}
1354 Returns true if the cell at the specified location can't be edited.
1355 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1359 \membersection{wxGrid::IsSelection}\label{wxgridisselection}
1361 \constfunc{bool}{IsSelection}{\void}
1363 Returns true if there are currently rows, columns or blocks of cells selected.
1367 \membersection{wxGrid::IsVisible}\label{wxgridisvisible}
1369 \constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}
1371 \constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}
1373 Returns true if a cell is either wholly visible (the default) or at least partially
1374 visible in the grid window.
1378 \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
1380 \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
1382 \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
1384 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
1385 nothing if the cell is already visible.
1389 \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
1391 \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
1393 Moves the grid cursor down by one row. If a block of cells was previously selected it
1394 will expand if the argument is true or be cleared if the argument is false.
1396 \wxheading{Keyboard}\\
1397 This function is called for Down cursor key presses or Shift+Down to expand a selection.
1401 \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
1403 \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
1405 Moves the grid cursor left by one column. If a block of cells was previously selected it
1406 will expand if the argument is true or be cleared if the argument is false.
1408 \wxheading{Keyboard}\\
1409 This function is called for Left cursor key presses or Shift+Left to expand a selection.
1413 \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
1415 \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
1417 Moves the grid cursor right by one column. 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 Right cursor key presses or Shift+Right to expand a selection.
1425 \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
1427 \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
1429 Moves the grid cursor up by one row. 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 Up cursor key presses or Shift+Up to expand a selection.
1437 \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
1439 \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
1441 Moves the grid cursor down in the current column such that it skips to the beginning or
1442 end of a block of non-empty cells. If a block of cells was previously selected it
1443 will expand if the argument is true or be cleared if the argument is false.
1445 \wxheading{Keyboard}\\
1446 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
1450 \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
1452 \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
1454 Moves the grid cursor left in the current row such that it skips to the beginning or
1455 end of a block of non-empty cells. If a block of cells was previously selected it
1456 will expand if the argument is true or be cleared if the argument is false.
1458 \wxheading{Keyboard}\\
1459 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
1463 \membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}
1465 \func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}
1467 Moves the grid cursor right in the current row such that it skips to the beginning or
1468 end of a block of non-empty cells. If a block of cells was previously selected it
1469 will expand if the argument is true or be cleared if the argument is false.
1471 \wxheading{Keyboard}\\
1472 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1476 \membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}
1478 \func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}
1480 Moves the grid cursor up in the current column such that it skips to the beginning or
1481 end of a block of non-empty cells. If a block of cells was previously selected it
1482 will expand if the argument is true or be cleared if the argument is false.
1484 \wxheading{Keyboard}\\
1485 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1489 \membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}
1491 \func{bool}{MovePageDown}{\void}
1493 Moves the grid cursor down by some number of rows so that the previous bottom visible row
1494 becomes the top visible row.
1496 \wxheading{Keyboard}\\
1497 This function is called for PgDn keypresses.
1501 \membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}
1503 \func{bool}{MovePageUp}{\void}
1505 Moves the grid cursor up by some number of rows so that the previous top visible row
1506 becomes the bottom visible row.
1508 \wxheading{Keyboard}\\
1509 This function is called for PgUp keypresses.
1513 \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1515 \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1517 Methods for a registry for mapping data types to Renderers/Editors
1521 \membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}
1523 \func{void}{SaveEditControlValue}{\void}
1525 Sets the value of the current grid cell to the current in-place edit control value.
1526 This is called automatically when the grid cursor moves from the current cell to a
1527 new cell. It is also a good idea to call this function when closing a grid since
1528 any edits to the final cell location will not be saved otherwise.
1532 \membersection{wxGrid::SelectAll}\label{wxgridselectall}
1534 \func{void}{SelectAll}{\void}
1536 Selects all cells in the grid.
1540 \membersection{wxGrid::SelectBlock}\label{wxgridselectblock}
1542 \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
1543 \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}
1545 \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
1546 \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}
1548 Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
1549 deselected; if true the column will be added to the existing selection.
1553 \membersection{wxGrid::SelectCol}\label{wxgridselectcol}
1555 \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}
1557 Selects the specified column. If addToSelected is false then any existing selection will be
1558 deselected; if true the column will be added to the existing selection.
1562 \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1564 \constfunc{wxRect}{SelectionToDeviceRect}{\void}
1566 This function returns the rectangle that encloses the selected cells
1567 in device coords and clipped to the client size of the grid window.
1571 \membersection{wxGrid::SelectRow}\label{wxgridselectrow}
1573 \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}
1575 Selects the specified row. If addToSelected is false then any existing selection will be
1576 deselected; if true the row will be added to the existing selection.
1580 \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1582 \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
1584 \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1586 Sets the horizontal and vertical alignment for grid cell text at the specified location.
1588 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
1589 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1593 \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1595 \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1599 \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
1601 \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
1603 Sets the editor for the grid cell at the specified location.
1604 The grid will take ownership of the pointer.
1606 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1607 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1611 \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
1613 \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}
1615 Sets the font for text in the grid cell at the specified location.
1619 \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
1621 \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
1623 Sets the renderer for the grid cell at the specified location.
1624 The grid will take ownership of the pointer.
1626 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1627 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1631 \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1633 \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1635 \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1637 \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}
1639 Sets the text colour for the grid cell at the specified location.
1643 \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1645 \func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
1647 \func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
1649 \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1651 Sets the string value for the cell at the specified location. For simple applications where a
1652 grid object automatically uses a default grid table of string values you use this function together
1653 with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
1655 For more complex applications where you have derived your own grid table class that contains
1656 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
1657 function for those cells that contain string values.
1659 The last form is for backward compatibility only.
1661 See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
1662 and the \helpref{wxGrid overview}{gridoverview} for more information.
1666 \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
1668 \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
1670 Sets the cell attributes for all cells in the specified column.
1672 For more information about controlling grid cell attributes see the
1673 \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
1674 \helpref{wxGrid classes overview}{gridoverview}.
1678 \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
1680 \func{void}{SetColFormatBool}{\param{int }{col}}
1682 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
1686 \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
1688 \func{void}{SetColFormatNumber}{\param{int }{col}}
1690 Sets the specified column to display integer values.
1694 \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
1696 \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
1698 Sets the specified column to display floating point values with the given width and precision.
1702 \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
1704 \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
1706 Sets the specified column to display data in a custom format.
1707 See the \helpref{wxGrid overview}{gridoverview} for more information on working
1708 with custom data types.
1712 \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
1714 \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1716 Sets the horizontal and vertical alignment of column label text.
1718 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1720 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1724 \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
1726 \func{void}{SetColLabelSize}{\param{int }{height}}
1728 Sets the height of the column labels.
1730 If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically
1731 so that no label is truncated. Note that this could be slow for a large table.
1735 \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
1737 \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}
1739 Set the value for the given column label. If you are using a derived grid table you must
1740 override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
1741 for this to have any effect.
1745 \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
1747 \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
1749 Sets the minimal width for the specified column. This should normally be called when creating the grid
1750 because it will not resize a column that is already narrower than the minimal width.
1751 The width argument must be higher than the minimimal acceptable column width, see
1752 \helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.
1756 \membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}
1758 \func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}
1760 This modifies the minimum column width that can be handled correctly. Specifying a low value here
1761 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1762 than the actual minimum size will incur a performance penalty in the functions which perform
1763 grid cell index lookup on the basis of screen coordinates.
1764 This should normally be called when creating the grid because it will not resize existing columns
1765 with sizes smaller than the value specified here.
1769 \membersection{wxGrid::SetColPos}\label{wxgridsetcolpos}
1771 \func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}}
1773 Sets the position of the specified column.
1777 \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
1779 \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
1781 Sets the width of the specified column.
1783 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1784 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1786 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1787 also be set as the minimal width for the column.
1790 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1791 The memory requirements for this could become prohibitive if your grid is very large.
1795 \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1797 \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1799 Sets the default horizontal and vertical alignment for grid cell text.
1801 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1803 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1807 \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1809 \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}
1811 Sets the default background colour for grid cells.
1815 \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1817 \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}
1819 Sets the default font to be used for grid cell text.
1823 \membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}
1825 \func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}
1827 Sets the current default colour for grid cell text.
1831 \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1833 \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1835 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1837 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1838 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1842 \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1844 \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1846 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1848 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1849 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1853 \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
1855 \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}
1857 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1858 the grid unless resizeExistingCols is true.
1862 \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1864 \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}
1866 Sets the default height for rows in the grid. This will only affect rows subsequently added
1867 to the grid unless resizeExistingRows is true.
1871 \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1873 \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
1875 Set the grid cursor to the specified cell.
1876 This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
1880 \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
1882 \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}
1884 Sets the colour used to draw grid lines.
1888 \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1890 \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}
1892 Sets the background colour for row and column labels.
1896 \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
1898 \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}
1900 Sets the font for row and column labels.
1904 \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1906 \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}
1908 Sets the colour for row and column label text.
1912 \membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1914 \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1916 A grid may occupy more space than needed for its rows/columns. This
1917 function allows to set how big this extra space is
1921 \membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1923 \func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1925 Common part of AutoSizeColumn/Row() and GetBestSize()
1929 \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1931 \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1935 \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1937 \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}
1939 Makes the cell at the specified location read-only or editable.
1940 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1944 \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
1946 \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
1948 Sets the cell attributes for all cells in the specified row.
1949 See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1950 about controlling cell attributes.
1954 \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
1956 \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1958 Sets the horizontal and vertical alignment of row label text.
1960 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1962 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1966 \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
1968 \func{void}{SetRowLabelSize}{\param{int }{width}}
1970 Sets the width of the row labels.
1972 If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically
1973 so that no label is truncated. Note that this could be slow for a large table.
1977 \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
1979 \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}
1981 Set the value for the given row label. If you are using a derived grid table you must
1982 override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
1983 for this to have any effect.
1987 \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
1989 \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}
1991 Sets the minimal height for the specified row. This should normally be called when creating the grid
1992 because it will not resize a row that is already shorter than the minimal height.
1993 The height argument must be higher than the minimimal acceptable row height, see
1994 \helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.
1998 \membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}
2000 \func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}
2002 This modifies the minimum row width that can be handled correctly. Specifying a low value here
2003 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
2004 than the actual minimum size will incur a performance penalty in the functions which perform
2005 grid cell index lookup on the basis of screen coordinates.
2006 This should normally be called when creating the grid because it will not resize existing rows
2007 with sizes smaller than the value specified here.
2011 \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
2013 \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
2015 Sets the height of the specified row.
2017 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
2018 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
2020 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
2021 also be set as the minimal width for the column.
2025 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
2026 The memory requirements for this could become prohibitive if your grid is very large.
2030 \membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex}
2032 \func{void}{SetScrollLineX}{\param{int }{x}}
2034 Sets the number of pixels per horizontal scroll increment. The default is 15.
2035 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
2036 errors: setting this to 1 can help.
2038 \wxheading{See also}
2040 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
2041 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
2042 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
2046 \membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney}
2048 \func{void}{SetScrollLineY}{\param{int }{y}}
2050 Sets the number of pixels per vertical scroll increment. The default is 15.
2051 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
2052 errors: setting this to 1 can help.
2054 \wxheading{See also}
2056 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
2057 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
2058 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex}
2062 \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
2064 \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
2068 \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
2070 \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
2074 \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
2076 \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}
2078 Set the selection behaviour of the grid.
2080 \wxheading{Parameters}
2082 \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
2084 \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
2086 \docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}
2090 \membersection{wxGrid::SetTable}\label{wxgridsettable}
2092 \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
2094 Passes a pointer to a custom grid table to be used by the grid. This should be called
2095 after the grid constructor and before using the grid object. If takeOwnership is set to
2096 true then the table will be deleted by the wxGrid destructor.
2098 Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
2099 application involves complex or non-string data or data sets that are too large to fit
2103 \membersection{wxGrid::SetUseNativeColLabels}\label{wxgridsetsenativecollabels}
2105 \func{void}{SetUseNativeColLabels}{\param{bool }{native= true}}
2107 Call this in order to make the column labels use a native look by using
2108 \helpref{wxRenderer::DrawHeaderButton}{wxrenderernativedrawheaderbutton}
2109 internally. There is no equivalent method for drawing row columns as
2110 there is not native look for that. This option is useful when using
2111 wxGrid for displaying tables and not as a spread-sheet.
2113 \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
2115 \func{void}{ShowCellEditControl}{\void}
2117 Displays the in-place cell edit control for the current cell.
2121 \membersection{wxGrid::XToCol}\label{wxgridxtocol}
2123 \constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}}
2125 \wxheading{Parameters}
2126 \docparam{x}{The x position to evaluate.}
2127 \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.}
2129 \wxheading{Return value}
2130 The grid column that corresponds to the logical x coordinate. Returns
2131 {\tt wxNOT\_FOUND} if there is no column at the x position.
2135 \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
2137 \constfunc{int}{XToEdgeOfCol}{\param{int }{x}}
2139 Returns the column whose right hand edge is close to the given logical x position.
2140 If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.
2144 \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
2146 \constfunc{int}{YToEdgeOfRow}{\param{int }{y}}
2148 Returns the row whose bottom edge is close to the given logical y position.
2149 If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.
2153 \membersection{wxGrid::YToRow}\label{wxgridytorow}
2155 \constfunc{int}{YToRow}{\param{int }{y}}
2157 Returns the grid row that corresponds to the logical y coordinate. Returns
2158 {\tt wxNOT\_FOUND} if there is no row at the y position.