]>
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 | ||
881 | \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const }{wxFont\&}} | |
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 | ||
78c49c58 | 897 | \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const }{wxColour\&}} |
a660d684 | 898 | |
2eebb742 JS |
899 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}} |
900 | ||
901 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{col}} | |
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 | |
78c49c58 MB |
968 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\ |
969 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. | |
970 | ||
971 | \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize} | |
972 | ||
973 | \func{void}{SetColLabelSize}{\param{int }{height}} | |
974 | ||
975 | Sets the height of the column labels. | |
976 | ||
977 | \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue} | |
978 | ||
979 | \func{void}{SetColLabelValue}{\param{int }{col}, \param{const }{wxString\&}} | |
980 | ||
981 | Set the value for the given column label. If you are using a derived grid table you must | |
982 | override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue} | |
983 | for this to have any effect. | |
984 | ||
985 | \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth} | |
986 | ||
987 | \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}} | |
988 | ||
989 | Sets the minimal width for the specified column. This should normally be called when creating the grid | |
990 | because it will not resize a column that is already narrower than the minimal width. | |
991 | ||
992 | \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize} | |
993 | ||
994 | \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}} | |
995 | ||
996 | Sets the width of the specified column. | |
997 | ||
998 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
999 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. | |
1000 | ||
2eebb742 | 1001 | Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will |
78c49c58 MB |
1002 | also be set as the minimal width for the column. |
1003 | ||
2eebb742 | 1004 | \wxheading{Note}\\ |
78c49c58 MB |
1005 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
1006 | The memory requirements for this could become prohibitive if your grid is very large. | |
1007 | ||
1008 | \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment} | |
1009 | ||
1010 | \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}} | |
1011 | ||
1012 | Sets the default horizontal and vertial alignment for grid cell text. | |
1013 | ||
1014 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\ | |
1015 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. | |
1016 | ||
1017 | \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour} | |
1018 | ||
1019 | \func{void}{SetDefaultCellBackgroundColour}{\param{const }{wxColour\&}} | |
1020 | ||
1021 | Sets the default background colour for grid cells. | |
1022 | ||
1023 | \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont} | |
1024 | ||
1025 | \func{void}{SetDefaultCellFont}{\param{const }{wxFont\&}} | |
1026 | ||
1027 | Sets the default font to be used for grid cell text. | |
1028 | ||
1029 | \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor} | |
1030 | ||
1031 | \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}} | |
1032 | ||
1033 | Sets the default editor for grid cells. The grid will take ownership of the pointer. | |
1034 | ||
1035 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
1036 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1037 | ||
1038 | \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer} | |
1039 | ||
1040 | \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}} | |
1041 | ||
1042 | Sets the default renderer for grid cells. The grid will take ownership of the pointer. | |
1043 | ||
1044 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
1045 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1046 | ||
1047 | \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize} | |
c0b042fc | 1048 | |
78c49c58 | 1049 | \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = FALSE}} |
c0b042fc | 1050 | |
78c49c58 MB |
1051 | Sets the default width for columns in the grid. This will only affect columns subsequently added to |
1052 | the grid unless resizeExistingCols is TRUE. | |
1053 | ||
1054 | \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize} | |
1055 | ||
1056 | \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = FALSE}} | |
1057 | ||
1058 | Sets the default height for rows in the grid. This will only affect rows subsequently added | |
1059 | to the grid unless resizeExistingRows is TRUE. | |
c0b042fc | 1060 | |
a660d684 KB |
1061 | \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor} |
1062 | ||
78c49c58 | 1063 | \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}} |
a660d684 | 1064 | |
78c49c58 MB |
1065 | Set the grid cursor to the specified cell. |
1066 | This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}. | |
a660d684 | 1067 | |
78c49c58 | 1068 | \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour} |
a660d684 | 1069 | |
78c49c58 | 1070 | \func{void}{SetGridLineColour}{\param{const }{wxColour\&}} |
a660d684 | 1071 | |
78c49c58 | 1072 | Sets the colour used to draw grid lines. |
a660d684 KB |
1073 | |
1074 | \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour} | |
1075 | ||
78c49c58 | 1076 | \func{void}{SetLabelBackgroundColour}{\param{const }{wxColour\&}} |
a660d684 | 1077 | |
78c49c58 | 1078 | Sets the background colour for row and column labels. |
a660d684 | 1079 | |
78c49c58 | 1080 | \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont} |
a660d684 | 1081 | |
78c49c58 | 1082 | \func{void}{SetLabelFont}{\param{const }{wxFont\&}} |
a660d684 | 1083 | |
78c49c58 | 1084 | Sets the font for row and column labels. |
a660d684 KB |
1085 | |
1086 | \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour} | |
1087 | ||
78c49c58 | 1088 | \func{void}{SetLabelTextColour}{\param{const }{wxColour\&}} |
a660d684 | 1089 | |
78c49c58 | 1090 | Sets the colour for row and column label text. |
a660d684 | 1091 | |
5c69031c MB |
1092 | \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly} |
1093 | ||
1094 | \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = TRUE}} | |
1095 | ||
1096 | Makes the cell at the specified location read-only or editable. | |
1097 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. | |
1098 | ||
78c49c58 | 1099 | \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr} |
a660d684 | 1100 | |
78c49c58 | 1101 | \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}} |
a660d684 | 1102 | |
78c49c58 MB |
1103 | Sets the cell attributes for all cells in the specified row. |
1104 | See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information | |
1105 | about controlling cell attributes. | |
a660d684 | 1106 | |
78c49c58 | 1107 | \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment} |
a660d684 | 1108 | |
78c49c58 | 1109 | \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} |
a660d684 | 1110 | |
78c49c58 | 1111 | Sets the horizontal and vertical alignment of row label text. |
a660d684 | 1112 | |
78c49c58 MB |
1113 | Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\ |
1114 | Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM. | |
a660d684 | 1115 | |
78c49c58 | 1116 | \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize} |
a660d684 | 1117 | |
78c49c58 | 1118 | \func{void}{SetRowLabelSize}{\param{int }{width}} |
a660d684 | 1119 | |
78c49c58 MB |
1120 | Sets the width of the row labels. |
1121 | ||
1122 | \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue} | |
1123 | ||
1124 | \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const }{wxString\&}} | |
1125 | ||
1126 | Set the value for the given row label. If you are using a derived grid table you must | |
1127 | override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue} | |
1128 | for this to have any effect. | |
1129 | ||
1130 | \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight} | |
1131 | ||
1132 | \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{width}} | |
1133 | ||
1134 | Sets the minimal height for the specified row. This should normally be called when creating the grid | |
1135 | because it will not resize a row that is already shorter than the minimal height. | |
1136 | ||
1137 | \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize} | |
1138 | ||
1139 | \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}} | |
1140 | ||
1141 | Sets the height of the specified row. | |
1142 | ||
1143 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
1144 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. | |
1145 | ||
2eebb742 | 1146 | Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will |
78c49c58 MB |
1147 | also be set as the minimal width for the column. |
1148 | ||
2eebb742 | 1149 | \wxheading{Note}\\ |
78c49c58 MB |
1150 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
1151 | The memory requirements for this could become prohibitive if your grid is very large. | |
1152 | ||
1153 | \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode} | |
1154 | ||
1155 | \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{selmode}} | |
1156 | ||
1157 | Set the selection behaviour of the grid. | |
1158 | ||
1159 | \wxheading{Parameters} | |
1160 | ||
1161 | \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.} | |
1162 | ||
1163 | \docparam(wxGrid::wxGridSelectRows}{Selections will consist of whole rows.} | |
1164 | ||
1165 | \docparam{wxGrid::wxGridSelectionColumns}{Selections will consist of whole columns.} | |
1166 | ||
1167 | \membersection{wxGrid::SetTable}\label{wxgridsettable} | |
1168 | ||
1169 | \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = FALSE}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}} | |
1170 | ||
2eebb742 | 1171 | Passes a pointer to a custom grid table to be used by the grid. This should be called |
78c49c58 MB |
1172 | after the grid constructor and before using the grid object. If takeOwnership is set to |
1173 | TRUE then the table will be deleted by the wxGrid destructor. | |
1174 | ||
1175 | Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your | |
1176 | application involves complex or non-string data or data sets that are too large to fit | |
1177 | wholly in memory. | |
1178 | ||
1179 | \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol} | |
1180 | ||
1181 | \func{void}{ShowCellEditControl}{\void} | |
1182 | ||
1183 | Displays the in-place cell edit control for the current cell. | |
1184 | ||
1185 | \membersection{wxGrid::XToCol}\label{wxgridxtocol} | |
1186 | ||
1187 | \func{int}{XToCol}{\param{int }{x}} | |
1188 | ||
1189 | Returns the grid column that corresponds to the logical x coordinate. Returns | |
1190 | wxNOT_FOUND if there is no column at the x position. | |
1191 | ||
1192 | \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol} | |
1193 | ||
1194 | \func{int}{XToEdgeOfCol}{\param{int }{x}} | |
1195 | ||
1196 | Returns the column whose right hand edge is close to the given logical x position. | |
1197 | If no column edge is near to this position wxNOT_FOUND is returned. | |
1198 | ||
1199 | \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow} | |
1200 | ||
1201 | \func{int}{YToEdgeOfRow}{\param{int }{y}} | |
1202 | ||
1203 | Returns the row whose bottom edge is close to the given logical y position. | |
1204 | If no row edge is near to this position wxNOT_FOUND is returned. | |
1205 | ||
1206 | \membersection{wxGrid::YToRow}\label{wxgridytorow} | |
1207 | ||
1208 | \func{int}{YToRow}{\param{int }{y}} | |
1209 | ||
1210 | Returns the grid row that corresponds to the logical y coordinate. Returns | |
1211 | wxNOT_FOUND if there is no row at the y position. | |
1212 | ||
1213 | ||
1214 | ||
78c49c58 MB |
1215 | \membersection{wxGrid::IsInSelection}\label{wxgridisinselection} |
1216 | ||
1217 | \func{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}} | |
1218 | ||
1219 | \func{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}} | |
1220 | ||
1221 | ||
1222 | \membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect} | |
1223 | ||
1224 | \func{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}} | |
1225 | ||
1226 | This function returns the rectangle that encloses the block of cells | |
1227 | limited by TopLeft and BottomRight cell in device coords and clipped | |
1228 | to the client size of the grid window. | |
1229 | ||
1230 | ||
1231 | \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect} | |
1232 | ||
1233 | \func{wxRect}{SelectionToDeviceRect}{\void} | |
1234 | ||
1235 | This function returns the rectangle that encloses the selected cells | |
1236 | in device coords and clipped to the client size of the grid window. | |
1237 | ||
1238 | ||
1239 | \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground} | |
1240 | ||
1241 | \constfunc{wxColour}{GetSelectionBackground}{\void} | |
1242 | ||
1243 | Access or update the selection fore/back colours | |
1244 | ||
1245 | ||
1246 | \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground} | |
1247 | ||
1248 | \constfunc{wxColour}{GetSelectionForeground}{\void} | |
1249 | ||
1250 | ||
1251 | \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground} | |
1252 | ||
1253 | \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}} | |
1254 | ||
1255 | ||
1256 | \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground} | |
1257 | ||
1258 | \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}} | |
1259 | ||
1260 | ||
1261 | \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype} | |
1262 | ||
1263 | \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}} | |
1264 | ||
1265 | Methods for a registry for mapping data types to Renderers/Editors | |
1266 | ||
1267 | ||
1268 | \membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell} | |
1269 | ||
1270 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}} | |
1271 | ||
1272 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}} | |
1273 | ||
1274 | ||
1275 | \membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell} | |
1276 | ||
1277 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}} | |
1278 | ||
1279 | ||
1280 | \membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype} | |
1281 | ||
1282 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}} | |
1283 | ||
1284 | ||
1285 | \membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype} | |
1286 | ||
1287 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}} | |
1288 | ||
1289 | ||
1290 | \membersection{wxGrid::SetMargins}\label{wxgridsetmargins} | |
1291 | ||
1292 | \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}} | |
1293 | ||
1294 | grid may occupy more space than needed for its rows/columns, this | |
1295 | function allows to set how big this extra space is | |
1296 | ||
78c49c58 MB |
1297 | \membersection{wxGrid::wxGrid}\label{wxgridwxgrid} |
1298 | ||
1299 | \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}} | |
1300 | ||
2eebb742 | 1301 | Backward compatibility. |
78c49c58 MB |
1302 | |
1303 | \membersection{wxGrid::UpdateDimensions}\label{wxgridupdatedimensions} | |
1304 | ||
1305 | \func{void}{UpdateDimensions}{\void} | |
1306 | ||
2eebb742 | 1307 | Backward compatibility. |
78c49c58 MB |
1308 | |
1309 | \membersection{wxGrid::GetRows}\label{wxgridgetrows} | |
1310 | ||
1311 | \func{int}{GetRows}{\void} | |
1312 | ||
2eebb742 | 1313 | Backward compatibility. |
78c49c58 MB |
1314 | |
1315 | \membersection{wxGrid::GetCols}\label{wxgridgetcols} | |
1316 | ||
1317 | \func{int}{GetCols}{\void} | |
1318 | ||
2eebb742 | 1319 | Backward compatibility. |
78c49c58 MB |
1320 | |
1321 | \membersection{wxGrid::GetCursorRow}\label{wxgridgetcursorrow} | |
1322 | ||
1323 | \func{int}{GetCursorRow}{\void} | |
1324 | ||
2eebb742 | 1325 | Backward compatibility. |
78c49c58 MB |
1326 | |
1327 | \membersection{wxGrid::GetCursorColumn}\label{wxgridgetcursorcolumn} | |
1328 | ||
1329 | \func{int}{GetCursorColumn}{\void} | |
1330 | ||
2eebb742 | 1331 | Backward compatibility. |
78c49c58 MB |
1332 | |
1333 | \membersection{wxGrid::GetScrollPosX}\label{wxgridgetscrollposx} | |
1334 | ||
1335 | \func{int}{GetScrollPosX}{\void} | |
1336 | ||
2eebb742 | 1337 | Backward compatibility. |
78c49c58 MB |
1338 | |
1339 | \membersection{wxGrid::GetScrollPosY}\label{wxgridgetscrollposy} | |
1340 | ||
1341 | \func{int}{GetScrollPosY}{\void} | |
1342 | ||
2eebb742 | 1343 | Backward compatibility. |
78c49c58 MB |
1344 | |
1345 | \membersection{wxGrid::SetScrollX}\label{wxgridsetscrollx} | |
1346 | ||
2eebb742 | 1347 | \func{void}{SetScrollX}{\param{int }{x}} |
78c49c58 | 1348 | |
2eebb742 | 1349 | Backward compatibility. |
78c49c58 MB |
1350 | |
1351 | \membersection{wxGrid::SetScrollY}\label{wxgridsetscrolly} | |
1352 | ||
2eebb742 | 1353 | \func{void}{SetScrollY}{\param{int }{y}} |
78c49c58 | 1354 | |
2eebb742 | 1355 | Backward compatibility. |
78c49c58 MB |
1356 | |
1357 | \membersection{wxGrid::SetColumnWidth}\label{wxgridsetcolumnwidth} | |
1358 | ||
1359 | \func{void}{SetColumnWidth}{\param{int }{col}, \param{int }{width}} | |
1360 | ||
2eebb742 | 1361 | Backward compatibility. |
78c49c58 MB |
1362 | |
1363 | \membersection{wxGrid::GetColumnWidth}\label{wxgridgetcolumnwidth} | |
1364 | ||
1365 | \func{int}{GetColumnWidth}{\param{int }{col}} | |
1366 | ||
2eebb742 | 1367 | Backward compatibility. |
78c49c58 MB |
1368 | |
1369 | \membersection{wxGrid::SetRowHeight}\label{wxgridsetrowheight} | |
1370 | ||
1371 | \func{void}{SetRowHeight}{\param{int }{row}, \param{int }{height}} | |
1372 | ||
2eebb742 | 1373 | Backward compatibility. |
78c49c58 MB |
1374 | |
1375 | \membersection{wxGrid::GetViewHeight}\label{wxgridgetviewheight} | |
1376 | ||
1377 | \func{int}{GetViewHeight}{\void} | |
1378 | ||
2eebb742 | 1379 | Backward compatibility. |
78c49c58 | 1380 | |
2eebb742 JS |
1381 | GetRowHeight() is below |
1382 | returned num whole rows visible. | |
78c49c58 MB |
1383 | |
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 | ||
1438 | \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const }{wxColour\&}} | |
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}} |