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
}
109 \membersection{Display format
}\label{wxgriddisplayformat
}
113 \membersection{Selection functions
}\label{wxgridselectionfunctions
}
115 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
}\\
116 \helpref{wxGrid::IsSelection
}{wxgridisselection
}\\
117 \helpref{wxGrid::SelectAll
}{wxgridselectall
}\\
118 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
}\\
119 \helpref{wxGrid::SelectCol
}{wxgridselectcol
}\\
120 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
122 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
123 \helponly{\insertatlevel{2}{
131 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
133 \func{}{wxGrid
}{\void}
137 \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
}}
139 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
140 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
145 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
147 \func{}{\destruct{wxGrid
}}{\void}
149 Destructor. This will also destroy the associated grid table unless you passed a table
150 object to the grid and specified that the grid should not take ownership of the
151 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
155 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
157 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
159 Appends one or more new columns to the right of the grid and returns true if
160 successful. The updateLabels argument is not used at present.
162 If you are using a derived grid table class you will need to override
163 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
164 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
168 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
170 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
172 Appends one or more new rows to the bottom of the grid and returns true if
173 successful. The updateLabels argument is not used at present.
175 If you are using a derived grid table class you will need to override
176 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
177 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
181 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
183 \func{void
}{AutoSize
}{\void}
185 Automatically sets the height and width of all rows and columns to fit their contents.
188 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
189 The memory requirements for this could become prohibitive if your grid is very large.
193 \membersection{wxGrid::AutoSizeColLabelSize
}\label{wxgridautosizecollabelsize
}
195 \func{void
}{AutoSizeColLabelSize
}{\param{int
}{col
}}
197 Automatically adjusts width of the column to fit its label.
201 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
203 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = true
}}
205 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
206 also be set as the minimal width for the column.
209 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
210 The memory requirements for this could become prohibitive if your grid is very large.
214 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
216 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = true
}}
218 Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will
219 also be set as the minimal widths for the columns.
222 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
223 The memory requirements for this could become prohibitive if your grid is very large.
227 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
229 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = true
}}
231 Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will
232 also be set as the minimal height for the row.
235 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
236 The memory requirements for this could become prohibitive if your grid is very large.
240 \membersection{wxGrid::AutoSizeRowLabelSize
}\label{wxgridautosizerowlabelsize
}
242 \func{void
}{AutoSizeRowLabelSize
}{\param{int
}{col
}}
244 Automatically adjusts height of the row to fit its label.
248 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
250 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = true
}}
252 Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will
253 also be set as the minimal heights for the rows.
256 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
257 The memory requirements for this could become prohibitive if your grid is very large.
261 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
263 \func{void
}{BeginBatch
}{\void}
265 Increments the grid's batch count. When the count is greater than zero repainting of
266 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
267 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
268 modification can be enclosed between BeginBatch and EndBatch calls to avoid
269 screen flicker. The final EndBatch will cause the grid to be repainted.
273 \helpref{wxGridUpdateLocker
}{wxgridupdatelocker
}
277 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
279 \constfunc{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
281 This function returns the rectangle that encloses the block of cells
282 limited by TopLeft and BottomRight cell in device coords and clipped
283 to the client size of the grid window.
287 \membersection{wxGrid::CanDragColMove
}\label{wxgridcandragcolmove
}
289 \constfunc{bool
}{CanDragColMove
}{\void}
291 Returns true if columns can be moved by dragging with the mouse. Columns can be moved
292 by dragging on their labels.
296 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
298 \constfunc{bool
}{CanDragColSize
}{\void}
300 Returns true if columns can be resized by dragging with the mouse. Columns can be resized
301 by dragging the edges of their labels. If grid line dragging is enabled they can also be
302 resized by dragging the right edge of the column in the grid cell area
303 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
307 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
309 \constfunc{bool
}{CanDragRowSize
}{\void}
311 Returns true if rows can be resized by dragging with the mouse. Rows can be resized
312 by dragging the edges of their labels. If grid line dragging is enabled they can also be
313 resized by dragging the lower edge of the row in the grid cell area
314 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
318 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
320 \constfunc{bool
}{CanDragGridSize
}{\void}
322 Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.
326 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
328 \constfunc{bool
}{CanEnableCellControl
}{\void}
330 Returns true if the in-place edit control for the current grid cell can be used and
331 false otherwise (e.g. if the current cell is read-only).
335 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
337 \constfunc{bool
}{CanHaveAttributes
}{\void}
339 Do we have some place to store attributes in?
343 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
345 \constfunc{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
347 \constfunc{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
349 Return the rectangle corresponding to the grid cell's size and position in logical
354 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
356 \func{void
}{ClearGrid
}{\void}
358 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
359 this function. If you are using a derived table class then you need to override
360 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
364 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
366 \func{void
}{ClearSelection
}{\void}
368 Deselects all cells that are currently selected.
372 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
374 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
376 Creates a grid with the specified initial number of rows and columns.
377 Call this directly after the grid constructor. When you use this
378 function wxGrid will create and manage a simple table of string values
379 for you. All of the grid data will be stored in memory.
381 For applications with more complex data types or relationships, or for
382 dealing with very large datasets, you should derive your own grid table
383 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
387 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
389 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = true
}}
391 Deletes one or more columns from a grid starting at the specified position and returns
392 true if successful. The updateLabels argument is not used at present.
394 If you are using a derived grid table class you will need to override
395 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
396 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
400 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
402 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = true
}}
404 Deletes one or more rows from a grid starting at the specified position and returns
405 true if successful. The updateLabels argument is not used at present.
407 If you are using a derived grid table class you will need to override
408 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
409 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
413 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
415 \func{void
}{DisableCellEditControl
}{\void}
417 Disables in-place editing of grid cells.
418 Equivalent to calling EnableCellEditControl(false).
422 \membersection{wxGrid::DisableDragColMove
}\label{wxgriddisabledragcolmove
}
424 \func{void
}{DisableDragColMove
}{\void}
426 Disables column moving by dragging with the mouse. Equivalent to passing false to
427 \helpref{wxGrid::EnableDragColMove
}{wxgridenabledragcolmove
}.
431 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
433 \func{void
}{DisableDragColSize
}{\void}
435 Disables column sizing by dragging with the mouse. Equivalent to passing false to
436 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
440 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
442 \func{void
}{DisableDragGridSize
}{\void}
444 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
445 false to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
449 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
451 \func{void
}{DisableDragRowSize
}{\void}
453 Disables row sizing by dragging with the mouse. Equivalent to passing false to
454 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
458 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
460 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = true
}}
462 Enables or disables in-place editing of grid cell data. The grid will issue either a
463 wxEVT
\_GRID\_EDITOR\_SHOWN or wxEVT
\_GRID\_EDITOR\_HIDDEN event.
467 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
469 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = true
}}
471 Enables or disables column sizing by dragging with the mouse.
475 \membersection{wxGrid::EnableDragColMove
}\label{wxgridenabledragcolmove
}
477 \func{void
}{EnableDragColMove
}{\param{bool
}{enable = true
}}
479 Enables or disables column moving by dragging with the mouse.
483 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
485 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = true
}}
487 Enables or disables row and column resizing by dragging gridlines with the mouse.
491 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
493 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = true
}}
495 Enables or disables row sizing by dragging with the mouse.
499 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
501 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
503 If the edit argument is false this function sets the whole grid as read-only. If the
504 argument is true the grid is set to the default state where cells may be editable. In the
505 default state you can set single grid cells and whole rows and columns to be editable or
507 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
508 cells you can also use the shortcut function
509 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
511 For more information about controlling grid cell attributes see the
512 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
513 \helpref{wxGrid classes overview
}{gridoverview
}.
517 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
519 \func{void
}{EnableGridLines
}{\param{bool
}{enable = true
}}
521 Turns the drawing of grid lines on or off.
525 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
527 \func{void
}{EndBatch
}{\void}
529 Decrements the grid's batch count. When the count is greater than zero repainting of
530 the grid is suppressed. Each previous call to
531 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
532 EndBatch. Code that does a lot of grid modification can be enclosed between
533 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
534 cause the grid to be repainted.
538 \helpref{wxGridUpdateLocker
}{wxgridupdatelocker
}
542 \membersection{wxGrid::Fit
}\label{wxgridfit
}
544 \func{void
}{Fit
}{\void}
546 Overridden wxWindow method.
550 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
552 \func{void
}{ForceRefresh
}{\void}
554 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
558 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
560 \constfunc{int
}{GetBatchCount
}{\void}
562 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
563 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
564 the grid's batch count is greater than zero the display will not be updated.
568 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
570 \constfunc{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
572 Sets the arguments to the horizontal and vertical text alignment values for the
573 grid cell at the specified location.
575 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
576 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
578 \perlnote{This method only takes the parameters
{\tt row
} and
{\tt col
} and
579 returns a
2-element list
{\tt ( horiz, vert )
}.
}
583 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
585 \constfunc{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
587 Returns the background colour of the cell at the specified location.
591 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
593 \constfunc{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
595 Returns a pointer to the editor for the cell at the specified location.
597 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
598 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
602 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
604 \constfunc{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
606 Returns the font for text in the grid cell at the specified location.
610 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
612 \constfunc{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
614 Returns a pointer to the renderer for the grid cell at the specified location.
616 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
617 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
621 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
623 \constfunc{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
625 Returns the text colour for the grid cell at the specified location.
629 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
631 \constfunc{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
633 \constfunc{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
635 Returns the string contained in the cell at the specified location. For simple applications where a
636 grid object automatically uses a default grid table of string values you use this function together
637 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
639 For more complex applications where you have derived your own grid table class that contains
640 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
641 function for those cells that contain string values.
643 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
644 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
648 \membersection{wxGrid::GetColAt
}\label{wxgridgetcolat
}
650 \constfunc{int
}{GetColAt
}{\param{int
}{colPos
}}
652 Returns the column ID of the specified column position.
655 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
657 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
661 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
663 \constfunc{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
665 Sets the arguments to the current column label alignment values.
667 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT.\\
668 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
670 \perlnote{This method takes no parameters and
671 returns a
2-element list
{\tt ( horiz, vert )
}.
}
675 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
677 \constfunc{int
}{GetColLabelSize
}{\void}
679 Returns the current height of the column labels.
683 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
685 \constfunc{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
687 Returns the specified column label. The default grid table class provides column labels of
688 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
689 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
694 \membersection{wxGrid::GetColMinimalAcceptableWidth
}\label{wxgridgetcolminimalacceptablewidth
}
696 \constfunc{int
}{GetColMinimalAcceptableWidth
}{}
698 This returns the value of the lowest column width that can be handled correctly. See
699 member
\helpref{SetColMinimalAcceptableWidth
}{wxgridsetcolminimalacceptablewidth
} for details.
703 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
705 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
707 Get the minimal width of the given column/row.
711 \membersection{wxGrid::GetColPos
}\label{wxgridgetcolpos
}
713 \constfunc{int
}{GetColPos
}{\param{int
}{colID
}}
715 Returns the position of the specified column.
719 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
721 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
725 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
727 \constfunc{int
}{GetColSize
}{\param{int
}{col
}}
729 Returns the width of the specified column.
733 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
735 \constfunc{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
737 Sets the arguments to the current default horizontal and vertical text alignment
740 Horizontal alignment will be one of wxALIGN
\_LEFT, wxALIGN
\_CENTRE or wxALIGN
\_RIGHT. \\
741 Vertical alignment will be one of wxALIGN
\_TOP, wxALIGN
\_CENTRE or wxALIGN
\_BOTTOM.
745 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
747 \constfunc{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
749 Returns the current default background colour for grid cells.
753 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
755 \constfunc{wxFont
}{GetDefaultCellFont
}{\void}
757 Returns the current default font for grid cell text.
761 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
763 \constfunc{wxColour
}{GetDefaultCellTextColour
}{\void}
765 Returns the current default colour for grid cell text.
769 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
771 \constfunc{int
}{GetDefaultColLabelSize
}{\void}
773 Returns the default height for column labels.
777 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
779 \constfunc{int
}{GetDefaultColSize
}{\void}
781 Returns the current default width for grid columns.
785 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
787 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
789 Returns a pointer to the current default grid cell editor.
791 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
792 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
796 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
798 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
800 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
804 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
806 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
810 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
812 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
814 Returns a pointer to the current default grid cell renderer.
816 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
817 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
821 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
823 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
827 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
829 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
833 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
835 \constfunc{int
}{GetDefaultRowLabelSize
}{\void}
837 Returns the default width for the row labels.
841 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
843 \constfunc{int
}{GetDefaultRowSize
}{\void}
845 Returns the current default height for grid rows.
849 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
851 \constfunc{int
}{GetGridCursorCol
}{\void}
853 Returns the current grid cell column position.
857 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
859 \constfunc{int
}{GetGridCursorRow
}{\void}
861 Returns the current grid cell row position.
865 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
867 \constfunc{wxColour
}{GetGridLineColour
}{\void}
869 Returns the colour used for grid lines.
873 \helpref{GetDefaultGridLinePen()
}{wxgridgetdefaultgridlinepen
}
876 \membersection{wxGrid::GetDefaultGridLinePen
}\label{wxgridgetdefaultgridlinepen
}
878 \func{wxPen
}{GetDefaultGridLinePen
}{\void}
880 Returns the pen used for grid lines. This virtual function may be overridden in
881 derived classes in order to change the appearance of grid lines. Note that
882 currently the pen width must be $
1$.
886 \helpref{GetColGridLinePen()
}{wxgridgetcolgridlinepen
},\\
887 \helpref{GetRowGridLinePen()
}{wxgridgetrowgridlinepen
}
892 \membersection{wxGrid::GetRowGridLinePen
}\label{wxgridgetrowgridlinepen
}
894 \func{wxPen
}{GetRowGridLinePen
}{\param{int
}{row
}}
896 Returns the pen used for horizontal grid lines. This virtual function may be
897 overridden in derived classes in order to change the appearance of individual
898 grid line for the given row
\arg{row
}.
903 // in a grid displaying music notation, use a solid black pen between
904 // octaves (C0=row
127, C1=row
115 etc.)
905 wxPen MidiGrid::GetRowGridLinePen(int row)
908 return wxPen
(*wxBLACK, 1, wxSOLID);
910 return GetDefaultGridLinePen();
916 \membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen}
918 \func{wxPen}{GetColGridLinePen}{\param{int }{col}}
920 Returns the pen used for vertical grid lines. This virtual function may be
921 overridden in derived classes in order to change the appearance of individual
922 grid lines for the given column \arg{col}.
924 See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example.
929 \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled}
931 \constfunc{bool}{GridLinesEnabled}{\void}
933 Returns true if drawing of grid lines is turned on, false otherwise.
937 \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
939 \constfunc{wxColour}{GetLabelBackgroundColour}{\void}
941 Returns the colour used for the background of row and column labels.
945 \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont}
947 \constfunc{wxFont}{GetLabelFont}{\void}
949 Returns the font used for row and column labels.
953 \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
955 \constfunc{wxColour}{GetLabelTextColour}{\void}
957 Returns the colour used for row and column label text.
961 \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols}
963 \constfunc{int}{GetNumberCols}{\void}
965 Returns the total number of grid columns (actually the number of columns in the underlying grid
970 \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows}
972 \constfunc{int}{GetNumberRows}{\void}
974 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
978 \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr}
980 \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}}
984 \membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight}
986 \constfunc{int}{GetRowMinimalAcceptableHeight}{}
988 This returns the value of the lowest row width that can be handled correctly. See
989 member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details.
993 \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight}
995 \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}}
999 \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment}
1001 \constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}}
1003 Sets the arguments to the current row label alignment values.
1005 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
1006 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
1008 \perlnote{This method takes no parameters and
1009 returns a 2-element list {\tt ( horiz, vert )}.}
1013 \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize}
1015 \constfunc{int}{GetRowLabelSize}{\void}
1017 Returns the current width of the row labels.
1021 \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue}
1023 \constfunc{wxString}{GetRowLabelValue}{\param{int }{row}}
1025 Returns the specified row label. The default grid table class provides numeric row labels.
1026 If you are using a custom grid table you can override
1027 \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide
1032 \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize}
1034 \constfunc{int}{GetRowSize}{\param{int }{row}}
1036 Returns the height of the specified row.
1040 \membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex}
1042 \constfunc{int}{GetScrollLineX}{\void}
1044 Returns the number of pixels per horizontal scroll increment. The default is 15.
1046 \wxheading{See also}
1048 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1049 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1050 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1054 \membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney}
1056 \constfunc{int}{GetScrollLineY}{\void}
1058 Returns the number of pixels per vertical scroll increment. The default is 15.
1060 \wxheading{See also}
1062 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1063 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp
1064 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1068 \membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode}
1070 \constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void}
1072 Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}.
1076 \membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells}
1078 \constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void}
1080 Returns an array of singly selected cells.
1084 \membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols}
1086 \constfunc{wxArrayInt}{GetSelectedCols}{\void}
1088 Returns an array of selected cols.
1092 \membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows}
1094 \constfunc{wxArrayInt}{GetSelectedRows}{\void}
1096 Returns an array of selected rows.
1100 \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground}
1102 \constfunc{wxColour}{GetSelectionBackground}{\void}
1104 Access or update the selection fore/back colours
1108 \membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft}
1110 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void}
1112 Returns an array of the top left corners of blocks of selected cells,
1113 see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}.
1117 \membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright}
1119 \constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void}
1121 Returns an array of the bottom right corners of blocks of selected cells,
1122 see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}.
1126 \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground}
1128 \constfunc{wxColour}{GetSelectionForeground}{\void}
1132 \membersection{wxGrid::GetTable}\label{wxgridgettable}
1134 \constfunc{wxGridTableBase *}{GetTable}{\void}
1136 Returns a base pointer to the current table object.
1140 \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth}
1142 \constfunc{int}{GetViewWidth}{\void}
1144 Returned number of whole cols visible.
1148 \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol}
1150 \func{void}{HideCellEditControl}{\void}
1152 Hides the in-place cell edit control.
1156 \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths}
1158 \func{void}{InitColWidths}{\void}
1160 Init the m\_colWidths/Rights arrays
1164 \membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights}
1166 \func{void}{InitRowHeights}{\void}
1168 NB: {\it never} access m\_row/col arrays directly because they are created
1169 on demand, {\it always} use accessor functions instead!
1171 Init the m\_rowHeights/Bottoms arrays with default values.
1175 \membersection{wxGrid::InsertCols}\label{wxgridinsertcols}
1177 \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}}
1179 Inserts one or more new columns into a grid with the first new column at the
1180 specified position and returns true if successful. The updateLabels argument is not
1183 The sequence of actions begins with the grid object requesting the underlying grid
1184 table to insert new columns. If this is successful the table notifies the grid and the
1185 grid updates the display. For a default grid (one where you have called
1186 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1187 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1188 then you must override
1189 \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived
1194 \membersection{wxGrid::InsertRows}\label{wxgridinsertrows}
1196 \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}}
1198 Inserts one or more new rows into a grid with the first new row at the specified
1199 position and returns true if successful. The updateLabels argument is not used at
1202 The sequence of actions begins with the grid object requesting the underlying grid
1203 table to insert new rows. If this is successful the table notifies the grid and the
1204 grid updates the display. For a default grid (one where you have called
1205 \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are
1206 using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable})
1207 then you must override
1208 \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived
1213 \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled}
1215 \constfunc{bool}{IsCellEditControlEnabled}{\void}
1217 Returns true if the in-place edit control is currently enabled.
1221 \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly}
1223 \constfunc{bool}{IsCurrentCellReadOnly}{\void}
1225 Returns true if the current cell has been set to read-only
1226 (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}).
1230 \membersection{wxGrid::IsEditable}\label{wxgridiseditable}
1232 \constfunc{bool}{IsEditable}{\void}
1234 Returns false if the whole grid has been set as read-only or true otherwise.
1235 See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about
1236 controlling the editing status of grid cells.
1240 \membersection{wxGrid::IsInSelection}\label{wxgridisinselection}
1242 \constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}}
1244 \constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}}
1246 Is this cell currently selected.
1250 \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly}
1252 \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}}
1254 Returns true if the cell at the specified location can't be edited.
1255 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1259 \membersection{wxGrid::IsSelection}\label{wxgridisselection}
1261 \constfunc{bool}{IsSelection}{\void}
1263 Returns true if there are currently rows, columns or blocks of cells selected.
1267 \membersection{wxGrid::IsVisible}\label{wxgridisvisible}
1269 \constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}}
1271 \constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}}
1273 Returns true if a cell is either wholly visible (the default) or at least partially
1274 visible in the grid window.
1278 \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible}
1280 \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}}
1282 \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}}
1284 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
1285 nothing if the cell is already visible.
1289 \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown}
1291 \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}}
1293 Moves the grid cursor down by one row. If a block of cells was previously selected it
1294 will expand if the argument is true or be cleared if the argument is false.
1296 \wxheading{Keyboard}\\
1297 This function is called for Down cursor key presses or Shift+Down to expand a selection.
1301 \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft}
1303 \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}}
1305 Moves the grid cursor left by one column. If a block of cells was previously selected it
1306 will expand if the argument is true or be cleared if the argument is false.
1308 \wxheading{Keyboard}\\
1309 This function is called for Left cursor key presses or Shift+Left to expand a selection.
1313 \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright}
1315 \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}}
1317 Moves the grid cursor right by one column. If a block of cells was previously selected it
1318 will expand if the argument is true or be cleared if the argument is false.
1320 \wxheading{Keyboard}\\
1321 This function is called for Right cursor key presses or Shift+Right to expand a selection.
1325 \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup}
1327 \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}}
1329 Moves the grid cursor up by one row. If a block of cells was previously selected it
1330 will expand if the argument is true or be cleared if the argument is false.
1332 \wxheading{Keyboard}\\
1333 This function is called for Up cursor key presses or Shift+Up to expand a selection.
1337 \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock}
1339 \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}}
1341 Moves the grid cursor down in the current column such that it skips to the beginning or
1342 end of a block of non-empty cells. If a block of cells was previously selected it
1343 will expand if the argument is true or be cleared if the argument is false.
1345 \wxheading{Keyboard}\\
1346 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
1350 \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock}
1352 \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}}
1354 Moves the grid cursor left in the current row such that it skips to the beginning or
1355 end of a block of non-empty cells. If a block of cells was previously selected it
1356 will expand if the argument is true or be cleared if the argument is false.
1358 \wxheading{Keyboard}\\
1359 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
1363 \membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock}
1365 \func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}}
1367 Moves the grid cursor right in the current row such that it skips to the beginning or
1368 end of a block of non-empty cells. If a block of cells was previously selected it
1369 will expand if the argument is true or be cleared if the argument is false.
1371 \wxheading{Keyboard}\\
1372 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
1376 \membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock}
1378 \func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}}
1380 Moves the grid cursor up in the current column such that it skips to the beginning or
1381 end of a block of non-empty cells. If a block of cells was previously selected it
1382 will expand if the argument is true or be cleared if the argument is false.
1384 \wxheading{Keyboard}\\
1385 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
1389 \membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown}
1391 \func{bool}{MovePageDown}{\void}
1393 Moves the grid cursor down by some number of rows so that the previous bottom visible row
1394 becomes the top visible row.
1396 \wxheading{Keyboard}\\
1397 This function is called for PgDn keypresses.
1401 \membersection{wxGrid::MovePageUp}\label{wxgridmovepageup}
1403 \func{bool}{MovePageUp}{\void}
1405 Moves the grid cursor up by some number of rows so that the previous top visible row
1406 becomes the bottom visible row.
1408 \wxheading{Keyboard}\\
1409 This function is called for PgUp keypresses.
1413 \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype}
1415 \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}}
1417 Methods for a registry for mapping data types to Renderers/Editors
1421 \membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue}
1423 \func{void}{SaveEditControlValue}{\void}
1425 Sets the value of the current grid cell to the current in-place edit control value.
1426 This is called automatically when the grid cursor moves from the current cell to a
1427 new cell. It is also a good idea to call this function when closing a grid since
1428 any edits to the final cell location will not be saved otherwise.
1432 \membersection{wxGrid::SelectAll}\label{wxgridselectall}
1434 \func{void}{SelectAll}{\void}
1436 Selects all cells in the grid.
1440 \membersection{wxGrid::SelectBlock}\label{wxgridselectblock}
1442 \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol},
1443 \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}}
1445 \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft},
1446 \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}}
1448 Selects a rectangular block of cells. If addToSelected is false then any existing selection will be
1449 deselected; if true the column will be added to the existing selection.
1453 \membersection{wxGrid::SelectCol}\label{wxgridselectcol}
1455 \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}}
1457 Selects the specified column. If addToSelected is false then any existing selection will be
1458 deselected; if true the column will be added to the existing selection.
1462 \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect}
1464 \constfunc{wxRect}{SelectionToDeviceRect}{\void}
1466 This function returns the rectangle that encloses the selected cells
1467 in device coords and clipped to the client size of the grid window.
1471 \membersection{wxGrid::SelectRow}\label{wxgridselectrow}
1473 \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}}
1475 Selects the specified row. If addToSelected is false then any existing selection will be
1476 deselected; if true the row will be added to the existing selection.
1480 \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment}
1482 \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}}
1484 \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}}
1486 Sets the horizontal and vertical alignment for grid cell text at the specified location.
1488 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\
1489 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1493 \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour}
1495 \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1499 \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor}
1501 \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}}
1503 Sets the editor for the grid cell at the specified location.
1504 The grid will take ownership of the pointer.
1506 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1507 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1511 \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont}
1513 \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}}
1515 Sets the font for text in the grid cell at the specified location.
1519 \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer}
1521 \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}}
1523 Sets the renderer for the grid cell at the specified location.
1524 The grid will take ownership of the pointer.
1526 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1527 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1531 \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour}
1533 \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}}
1535 \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}}
1537 \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}}
1539 Sets the text colour for the grid cell at the specified location.
1543 \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue}
1545 \func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}}
1547 \func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}}
1549 \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}}
1551 Sets the string value for the cell at the specified location. For simple applications where a
1552 grid object automatically uses a default grid table of string values you use this function together
1553 with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values.
1555 For more complex applications where you have derived your own grid table class that contains
1556 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
1557 function for those cells that contain string values.
1559 The last form is for backward compatibility only.
1561 See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas}
1562 and the \helpref{wxGrid overview}{gridoverview} for more information.
1566 \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr}
1568 \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}}
1570 Sets the cell attributes for all cells in the specified column.
1572 For more information about controlling grid cell attributes see the
1573 \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the
1574 \helpref{wxGrid classes overview}{gridoverview}.
1578 \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool}
1580 \func{void}{SetColFormatBool}{\param{int }{col}}
1582 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
1586 \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber}
1588 \func{void}{SetColFormatNumber}{\param{int }{col}}
1590 Sets the specified column to display integer values.
1594 \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat}
1596 \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}}
1598 Sets the specified column to display floating point values with the given width and precision.
1602 \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom}
1604 \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}}
1606 Sets the specified column to display data in a custom format.
1607 See the \helpref{wxGrid overview}{gridoverview} for more information on working
1608 with custom data types.
1612 \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment}
1614 \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1616 Sets the horizontal and vertical alignment of column label text.
1618 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1620 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1624 \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize}
1626 \func{void}{SetColLabelSize}{\param{int }{height}}
1628 Sets the height of the column labels.
1630 If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically
1631 so that no label is truncated. Note that this could be slow for a large table.
1635 \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue}
1637 \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}}
1639 Set the value for the given column label. If you are using a derived grid table you must
1640 override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue}
1641 for this to have any effect.
1645 \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth}
1647 \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}}
1649 Sets the minimal width for the specified column. This should normally be called when creating the grid
1650 because it will not resize a column that is already narrower than the minimal width.
1651 The width argument must be higher than the minimimal acceptable column width, see
1652 \helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}.
1656 \membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth}
1658 \func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}}
1660 This modifies the minimum column width that can be handled correctly. Specifying a low value here
1661 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1662 than the actual minimum size will incur a performance penalty in the functions which perform
1663 grid cell index lookup on the basis of screen coordinates.
1664 This should normally be called when creating the grid because it will not resize existing columns
1665 with sizes smaller than the value specified here.
1669 \membersection{wxGrid::SetColPos}\label{wxgridsetcolpos}
1671 \func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}}
1673 Sets the position of the specified column.
1677 \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize}
1679 \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}}
1681 Sets the width of the specified column.
1683 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1684 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1686 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1687 also be set as the minimal width for the column.
1690 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1691 The memory requirements for this could become prohibitive if your grid is very large.
1695 \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment}
1697 \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}}
1699 Sets the default horizontal and vertical alignment for grid cell text.
1701 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1703 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1707 \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour}
1709 \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}}
1711 Sets the default background colour for grid cells.
1715 \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont}
1717 \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}}
1719 Sets the default font to be used for grid cell text.
1723 \membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour}
1725 \func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}}
1727 Sets the current default colour for grid cell text.
1731 \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor}
1733 \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}}
1735 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1737 See \helpref{wxGridCellEditor}{wxgridcelleditor} and
1738 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1742 \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer}
1744 \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}}
1746 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1748 See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and
1749 the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers.
1753 \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize}
1755 \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}}
1757 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1758 the grid unless resizeExistingCols is true.
1762 \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize}
1764 \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}}
1766 Sets the default height for rows in the grid. This will only affect rows subsequently added
1767 to the grid unless resizeExistingRows is true.
1771 \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor}
1773 \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}}
1775 Set the grid cursor to the specified cell.
1776 This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}.
1780 \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour}
1782 \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}}
1784 Sets the colour used to draw grid lines.
1788 \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour}
1790 \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}}
1792 Sets the background colour for row and column labels.
1796 \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont}
1798 \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}}
1800 Sets the font for row and column labels.
1804 \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour}
1806 \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}}
1808 Sets the colour for row and column label text.
1812 \membersection{wxGrid::SetMargins}\label{wxgridsetmargins}
1814 \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}}
1816 A grid may occupy more space than needed for its rows/columns. This
1817 function allows to set how big this extra space is
1821 \membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes}
1823 \func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1825 Common part of AutoSizeColumn/Row() and GetBestSize()
1829 \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes}
1831 \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}}
1835 \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly}
1837 \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}}
1839 Makes the cell at the specified location read-only or editable.
1840 See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}.
1844 \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr}
1846 \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}}
1848 Sets the cell attributes for all cells in the specified row.
1849 See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information
1850 about controlling cell attributes.
1854 \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment}
1856 \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}}
1858 Sets the horizontal and vertical alignment of row label text.
1860 Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.
1862 Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM.
1866 \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize}
1868 \func{void}{SetRowLabelSize}{\param{int }{width}}
1870 Sets the width of the row labels.
1872 If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically
1873 so that no label is truncated. Note that this could be slow for a large table.
1877 \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue}
1879 \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}}
1881 Set the value for the given row label. If you are using a derived grid table you must
1882 override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue}
1883 for this to have any effect.
1887 \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight}
1889 \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}}
1891 Sets the minimal height for the specified row. This should normally be called when creating the grid
1892 because it will not resize a row that is already shorter than the minimal height.
1893 The height argument must be higher than the minimimal acceptable row height, see
1894 \helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}.
1898 \membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight}
1900 \func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}}
1902 This modifies the minimum row width that can be handled correctly. Specifying a low value here
1903 allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller
1904 than the actual minimum size will incur a performance penalty in the functions which perform
1905 grid cell index lookup on the basis of screen coordinates.
1906 This should normally be called when creating the grid because it will not resize existing rows
1907 with sizes smaller than the value specified here.
1911 \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize}
1913 \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}}
1915 Sets the height of the specified row.
1917 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1918 block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes.
1920 Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will
1921 also be set as the minimal width for the column.
1925 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1926 The memory requirements for this could become prohibitive if your grid is very large.
1930 \membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex}
1932 \func{void}{SetScrollLineX}{\param{int }{x}}
1934 Sets the number of pixels per horizontal scroll increment. The default is 15.
1935 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1936 errors: setting this to 1 can help.
1938 \wxheading{See also}
1940 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1941 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1942 \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney}
1946 \membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney}
1948 \func{void}{SetScrollLineY}{\param{int }{y}}
1950 Sets the number of pixels per vertical scroll increment. The default is 15.
1951 Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding
1952 errors: setting this to 1 can help.
1954 \wxheading{See also}
1956 \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp
1957 \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp
1958 \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex}
1962 \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground}
1964 \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}}
1968 \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground}
1970 \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}}
1974 \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode}
1976 \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}}
1978 Set the selection behaviour of the grid.
1980 \wxheading{Parameters}
1982 \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.}
1984 \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.}
1986 \docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.}
1990 \membersection{wxGrid::SetTable}\label{wxgridsettable}
1992 \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}}
1994 Passes a pointer to a custom grid table to be used by the grid. This should be called
1995 after the grid constructor and before using the grid object. If takeOwnership is set to
1996 true then the table will be deleted by the wxGrid destructor.
1998 Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your
1999 application involves complex or non-string data or data sets that are too large to fit
2004 \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol}
2006 \func{void}{ShowCellEditControl}{\void}
2008 Displays the in-place cell edit control for the current cell.
2012 \membersection{wxGrid::XToCol}\label{wxgridxtocol}
2014 \constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}}
2016 \wxheading{Parameters}
2017 \docparam{x}{The x position to evaluate.}
2018 \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.}
2020 \wxheading{Return value}
2021 The grid column that corresponds to the logical x coordinate. Returns
2022 {\tt wxNOT\_FOUND} if there is no column at the x position.
2026 \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol}
2028 \constfunc{int}{XToEdgeOfCol}{\param{int }{x}}
2030 Returns the column whose right hand edge is close to the given logical x position.
2031 If no column edge is near to this position {\tt wxNOT\_FOUND} is returned.
2035 \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow}
2037 \constfunc{int}{YToEdgeOfRow}{\param{int }{y}}
2039 Returns the row whose bottom edge is close to the given logical y position.
2040 If no row edge is near to this position {\tt wxNOT\_FOUND} is returned.
2044 \membersection{wxGrid::YToRow}\label{wxgridytorow}
2046 \constfunc{int}{YToRow}{\param{int }{y}}
2048 Returns the grid row that corresponds to the logical y coordinate. Returns
2049 {\tt wxNOT\_FOUND} if there is no row at the y position.