]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxGrid}}\label{wxgrid} |
2 | ||
78c49c58 | 3 | wxGrid and its related classes are used for displaying and editing tabular |
2eebb742 | 4 | data. They provide a rich set of features for display, editing, and |
78c49c58 MB |
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 | |
2eebb742 JS |
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 | |
78c49c58 | 9 | classes for custom grid views, grid data tables, cell editors and |
2eebb742 | 10 | renderers. The \helpref{wxGrid classes overview}{gridoverview} has |
78c49c58 MB |
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. | |
14 | ||
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 | |
2eebb742 JS |
17 | want to have a look at the \helpref{wxGrid classes overview}{gridoverview} to see |
18 | how things have changed. The new grid classes are reasonably backward-compatible | |
19 | but there are some exceptions. There are also easier ways of doing many things compared to | |
78c49c58 | 20 | the previous implementation. |
a660d684 KB |
21 | |
22 | \wxheading{Derived from} | |
23 | ||
78c49c58 | 24 | \helpref{wxScrolledWindow}{wxscrolledwindow}\\ |
a660d684 KB |
25 | \helpref{wxWindow}{wxwindow}\\ |
26 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
27 | \helpref{wxObject}{wxobject} | |
28 | ||
954b8ae6 JS |
29 | \wxheading{Include files} |
30 | ||
31 | <wx/grid.h> | |
32 | ||
a660d684 KB |
33 | \wxheading{Window styles} |
34 | ||
78c49c58 | 35 | There are presently no specific window styles for wxGrid. |
a660d684 | 36 | |
78c49c58 | 37 | \wxheading{Event handling} |
a660d684 KB |
38 | |
39 | \wxheading{See also} | |
40 | ||
78c49c58 | 41 | \helpref{wxGrid overview}{gridoverview} |
a660d684 | 42 | |
78c49c58 MB |
43 | %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%% |
44 | \latexignore{\rtfignore{\wxheading{Function groups}}} | |
a660d684 | 45 | |
78c49c58 | 46 | \membersection{Constructors and initialization} |
a660d684 | 47 | |
2eebb742 JS |
48 | \helpref{wxGrid}{wxgridctor}\\ |
49 | \helpref{\destruct{wxGrid}}{wxgriddtor}\\ | |
50 | \helpref{CreateGrid}{wxgridcreategrid}\\ | |
78c49c58 | 51 | \helpref{SetTable}{wxgridsettable} |
a660d684 | 52 | |
78c49c58 | 53 | \membersection{Display format} |
a660d684 | 54 | |
78c49c58 | 55 | \membersection{Selection functions} |
a660d684 | 56 | |
2eebb742 JS |
57 | \helpref{wxGrid::ClearSelection}{wxgridclearselection}\\ |
58 | \helpref{wxGrid::IsSelection}{wxgridisselection}\\ | |
59 | \helpref{wxGrid::SelectAll}{wxgridselectall}\\ | |
60 | \helpref{wxGrid::SelectBlock}{wxgridselectblock}\\ | |
61 | \helpref{wxGrid::SelectCol}{wxgridselectcol}\\ | |
5c69031c MB |
62 | \helpref{wxGrid::SelectRow}{wxgridselectrow} |
63 | ||
78c49c58 MB |
64 | %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%% |
65 | \helponly{\insertatlevel{2}{ | |
a660d684 | 66 | |
78c49c58 MB |
67 | \wxheading{Members} |
68 | ||
69 | }} | |
70 | ||
71 | \membersection{wxGrid::wxGrid}\label{wxgridctor} | |
72 | ||
73 | \func{}{wxGrid}{\void} | |
74 | ||
75 | Default constructor | |
76 | ||
77 | \func{}{wxGrid}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxWANTS\_CHARS}, \param{const wxString\& }{name = wxPanelNameStr}} | |
78 | ||
79 | Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or | |
80 | \helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using | |
81 | it. | |
82 | ||
83 | \membersection{wxGrid::\destruct{wxGrid}}\label{wxgriddtor} | |
84 | ||
85 | \func{}{\destruct{wxGrid}}{\void} | |
86 | ||
87 | Destructor. This will also destroy the associated grid table unless you passed a table | |
88 | object to the grid and specified that the grid should not take ownership of the | |
89 | table (see \helpref{wxGrid::SetTable}{wxgridsettable}). | |
a660d684 KB |
90 | |
91 | \membersection{wxGrid::AppendCols}\label{wxgridappendcols} | |
92 | ||
78c49c58 MB |
93 | \func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = TRUE}} |
94 | ||
95 | Appends one or more new columns to the right of the grid and returns TRUE if | |
96 | successful. The updateLabels argument is not used at present. | |
a660d684 | 97 | |
78c49c58 MB |
98 | If you are using a derived grid table class you will need to override |
99 | \helpref{wxGridTableBase::AppendCols}{wxgridtablebaseappendcols}. See | |
100 | \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information. | |
a660d684 KB |
101 | |
102 | \membersection{wxGrid::AppendRows}\label{wxgridappendrows} | |
103 | ||
78c49c58 MB |
104 | \func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = TRUE}} |
105 | ||
106 | Appends one or more new rows to the bottom of the grid and returns TRUE if | |
107 | successful. The updateLabels argument is not used at present. | |
108 | ||
109 | If you are using a derived grid table class you will need to override | |
110 | \helpref{wxGridTableBase::AppendRows}{wxgridtablebaseappendrows}. See | |
111 | \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information. | |
112 | ||
113 | \membersection{wxGrid::AutoSize}\label{wxgridautosize} | |
114 | ||
115 | \func{void}{AutoSize}{\void} | |
116 | ||
117 | Automatically sets the height and width of all rows and columns to fit their contents. | |
118 | ||
2eebb742 | 119 | \wxheading{Note}\\ |
78c49c58 MB |
120 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
121 | The memory requirements for this could become prohibitive if your grid is very large. | |
a660d684 | 122 | |
78c49c58 MB |
123 | \membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn} |
124 | ||
125 | \func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = TRUE}} | |
126 | ||
2eebb742 | 127 | Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will |
78c49c58 MB |
128 | also be set as the minimal width for the column. |
129 | ||
2eebb742 | 130 | \wxheading{Note}\\ |
78c49c58 MB |
131 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
132 | The memory requirements for this could become prohibitive if your grid is very large. | |
133 | ||
134 | \membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns} | |
135 | ||
136 | \func{void}{AutoSizeColumns}{\param{bool }{setAsMin = TRUE}} | |
137 | ||
2eebb742 | 138 | Automatically sizes all columns to fit their contents. If setAsMin is TRUE the calculated widths will |
78c49c58 MB |
139 | also be set as the minimal widths for the columns. |
140 | ||
2eebb742 | 141 | \wxheading{Note}\\ |
78c49c58 MB |
142 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
143 | The memory requirements for this could become prohibitive if your grid is very large. | |
144 | ||
145 | \membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow} | |
146 | ||
147 | \func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = TRUE}} | |
148 | ||
2eebb742 | 149 | Automatically sizes the row to fit its contents. If setAsMin is TRUE the calculated height will |
78c49c58 MB |
150 | also be set as the minimal height for the row. |
151 | ||
2eebb742 | 152 | \wxheading{Note}\\ |
78c49c58 MB |
153 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
154 | The memory requirements for this could become prohibitive if your grid is very large. | |
155 | ||
156 | \membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows} | |
157 | ||
158 | \func{void}{AutoSizeRows}{\param{bool }{setAsMin = TRUE}} | |
159 | ||
2eebb742 | 160 | Automatically sizes all rows to fit their contents. If setAsMin is TRUE the calculated heights will |
78c49c58 MB |
161 | also be set as the minimal heights for the rows. |
162 | ||
2eebb742 | 163 | \wxheading{Note}\\ |
78c49c58 MB |
164 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
165 | The memory requirements for this could become prohibitive if your grid is very large. | |
a660d684 KB |
166 | |
167 | \membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch} | |
168 | ||
169 | \func{void}{BeginBatch}{\void} | |
170 | ||
78c49c58 MB |
171 | Increments the grid's batch count. When the count is greater than zero repainting of |
172 | the grid is suppressed. Each call to BeginBatch must be matched by a later call to | |
173 | \helpref{wxGrid::EndBatch}{wxgridendbatch}. Code that does a lot of grid | |
174 | modification can be enclosed between BeginBatch and EndBatch calls to avoid | |
175 | screen flicker. The final EndBatch will cause the grid to be repainted. | |
a660d684 | 176 | |
78c49c58 | 177 | \membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize} |
a660d684 | 178 | |
78c49c58 | 179 | \func{bool}{CanDragColSize}{\void} |
a660d684 | 180 | |
2eebb742 | 181 | Returns TRUE if columns can be resized by dragging with the mouse. Columns can be resized |
78c49c58 MB |
182 | by dragging the edges of their labels. If grid line dragging is enabled they can also be |
183 | resized by dragging the right edge of the column in the grid cell area | |
184 | (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}). | |
a660d684 | 185 | |
78c49c58 | 186 | \membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize} |
a660d684 | 187 | |
78c49c58 | 188 | \func{bool}{CanDragRowSize}{\void} |
a660d684 | 189 | |
2eebb742 | 190 | Returns TRUE if rows can be resized by dragging with the mouse. Rows can be resized |
78c49c58 MB |
191 | by dragging the edges of their labels. If grid line dragging is enabled they can also be |
192 | resized by dragging the lower edge of the row in the grid cell area | |
193 | (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}). | |
a660d684 | 194 | |
78c49c58 | 195 | \membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize} |
a660d684 | 196 | |
78c49c58 | 197 | \func{bool}{CanDragGridSize}{\void} |
a660d684 | 198 | |
78c49c58 | 199 | Return TRUE if the dragging of grid lines to resize rows and columns is enabled or FALSE otherwise. |
21f280f4 | 200 | |
78c49c58 | 201 | \membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol} |
a660d684 | 202 | |
78c49c58 | 203 | \constfunc{bool}{CanEnableCellControl}{\void} |
a660d684 | 204 | |
78c49c58 MB |
205 | Returns TRUE if the in-place edit control for the current grid cell can be used and |
206 | FALSE otherwise (e.g. if the current cell is read-only). | |
207 | ||
208 | \membersection{wxGrid::CellToRect}\label{wxgridcelltorect} | |
209 | ||
210 | \func{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}} | |
211 | ||
212 | \func{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}} | |
213 | ||
214 | Return the rectangle corresponding to the grid cell's size and position in logical | |
215 | coordinates. | |
216 | ||
217 | \membersection{wxGrid::ClearGrid}\label{wxgridcleargrid} | |
218 | ||
219 | \func{void}{ClearGrid}{\void} | |
220 | ||
221 | Clears all data in the underlying grid table and repaints the grid. The table is not deleted by | |
222 | this function. If you are using a derived table class then you need to override | |
223 | \helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect. | |
224 | ||
5c69031c MB |
225 | \membersection{wxGrid::ClearSelection}\label{wxgridclearselection} |
226 | ||
227 | \func{void}{ClearSelection}{\void} | |
228 | ||
229 | Deselects all cells that are currently selected. | |
230 | ||
78c49c58 MB |
231 | \membersection{wxGrid::CreateGrid}\label{wxgridcreategrid} |
232 | ||
233 | \func{bool}{CreateGrid}{\param{int }{numRows}, \param{int }{numCols}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}} | |
234 | ||
235 | Creates a grid with the specified initial number of rows and columns. | |
236 | Call this directly after the grid constructor. When you use this | |
237 | function wxGrid will create and manage a simple table of string values | |
238 | for you. All of the grid data will be stored in memory. | |
239 | ||
240 | For applications with more complex data types or relationships, or for | |
241 | dealing with very large datasets, you should derive your own grid table | |
242 | class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}. | |
a660d684 KB |
243 | |
244 | \membersection{wxGrid::DeleteCols}\label{wxgriddeletecols} | |
245 | ||
78c49c58 | 246 | \func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = TRUE}} |
a660d684 | 247 | |
78c49c58 MB |
248 | Deletes one or more columns from a grid starting at the specified position and returns |
249 | TRUE if successful. The updateLabels argument is not used at present. | |
250 | ||
251 | If you are using a derived grid table class you will need to override | |
252 | \helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See | |
253 | \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information. | |
a660d684 KB |
254 | |
255 | \membersection{wxGrid::DeleteRows}\label{wxgriddeleterows} | |
256 | ||
78c49c58 MB |
257 | \func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = TRUE}} |
258 | ||
259 | Deletes one or more rows from a grid starting at the specified position and returns | |
260 | TRUE if successful. The updateLabels argument is not used at present. | |
261 | ||
262 | If you are using a derived grid table class you will need to override | |
263 | \helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See | |
264 | \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information. | |
265 | ||
266 | \membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol} | |
267 | ||
268 | \func{void}{DisableCellEditControl}{\void} | |
269 | ||
270 | Disables in-place editing of grid cells. | |
271 | Equivalent to calling EnableCellEditControl(FALSE). | |
272 | ||
273 | \membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize} | |
274 | ||
275 | \func{void}{DisableDragColSize}{\void} | |
276 | ||
277 | Disables column sizing by dragging with the mouse. Equivalent to passing FALSE to | |
278 | \helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}. | |
279 | ||
280 | \membersection{wxGrid::DisableDragGridSize}\label{wxgriddisabledraggridsize} | |
281 | ||
282 | \func{void}{DisableDragGridSize}{\void} | |
283 | ||
284 | Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing | |
285 | FALSE to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize} | |
286 | ||
287 | \membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize} | |
288 | ||
289 | \func{void}{DisableDragRowSize}{\void} | |
290 | ||
291 | Disables row sizing by dragging with the mouse. Equivalent to passing FALSE to | |
292 | \helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}. | |
293 | ||
294 | \membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol} | |
295 | ||
296 | \func{void}{EnableCellEditControl}{\param{bool }{enable = TRUE}} | |
297 | ||
298 | Enables or disables in-place editing of grid cell data. The grid will issue either a | |
299 | wxEVT_GRID_EDITOR_SHOWN or wxEVT_GRID_EDITOR_HIDDEN event. | |
300 | ||
301 | \membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize} | |
302 | ||
303 | \func{void}{EnableDragColSize}{\param{bool }{enable = TRUE}} | |
a660d684 | 304 | |
78c49c58 MB |
305 | Enables or disables column sizing by dragging with the mouse. |
306 | ||
307 | \membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize} | |
308 | ||
309 | \func{void}{EnableDragGridSize}{\param{bool }{enable = TRUE}} | |
310 | ||
311 | Enables or disables row and column resizing by dragging gridlines with the mouse. | |
312 | ||
313 | \membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize} | |
314 | ||
315 | \func{void}{EnableDragRowSize}{\param{bool }{enable = TRUE}} | |
316 | ||
317 | Enables or disables row sizing by dragging with the mouse. | |
318 | ||
319 | \membersection{wxGrid::EnableEditing}\label{wxgridenableediting} | |
320 | ||
321 | \func{void}{EnableEditing}{\param{bool }{edit}} | |
322 | ||
323 | If the edit argument is FALSE this function sets the whole grid as read-only. If the | |
324 | argument is TRUE the grid is set to the default state where cells may be editable. In the | |
325 | default state you can set single grid cells and whole rows and columns to be editable or | |
326 | read-only via | |
327 | \helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single | |
328 | cells you can also use the shortcut function | |
329 | \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}. | |
330 | ||
331 | For more information about controlling grid cell attributes see the | |
332 | \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the | |
333 | \helpref{wxGrid classes overview}{gridoverview}. | |
334 | ||
335 | \membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines} | |
336 | ||
337 | \func{void}{EnableGridLines}{\param{bool }{enable = TRUE}} | |
338 | ||
339 | Turns the drawing of grid lines on or off. | |
a660d684 KB |
340 | |
341 | \membersection{wxGrid::EndBatch}\label{wxgridendbatch} | |
342 | ||
343 | \func{void}{EndBatch}{\void} | |
344 | ||
78c49c58 MB |
345 | Decrements the grid's batch count. When the count is greater than zero repainting of |
346 | the grid is suppressed. Each previous call to | |
347 | \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} must be matched by a later call to | |
348 | EndBatch. Code that does a lot of grid modification can be enclosed between | |
349 | BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will | |
350 | cause the grid to be repainted. | |
351 | ||
352 | \membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh} | |
a660d684 | 353 | |
78c49c58 MB |
354 | \func{void}{ForceRefresh}{\void} |
355 | ||
356 | Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh. | |
a660d684 KB |
357 | |
358 | \membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount} | |
359 | ||
78c49c58 | 360 | \func{int}{GetBatchCount}{\void} |
a660d684 | 361 | |
78c49c58 MB |
362 | Returns the number of times that \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} has been called |
363 | without (yet) matching calls to \helpref{wxGrid::EndBatch}{wxgridendbatch}. While | |
364 | the grid's batch count is greater than zero the display will not be updated. | |
a660d684 | 365 | |
78c49c58 | 366 | \membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment} |
a660d684 | 367 | |
78c49c58 | 368 | \func{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}} |
a660d684 | 369 | |
78c49c58 MB |
370 | Sets the arguments to the horizontal and vertical text alignment values for the |
371 | grid cell at the specified location. | |
a660d684 | 372 | |
78c49c58 MB |
373 | Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\ |
374 | Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. | |
a660d684 | 375 | |
78c49c58 | 376 | \membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour} |
a660d684 | 377 | |
78c49c58 | 378 | \func{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}} |
a660d684 | 379 | |
78c49c58 | 380 | Returns the background colour of the cell at the specified location. |
a660d684 | 381 | |
78c49c58 | 382 | \membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor} |
a660d684 | 383 | |
78c49c58 | 384 | \func{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}} |
a660d684 | 385 | |
78c49c58 | 386 | Returns a pointer to the editor for the cell at the specified location. |
21f280f4 | 387 | |
78c49c58 MB |
388 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and |
389 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
a660d684 | 390 | |
78c49c58 | 391 | \membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont} |
a660d684 | 392 | |
78c49c58 | 393 | \func{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}} |
a660d684 | 394 | |
78c49c58 | 395 | Returns the font for text in the grid cell at the specified location. |
a660d684 | 396 | |
78c49c58 | 397 | \membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer} |
21f280f4 | 398 | |
78c49c58 | 399 | \func{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}} |
a660d684 | 400 | |
78c49c58 | 401 | Returns a pointer to the renderer for the grid cell at the specified location. |
a660d684 | 402 | |
78c49c58 MB |
403 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and |
404 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
a660d684 KB |
405 | |
406 | \membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour} | |
407 | ||
78c49c58 | 408 | \func{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}} |
a660d684 | 409 | |
78c49c58 | 410 | Returns the text colour for the grid cell at the specified location. |
a660d684 | 411 | |
5c69031c MB |
412 | \membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue} |
413 | ||
414 | \func{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}} | |
415 | ||
416 | \func{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}} | |
417 | ||
418 | Returns the string contained in the cell at the specified location. For simple applications where a | |
419 | grid object automatically uses a default grid table of string values you use this function together | |
420 | with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values. | |
421 | ||
422 | For more complex applications where you have derived your own grid table class that contains | |
423 | various data types (e.g. numeric, boolean or user-defined custom types) then you only use this | |
424 | function for those cells that contain string values. | |
425 | ||
426 | See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas} | |
427 | and the \helpref{wxGrid overview}{gridoverview} for more information. | |
428 | ||
78c49c58 | 429 | \membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment} |
a660d684 | 430 | |
78c49c58 | 431 | \func{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}} |
21f280f4 | 432 | |
78c49c58 | 433 | Sets the arguments to the current column label alignment values. |
a660d684 | 434 | |
78c49c58 MB |
435 | Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\ |
436 | Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM. | |
a660d684 | 437 | |
78c49c58 | 438 | \membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize} |
a660d684 | 439 | |
78c49c58 | 440 | \func{int}{GetColLabelSize}{\void} |
a660d684 | 441 | |
78c49c58 | 442 | Returns the current height of the column labels. |
21f280f4 | 443 | |
78c49c58 | 444 | \membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue} |
a660d684 | 445 | |
78c49c58 | 446 | \func{wxString}{GetColLabelValue}{\param{int }{col}} |
a660d684 | 447 | |
78c49c58 | 448 | Returns the specifed column label. The default grid table class provides column labels of |
2eebb742 | 449 | the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override |
78c49c58 MB |
450 | \helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide |
451 | your own labels. | |
a660d684 | 452 | |
78c49c58 | 453 | \membersection{wxGrid::GetColSize}\label{wxgridgetcolsize} |
a660d684 | 454 | |
78c49c58 | 455 | \func{int}{GetColSize}{\param{int }{col}} |
a660d684 | 456 | |
78c49c58 | 457 | Returns the width of the specified column. |
a660d684 | 458 | |
78c49c58 | 459 | \membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment} |
a660d684 | 460 | |
78c49c58 | 461 | \func{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}} |
a660d684 | 462 | |
78c49c58 MB |
463 | Sets the arguments to the current default horizontal and vertical text alignment |
464 | values. | |
a660d684 | 465 | |
2eebb742 JS |
466 | Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\ |
467 | Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
a660d684 | 468 | |
78c49c58 | 469 | \membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour} |
a660d684 | 470 | |
78c49c58 | 471 | \func{wxColour}{GetDefaultCellBackgroundColour}{\void} |
a660d684 | 472 | |
78c49c58 | 473 | Returns the current default background colour for grid cells. |
a660d684 | 474 | |
78c49c58 | 475 | \membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont} |
a660d684 | 476 | |
78c49c58 | 477 | \func{wxFont}{GetDefaultCellFont}{\void} |
a660d684 | 478 | |
78c49c58 | 479 | Returns the current default font for grid cell text. |
a660d684 | 480 | |
78c49c58 | 481 | \membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour} |
a660d684 | 482 | |
78c49c58 | 483 | \func{wxColour}{GetDefaultCellTextColour}{\void} |
a660d684 | 484 | |
78c49c58 | 485 | Returns the current default colour for grid cell text. |
a660d684 | 486 | |
78c49c58 | 487 | \membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize} |
a660d684 | 488 | |
78c49c58 | 489 | \func{int}{GetDefaultColLabelSize}{\void} |
a660d684 | 490 | |
78c49c58 | 491 | Returns the default height for column labels. |
c0b042fc | 492 | |
78c49c58 | 493 | \membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize} |
c0b042fc | 494 | |
78c49c58 | 495 | \func{int}{GetDefaultColSize}{\void} |
c0b042fc | 496 | |
78c49c58 | 497 | Returns the current default width for grid columns. |
a660d684 | 498 | |
78c49c58 | 499 | \membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor} |
a660d684 | 500 | |
78c49c58 | 501 | \constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void} |
a660d684 | 502 | |
78c49c58 MB |
503 | Returns a pointer to the current default grid cell editor. |
504 | ||
505 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
506 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
507 | ||
508 | \membersection{wxGrid::GetDefaultRenderer}\label{wxgridgetdefaultrenderer} | |
509 | ||
510 | \constfunc{wxGridCellRenderer*}{GetDefaultRenderer}{\void} | |
511 | ||
512 | Returns a pointer to the current default grid cell renderer. | |
513 | ||
514 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
515 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
a660d684 | 516 | |
78c49c58 | 517 | \membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize} |
a660d684 | 518 | |
78c49c58 MB |
519 | \func{int}{GetDefaultRowLabelSize}{\void} |
520 | ||
521 | Returns the default width for the row labels. | |
522 | ||
523 | \membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize} | |
524 | ||
525 | \func{int}{GetDefaultRowSize}{\void} | |
526 | ||
527 | Returns the current default height for grid rows. | |
528 | ||
529 | \membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol} | |
530 | ||
531 | \func{int}{GetGridCursorCol}{\void} | |
532 | ||
533 | Returns the current grid cell column position. | |
534 | ||
535 | \membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow} | |
536 | ||
537 | \func{int}{GetGridCursorRow}{\void} | |
538 | ||
539 | Returns the current grid cell row position. | |
540 | ||
541 | \membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour} | |
542 | ||
543 | \func{wxColour}{GetGridLineColour}{\void} | |
544 | ||
545 | Returns the colour used for grid lines. | |
546 | ||
547 | \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled} | |
548 | ||
549 | \func{bool}{GridLinesEnabled}{\void} | |
550 | ||
551 | Returnes TRUE if drawing of grid lines is turned on, FALSE otherwise. | |
a660d684 KB |
552 | |
553 | \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour} | |
554 | ||
78c49c58 | 555 | \func{wxColour}{GetLabelBackgroundColour}{\void} |
a660d684 | 556 | |
78c49c58 | 557 | Returns the colour used for the background of row and column labels. |
a660d684 | 558 | |
78c49c58 | 559 | \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont} |
a660d684 | 560 | |
78c49c58 | 561 | \func{wxFont}{GetLabelFont}{\void} |
a660d684 | 562 | |
78c49c58 | 563 | Returns the font used for row and column labels. |
a660d684 KB |
564 | |
565 | \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour} | |
566 | ||
78c49c58 | 567 | \func{wxColour}{GetLabelTextColour}{\void} |
a660d684 | 568 | |
78c49c58 | 569 | Returns the colour used for row and column label text. |
a660d684 | 570 | |
78c49c58 | 571 | \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols} |
a660d684 | 572 | |
78c49c58 | 573 | \func{int}{GetNumberCols}{\void} |
a660d684 | 574 | |
78c49c58 MB |
575 | Returns the total number of grid columns (actually the number of columns in the underlying grid |
576 | table). | |
a660d684 | 577 | |
78c49c58 | 578 | \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows} |
a660d684 | 579 | |
78c49c58 | 580 | \func{int}{GetNumberRows}{\void} |
a660d684 | 581 | |
78c49c58 | 582 | Returns the total number of grid rows (actually the number of rows in the underlying grid table). |
a660d684 | 583 | |
78c49c58 | 584 | \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment} |
a660d684 | 585 | |
78c49c58 | 586 | \func{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}} |
a660d684 | 587 | |
78c49c58 | 588 | Sets the arguments to the current row label alignment values. |
a660d684 | 589 | |
78c49c58 MB |
590 | Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\ |
591 | Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM. | |
a660d684 | 592 | |
78c49c58 | 593 | \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize} |
a660d684 | 594 | |
78c49c58 | 595 | \func{int}{GetRowLabelSize}{\void} |
a660d684 | 596 | |
78c49c58 | 597 | Returns the current width of the row labels. |
a660d684 | 598 | |
78c49c58 | 599 | \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue} |
a660d684 | 600 | |
78c49c58 | 601 | \func{wxString}{GetRowLabelValue}{\param{int }{row}} |
a660d684 | 602 | |
78c49c58 MB |
603 | Returns the specifed row label. The default grid table class provides numeric row labels. |
604 | If you are using a custom grid table you can override | |
605 | \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide | |
606 | your own labels. | |
a660d684 | 607 | |
78c49c58 | 608 | \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize} |
a660d684 | 609 | |
78c49c58 | 610 | \func{int}{GetRowSize}{\param{int }{row}} |
a660d684 | 611 | |
78c49c58 | 612 | Returns the height of the specified row. |
a660d684 | 613 | |
78c49c58 | 614 | \membersection{wxGrid::GetTable}\label{wxgridgettable} |
a660d684 | 615 | |
78c49c58 | 616 | \constfunc{wxGridTableBase *}{GetTable}{\void} |
a660d684 | 617 | |
78c49c58 | 618 | Returns a base pointer to the current table object. |
a660d684 | 619 | |
78c49c58 | 620 | \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol} |
a660d684 | 621 | |
78c49c58 MB |
622 | \func{void}{HideCellEditControl}{\void} |
623 | ||
624 | Hides the in-place cell edit control. | |
a660d684 KB |
625 | |
626 | \membersection{wxGrid::InsertCols}\label{wxgridinsertcols} | |
627 | ||
78c49c58 MB |
628 | \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = TRUE}} |
629 | ||
630 | Inserts one or more new columns into a grid with the first new column at the | |
631 | specified position and returns TRUE if successful. The updateLabels argument is not | |
632 | used at present. | |
a660d684 | 633 | |
78c49c58 MB |
634 | The sequence of actions begins with the grid object requesting the underlying grid |
635 | table to insert new columns. If this is successful the table notifies the grid and the | |
636 | grid updates the display. For a default grid (one where you have called | |
637 | \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are | |
638 | using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable}) | |
639 | then you must override | |
640 | \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived | |
641 | table class. | |
a660d684 KB |
642 | |
643 | \membersection{wxGrid::InsertRows}\label{wxgridinsertrows} | |
644 | ||
78c49c58 | 645 | \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = TRUE}} |
a660d684 | 646 | |
78c49c58 MB |
647 | Inserts one or more new rows into a grid with the first new row at the specified |
648 | position and returns TRUE if successful. The updateLabels argument is not used at | |
649 | present. | |
a660d684 | 650 | |
78c49c58 MB |
651 | The sequence of actions begins with the grid object requesting the underlying grid |
652 | table to insert new rows. If this is successful the table notifies the grid and the | |
653 | grid updates the display. For a default grid (one where you have called | |
654 | \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are | |
655 | using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable}) | |
656 | then you must override | |
657 | \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived | |
658 | table class. | |
659 | ||
660 | \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled} | |
661 | ||
662 | \constfunc{bool}{IsCellEditControlEnabled}{\void} | |
663 | ||
664 | Returns TRUE if the in-place edit control is currently enabled. | |
665 | ||
666 | \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly} | |
667 | ||
668 | \constfunc{bool}{IsCurrentCellReadOnly}{\void} | |
669 | ||
670 | Returns TRUE if the current cell has been set to read-only | |
671 | (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}). | |
672 | ||
673 | \membersection{wxGrid::IsEditable}\label{wxgridiseditable} | |
a660d684 | 674 | |
78c49c58 | 675 | \func{bool}{IsEditable}{\void} |
a660d684 | 676 | |
78c49c58 MB |
677 | Returns FALSE if the whole grid has been set as read-only or TRUE otherwise. |
678 | See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about | |
679 | controlling the editing status of grid cells. | |
a660d684 | 680 | |
5c69031c MB |
681 | \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly} |
682 | ||
683 | \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}} | |
684 | ||
685 | Returns TRUE if the cell at the specified location can't be edited. | |
686 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. | |
687 | ||
688 | \membersection{wxGrid::IsSelection}\label{wxgridisselection} | |
689 | ||
690 | \func{bool}{IsSelection}{\void} | |
691 | ||
692 | Returns TRUE if there are currently rows, columns or blocks of cells selected. | |
693 | ||
78c49c58 | 694 | \membersection{wxGrid::IsVisible}\label{wxgridisvisible} |
a660d684 | 695 | |
2eebb742 | 696 | \func{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = TRUE}} |
a660d684 | 697 | |
2eebb742 | 698 | \func{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = TRUE}} |
a660d684 | 699 | |
78c49c58 MB |
700 | Returns TRUE if a cell is either wholly visible (the default) or at least partially |
701 | visible in the grid window. | |
a660d684 | 702 | |
78c49c58 | 703 | \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible} |
a660d684 | 704 | |
78c49c58 | 705 | \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}} |
a660d684 | 706 | |
78c49c58 | 707 | \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}} |
a660d684 | 708 | |
78c49c58 MB |
709 | Brings the specified cell into the visible grid cell area with minimal scrolling. Does |
710 | nothing if the cell is already visible. | |
a660d684 | 711 | |
78c49c58 | 712 | \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown} |
a660d684 | 713 | |
78c49c58 | 714 | \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}} |
a660d684 | 715 | |
2eebb742 | 716 | Moves the grid cursor down by one row. If a block of cells was previously selected it |
78c49c58 | 717 | will expand if the argument is TRUE or be cleared if the argument is FALSE. |
a660d684 | 718 | |
78c49c58 MB |
719 | \wxheading{Keyboard}\\ |
720 | This function is called for Down cursor key presses or Shift+Down to expand a selection. | |
a660d684 | 721 | |
78c49c58 | 722 | \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft} |
a660d684 | 723 | |
78c49c58 | 724 | \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}} |
a660d684 | 725 | |
78c49c58 MB |
726 | Moves the grid cursor left by one column. If a block of cells was previously selected it |
727 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
a660d684 | 728 | |
78c49c58 MB |
729 | \wxheading{Keyboard}\\ |
730 | This function is called for Left cursor key presses or Shift+Left to expand a selection. | |
a660d684 | 731 | |
78c49c58 | 732 | \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright} |
a660d684 | 733 | |
78c49c58 | 734 | \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}} |
a660d684 | 735 | |
78c49c58 MB |
736 | Moves the grid cursor right by one column. If a block of cells was previously selected it |
737 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
a660d684 | 738 | |
78c49c58 MB |
739 | \wxheading{Keyboard}\\ |
740 | This function is called for Right cursor key presses or Shift+Right to expand a selection. | |
a660d684 | 741 | |
78c49c58 | 742 | \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup} |
a660d684 | 743 | |
78c49c58 | 744 | \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}} |
a660d684 | 745 | |
78c49c58 MB |
746 | Moves the grid cursor up by one row. If a block of cells was previously selected it |
747 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
a660d684 | 748 | |
78c49c58 MB |
749 | \wxheading{Keyboard}\\ |
750 | This function is called for Up cursor key presses or Shift+Up to expand a selection. | |
a660d684 | 751 | |
78c49c58 | 752 | \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock} |
a660d684 | 753 | |
78c49c58 | 754 | \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}} |
a660d684 | 755 | |
78c49c58 MB |
756 | Moves the grid cursor down in the current column such that it skips to the beginning or |
757 | end of a block of non-empty cells. If a block of cells was previously selected it | |
758 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
a660d684 | 759 | |
78c49c58 MB |
760 | \wxheading{Keyboard}\\ |
761 | This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection. | |
a660d684 | 762 | |
78c49c58 | 763 | \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock} |
a660d684 | 764 | |
78c49c58 | 765 | \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}} |
a660d684 | 766 | |
78c49c58 MB |
767 | Moves the grid cursor left in the current row such that it skips to the beginning or |
768 | end of a block of non-empty cells. If a block of cells was previously selected it | |
769 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
a660d684 | 770 | |
78c49c58 MB |
771 | \wxheading{Keyboard}\\ |
772 | This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection. | |
a660d684 | 773 | |
78c49c58 MB |
774 | \membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock} |
775 | ||
776 | \func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}} | |
777 | ||
778 | Moves the grid cursor right in the current row such that it skips to the beginning or | |
779 | end of a block of non-empty cells. If a block of cells was previously selected it | |
780 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
781 | ||
782 | \wxheading{Keyboard}\\ | |
783 | This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection. | |
784 | ||
785 | \membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock} | |
786 | ||
787 | \func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}} | |
788 | ||
789 | Moves the grid cursor up in the current column such that it skips to the beginning or | |
790 | end of a block of non-empty cells. If a block of cells was previously selected it | |
791 | will expand if the argument is TRUE or be cleared if the argument is FALSE. | |
792 | ||
793 | \wxheading{Keyboard}\\ | |
794 | This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection. | |
795 | ||
796 | \membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown} | |
797 | ||
798 | \func{bool}{MovePageDown}{\void} | |
799 | ||
800 | Moves the grid cursor down by some number of rows so that the previous bottom visible row | |
801 | becomes the top visible row. | |
802 | ||
803 | \wxheading{Keyboard}\\ | |
804 | This function is called for PgDn keypresses. | |
805 | ||
806 | \membersection{wxGrid::MovePageUp}\label{wxgridmovepageup} | |
807 | ||
808 | \func{bool}{MovePageUp}{\void} | |
809 | ||
810 | Moves the grid cursor up by some number of rows so that the previous top visible row | |
811 | becomes the bottom visible row. | |
812 | ||
813 | \wxheading{Keyboard}\\ | |
814 | This function is called for PgUp keypresses. | |
815 | ||
816 | \membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue} | |
817 | ||
818 | \func{void}{SaveEditControlValue}{\void} | |
819 | ||
820 | Sets the value of the current grid cell to the current in-place edit control value. | |
821 | This is called automatically when the grid cursor moves from the current cell to a | |
822 | new cell. It is also a good idea to call this function when closing a grid since | |
823 | any edits to the final cell location will not be saved otherwise. | |
a660d684 | 824 | |
5c69031c MB |
825 | \membersection{wxGrid::SelectAll}\label{wxgridselectall} |
826 | ||
827 | \func{void}{SelectAll}{\void} | |
828 | ||
829 | Selects all cells in the grid. | |
830 | ||
831 | \membersection{wxGrid::SelectBlock}\label{wxgridselectblock} | |
832 | ||
cbb4b02f MB |
833 | \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol}, |
834 | \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = FALSE}} | |
5c69031c | 835 | |
cbb4b02f MB |
836 | \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft}, |
837 | \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = FALSE}} | |
5c69031c | 838 | |
cbb4b02f MB |
839 | Selects a rectangular block of cells. If addToSelected is FALSE then any existing selection will be |
840 | deselected; if TRUE the column will be added to the existing selection. | |
5c69031c MB |
841 | |
842 | \membersection{wxGrid::SelectCol}\label{wxgridselectcol} | |
843 | ||
844 | \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = FALSE}} | |
845 | ||
846 | Selects the specified column. If addToSelected is FALSE then any existing selection will be | |
847 | deselected; if TRUE the column will be added to the existing selection. | |
848 | ||
849 | \membersection{wxGrid::SelectRow}\label{wxgridselectrow} | |
850 | ||
851 | \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = FALSE}} | |
852 | ||
853 | Selects the specified row. If addToSelected is FALSE then any existing selection will be | |
854 | deselected; if TRUE the row will be added to the existing selection. | |
855 | ||
a660d684 KB |
856 | \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment} |
857 | ||
78c49c58 | 858 | \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}} |
a660d684 | 859 | |
2eebb742 JS |
860 | \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}} |
861 | ||
862 | \func{void}{SetCellAlignment}{\param{int }{align}} | |
863 | ||
78c49c58 | 864 | Sets the horizontal and vertial alignment for grid cell text at the specified location. |
a660d684 | 865 | |
78c49c58 MB |
866 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\ |
867 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. | |
a660d684 | 868 | |
78c49c58 | 869 | \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor} |
21f280f4 | 870 | |
78c49c58 MB |
871 | \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}} |
872 | ||
873 | Sets the editor for the grid cell at the specified location. | |
874 | The grid will take ownership of the pointer. | |
875 | ||
876 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
877 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
878 | ||
879 | \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont} | |
880 | ||
deea56b1 | 881 | \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}} |
78c49c58 MB |
882 | |
883 | Sets the font for text in the grid cell at the specified location. | |
a660d684 | 884 | |
78c49c58 | 885 | \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer} |
a660d684 | 886 | |
78c49c58 | 887 | \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}} |
a660d684 | 888 | |
78c49c58 MB |
889 | Sets the renderer for the grid cell at the specified location. |
890 | The grid will take ownership of the pointer. | |
a660d684 | 891 | |
78c49c58 MB |
892 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and |
893 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
21f280f4 | 894 | |
a660d684 KB |
895 | \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour} |
896 | ||
68f30f26 | 897 | \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}} |
a660d684 | 898 | |
2eebb742 JS |
899 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}} |
900 | ||
deea56b1 | 901 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}} |
2eebb742 | 902 | |
78c49c58 | 903 | Sets the text colour for the grid cell at the specified location. |
a660d684 | 904 | |
5c69031c MB |
905 | \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue} |
906 | ||
907 | \func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}} | |
908 | ||
909 | \func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}} | |
910 | ||
2eebb742 JS |
911 | \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}} |
912 | ||
5c69031c MB |
913 | Sets the string value for the cell at the specified location. For simple applications where a |
914 | grid object automatically uses a default grid table of string values you use this function together | |
915 | with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values. | |
916 | ||
917 | For more complex applications where you have derived your own grid table class that contains | |
918 | various data types (e.g. numeric, boolean or user-defined custom types) then you only use this | |
2eebb742 JS |
919 | function for those cells that contain string values. |
920 | ||
921 | The last form is for backward compatibility only. | |
5c69031c MB |
922 | |
923 | See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas} | |
924 | and the \helpref{wxGrid overview}{gridoverview} for more information. | |
925 | ||
78c49c58 | 926 | \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr} |
a660d684 | 927 | |
78c49c58 | 928 | \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}} |
21f280f4 | 929 | |
78c49c58 | 930 | Sets the cell attributes for all cells in the specified column. |
a660d684 | 931 | |
78c49c58 MB |
932 | For more information about controlling grid cell attributes see the |
933 | \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the | |
934 | \helpref{wxGrid classes overview}{gridoverview}. | |
a660d684 | 935 | |
78c49c58 | 936 | \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool} |
a660d684 | 937 | |
78c49c58 | 938 | \func{void}{SetColFormatBool}{\param{int }{col}} |
a660d684 | 939 | |
78c49c58 | 940 | Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox. |
21f280f4 | 941 | |
78c49c58 | 942 | \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber} |
a660d684 | 943 | |
78c49c58 | 944 | \func{void}{SetColFormatNumber}{\param{int }{col}} |
a660d684 | 945 | |
78c49c58 | 946 | Sets the specified column to display integer values. |
a660d684 | 947 | |
78c49c58 | 948 | \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat} |
a660d684 | 949 | |
78c49c58 | 950 | \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}} |
a660d684 | 951 | |
78c49c58 | 952 | Sets the specified column to display floating point values with the given width and precision. |
a660d684 | 953 | |
78c49c58 | 954 | \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom} |
a660d684 | 955 | |
78c49c58 | 956 | \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}} |
a660d684 | 957 | |
78c49c58 MB |
958 | Sets the specified column to display data in a custom format. |
959 | See the \helpref{wxGrid overview}{gridoverview} for more information on working | |
960 | with custom data types. | |
a660d684 | 961 | |
78c49c58 | 962 | \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment} |
a660d684 | 963 | |
78c49c58 | 964 | \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} |
a660d684 | 965 | |
78c49c58 | 966 | Sets the horizontal and vertical alignment of column label text. |
a660d684 | 967 | |
deea56b1 JS |
968 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. |
969 | ||
78c49c58 MB |
970 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. |
971 | ||
972 | \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize} | |
973 | ||
974 | \func{void}{SetColLabelSize}{\param{int }{height}} | |
975 | ||
976 | Sets the height of the column labels. | |
977 | ||
978 | \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue} | |
979 | ||
deea56b1 | 980 | \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}} |
78c49c58 MB |
981 | |
982 | Set the value for the given column label. If you are using a derived grid table you must | |
983 | override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue} | |
984 | for this to have any effect. | |
985 | ||
986 | \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth} | |
987 | ||
988 | \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}} | |
989 | ||
990 | Sets the minimal width for the specified column. This should normally be called when creating the grid | |
991 | because it will not resize a column that is already narrower than the minimal width. | |
992 | ||
993 | \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize} | |
994 | ||
995 | \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}} | |
996 | ||
997 | Sets the width of the specified column. | |
998 | ||
999 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
1000 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. | |
1001 | ||
2eebb742 | 1002 | Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will |
78c49c58 MB |
1003 | also be set as the minimal width for the column. |
1004 | ||
2eebb742 | 1005 | \wxheading{Note}\\ |
78c49c58 MB |
1006 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
1007 | The memory requirements for this could become prohibitive if your grid is very large. | |
1008 | ||
1009 | \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment} | |
1010 | ||
1011 | \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}} | |
1012 | ||
1013 | Sets the default horizontal and vertial alignment for grid cell text. | |
1014 | ||
deea56b1 JS |
1015 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. |
1016 | ||
78c49c58 MB |
1017 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. |
1018 | ||
1019 | \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour} | |
1020 | ||
deea56b1 | 1021 | \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}} |
78c49c58 MB |
1022 | |
1023 | Sets the default background colour for grid cells. | |
1024 | ||
1025 | \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont} | |
1026 | ||
deea56b1 | 1027 | \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}} |
78c49c58 MB |
1028 | |
1029 | Sets the default font to be used for grid cell text. | |
1030 | ||
1031 | \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor} | |
1032 | ||
1033 | \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}} | |
1034 | ||
1035 | Sets the default editor for grid cells. The grid will take ownership of the pointer. | |
1036 | ||
1037 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
1038 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1039 | ||
1040 | \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer} | |
1041 | ||
1042 | \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}} | |
1043 | ||
1044 | Sets the default renderer for grid cells. The grid will take ownership of the pointer. | |
1045 | ||
1046 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
1047 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1048 | ||
1049 | \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize} | |
c0b042fc | 1050 | |
78c49c58 | 1051 | \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = FALSE}} |
c0b042fc | 1052 | |
78c49c58 MB |
1053 | Sets the default width for columns in the grid. This will only affect columns subsequently added to |
1054 | the grid unless resizeExistingCols is TRUE. | |
1055 | ||
1056 | \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize} | |
1057 | ||
1058 | \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = FALSE}} | |
1059 | ||
1060 | Sets the default height for rows in the grid. This will only affect rows subsequently added | |
1061 | to the grid unless resizeExistingRows is TRUE. | |
c0b042fc | 1062 | |
a660d684 KB |
1063 | \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor} |
1064 | ||
78c49c58 | 1065 | \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}} |
a660d684 | 1066 | |
78c49c58 MB |
1067 | Set the grid cursor to the specified cell. |
1068 | This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}. | |
a660d684 | 1069 | |
78c49c58 | 1070 | \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour} |
a660d684 | 1071 | |
deea56b1 | 1072 | \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}} |
a660d684 | 1073 | |
78c49c58 | 1074 | Sets the colour used to draw grid lines. |
a660d684 KB |
1075 | |
1076 | \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour} | |
1077 | ||
deea56b1 | 1078 | \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}} |
a660d684 | 1079 | |
78c49c58 | 1080 | Sets the background colour for row and column labels. |
a660d684 | 1081 | |
78c49c58 | 1082 | \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont} |
a660d684 | 1083 | |
deea56b1 | 1084 | \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}} |
a660d684 | 1085 | |
78c49c58 | 1086 | Sets the font for row and column labels. |
a660d684 KB |
1087 | |
1088 | \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour} | |
1089 | ||
deea56b1 | 1090 | \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}} |
a660d684 | 1091 | |
78c49c58 | 1092 | Sets the colour for row and column label text. |
a660d684 | 1093 | |
5c69031c MB |
1094 | \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly} |
1095 | ||
1096 | \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = TRUE}} | |
1097 | ||
1098 | Makes the cell at the specified location read-only or editable. | |
1099 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. | |
1100 | ||
78c49c58 | 1101 | \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr} |
a660d684 | 1102 | |
78c49c58 | 1103 | \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}} |
a660d684 | 1104 | |
78c49c58 MB |
1105 | Sets the cell attributes for all cells in the specified row. |
1106 | See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information | |
1107 | about controlling cell attributes. | |
a660d684 | 1108 | |
78c49c58 | 1109 | \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment} |
a660d684 | 1110 | |
78c49c58 | 1111 | \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} |
a660d684 | 1112 | |
78c49c58 | 1113 | Sets the horizontal and vertical alignment of row label text. |
a660d684 | 1114 | |
deea56b1 JS |
1115 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. |
1116 | ||
78c49c58 | 1117 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. |
a660d684 | 1118 | |
78c49c58 | 1119 | \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize} |
a660d684 | 1120 | |
78c49c58 | 1121 | \func{void}{SetRowLabelSize}{\param{int }{width}} |
a660d684 | 1122 | |
78c49c58 MB |
1123 | Sets the width of the row labels. |
1124 | ||
1125 | \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue} | |
1126 | ||
deea56b1 | 1127 | \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}} |
78c49c58 MB |
1128 | |
1129 | Set the value for the given row label. If you are using a derived grid table you must | |
deea56b1 | 1130 | override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue} |
78c49c58 MB |
1131 | for this to have any effect. |
1132 | ||
1133 | \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight} | |
1134 | ||
1135 | \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{width}} | |
1136 | ||
1137 | Sets the minimal height for the specified row. This should normally be called when creating the grid | |
1138 | because it will not resize a row that is already shorter than the minimal height. | |
1139 | ||
1140 | \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize} | |
1141 | ||
1142 | \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}} | |
1143 | ||
1144 | Sets the height of the specified row. | |
1145 | ||
1146 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
1147 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. | |
1148 | ||
2eebb742 | 1149 | Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will |
78c49c58 MB |
1150 | also be set as the minimal width for the column. |
1151 | ||
deea56b1 JS |
1152 | \wxheading{Note} |
1153 | ||
78c49c58 MB |
1154 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
1155 | The memory requirements for this could become prohibitive if your grid is very large. | |
1156 | ||
1157 | \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode} | |
1158 | ||
deea56b1 | 1159 | \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}} |
78c49c58 MB |
1160 | |
1161 | Set the selection behaviour of the grid. | |
1162 | ||
1163 | \wxheading{Parameters} | |
1164 | ||
1165 | \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.} | |
1166 | ||
deea56b1 | 1167 | \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.} |
78c49c58 MB |
1168 | |
1169 | \docparam{wxGrid::wxGridSelectionColumns}{Selections will consist of whole columns.} | |
1170 | ||
1171 | \membersection{wxGrid::SetTable}\label{wxgridsettable} | |
1172 | ||
1173 | \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = FALSE}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}} | |
1174 | ||
2eebb742 | 1175 | Passes a pointer to a custom grid table to be used by the grid. This should be called |
78c49c58 MB |
1176 | after the grid constructor and before using the grid object. If takeOwnership is set to |
1177 | TRUE then the table will be deleted by the wxGrid destructor. | |
1178 | ||
1179 | Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your | |
1180 | application involves complex or non-string data or data sets that are too large to fit | |
1181 | wholly in memory. | |
1182 | ||
1183 | \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol} | |
1184 | ||
1185 | \func{void}{ShowCellEditControl}{\void} | |
1186 | ||
1187 | Displays the in-place cell edit control for the current cell. | |
1188 | ||
1189 | \membersection{wxGrid::XToCol}\label{wxgridxtocol} | |
1190 | ||
1191 | \func{int}{XToCol}{\param{int }{x}} | |
1192 | ||
1193 | Returns the grid column that corresponds to the logical x coordinate. Returns | |
1194 | wxNOT_FOUND if there is no column at the x position. | |
1195 | ||
1196 | \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol} | |
1197 | ||
1198 | \func{int}{XToEdgeOfCol}{\param{int }{x}} | |
1199 | ||
1200 | Returns the column whose right hand edge is close to the given logical x position. | |
1201 | If no column edge is near to this position wxNOT_FOUND is returned. | |
1202 | ||
1203 | \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow} | |
1204 | ||
1205 | \func{int}{YToEdgeOfRow}{\param{int }{y}} | |
1206 | ||
1207 | Returns the row whose bottom edge is close to the given logical y position. | |
1208 | If no row edge is near to this position wxNOT_FOUND is returned. | |
1209 | ||
1210 | \membersection{wxGrid::YToRow}\label{wxgridytorow} | |
1211 | ||
1212 | \func{int}{YToRow}{\param{int }{y}} | |
1213 | ||
1214 | Returns the grid row that corresponds to the logical y coordinate. Returns | |
1215 | wxNOT_FOUND if there is no row at the y position. | |
1216 | ||
1217 | ||
1218 | ||
78c49c58 MB |
1219 | \membersection{wxGrid::IsInSelection}\label{wxgridisinselection} |
1220 | ||
1221 | \func{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}} | |
1222 | ||
1223 | \func{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}} | |
1224 | ||
1225 | ||
1226 | \membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect} | |
1227 | ||
1228 | \func{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}} | |
1229 | ||
1230 | This function returns the rectangle that encloses the block of cells | |
1231 | limited by TopLeft and BottomRight cell in device coords and clipped | |
1232 | to the client size of the grid window. | |
1233 | ||
1234 | ||
1235 | \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect} | |
1236 | ||
1237 | \func{wxRect}{SelectionToDeviceRect}{\void} | |
1238 | ||
1239 | This function returns the rectangle that encloses the selected cells | |
1240 | in device coords and clipped to the client size of the grid window. | |
1241 | ||
1242 | ||
1243 | \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground} | |
1244 | ||
1245 | \constfunc{wxColour}{GetSelectionBackground}{\void} | |
1246 | ||
1247 | Access or update the selection fore/back colours | |
1248 | ||
1249 | ||
1250 | \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground} | |
1251 | ||
1252 | \constfunc{wxColour}{GetSelectionForeground}{\void} | |
1253 | ||
1254 | ||
1255 | \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground} | |
1256 | ||
1257 | \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}} | |
1258 | ||
1259 | ||
1260 | \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground} | |
1261 | ||
1262 | \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}} | |
1263 | ||
1264 | ||
1265 | \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype} | |
1266 | ||
1267 | \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}} | |
1268 | ||
1269 | Methods for a registry for mapping data types to Renderers/Editors | |
1270 | ||
78c49c58 MB |
1271 | \membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell} |
1272 | ||
1273 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}} | |
1274 | ||
1275 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}} | |
1276 | ||
1277 | ||
1278 | \membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell} | |
1279 | ||
1280 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}} | |
1281 | ||
1282 | ||
1283 | \membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype} | |
1284 | ||
1285 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}} | |
1286 | ||
1287 | ||
1288 | \membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype} | |
1289 | ||
1290 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}} | |
1291 | ||
1292 | ||
1293 | \membersection{wxGrid::SetMargins}\label{wxgridsetmargins} | |
1294 | ||
1295 | \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}} | |
1296 | ||
deea56b1 | 1297 | A grid may occupy more space than needed for its rows/columns. This |
78c49c58 MB |
1298 | function allows to set how big this extra space is |
1299 | ||
78c49c58 MB |
1300 | \membersection{wxGrid::wxGrid}\label{wxgridwxgrid} |
1301 | ||
1302 | \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}} | |
1303 | ||
2eebb742 | 1304 | Backward compatibility. |
78c49c58 MB |
1305 | |
1306 | \membersection{wxGrid::UpdateDimensions}\label{wxgridupdatedimensions} | |
1307 | ||
1308 | \func{void}{UpdateDimensions}{\void} | |
1309 | ||
2eebb742 | 1310 | Backward compatibility. |
78c49c58 MB |
1311 | |
1312 | \membersection{wxGrid::GetRows}\label{wxgridgetrows} | |
1313 | ||
1314 | \func{int}{GetRows}{\void} | |
1315 | ||
2eebb742 | 1316 | Backward compatibility. |
78c49c58 MB |
1317 | |
1318 | \membersection{wxGrid::GetCols}\label{wxgridgetcols} | |
1319 | ||
1320 | \func{int}{GetCols}{\void} | |
1321 | ||
2eebb742 | 1322 | Backward compatibility. |
78c49c58 MB |
1323 | |
1324 | \membersection{wxGrid::GetCursorRow}\label{wxgridgetcursorrow} | |
1325 | ||
1326 | \func{int}{GetCursorRow}{\void} | |
1327 | ||
2eebb742 | 1328 | Backward compatibility. |
78c49c58 MB |
1329 | |
1330 | \membersection{wxGrid::GetCursorColumn}\label{wxgridgetcursorcolumn} | |
1331 | ||
1332 | \func{int}{GetCursorColumn}{\void} | |
1333 | ||
2eebb742 | 1334 | Backward compatibility. |
78c49c58 MB |
1335 | |
1336 | \membersection{wxGrid::GetScrollPosX}\label{wxgridgetscrollposx} | |
1337 | ||
1338 | \func{int}{GetScrollPosX}{\void} | |
1339 | ||
2eebb742 | 1340 | Backward compatibility. |
78c49c58 MB |
1341 | |
1342 | \membersection{wxGrid::GetScrollPosY}\label{wxgridgetscrollposy} | |
1343 | ||
1344 | \func{int}{GetScrollPosY}{\void} | |
1345 | ||
2eebb742 | 1346 | Backward compatibility. |
78c49c58 MB |
1347 | |
1348 | \membersection{wxGrid::SetScrollX}\label{wxgridsetscrollx} | |
1349 | ||
2eebb742 | 1350 | \func{void}{SetScrollX}{\param{int }{x}} |
78c49c58 | 1351 | |
2eebb742 | 1352 | Backward compatibility. |
78c49c58 MB |
1353 | |
1354 | \membersection{wxGrid::SetScrollY}\label{wxgridsetscrolly} | |
1355 | ||
2eebb742 | 1356 | \func{void}{SetScrollY}{\param{int }{y}} |
78c49c58 | 1357 | |
2eebb742 | 1358 | Backward compatibility. |
78c49c58 MB |
1359 | |
1360 | \membersection{wxGrid::SetColumnWidth}\label{wxgridsetcolumnwidth} | |
1361 | ||
1362 | \func{void}{SetColumnWidth}{\param{int }{col}, \param{int }{width}} | |
1363 | ||
2eebb742 | 1364 | Backward compatibility. |
78c49c58 MB |
1365 | |
1366 | \membersection{wxGrid::GetColumnWidth}\label{wxgridgetcolumnwidth} | |
1367 | ||
1368 | \func{int}{GetColumnWidth}{\param{int }{col}} | |
1369 | ||
2eebb742 | 1370 | Backward compatibility. |
78c49c58 MB |
1371 | |
1372 | \membersection{wxGrid::SetRowHeight}\label{wxgridsetrowheight} | |
1373 | ||
1374 | \func{void}{SetRowHeight}{\param{int }{row}, \param{int }{height}} | |
1375 | ||
2eebb742 | 1376 | Backward compatibility. |
78c49c58 MB |
1377 | |
1378 | \membersection{wxGrid::GetViewHeight}\label{wxgridgetviewheight} | |
1379 | ||
1380 | \func{int}{GetViewHeight}{\void} | |
1381 | ||
2eebb742 | 1382 | Backward compatibility. |
78c49c58 | 1383 | |
78c49c58 MB |
1384 | \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth} |
1385 | ||
1386 | \func{int}{GetViewWidth}{\void} | |
1387 | ||
2eebb742 | 1388 | Returned number of whole cols visible. |
78c49c58 MB |
1389 | |
1390 | \membersection{wxGrid::SetLabelSize}\label{wxgridsetlabelsize} | |
1391 | ||
1392 | \func{void}{SetLabelSize}{\param{int }{orientation}, \param{int }{sz}} | |
1393 | ||
1394 | ||
1395 | \membersection{wxGrid::GetLabelSize}\label{wxgridgetlabelsize} | |
1396 | ||
1397 | \func{int}{GetLabelSize}{\param{int }{orientation}} | |
1398 | ||
1399 | ||
1400 | \membersection{wxGrid::SetLabelAlignment}\label{wxgridsetlabelalignment} | |
1401 | ||
1402 | \func{void}{SetLabelAlignment}{\param{int }{orientation}, \param{int }{align}} | |
1403 | ||
1404 | ||
1405 | \membersection{wxGrid::GetLabelAlignment}\label{wxgridgetlabelalignment} | |
1406 | ||
2eebb742 | 1407 | \func{int}{GetLabelAlignment}{\param{int }{orientation}, \param{int }{align}} |
78c49c58 MB |
1408 | |
1409 | ||
1410 | \membersection{wxGrid::SetLabelValue}\label{wxgridsetlabelvalue} | |
1411 | ||
1412 | \func{void}{SetLabelValue}{\param{int }{orientation}, \param{const wxString\& }{val}, \param{int }{pos}} | |
1413 | ||
1414 | ||
1415 | \membersection{wxGrid::GetLabelValue}\label{wxgridgetlabelvalue} | |
1416 | ||
1417 | \func{wxString}{GetLabelValue}{\param{int }{orientation}, \param{int }{pos}} | |
1418 | ||
1419 | ||
1420 | \membersection{wxGrid::GetCellTextFont}\label{wxgridgetcelltextfont} | |
1421 | ||
1422 | \constfunc{wxFont}{GetCellTextFont}{\void} | |
1423 | ||
2eebb742 | 1424 | \constfunc{wxFont}{GetCellTextFont}{\param{int }{row}, \param{int }{col}} |
78c49c58 MB |
1425 | |
1426 | ||
1427 | \membersection{wxGrid::SetCellTextFont}\label{wxgridsetcelltextfont} | |
1428 | ||
1429 | \func{void}{SetCellTextFont}{\param{const wxFont\& }{fnt}} | |
1430 | ||
78c49c58 MB |
1431 | \func{void}{SetCellTextFont}{\param{const wxFont\& }{fnt}, \param{int }{row}, \param{int }{col}} |
1432 | ||
1433 | ||
78c49c58 MB |
1434 | \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour} |
1435 | ||
1436 | \func{void}{SetCellBackgroundColour}{\param{const wxColour\& }{col}} | |
1437 | ||
deea56b1 | 1438 | \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}} |
78c49c58 MB |
1439 | |
1440 | \func{void}{SetCellBackgroundColour}{\param{const wxColour\& }{colour}, \param{int }{row}, \param{int }{col}} | |
1441 | ||
1442 | ||
1443 | \membersection{wxGrid::GetEditable}\label{wxgridgeteditable} | |
1444 | ||
1445 | \func{bool}{GetEditable}{\void} | |
1446 | ||
1447 | ||
1448 | \membersection{wxGrid::SetEditable}\label{wxgridseteditable} | |
1449 | ||
1450 | \func{void}{SetEditable}{\param{bool }{edit = TRUE}} | |
1451 | ||
1452 | ||
1453 | \membersection{wxGrid::GetEditInPlace}\label{wxgridgeteditinplace} | |
1454 | ||
1455 | \func{bool}{GetEditInPlace}{\void} | |
1456 | ||
1457 | ||
1458 | \membersection{wxGrid::SetEditInPlace}\label{wxgridseteditinplace} | |
1459 | ||
2eebb742 | 1460 | \func{void}{SetEditInPlace}{\param{bool }{edit = TRUE}} |
78c49c58 MB |
1461 | |
1462 | ||
1463 | \membersection{wxGrid::SetCellBitmap}\label{wxgridsetcellbitmap} | |
1464 | ||
2eebb742 | 1465 | \func{void}{SetCellBitmap}{\param{wxBitmap* }{bitmap}, \param{int }{row}, \param{int }{col}} |
78c49c58 MB |
1466 | |
1467 | ||
1468 | \membersection{wxGrid::SetDividerPen}\label{wxgridsetdividerpen} | |
1469 | ||
2eebb742 | 1470 | \func{void}{SetDividerPen}{\param{const wxPen\& }{pen}} |
78c49c58 MB |
1471 | |
1472 | ||
1473 | \membersection{wxGrid::GetDividerPen}\label{wxgridgetdividerpen} | |
1474 | ||
1475 | \constfunc{wxPen\&}{GetDividerPen}{\void} | |
1476 | ||
1477 | ||
1478 | \membersection{wxGrid::OnActivate}\label{wxgridonactivate} | |
1479 | ||
2eebb742 | 1480 | \func{void}{OnActivate}{\param{bool }{active}} |
78c49c58 MB |
1481 | |
1482 | \membersection{wxGrid::Fit}\label{wxgridfit} | |
1483 | ||
1484 | \func{void}{Fit}{\void} | |
1485 | ||
2eebb742 | 1486 | Overridden wxWindow methods |
78c49c58 MB |
1487 | |
1488 | \membersection{wxGrid::DoGetBestSize}\label{wxgriddogetbestsize} | |
1489 | ||
1490 | \constfunc{wxSize}{DoGetBestSize}{\void} | |
1491 | ||
78c49c58 MB |
1492 | \membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights} |
1493 | ||
1494 | \func{void}{InitRowHeights}{\void} | |
1495 | ||
2eebb742 JS |
1496 | NB: {\it never} access m\_row/col arrays directly because they are created |
1497 | on demand, {\it always} use accessor functions instead! | |
78c49c58 | 1498 | |
2eebb742 | 1499 | Init the m\_rowHeights/Bottoms arrays with default values. |
78c49c58 MB |
1500 | |
1501 | \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths} | |
1502 | ||
1503 | \func{void}{InitColWidths}{\void} | |
1504 | ||
2eebb742 | 1505 | Init the m\_colWidths/Rights arrays |
78c49c58 MB |
1506 | |
1507 | ||
1508 | \membersection{wxGrid::GetColWidth}\label{wxgridgetcolwidth} | |
1509 | ||
1510 | \constfunc{int}{GetColWidth}{\param{int }{col}} | |
1511 | ||
2eebb742 | 1512 | Get the col/row coords |
78c49c58 MB |
1513 | |
1514 | ||
1515 | \membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft} | |
1516 | ||
1517 | \constfunc{int}{GetColLeft}{\param{int }{col}} | |
1518 | ||
1519 | ||
1520 | \membersection{wxGrid::GetColRight}\label{wxgridgetcolright} | |
1521 | ||
1522 | \constfunc{int}{GetColRight}{\param{int }{col}} | |
1523 | ||
1524 | ||
1525 | \membersection{wxGrid::GetRowHeight}\label{wxgridgetrowheight} | |
1526 | ||
1527 | \constfunc{int}{GetRowHeight}{\param{int }{row}} | |
1528 | ||
2eebb742 | 1529 | This function must be public for compatibility. |
78c49c58 MB |
1530 | |
1531 | \membersection{wxGrid::GetRowTop}\label{wxgridgetrowtop} | |
1532 | ||
1533 | \constfunc{int}{GetRowTop}{\param{int }{row}} | |
1534 | ||
1535 | ||
1536 | \membersection{wxGrid::GetRowBottom}\label{wxgridgetrowbottom} | |
1537 | ||
1538 | \constfunc{int}{GetRowBottom}{\param{int }{row}} | |
1539 | ||
1540 | ||
1541 | \membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes} | |
1542 | ||
1543 | \func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = TRUE}} | |
1544 | ||
2eebb742 | 1545 | Common part of AutoSizeColumn/Row() and GetBestSize() |
78c49c58 MB |
1546 | |
1547 | \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes} | |
1548 | ||
1549 | \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = TRUE}} | |
1550 | ||
78c49c58 MB |
1551 | \membersection{wxGrid::AutoSizeColOrRow}\label{wxgridautosizecolorrow} |
1552 | ||
1553 | \func{void}{AutoSizeColOrRow}{\param{int }{n}, \param{bool }{setAsMin}, \param{bool }{column}} | |
1554 | ||
2eebb742 | 1555 | Common part of AutoSizeColumn/Row() or row? |
78c49c58 MB |
1556 | |
1557 | \membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth} | |
1558 | ||
1559 | \constfunc{int}{GetColMinimalWidth}{\param{int }{col}} | |
1560 | ||
1561 | get the minimal width of the given column/row | |
1562 | ||
78c49c58 MB |
1563 | \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight} |
1564 | ||
1565 | \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}} | |
1566 | ||
78c49c58 MB |
1567 | \membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes} |
1568 | ||
1569 | \func{bool}{CanHaveAttributes}{\void} | |
1570 | ||
2eebb742 | 1571 | Do we have some place to store attributes in? |
a660d684 | 1572 | |
78c49c58 | 1573 | \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr} |
a660d684 | 1574 | |
2eebb742 | 1575 | \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}} |
deea56b1 | 1576 |