1 \section{\class{wxGrid
}}\label{wxgrid
}
3 wxGrid and its related classes are used for displaying and editing tabular
4 data. They provide a rich set of features for display, editing, and
5 interacting with a variety of data sources. For simple applications, and to
6 help you get started, wxGrid is the only class you need to refer to
7 directly. It will set up default instances of the other classes and manage
8 them for you. For more complex applications you can derive your own
9 classes for custom grid views, grid data tables, cell editors and
10 renderers. The
\helpref{wxGrid classes overview
}{gridoverview
} has
11 examples of simple and more complex applications, explains the
12 relationship between the various grid classes and has a summary of the
13 keyboard shortcuts and mouse functions provided by wxGrid.
15 wxGrid has been greatly expanded and redesigned for wxWindows
2.2
16 onwards. If you have been using the old wxGrid class you will probably
17 want to have a look at the
\helpref{wxGrid classes
18 overview
}{gridoverview
} to see how things have changed. The new grid
19 classes are reasonably backward-compatible but there are some
20 exceptions. There are also easier ways of doing many things compared to
21 the previous implementation.
24 \wxheading{Derived from
}
26 % UNCOMMENT THIS BEFORE COMMITTING TO CVS
28 \helpref{wxScrolledWindow
}{wxscrolledwindow
}\\
29 \helpref{wxWindow
}{wxwindow
}\\
30 \helpref{wxEvtHandler
}{wxevthandler
}\\
31 \helpref{wxObject
}{wxobject
}
34 \wxheading{Include files
}
38 \wxheading{Window styles
}
40 There are presently no specific window styles for wxGrid.
42 \wxheading{Event handling
}
46 \helpref{wxGrid overview
}{gridoverview
}
48 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
49 \latexignore{\rtfignore{\wxheading{Function groups
}}}
51 \membersection{Constructors and initialization
}
53 \helpref{wxGrid
}{wxgridctor
} \\
54 \helpref{\destruct{wxGrid
}}{wxgriddtor
} \\
55 \helpref{CreateGrid
}{wxgridcreategrid
} \\
56 \helpref{SetTable
}{wxgridsettable
}
58 \membersection{Display format
}
60 \membersection{Selection functions
}
62 \helpref{wxGrid::ClearSelection
}{wxgridclearselection
} \\
63 \helpref{wxGrid::IsSelection
}{wxgridisselection
} \\
64 \helpref{wxGrid::SelectAll
}{wxgridselectall
} \\
65 \helpref{wxGrid::SelectBlock
}{wxgridselectblock
} \\
66 \helpref{wxGrid::SelectCol
}{wxgridselectcol
} \\
67 \helpref{wxGrid::SelectRow
}{wxgridselectrow
}
69 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
70 \helponly{\insertatlevel{2}{
76 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
78 \func{}{wxGrid
}{\void}
82 \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
}}
84 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
85 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
88 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
90 \func{}{\destruct{wxGrid
}}{\void}
92 Destructor. This will also destroy the associated grid table unless you passed a table
93 object to the grid and specified that the grid should not take ownership of the
94 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
96 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
98 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
100 Appends one or more new columns to the right of the grid and returns TRUE if
101 successful. The updateLabels argument is not used at present.
103 If you are using a derived grid table class you will need to override
104 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
105 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
107 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
109 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
111 Appends one or more new rows to the bottom of the grid and returns TRUE if
112 successful. The updateLabels argument is not used at present.
114 If you are using a derived grid table class you will need to override
115 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
116 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
118 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
120 \func{void
}{AutoSize
}{\void}
122 Automatically sets the height and width of all rows and columns to fit their contents.
125 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
126 The memory requirements for this could become prohibitive if your grid is very large.
128 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
130 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = TRUE
}}
132 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
133 also be set as the minimal width for the column.
136 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
137 The memory requirements for this could become prohibitive if your grid is very large.
139 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
141 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = TRUE
}}
143 Automatically sizes all columns to fit their contents. If setAsMin is TRUE the calculated widths will
144 also be set as the minimal widths for the columns.
147 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
148 The memory requirements for this could become prohibitive if your grid is very large.
150 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
152 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = TRUE
}}
154 Automatically sizes the row to fit its contents. If setAsMin is TRUE the calculated height will
155 also be set as the minimal height for the row.
158 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
159 The memory requirements for this could become prohibitive if your grid is very large.
161 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
163 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = TRUE
}}
165 Automatically sizes all rows to fit their contents. If setAsMin is TRUE the calculated heights will
166 also be set as the minimal heights for the rows.
169 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
170 The memory requirements for this could become prohibitive if your grid is very large.
172 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
174 \func{void
}{BeginBatch
}{\void}
176 Increments the grid's batch count. When the count is greater than zero repainting of
177 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
178 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
179 modification can be enclosed between BeginBatch and EndBatch calls to avoid
180 screen flicker. The final EndBatch will cause the grid to be repainted.
182 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
184 \func{bool
}{CanDragColSize
}{\void}
186 Returns TRUE if columns can be resized by dragging with the mouse. Columns can be resized
187 by dragging the edges of their labels. If grid line dragging is enabled they can also be
188 resized by dragging the right edge of the column in the grid cell area
189 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
191 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
193 \func{bool
}{CanDragRowSize
}{\void}
195 Returns TRUE if rows can be resized by dragging with the mouse. Rows can be resized
196 by dragging the edges of their labels. If grid line dragging is enabled they can also be
197 resized by dragging the lower edge of the row in the grid cell area
198 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
200 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
202 \func{bool
}{CanDragGridSize
}{\void}
204 Return TRUE if the dragging of grid lines to resize rows and columns is enabled or FALSE otherwise.
206 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
208 \constfunc{bool
}{CanEnableCellControl
}{\void}
210 Returns TRUE if the in-place edit control for the current grid cell can be used and
211 FALSE otherwise (e.g. if the current cell is read-only).
213 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
215 \func{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
217 \func{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
219 Return the rectangle corresponding to the grid cell's size and position in logical
222 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
224 \func{void
}{ClearGrid
}{\void}
226 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
227 this function. If you are using a derived table class then you need to override
228 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
230 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
232 \func{void
}{ClearSelection
}{\void}
234 Deselects all cells that are currently selected.
236 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
238 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
240 Creates a grid with the specified initial number of rows and columns.
241 Call this directly after the grid constructor. When you use this
242 function wxGrid will create and manage a simple table of string values
243 for you. All of the grid data will be stored in memory.
245 For applications with more complex data types or relationships, or for
246 dealing with very large datasets, you should derive your own grid table
247 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
249 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
251 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
253 Deletes one or more columns from a grid starting at the specified position and returns
254 TRUE if successful. The updateLabels argument is not used at present.
256 If you are using a derived grid table class you will need to override
257 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
258 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
260 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
262 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
264 Deletes one or more rows from a grid starting at the specified position and returns
265 TRUE if successful. The updateLabels argument is not used at present.
267 If you are using a derived grid table class you will need to override
268 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
269 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
271 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
273 \func{void
}{DisableCellEditControl
}{\void}
275 Disables in-place editing of grid cells.
276 Equivalent to calling EnableCellEditControl(FALSE).
278 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
280 \func{void
}{DisableDragColSize
}{\void}
282 Disables column sizing by dragging with the mouse. Equivalent to passing FALSE to
283 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
285 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
287 \func{void
}{DisableDragGridSize
}{\void}
289 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
290 FALSE to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
292 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
294 \func{void
}{DisableDragRowSize
}{\void}
296 Disables row sizing by dragging with the mouse. Equivalent to passing FALSE to
297 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
299 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
301 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = TRUE
}}
303 Enables or disables in-place editing of grid cell data. The grid will issue either a
304 wxEVT_GRID_EDITOR_SHOWN or wxEVT_GRID_EDITOR_HIDDEN event.
306 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
308 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = TRUE
}}
310 Enables or disables column sizing by dragging with the mouse.
312 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
314 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = TRUE
}}
316 Enables or disables row and column resizing by dragging gridlines with the mouse.
318 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
320 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = TRUE
}}
322 Enables or disables row sizing by dragging with the mouse.
324 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
326 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
328 If the edit argument is FALSE this function sets the whole grid as read-only. If the
329 argument is TRUE the grid is set to the default state where cells may be editable. In the
330 default state you can set single grid cells and whole rows and columns to be editable or
332 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
333 cells you can also use the shortcut function
334 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
336 For more information about controlling grid cell attributes see the
337 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
338 \helpref{wxGrid classes overview
}{gridoverview
}.
340 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
342 \func{void
}{EnableGridLines
}{\param{bool
}{enable = TRUE
}}
344 Turns the drawing of grid lines on or off.
346 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
348 \func{void
}{EndBatch
}{\void}
350 Decrements the grid's batch count. When the count is greater than zero repainting of
351 the grid is suppressed. Each previous call to
352 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
353 EndBatch. Code that does a lot of grid modification can be enclosed between
354 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
355 cause the grid to be repainted.
357 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
359 \func{void
}{ForceRefresh
}{\void}
361 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
363 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
365 \func{int
}{GetBatchCount
}{\void}
367 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
368 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
369 the grid's batch count is greater than zero the display will not be updated.
371 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
373 \func{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
375 Sets the arguments to the horizontal and vertical text alignment values for the
376 grid cell at the specified location.
378 Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
379 Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
381 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
383 \func{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
385 Returns the background colour of the cell at the specified location.
387 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
389 \func{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
391 Returns a pointer to the editor for the cell at the specified location.
393 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
394 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
396 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
398 \func{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
400 Returns the font for text in the grid cell at the specified location.
402 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
404 \func{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
406 Returns a pointer to the renderer for the grid cell at the specified location.
408 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
409 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
411 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
413 \func{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
415 Returns the text colour for the grid cell at the specified location.
417 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
419 \func{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
421 \func{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
423 Returns the string contained in the cell at the specified location. For simple applications where a
424 grid object automatically uses a default grid table of string values you use this function together
425 with
\helpref{wxGrid::SetCellValue
}{wxgridsetcellvalue
} to access cell values.
427 For more complex applications where you have derived your own grid table class that contains
428 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
429 function for those cells that contain string values.
431 See
\helpref{wxGridTableBase::CanGetValueAs
}{wxgridtablebasecangetvalueas
}
432 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
434 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
436 \func{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
438 Sets the arguments to the current column label alignment values.
440 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
441 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
443 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
445 \func{int
}{GetColLabelSize
}{\void}
447 Returns the current height of the column labels.
449 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
451 \func{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
453 Returns the specifed column label. The default grid table class provides column labels of
454 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
455 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
458 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
460 \func{int
}{GetColSize
}{\param{int
}{col
}}
462 Returns the width of the specified column.
464 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
466 \func{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
468 Sets the arguments to the current default horizontal and vertical text alignment
471 Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
472 Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
474 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
476 \func{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
478 Returns the current default background colour for grid cells.
480 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
482 \func{wxFont
}{GetDefaultCellFont
}{\void}
484 Returns the current default font for grid cell text.
486 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
488 \func{wxColour
}{GetDefaultCellTextColour
}{\void}
490 Returns the current default colour for grid cell text.
492 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
494 \func{int
}{GetDefaultColLabelSize
}{\void}
496 Returns the default height for column labels.
498 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
500 \func{int
}{GetDefaultColSize
}{\void}
502 Returns the current default width for grid columns.
504 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
506 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
508 Returns a pointer to the current default grid cell editor.
510 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
511 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
513 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
515 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
517 Returns a pointer to the current default grid cell renderer.
519 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
520 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
522 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
524 \func{int
}{GetDefaultRowLabelSize
}{\void}
526 Returns the default width for the row labels.
528 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
530 \func{int
}{GetDefaultRowSize
}{\void}
532 Returns the current default height for grid rows.
534 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
536 \func{int
}{GetGridCursorCol
}{\void}
538 Returns the current grid cell column position.
540 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
542 \func{int
}{GetGridCursorRow
}{\void}
544 Returns the current grid cell row position.
546 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
548 \func{wxColour
}{GetGridLineColour
}{\void}
550 Returns the colour used for grid lines.
552 \membersection{wxGrid::GridLinesEnabled
}\label{wxgridgridlinesenabled
}
554 \func{bool
}{GridLinesEnabled
}{\void}
556 Returnes TRUE if drawing of grid lines is turned on, FALSE otherwise.
558 \membersection{wxGrid::GetLabelBackgroundColour
}\label{wxgridgetlabelbackgroundcolour
}
560 \func{wxColour
}{GetLabelBackgroundColour
}{\void}
562 Returns the colour used for the background of row and column labels.
564 \membersection{wxGrid::GetLabelFont
}\label{wxgridgetlabelfont
}
566 \func{wxFont
}{GetLabelFont
}{\void}
568 Returns the font used for row and column labels.
570 \membersection{wxGrid::GetLabelTextColour
}\label{wxgridgetlabeltextcolour
}
572 \func{wxColour
}{GetLabelTextColour
}{\void}
574 Returns the colour used for row and column label text.
576 \membersection{wxGrid::GetNumberCols
}\label{wxgridgetnumbercols
}
578 \func{int
}{GetNumberCols
}{\void}
580 Returns the total number of grid columns (actually the number of columns in the underlying grid
583 \membersection{wxGrid::GetNumberRows
}\label{wxgridgetnumberrows
}
585 \func{int
}{GetNumberRows
}{\void}
587 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
589 \membersection{wxGrid::GetRowLabelAlignment
}\label{wxgridgetrowlabelalignment
}
591 \func{void
}{GetRowLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
593 Sets the arguments to the current row label alignment values.
595 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
596 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
598 \membersection{wxGrid::GetRowLabelSize
}\label{wxgridgetrowlabelsize
}
600 \func{int
}{GetRowLabelSize
}{\void}
602 Returns the current width of the row labels.
604 \membersection{wxGrid::GetRowLabelValue
}\label{wxgridgetrowlabelvalue
}
606 \func{wxString
}{GetRowLabelValue
}{\param{int
}{row
}}
608 Returns the specifed row label. The default grid table class provides numeric row labels.
609 If you are using a custom grid table you can override
610 \helpref{wxGridTableBase::GetRowLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
613 \membersection{wxGrid::GetRowSize
}\label{wxgridgetrowsize
}
615 \func{int
}{GetRowSize
}{\param{int
}{row
}}
617 Returns the height of the specified row.
619 \membersection{wxGrid::GetTable
}\label{wxgridgettable
}
621 \constfunc{wxGridTableBase *
}{GetTable
}{\void}
623 Returns a base pointer to the current table object.
625 \membersection{wxGrid::HideCellEditControl
}\label{wxgridhidecelleditcontrol
}
627 \func{void
}{HideCellEditControl
}{\void}
629 Hides the in-place cell edit control.
631 \membersection{wxGrid::InsertCols
}\label{wxgridinsertcols
}
633 \func{bool
}{InsertCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
635 Inserts one or more new columns into a grid with the first new column at the
636 specified position and returns TRUE if successful. The updateLabels argument is not
639 The sequence of actions begins with the grid object requesting the underlying grid
640 table to insert new columns. If this is successful the table notifies the grid and the
641 grid updates the display. For a default grid (one where you have called
642 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
643 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
644 then you must override
645 \helpref{wxGridTableBase::InsertCols
}{wxgridtablebaseinsertcols
} in your derived
648 \membersection{wxGrid::InsertRows
}\label{wxgridinsertrows
}
650 \func{bool
}{InsertRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
652 Inserts one or more new rows into a grid with the first new row at the specified
653 position and returns TRUE if successful. The updateLabels argument is not used at
656 The sequence of actions begins with the grid object requesting the underlying grid
657 table to insert new rows. If this is successful the table notifies the grid and the
658 grid updates the display. For a default grid (one where you have called
659 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
660 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
661 then you must override
662 \helpref{wxGridTableBase::InsertRows
}{wxgridtablebaseinsertrows
} in your derived
665 \membersection{wxGrid::IsCellEditControlEnabled
}\label{wxgridiscelleditcontrolenabled
}
667 \constfunc{bool
}{IsCellEditControlEnabled
}{\void}
669 Returns TRUE if the in-place edit control is currently enabled.
671 \membersection{wxGrid::IsCurrentCellReadOnly
}\label{wxgridiscurrentcellreadonly
}
673 \constfunc{bool
}{IsCurrentCellReadOnly
}{\void}
675 Returns TRUE if the current cell has been set to read-only
676 (see
\helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}).
678 \membersection{wxGrid::IsEditable
}\label{wxgridiseditable
}
680 \func{bool
}{IsEditable
}{\void}
682 Returns FALSE if the whole grid has been set as read-only or TRUE otherwise.
683 See
\helpref{wxGrid::EnableEditing
}{wxgridenableediting
} for more information about
684 controlling the editing status of grid cells.
686 \membersection{wxGrid::IsReadOnly
}\label{wxgridisreadonly
}
688 \constfunc{bool
}{IsReadOnly
}{\param{int
}{row
},
\param{int
}{col
}}
690 Returns TRUE if the cell at the specified location can't be edited.
691 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
693 \membersection{wxGrid::IsSelection
}\label{wxgridisselection
}
695 \func{bool
}{IsSelection
}{\void}
697 Returns TRUE if there are currently rows, columns or blocks of cells selected.
699 \membersection{wxGrid::IsVisible
}\label{wxgridisvisible
}
701 \func{bool
}{IsVisible
}{\param{int
}{row
},
\param{int
}{col
},
702 \param{bool
}{wholeCellVisible = TRUE
}
704 \func{bool
}{IsVisible
}{\param{const wxGridCellCoords\&
}{coords
},
705 \param{bool
}{wholeCellVisible = TRUE
}}
707 Returns TRUE if a cell is either wholly visible (the default) or at least partially
708 visible in the grid window.
710 \membersection{wxGrid::MakeCellVisible
}\label{wxgridmakecellvisible
}
712 \func{void
}{MakeCellVisible
}{\param{int
}{row
},
\param{int
}{col
}}
714 \func{void
}{MakeCellVisible
}{\param{const wxGridCellCoords\&
}{coords
}}
716 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
717 nothing if the cell is already visible.
719 \membersection{wxGrid::MoveCursorDown
}\label{wxgridmovecursordown
}
721 \func{bool
}{MoveCursorDown
}{\param{bool
}{expandSelection
}}
723 Moves the grid cursor down by one row. If a block of cells was previously selected it
724 will expand if the argument is TRUE or be cleared if the argument is FALSE.
726 \wxheading{Keyboard
}\\
727 This function is called for Down cursor key presses or Shift+Down to expand a selection.
729 \membersection{wxGrid::MoveCursorLeft
}\label{wxgridmovecursorleft
}
731 \func{bool
}{MoveCursorLeft
}{\param{bool
}{expandSelection
}}
733 Moves the grid cursor left by one column. If a block of cells was previously selected it
734 will expand if the argument is TRUE or be cleared if the argument is FALSE.
736 \wxheading{Keyboard
}\\
737 This function is called for Left cursor key presses or Shift+Left to expand a selection.
739 \membersection{wxGrid::MoveCursorRight
}\label{wxgridmovecursorright
}
741 \func{bool
}{MoveCursorRight
}{\param{bool
}{expandSelection
}}
743 Moves the grid cursor right by one column. If a block of cells was previously selected it
744 will expand if the argument is TRUE or be cleared if the argument is FALSE.
746 \wxheading{Keyboard
}\\
747 This function is called for Right cursor key presses or Shift+Right to expand a selection.
749 \membersection{wxGrid::MoveCursorUp
}\label{wxgridmovecursorup
}
751 \func{bool
}{MoveCursorUp
}{\param{bool
}{expandSelection
}}
753 Moves the grid cursor up by one row. If a block of cells was previously selected it
754 will expand if the argument is TRUE or be cleared if the argument is FALSE.
756 \wxheading{Keyboard
}\\
757 This function is called for Up cursor key presses or Shift+Up to expand a selection.
759 \membersection{wxGrid::MoveCursorDownBlock
}\label{wxgridmovecursordownblock
}
761 \func{bool
}{MoveCursorDownBlock
}{\param{bool
}{expandSelection
}}
763 Moves the grid cursor down in the current column such that it skips to the beginning or
764 end of a block of non-empty cells. If a block of cells was previously selected it
765 will expand if the argument is TRUE or be cleared if the argument is FALSE.
767 \wxheading{Keyboard
}\\
768 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
770 \membersection{wxGrid::MoveCursorLeftBlock
}\label{wxgridmovecursorleftblock
}
772 \func{bool
}{MoveCursorLeftBlock
}{\param{bool
}{expandSelection
}}
774 Moves the grid cursor left in the current row such that it skips to the beginning or
775 end of a block of non-empty cells. If a block of cells was previously selected it
776 will expand if the argument is TRUE or be cleared if the argument is FALSE.
778 \wxheading{Keyboard
}\\
779 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
781 \membersection{wxGrid::MoveCursorRightBlock
}\label{wxgridmovecursorrightblock
}
783 \func{bool
}{MoveCursorRightBlock
}{\param{bool
}{expandSelection
}}
785 Moves the grid cursor right in the current row such that it skips to the beginning or
786 end of a block of non-empty cells. If a block of cells was previously selected it
787 will expand if the argument is TRUE or be cleared if the argument is FALSE.
789 \wxheading{Keyboard
}\\
790 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
792 \membersection{wxGrid::MoveCursorUpBlock
}\label{wxgridmovecursorupblock
}
794 \func{bool
}{MoveCursorUpBlock
}{\param{bool
}{expandSelection
}}
796 Moves the grid cursor up in the current column such that it skips to the beginning or
797 end of a block of non-empty cells. If a block of cells was previously selected it
798 will expand if the argument is TRUE or be cleared if the argument is FALSE.
800 \wxheading{Keyboard
}\\
801 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
803 \membersection{wxGrid::MovePageDown
}\label{wxgridmovepagedown
}
805 \func{bool
}{MovePageDown
}{\void}
807 Moves the grid cursor down by some number of rows so that the previous bottom visible row
808 becomes the top visible row.
810 \wxheading{Keyboard
}\\
811 This function is called for PgDn keypresses.
813 \membersection{wxGrid::MovePageUp
}\label{wxgridmovepageup
}
815 \func{bool
}{MovePageUp
}{\void}
817 Moves the grid cursor up by some number of rows so that the previous top visible row
818 becomes the bottom visible row.
820 \wxheading{Keyboard
}\\
821 This function is called for PgUp keypresses.
823 \membersection{wxGrid::SaveEditControlValue
}\label{wxgridsaveeditcontrolvalue
}
825 \func{void
}{SaveEditControlValue
}{\void}
827 Sets the value of the current grid cell to the current in-place edit control value.
828 This is called automatically when the grid cursor moves from the current cell to a
829 new cell. It is also a good idea to call this function when closing a grid since
830 any edits to the final cell location will not be saved otherwise.
832 \membersection{wxGrid::SelectAll
}\label{wxgridselectall
}
834 \func{void
}{SelectAll
}{\void}
836 Selects all cells in the grid.
838 \membersection{wxGrid::SelectBlock
}\label{wxgridselectblock
}
840 \func{void
}{SelectBlock
}{\param{int
}{topRow
},
\param{int
}{leftCol
},
841 \param{int
}{bottomRow
},
\param{int
}{rightCol
},
\param{bool
}{addToSelected = FALSE
}}
843 \func{void
}{SelectBlock
}{\param{const wxGridCellCoords\&
}{topLeft
},
844 \param{const wxGridCellCoords\&
}{bottomRight
},
\param{bool
}{addToSelected = FALSE
}}
846 Selects a rectangular block of cells. If addToSelected is FALSE then any existing selection will be
847 deselected; if TRUE the column will be added to the existing selection.
849 \membersection{wxGrid::SelectCol
}\label{wxgridselectcol
}
851 \func{void
}{SelectCol
}{\param{int
}{col
},
\param{bool
}{addToSelected = FALSE
}}
853 Selects the specified column. If addToSelected is FALSE then any existing selection will be
854 deselected; if TRUE the column will be added to the existing selection.
856 \membersection{wxGrid::SelectRow
}\label{wxgridselectrow
}
858 \func{void
}{SelectRow
}{\param{int
}{row
},
\param{bool
}{addToSelected = FALSE
}}
860 Selects the specified row. If addToSelected is FALSE then any existing selection will be
861 deselected; if TRUE the row will be added to the existing selection.
863 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
865 \func{void
}{SetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int
}{horiz
},
\param{int
}{vert
}}
867 Sets the horizontal and vertial alignment for grid cell text at the specified location.
869 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
870 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
872 \membersection{wxGrid::SetCellEditor
}\label{wxgridsetcelleditor
}
874 \func{void
}{SetCellEditor
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellEditor*
}{editor
}}
876 Sets the editor for the grid cell at the specified location.
877 The grid will take ownership of the pointer.
879 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
880 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
882 \membersection{wxGrid::SetCellFont
}\label{wxgridsetcellfont
}
884 \func{void
}{SetCellFont
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxFont\&
}}
886 Sets the font for text in the grid cell at the specified location.
888 \membersection{wxGrid::SetCellRenderer
}\label{wxgridsetcellrenderer
}
890 \func{void
}{SetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellRenderer*
}{renderer
}}
892 Sets the renderer for the grid cell at the specified location.
893 The grid will take ownership of the pointer.
895 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
896 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
898 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
900 \func{void
}{SetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxColour\&
}}
902 Sets the text colour for the grid cell at the specified location.
904 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
906 \func{void
}{SetCellValue
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxString\&
}{s
}}
908 \func{void
}{SetCellValue
}{\param{const wxGridCellCoords\&
}{coords
},
\param{const wxString\&
}{s
}}
910 Sets the string value for the cell at the specified location. For simple applications where a
911 grid object automatically uses a default grid table of string values you use this function together
912 with
\helpref{wxGrid::GetCellValue
}{wxgridgetcellvalue
} to access cell values.
914 For more complex applications where you have derived your own grid table class that contains
915 various data types (e.g. numeric, boolean or user-defined custom types) then you only use this
916 function for those cells that contain string values.
918 See
\helpref{wxGridTableBase::CanSetValueAs
}{wxgridtablebasecangetvalueas
}
919 and the
\helpref{wxGrid overview
}{gridoverview
} for more information.
921 \membersection{wxGrid::SetColAttr
}\label{wxgridsetcolattr
}
923 \func{void
}{SetColAttr
}{\param{int
}{col
},
\param{wxGridCellAttr*
}{attr
}}
925 Sets the cell attributes for all cells in the specified column.
927 For more information about controlling grid cell attributes see the
928 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
929 \helpref{wxGrid classes overview
}{gridoverview
}.
931 \membersection{wxGrid::SetColFormatBool
}\label{wxgridsetcolformatbool
}
933 \func{void
}{SetColFormatBool
}{\param{int
}{col
}}
935 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
937 \membersection{wxGrid::SetColFormatNumber
}\label{wxgridsetcolformatnumber
}
939 \func{void
}{SetColFormatNumber
}{\param{int
}{col
}}
941 Sets the specified column to display integer values.
943 \membersection{wxGrid::SetColFormatFloat
}\label{wxgridsetcolformatfloat
}
945 \func{void
}{SetColFormatFloat
}{\param{int
}{col
},
\param{int
}{width = -
1},
\param{int
}{precision = -
1}}
947 Sets the specified column to display floating point values with the given width and precision.
949 \membersection{wxGrid::SetColFormatCustom
}\label{wxgridsetcolformatcustom
}
951 \func{void
}{SetColFormatCustom
}{\param{int
}{col
},
\param{const wxString\&
}{typeName
}}
953 Sets the specified column to display data in a custom format.
954 See the
\helpref{wxGrid overview
}{gridoverview
} for more information on working
955 with custom data types.
957 \membersection{wxGrid::SetColLabelAlignment
}\label{wxgridsetcollabelalignment
}
959 \func{void
}{SetColLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
961 Sets the horizontal and vertical alignment of column label text.
963 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
964 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
966 \membersection{wxGrid::SetColLabelSize
}\label{wxgridsetcollabelsize
}
968 \func{void
}{SetColLabelSize
}{\param{int
}{height
}}
970 Sets the height of the column labels.
972 \membersection{wxGrid::SetColLabelValue
}\label{wxgridsetcollabelvalue
}
974 \func{void
}{SetColLabelValue
}{\param{int
}{col
},
\param{const
}{wxString\&
}}
976 Set the value for the given column label. If you are using a derived grid table you must
977 override
\helpref{wxGridTableBase::SetColLabelValue
}{wxgridtablebasesetcollabelvalue
}
978 for this to have any effect.
980 \membersection{wxGrid::SetColMinimalWidth
}\label{wxgridsetcolminimalwidth
}
982 \func{void
}{SetColMinimalWidth
}{\param{int
}{col
},
\param{int
}{width
}}
984 Sets the minimal width for the specified column. This should normally be called when creating the grid
985 because it will not resize a column that is already narrower than the minimal width.
987 \membersection{wxGrid::SetColSize
}\label{wxgridsetcolsize
}
989 \func{void
}{SetColSize
}{\param{int
}{col
},
\param{int
}{width
}}
991 Sets the width of the specified column.
993 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
994 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
996 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
997 also be set as the minimal width for the column.
1000 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1001 The memory requirements for this could become prohibitive if your grid is very large.
1003 \membersection{wxGrid::SetDefaultCellAlignment
}\label{wxgridsetdefaultcellalignment
}
1005 \func{void
}{SetDefaultCellAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1007 Sets the default horizontal and vertial alignment for grid cell text.
1009 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1010 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
1012 \membersection{wxGrid::SetDefaultCellBackgroundColour
}\label{wxgridsetdefaultcellbackgroundcolour
}
1014 \func{void
}{SetDefaultCellBackgroundColour
}{\param{const
}{wxColour\&
}}
1016 Sets the default background colour for grid cells.
1018 \membersection{wxGrid::SetDefaultCellFont
}\label{wxgridsetdefaultcellfont
}
1020 \func{void
}{SetDefaultCellFont
}{\param{const
}{wxFont\&
}}
1022 Sets the default font to be used for grid cell text.
1024 \membersection{wxGrid::SetDefaultEditor
}\label{wxgridsetdefaulteditor
}
1026 \func{void
}{SetDefaultEditor
}{\param{wxGridCellEditor*
}{editor
}}
1028 Sets the default editor for grid cells. The grid will take ownership of the pointer.
1030 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
1031 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1033 \membersection{wxGrid::SetDefaultRenderer
}\label{wxgridsetdefaultrenderer
}
1035 \func{void
}{SetDefaultRenderer
}{\param{wxGridCellRenderer*
}{renderer
}}
1037 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
1039 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
1040 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
1042 \membersection{wxGrid::SetDefaultColSize
}\label{wxgridsetdefaultcolsize
}
1044 \func{void
}{SetDefaultColSize
}{\param{int
}{width
},
\param{bool
}{resizeExistingCols = FALSE
}}
1046 Sets the default width for columns in the grid. This will only affect columns subsequently added to
1047 the grid unless resizeExistingCols is TRUE.
1049 \membersection{wxGrid::SetDefaultRowSize
}\label{wxgridsetdefaultrowsize
}
1051 \func{void
}{SetDefaultRowSize
}{\param{int
}{height
},
\param{bool
}{resizeExistingRows = FALSE
}}
1053 Sets the default height for rows in the grid. This will only affect rows subsequently added
1054 to the grid unless resizeExistingRows is TRUE.
1056 \membersection{wxGrid::SetGridCursor
}\label{wxgridsetgridcursor
}
1058 \func{void
}{SetGridCursor
}{\param{int
}{row
},
\param{int
}{col
}}
1060 Set the grid cursor to the specified cell.
1061 This function calls
\helpref{wxGrid::MakeCellVisible
}{wxgridmakecellvisible
}.
1063 \membersection{wxGrid::SetGridLineColour
}\label{wxgridsetgridlinecolour
}
1065 \func{void
}{SetGridLineColour
}{\param{const
}{wxColour\&
}}
1067 Sets the colour used to draw grid lines.
1069 \membersection{wxGrid::SetLabelBackgroundColour
}\label{wxgridsetlabelbackgroundcolour
}
1071 \func{void
}{SetLabelBackgroundColour
}{\param{const
}{wxColour\&
}}
1073 Sets the background colour for row and column labels.
1075 \membersection{wxGrid::SetLabelFont
}\label{wxgridsetlabelfont
}
1077 \func{void
}{SetLabelFont
}{\param{const
}{wxFont\&
}}
1079 Sets the font for row and column labels.
1081 \membersection{wxGrid::SetLabelTextColour
}\label{wxgridsetlabeltextcolour
}
1083 \func{void
}{SetLabelTextColour
}{\param{const
}{wxColour\&
}}
1085 Sets the colour for row and column label text.
1087 \membersection{wxGrid::SetReadOnly
}\label{wxgridsetreadonly
}
1089 \func{void
}{SetReadOnly
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{isReadOnly = TRUE
}}
1091 Makes the cell at the specified location read-only or editable.
1092 See also
\helpref{wxGrid::IsReadOnly
}{wxgridisreadonly
}.
1094 \membersection{wxGrid::SetRowAttr
}\label{wxgridsetrowattr
}
1096 \func{void
}{SetRowAttr
}{\param{int
}{row
},
\param{wxGridCellAttr*
}{attr
}}
1098 Sets the cell attributes for all cells in the specified row.
1099 See the
\helpref{wxGridCellAttr
}{wxgridcellattr
} class for more information
1100 about controlling cell attributes.
1102 \membersection{wxGrid::SetRowLabelAlignment
}\label{wxgridsetrowlabelalignment
}
1104 \func{void
}{SetRowLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1106 Sets the horizontal and vertical alignment of row label text.
1108 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1109 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
1111 \membersection{wxGrid::SetRowLabelSize
}\label{wxgridsetrowlabelsize
}
1113 \func{void
}{SetRowLabelSize
}{\param{int
}{width
}}
1115 Sets the width of the row labels.
1117 \membersection{wxGrid::SetRowLabelValue
}\label{wxgridsetrowlabelvalue
}
1119 \func{void
}{SetRowLabelValue
}{\param{int
}{row
},
\param{const
}{wxString\&
}}
1121 Set the value for the given row label. If you are using a derived grid table you must
1122 override
\helpref{wxGridTableBase::SetRowLabelValue
}{wxgridtablebasesetrowlabelvalue
}
1123 for this to have any effect.
1125 \membersection{wxGrid::SetRowMinimalHeight
}\label{wxgridsetrowminimalheight
}
1127 \func{void
}{SetRowMinimalHeight
}{\param{int
}{row
},
\param{int
}{width
}}
1129 Sets the minimal height for the specified row. This should normally be called when creating the grid
1130 because it will not resize a row that is already shorter than the minimal height.
1132 \membersection{wxGrid::SetRowSize
}\label{wxgridsetrowsize
}
1134 \func{void
}{SetRowSize
}{\param{int
}{row
},
\param{int
}{height
}}
1136 Sets the height of the specified row.
1138 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1139 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1141 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1142 also be set as the minimal width for the column.
1145 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1146 The memory requirements for this could become prohibitive if your grid is very large.
1148 \membersection{wxGrid::SetSelectionMode
}\label{wxgridsetselectionmode
}
1150 \func{void
}{SetSelectionMode
}{\param{wxGrid::wxGridSelectionModes
}{selmode
}}
1152 Set the selection behaviour of the grid.
1154 \wxheading{Parameters
}
1156 \docparam{wxGrid::wxGridSelectCells
}{The default mode where individual cells are selected.
}
1158 \docparam(wxGrid::wxGridSelectRows
}{Selections will consist of whole rows.
}
1160 \docparam{wxGrid::wxGridSelectionColumns
}{Selections will consist of whole columns.
}
1162 \membersection{wxGrid::SetTable
}\label{wxgridsettable
}
1164 \func{bool
}{SetTable
}{\param{wxGridTableBase*
}{table
},
\param{bool
}{takeOwnership = FALSE
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
1166 Passes a pointer to a custom grid table to be used by the grid. This should be called
1167 after the grid constructor and before using the grid object. If takeOwnership is set to
1168 TRUE then the table will be deleted by the wxGrid destructor.
1170 Use this function instead of
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} when your
1171 application involves complex or non-string data or data sets that are too large to fit
1174 \membersection{wxGrid::ShowCellEditControl
}\label{wxgridshowcelleditcontrol
}
1176 \func{void
}{ShowCellEditControl
}{\void}
1178 Displays the in-place cell edit control for the current cell.
1180 \membersection{wxGrid::XToCol
}\label{wxgridxtocol
}
1182 \func{int
}{XToCol
}{\param{int
}{x
}}
1184 Returns the grid column that corresponds to the logical x coordinate. Returns
1185 wxNOT_FOUND if there is no column at the x position.
1187 \membersection{wxGrid::XToEdgeOfCol
}\label{wxgridxtoedgeofcol
}
1189 \func{int
}{XToEdgeOfCol
}{\param{int
}{x
}}
1191 Returns the column whose right hand edge is close to the given logical x position.
1192 If no column edge is near to this position wxNOT_FOUND is returned.
1194 \membersection{wxGrid::YToEdgeOfRow
}\label{wxgridytoedgeofrow
}
1196 \func{int
}{YToEdgeOfRow
}{\param{int
}{y
}}
1198 Returns the row whose bottom edge is close to the given logical y position.
1199 If no row edge is near to this position wxNOT_FOUND is returned.
1201 \membersection{wxGrid::YToRow
}\label{wxgridytorow
}
1203 \func{int
}{YToRow
}{\param{int
}{y
}}
1205 Returns the grid row that corresponds to the logical y coordinate. Returns
1206 wxNOT_FOUND if there is no row at the y position.
1210 \membersection{wxGrid::IsInSelection
}\label{wxgridisinselection
}
1212 \func{bool
}{IsInSelection
}{\param{int
}{row
},
\param{int
}{col
}}
1214 \func{bool
}{IsInSelection
}{\param{const wxGridCellCoords\&
}{coords
}}
1217 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
1219 \func{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
1221 This function returns the rectangle that encloses the block of cells
1222 limited by TopLeft and BottomRight cell in device coords and clipped
1223 to the client size of the grid window.
1226 \membersection{wxGrid::SelectionToDeviceRect
}\label{wxgridselectiontodevicerect
}
1228 \func{wxRect
}{SelectionToDeviceRect
}{\void}
1230 This function returns the rectangle that encloses the selected cells
1231 in device coords and clipped to the client size of the grid window.
1234 \membersection{wxGrid::GetSelectionBackground
}\label{wxgridgetselectionbackground
}
1236 \constfunc{wxColour
}{GetSelectionBackground
}{\void}
1238 Access or update the selection fore/back colours
1241 \membersection{wxGrid::GetSelectionForeground
}\label{wxgridgetselectionforeground
}
1243 \constfunc{wxColour
}{GetSelectionForeground
}{\void}
1246 \membersection{wxGrid::SetSelectionBackground
}\label{wxgridsetselectionbackground
}
1248 \func{void
}{SetSelectionBackground
}{\param{const wxColour\&
}{c
}}
1251 \membersection{wxGrid::SetSelectionForeground
}\label{wxgridsetselectionforeground
}
1253 \func{void
}{SetSelectionForeground
}{\param{const wxColour\&
}{c
}}
1256 \membersection{wxGrid::RegisterDataType
}\label{wxgridregisterdatatype
}
1258 \func{void
}{RegisterDataType
}{\param{const wxString\&
}{typeName
},
\param{wxGridCellRenderer*
}{renderer
},
\param{wxGridCellEditor*
}{editor
}}
1260 Methods for a registry for mapping data types to Renderers/Editors
1263 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
1265 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1267 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
1270 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
1272 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1275 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
1277 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
1280 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
1282 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
1285 \membersection{wxGrid::SetMargins
}\label{wxgridsetmargins
}
1287 \func{void
}{SetMargins
}{\param{int
}{extraWidth
},
\param{int
}{extraHeight
}}
1289 grid may occupy more space than needed for its rows/columns, this
1290 function allows to set how big this extra space is
1293 \membersection{wxGrid::wxGrid
}\label{wxgridwxgrid
}
1295 \func{}{wxGrid
}{\param{wxWindow*
}{parent
},
\param{int
}{x
},
\param{int
}{y
},
\param{int
}{w = -
1},
\param{int
}{h = -
1},
\param{long
}{style = wxWANTS
\_CHARS},
\param{const wxString\&
}{name = wxPanelNameStr
}}
1297 ------ For compatibility with previous wxGrid only...
1299 ** Don't use these in new code because they **
1300 ** are liable to disappear in a future **
1305 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
1307 \func{void
}{SetCellValue
}{\param{const wxString\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
1310 \membersection{wxGrid::UpdateDimensions
}\label{wxgridupdatedimensions
}
1312 \func{void
}{UpdateDimensions
}{\void}
1315 \membersection{wxGrid::GetRows
}\label{wxgridgetrows
}
1317 \func{int
}{GetRows
}{\void}
1320 \membersection{wxGrid::GetCols
}\label{wxgridgetcols
}
1322 \func{int
}{GetCols
}{\void}
1325 \membersection{wxGrid::GetCursorRow
}\label{wxgridgetcursorrow
}
1327 \func{int
}{GetCursorRow
}{\void}
1330 \membersection{wxGrid::GetCursorColumn
}\label{wxgridgetcursorcolumn
}
1332 \func{int
}{GetCursorColumn
}{\void}
1335 \membersection{wxGrid::GetScrollPosX
}\label{wxgridgetscrollposx
}
1337 \func{int
}{GetScrollPosX
}{\void}
1340 \membersection{wxGrid::GetScrollPosY
}\label{wxgridgetscrollposy
}
1342 \func{int
}{GetScrollPosY
}{\void}
1345 \membersection{wxGrid::SetScrollX
}\label{wxgridsetscrollx
}
1347 \func{void
}{SetScrollX
}{\param{int
}{WXUNUSED(x)
}}
1350 \membersection{wxGrid::SetScrollY
}\label{wxgridsetscrolly
}
1352 \func{void
}{SetScrollY
}{\param{int
}{WXUNUSED(y)
}}
1355 \membersection{wxGrid::SetColumnWidth
}\label{wxgridsetcolumnwidth
}
1357 \func{void
}{SetColumnWidth
}{\param{int
}{col
},
\param{int
}{width
}}
1360 \membersection{wxGrid::GetColumnWidth
}\label{wxgridgetcolumnwidth
}
1362 \func{int
}{GetColumnWidth
}{\param{int
}{col
}}
1365 \membersection{wxGrid::SetRowHeight
}\label{wxgridsetrowheight
}
1367 \func{void
}{SetRowHeight
}{\param{int
}{row
},
\param{int
}{height
}}
1370 \membersection{wxGrid::GetViewHeight
}\label{wxgridgetviewheight
}
1372 \func{int
}{GetViewHeight
}{\void}
1374 GetRowHeight() is below
1375 returned num whole rows visible
1378 \membersection{wxGrid::GetViewWidth
}\label{wxgridgetviewwidth
}
1380 \func{int
}{GetViewWidth
}{\void}
1382 returned num whole cols visible
1385 \membersection{wxGrid::SetLabelSize
}\label{wxgridsetlabelsize
}
1387 \func{void
}{SetLabelSize
}{\param{int
}{orientation
},
\param{int
}{sz
}}
1390 \membersection{wxGrid::GetLabelSize
}\label{wxgridgetlabelsize
}
1392 \func{int
}{GetLabelSize
}{\param{int
}{orientation
}}
1395 \membersection{wxGrid::SetLabelAlignment
}\label{wxgridsetlabelalignment
}
1397 \func{void
}{SetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{align
}}
1400 \membersection{wxGrid::GetLabelAlignment
}\label{wxgridgetlabelalignment
}
1402 \func{int
}{GetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{WXUNUSED(align)
}}
1405 \membersection{wxGrid::SetLabelValue
}\label{wxgridsetlabelvalue
}
1407 \func{void
}{SetLabelValue
}{\param{int
}{orientation
},
\param{const wxString\&
}{val
},
\param{int
}{pos
}}
1410 \membersection{wxGrid::GetLabelValue
}\label{wxgridgetlabelvalue
}
1412 \func{wxString
}{GetLabelValue
}{\param{int
}{orientation
},
\param{int
}{pos
}}
1415 \membersection{wxGrid::GetCellTextFont
}\label{wxgridgetcelltextfont
}
1417 \constfunc{wxFont
}{GetCellTextFont
}{\void}
1420 \membersection{wxGrid::GetCellTextFont
}\label{wxgridgetcelltextfont
}
1422 \constfunc{wxFont
}{GetCellTextFont
}{\param{int
}{WXUNUSED(row)
},
\param{int
}{WXUNUSED(col)
}}
1425 \membersection{wxGrid::SetCellTextFont
}\label{wxgridsetcelltextfont
}
1427 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
}}
1430 \membersection{wxGrid::SetCellTextFont
}\label{wxgridsetcelltextfont
}
1432 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
},
\param{int
}{row
},
\param{int
}{col
}}
1435 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
1437 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
1440 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
1442 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{col
}}
1445 \membersection{wxGrid::SetCellBackgroundColour
}\label{wxgridsetcellbackgroundcolour
}
1447 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{col
}}
1449 \func{void
}{SetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxColour\&
}}
1451 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{colour
},
\param{int
}{row
},
\param{int
}{col
}}
1454 \membersection{wxGrid::GetEditable
}\label{wxgridgeteditable
}
1456 \func{bool
}{GetEditable
}{\void}
1459 \membersection{wxGrid::SetEditable
}\label{wxgridseteditable
}
1461 \func{void
}{SetEditable
}{\param{bool
}{edit = TRUE
}}
1464 \membersection{wxGrid::GetEditInPlace
}\label{wxgridgeteditinplace
}
1466 \func{bool
}{GetEditInPlace
}{\void}
1469 \membersection{wxGrid::SetEditInPlace
}\label{wxgridseteditinplace
}
1471 \func{void
}{SetEditInPlace
}{\param{bool
}{WXUNUSED(edit) = TRUE
}}
1474 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
1476 \func{void
}{SetCellAlignment
}{\param{int
}{align
},
\param{int
}{row
},
\param{int
}{col
}}
1479 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
1481 \func{void
}{SetCellAlignment
}{\param{int
}{WXUNUSED(align)
}}
1484 \membersection{wxGrid::SetCellBitmap
}\label{wxgridsetcellbitmap
}
1486 \func{void
}{SetCellBitmap
}{\param{wxBitmap*
}{WXUNUSED(bitmap)
},
\param{int
}{WXUNUSED(row)
},
\param{int
}{WXUNUSED(col)
}}
1489 \membersection{wxGrid::SetDividerPen
}\label{wxgridsetdividerpen
}
1491 \func{void
}{SetDividerPen
}{\param{const wxPen\&
}{WXUNUSED(pen)
}}
1494 \membersection{wxGrid::GetDividerPen
}\label{wxgridgetdividerpen
}
1496 \constfunc{wxPen\&
}{GetDividerPen
}{\void}
1499 \membersection{wxGrid::OnActivate
}\label{wxgridonactivate
}
1501 \func{void
}{OnActivate
}{\param{bool
}{WXUNUSED(active)
}}
1504 \membersection{wxGrid::Fit
}\label{wxgridfit
}
1506 \func{void
}{Fit
}{\void}
1508 overridden wxWindow methods
1511 \membersection{wxGrid::DoGetBestSize
}\label{wxgriddogetbestsize
}
1513 \constfunc{wxSize
}{DoGetBestSize
}{\void}
1516 \membersection{wxGrid::InitRowHeights
}\label{wxgridinitrowheights
}
1518 \func{void
}{InitRowHeights
}{\void}
1520 NB: *never* access m
\_row/col arrays directly because they are created
1521 on demand, *always* use accessor functions instead!
1522 init the m
\_rowHeights/Bottoms arrays with default values
1525 \membersection{wxGrid::InitColWidths
}\label{wxgridinitcolwidths
}
1527 \func{void
}{InitColWidths
}{\void}
1529 init the m
\_colWidths/Rights arrays
1532 \membersection{wxGrid::GetColWidth
}\label{wxgridgetcolwidth
}
1534 \constfunc{int
}{GetColWidth
}{\param{int
}{col
}}
1536 get the col/row coords
1539 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
1541 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
1544 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
1546 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
1549 \membersection{wxGrid::GetRowHeight
}\label{wxgridgetrowheight
}
1551 \constfunc{int
}{GetRowHeight
}{\param{int
}{row
}}
1553 this function must be public for compatibility...
1556 \membersection{wxGrid::GetRowTop
}\label{wxgridgetrowtop
}
1558 \constfunc{int
}{GetRowTop
}{\param{int
}{row
}}
1561 \membersection{wxGrid::GetRowBottom
}\label{wxgridgetrowbottom
}
1563 \constfunc{int
}{GetRowBottom
}{\param{int
}{row
}}
1566 \membersection{wxGrid::SetOrCalcColumnSizes
}\label{wxgridsetorcalccolumnsizes
}
1568 \func{int
}{SetOrCalcColumnSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1570 common part of AutoSizeColumn/Row() and GetBestSize()
1573 \membersection{wxGrid::SetOrCalcRowSizes
}\label{wxgridsetorcalcrowsizes
}
1575 \func{int
}{SetOrCalcRowSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1578 \membersection{wxGrid::AutoSizeColOrRow
}\label{wxgridautosizecolorrow
}
1580 \func{void
}{AutoSizeColOrRow
}{\param{int
}{n
},
\param{bool
}{setAsMin
},
\param{bool
}{column
}}
1582 common part of AutoSizeColumn/Row()
1585 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
1587 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
1589 get the minimal width of the given column/row
1592 \membersection{wxGrid::GetRowMinimalHeight
}\label{wxgridgetrowminimalheight
}
1594 \constfunc{int
}{GetRowMinimalHeight
}{\param{int
}{col
}}
1597 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
1599 \func{bool
}{CanHaveAttributes
}{\void}
1601 do we have some place to store attributes in?
1604 \membersection{wxGrid::GetOrCreateCellAttr
}\label{wxgridgetorcreatecellattr
}
1606 \constfunc{wxGridCellAttr*
}{GetOrCreateCellAttr
}{\param{int
}{row
},
\param{int
}{col
}