]>
Commit | Line | Data |
---|---|---|
4b39770c WS |
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2 | %% Name: grid.tex | |
3 | %% Purpose: wxGrid | |
4 | %% Author: | |
d4175745 | 5 | %% Modified by: Santiago Palacios |
4b39770c WS |
6 | %% Created: |
7 | %% RCS-ID: $Id$ | |
8 | %% Copyright: (c) wxWidgets | |
9 | %% License: wxWindows license | |
10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | ||
a660d684 KB |
12 | \section{\class{wxGrid}}\label{wxgrid} |
13 | ||
78c49c58 | 14 | wxGrid and its related classes are used for displaying and editing tabular |
2eebb742 | 15 | data. They provide a rich set of features for display, editing, and |
78c49c58 MB |
16 | interacting with a variety of data sources. For simple applications, and to |
17 | help you get started, wxGrid is the only class you need to refer to | |
2eebb742 JS |
18 | directly. It will set up default instances of the other classes and manage |
19 | them for you. For more complex applications you can derive your own | |
78c49c58 | 20 | classes for custom grid views, grid data tables, cell editors and |
2eebb742 | 21 | renderers. The \helpref{wxGrid classes overview}{gridoverview} has |
78c49c58 MB |
22 | examples of simple and more complex applications, explains the |
23 | relationship between the various grid classes and has a summary of the | |
24 | keyboard shortcuts and mouse functions provided by wxGrid. | |
25 | ||
fc2171bd | 26 | wxGrid has been greatly expanded and redesigned for wxWidgets 2.2 |
78c49c58 | 27 | onwards. If you have been using the old wxGrid class you will probably |
2eebb742 JS |
28 | want to have a look at the \helpref{wxGrid classes overview}{gridoverview} to see |
29 | how things have changed. The new grid classes are reasonably backward-compatible | |
30 | but there are some exceptions. There are also easier ways of doing many things compared to | |
4b39770c | 31 | the previous implementation. |
a660d684 KB |
32 | |
33 | \wxheading{Derived from} | |
34 | ||
78c49c58 | 35 | \helpref{wxScrolledWindow}{wxscrolledwindow}\\ |
a660d684 KB |
36 | \helpref{wxWindow}{wxwindow}\\ |
37 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
38 | \helpref{wxObject}{wxobject} | |
39 | ||
954b8ae6 JS |
40 | \wxheading{Include files} |
41 | ||
42 | <wx/grid.h> | |
43 | ||
a7af285d VZ |
44 | \wxheading{Library} |
45 | ||
46 | \helpref{wxAdv}{librarieslist} | |
47 | ||
a660d684 KB |
48 | \wxheading{Window styles} |
49 | ||
78c49c58 | 50 | There are presently no specific window styles for wxGrid. |
a660d684 | 51 | |
78c49c58 | 52 | \wxheading{Event handling} |
a660d684 | 53 | |
cbc95b2c MB |
54 | \input gridevt.inc |
55 | ||
4b39770c | 56 | The event handler for the following functions takes a |
cbc95b2c | 57 | \helpref{wxGridSizeEvent}{wxgridsizeevent} parameter. |
24d70590 | 58 | The ...\_CMD\_... variants also take a window identifier. |
cbc95b2c MB |
59 | |
60 | \twocolwidtha{7cm} | |
61 | \begin{twocollist}\itemsep=0pt | |
62 | \twocolitem{{\bf EVT\_GRID\_COL\_SIZE(func)}}{The user resized a column by dragging it. Processes a wxEVT\_GRID\_COL\_SIZE.} | |
63 | \twocolitem{{\bf EVT\_GRID\_ROW\_SIZE(func)}}{The user resized a row by dragging it. Processes a wxEVT\_GRID\_ROW\_SIZE.} | |
24d70590 JS |
64 | \twocolitem{{\bf EVT\_GRID\_CMD\_COL\_SIZE(func)}}{The user resized a column by dragging it; variant taking a window identifier. Processes a wxEVT\_GRID\_COL\_SIZE.} |
65 | \twocolitem{{\bf EVT\_GRID\_CMD\_ROW\_SIZE(func)}}{The user resized a row by dragging it; variant taking a window identifier. Processes a wxEVT\_GRID\_ROW\_SIZE.} | |
cbc95b2c MB |
66 | \end{twocollist}% |
67 | ||
4b39770c | 68 | The event handler for the following functions takes a |
cbc95b2c | 69 | \helpref{wxGridRangeSelectEvent}{wxgridrangeselectevent} parameter. |
24d70590 | 70 | The ...\_CMD\_... variant also takes a window identifier. |
cbc95b2c MB |
71 | |
72 | \twocolwidtha{7cm} | |
73 | \begin{twocollist}\itemsep=0pt | |
74 | \twocolitem{{\bf EVT\_GRID\_RANGE\_SELECT(func)}}{The user selected a group of contiguous cells. Processes a wxEVT\_GRID\_RANGE\_SELECT.} | |
24d70590 | 75 | \twocolitem{{\bf EVT\_GRID\_CMD\_RANGE\_SELECT(id, func)}}{The user selected a group of contiguous cells; variant taking a window identifier. Processes a wxEVT\_GRID\_RANGE\_SELECT.} |
cbc95b2c MB |
76 | \end{twocollist}% |
77 | ||
4b39770c | 78 | The event handler for the following functions takes a |
cbc95b2c | 79 | \helpref{wxGridEditorCreatedEvent}{wxgrideditorcreatedevent} parameter. |
24d70590 | 80 | The ...\_CMD\_... variant also takes a window identifier. |
cbc95b2c MB |
81 | |
82 | \twocolwidtha{7cm} | |
83 | \begin{twocollist}\itemsep=0pt | |
84 | \twocolitem{{\bf EVT\_GRID\_EDITOR\_CREATED(func)}}{The editor for a cell was created. Processes a wxEVT\_GRID\_EDITOR\_CREATED.} | |
24d70590 | 85 | \twocolitem{{\bf EVT\_GRID\_CMD\_EDITOR\_CREATED(id, func)}}{The editor for a cell was created; variant taking a window identifier. Processes a wxEVT\_GRID\_EDITOR\_CREATED.} |
cbc95b2c MB |
86 | \end{twocollist}% |
87 | ||
a660d684 KB |
88 | \wxheading{See also} |
89 | ||
78c49c58 | 90 | \helpref{wxGrid overview}{gridoverview} |
a660d684 | 91 | |
78c49c58 MB |
92 | %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%% |
93 | \latexignore{\rtfignore{\wxheading{Function groups}}} | |
a660d684 | 94 | |
4b39770c WS |
95 | |
96 | ||
f0e8a2d0 | 97 | \membersection{Constructors and initialization}\label{wxgridconstructors} |
a660d684 | 98 | |
2eebb742 JS |
99 | \helpref{wxGrid}{wxgridctor}\\ |
100 | \helpref{\destruct{wxGrid}}{wxgriddtor}\\ | |
101 | \helpref{CreateGrid}{wxgridcreategrid}\\ | |
78c49c58 | 102 | \helpref{SetTable}{wxgridsettable} |
a660d684 | 103 | |
4b39770c WS |
104 | |
105 | ||
f0e8a2d0 | 106 | \membersection{Display format}\label{wxgriddisplayformat} |
a660d684 | 107 | |
4b39770c WS |
108 | |
109 | ||
f0e8a2d0 | 110 | \membersection{Selection functions}\label{wxgridselectionfunctions} |
a660d684 | 111 | |
2eebb742 JS |
112 | \helpref{wxGrid::ClearSelection}{wxgridclearselection}\\ |
113 | \helpref{wxGrid::IsSelection}{wxgridisselection}\\ | |
114 | \helpref{wxGrid::SelectAll}{wxgridselectall}\\ | |
115 | \helpref{wxGrid::SelectBlock}{wxgridselectblock}\\ | |
116 | \helpref{wxGrid::SelectCol}{wxgridselectcol}\\ | |
5c69031c MB |
117 | \helpref{wxGrid::SelectRow}{wxgridselectrow} |
118 | ||
78c49c58 MB |
119 | %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%% |
120 | \helponly{\insertatlevel{2}{ | |
a660d684 | 121 | |
78c49c58 MB |
122 | \wxheading{Members} |
123 | ||
124 | }} | |
125 | ||
4b39770c WS |
126 | |
127 | ||
78c49c58 MB |
128 | \membersection{wxGrid::wxGrid}\label{wxgridctor} |
129 | ||
130 | \func{}{wxGrid}{\void} | |
131 | ||
132 | Default constructor | |
133 | ||
134 | \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}} | |
135 | ||
4b39770c | 136 | Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or |
78c49c58 | 137 | \helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using |
4b39770c WS |
138 | it. |
139 | ||
140 | ||
78c49c58 MB |
141 | |
142 | \membersection{wxGrid::\destruct{wxGrid}}\label{wxgriddtor} | |
143 | ||
144 | \func{}{\destruct{wxGrid}}{\void} | |
145 | ||
146 | Destructor. This will also destroy the associated grid table unless you passed a table | |
147 | object to the grid and specified that the grid should not take ownership of the | |
4b39770c WS |
148 | table (see \helpref{wxGrid::SetTable}{wxgridsettable}). |
149 | ||
150 | ||
a660d684 KB |
151 | |
152 | \membersection{wxGrid::AppendCols}\label{wxgridappendcols} | |
153 | ||
cc81d32f | 154 | \func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = true}} |
78c49c58 | 155 | |
cc81d32f | 156 | Appends one or more new columns to the right of the grid and returns true if |
78c49c58 | 157 | successful. The updateLabels argument is not used at present. |
a660d684 | 158 | |
4b39770c WS |
159 | If you are using a derived grid table class you will need to override |
160 | \helpref{wxGridTableBase::AppendCols}{wxgridtablebaseappendcols}. See | |
161 | \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information. | |
162 | ||
163 | ||
a660d684 KB |
164 | |
165 | \membersection{wxGrid::AppendRows}\label{wxgridappendrows} | |
166 | ||
cc81d32f | 167 | \func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = true}} |
78c49c58 | 168 | |
cc81d32f | 169 | Appends one or more new rows to the bottom of the grid and returns true if |
78c49c58 MB |
170 | successful. The updateLabels argument is not used at present. |
171 | ||
4b39770c WS |
172 | If you are using a derived grid table class you will need to override |
173 | \helpref{wxGridTableBase::AppendRows}{wxgridtablebaseappendrows}. See | |
174 | \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information. | |
175 | ||
176 | ||
78c49c58 MB |
177 | |
178 | \membersection{wxGrid::AutoSize}\label{wxgridautosize} | |
179 | ||
180 | \func{void}{AutoSize}{\void} | |
181 | ||
182 | Automatically sets the height and width of all rows and columns to fit their contents. | |
183 | ||
2eebb742 | 184 | \wxheading{Note}\\ |
78c49c58 | 185 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c WS |
186 | The memory requirements for this could become prohibitive if your grid is very large. |
187 | ||
188 | ||
a660d684 | 189 | |
733f486a | 190 | \membersection{wxGrid::AutoSizeColLabelSize}\label{wxgridautosizecollabelsize} |
608754c4 | 191 | |
733f486a | 192 | \func{void}{AutoSizeColLabelSize}{\param{int }{col}} |
608754c4 | 193 | |
733f486a | 194 | Automatically adjusts width of the column to fit its label. |
4b39770c WS |
195 | |
196 | ||
608754c4 | 197 | |
78c49c58 MB |
198 | \membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn} |
199 | ||
cc81d32f | 200 | \func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = true}} |
78c49c58 | 201 | |
cc81d32f | 202 | Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will |
78c49c58 MB |
203 | also be set as the minimal width for the column. |
204 | ||
2eebb742 | 205 | \wxheading{Note}\\ |
78c49c58 | 206 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c WS |
207 | The memory requirements for this could become prohibitive if your grid is very large. |
208 | ||
209 | ||
78c49c58 MB |
210 | |
211 | \membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns} | |
212 | ||
cc81d32f | 213 | \func{void}{AutoSizeColumns}{\param{bool }{setAsMin = true}} |
78c49c58 | 214 | |
cc81d32f | 215 | Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will |
78c49c58 MB |
216 | also be set as the minimal widths for the columns. |
217 | ||
2eebb742 | 218 | \wxheading{Note}\\ |
78c49c58 | 219 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c WS |
220 | The memory requirements for this could become prohibitive if your grid is very large. |
221 | ||
222 | ||
78c49c58 MB |
223 | |
224 | \membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow} | |
225 | ||
cc81d32f | 226 | \func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = true}} |
78c49c58 | 227 | |
cc81d32f | 228 | Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will |
78c49c58 MB |
229 | also be set as the minimal height for the row. |
230 | ||
2eebb742 | 231 | \wxheading{Note}\\ |
78c49c58 | 232 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c WS |
233 | The memory requirements for this could become prohibitive if your grid is very large. |
234 | ||
235 | ||
78c49c58 | 236 | |
733f486a VZ |
237 | \membersection{wxGrid::AutoSizeRowLabelSize}\label{wxgridautosizerowlabelsize} |
238 | ||
239 | \func{void}{AutoSizeRowLabelSize}{\param{int }{col}} | |
240 | ||
241 | Automatically adjusts height of the row to fit its label. | |
242 | ||
243 | ||
244 | ||
78c49c58 MB |
245 | \membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows} |
246 | ||
cc81d32f | 247 | \func{void}{AutoSizeRows}{\param{bool }{setAsMin = true}} |
78c49c58 | 248 | |
cc81d32f | 249 | Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will |
78c49c58 MB |
250 | also be set as the minimal heights for the rows. |
251 | ||
2eebb742 | 252 | \wxheading{Note}\\ |
78c49c58 | 253 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c WS |
254 | The memory requirements for this could become prohibitive if your grid is very large. |
255 | ||
256 | ||
a660d684 KB |
257 | |
258 | \membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch} | |
259 | ||
260 | \func{void}{BeginBatch}{\void} | |
261 | ||
78c49c58 | 262 | Increments the grid's batch count. When the count is greater than zero repainting of |
4b39770c | 263 | the grid is suppressed. Each call to BeginBatch must be matched by a later call to |
78c49c58 MB |
264 | \helpref{wxGrid::EndBatch}{wxgridendbatch}. Code that does a lot of grid |
265 | modification can be enclosed between BeginBatch and EndBatch calls to avoid | |
266 | screen flicker. The final EndBatch will cause the grid to be repainted. | |
a660d684 | 267 | |
b62f94ff VZ |
268 | \wxheading{See also} |
269 | ||
270 | \helpref{wxGridUpdateLocker}{wxgridupdatelocker} | |
271 | ||
4b39770c WS |
272 | |
273 | ||
608754c4 JS |
274 | \membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect} |
275 | ||
ef316e23 | 276 | \constfunc{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}} |
608754c4 JS |
277 | |
278 | This function returns the rectangle that encloses the block of cells | |
279 | limited by TopLeft and BottomRight cell in device coords and clipped | |
280 | to the client size of the grid window. | |
281 | ||
282 | ||
4b39770c | 283 | |
d4175745 VZ |
284 | \membersection{wxGrid::CanDragColMove}\label{wxgridcandragcolmove} |
285 | ||
ef316e23 | 286 | \constfunc{bool}{CanDragColMove}{\void} |
d4175745 VZ |
287 | |
288 | Returns true if columns can be moved by dragging with the mouse. Columns can be moved | |
289 | by dragging on their labels. | |
290 | ||
291 | ||
292 | ||
78c49c58 | 293 | \membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize} |
a660d684 | 294 | |
ef316e23 | 295 | \constfunc{bool}{CanDragColSize}{\void} |
a660d684 | 296 | |
cc81d32f | 297 | Returns true if columns can be resized by dragging with the mouse. Columns can be resized |
78c49c58 | 298 | by dragging the edges of their labels. If grid line dragging is enabled they can also be |
4b39770c | 299 | resized by dragging the right edge of the column in the grid cell area |
78c49c58 | 300 | (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}). |
a660d684 | 301 | |
4b39770c WS |
302 | |
303 | ||
78c49c58 | 304 | \membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize} |
a660d684 | 305 | |
ef316e23 | 306 | \constfunc{bool}{CanDragRowSize}{\void} |
a660d684 | 307 | |
cc81d32f | 308 | Returns true if rows can be resized by dragging with the mouse. Rows can be resized |
78c49c58 | 309 | by dragging the edges of their labels. If grid line dragging is enabled they can also be |
4b39770c | 310 | resized by dragging the lower edge of the row in the grid cell area |
78c49c58 | 311 | (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}). |
a660d684 | 312 | |
4b39770c WS |
313 | |
314 | ||
78c49c58 | 315 | \membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize} |
a660d684 | 316 | |
ef316e23 | 317 | \constfunc{bool}{CanDragGridSize}{\void} |
a660d684 | 318 | |
cc81d32f | 319 | Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise. |
21f280f4 | 320 | |
4b39770c WS |
321 | |
322 | ||
78c49c58 | 323 | \membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol} |
a660d684 | 324 | |
78c49c58 | 325 | \constfunc{bool}{CanEnableCellControl}{\void} |
a660d684 | 326 | |
cc81d32f VS |
327 | Returns true if the in-place edit control for the current grid cell can be used and |
328 | false otherwise (e.g. if the current cell is read-only). | |
78c49c58 | 329 | |
4b39770c WS |
330 | |
331 | ||
608754c4 JS |
332 | \membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes} |
333 | ||
ef316e23 | 334 | \constfunc{bool}{CanHaveAttributes}{\void} |
608754c4 JS |
335 | |
336 | Do we have some place to store attributes in? | |
337 | ||
4b39770c WS |
338 | |
339 | ||
78c49c58 MB |
340 | \membersection{wxGrid::CellToRect}\label{wxgridcelltorect} |
341 | ||
ef316e23 | 342 | \constfunc{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}} |
78c49c58 | 343 | |
ef316e23 | 344 | \constfunc{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}} |
78c49c58 MB |
345 | |
346 | Return the rectangle corresponding to the grid cell's size and position in logical | |
347 | coordinates. | |
348 | ||
4b39770c WS |
349 | |
350 | ||
78c49c58 MB |
351 | \membersection{wxGrid::ClearGrid}\label{wxgridcleargrid} |
352 | ||
353 | \func{void}{ClearGrid}{\void} | |
354 | ||
355 | Clears all data in the underlying grid table and repaints the grid. The table is not deleted by | |
4b39770c | 356 | this function. If you are using a derived table class then you need to override |
78c49c58 MB |
357 | \helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect. |
358 | ||
4b39770c WS |
359 | |
360 | ||
5c69031c MB |
361 | \membersection{wxGrid::ClearSelection}\label{wxgridclearselection} |
362 | ||
363 | \func{void}{ClearSelection}{\void} | |
364 | ||
365 | Deselects all cells that are currently selected. | |
366 | ||
4b39770c WS |
367 | |
368 | ||
78c49c58 MB |
369 | \membersection{wxGrid::CreateGrid}\label{wxgridcreategrid} |
370 | ||
371 | \func{bool}{CreateGrid}{\param{int }{numRows}, \param{int }{numCols}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}} | |
372 | ||
373 | Creates a grid with the specified initial number of rows and columns. | |
374 | Call this directly after the grid constructor. When you use this | |
375 | function wxGrid will create and manage a simple table of string values | |
376 | for you. All of the grid data will be stored in memory. | |
377 | ||
378 | For applications with more complex data types or relationships, or for | |
379 | dealing with very large datasets, you should derive your own grid table | |
4b39770c WS |
380 | class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}. |
381 | ||
382 | ||
a660d684 KB |
383 | |
384 | \membersection{wxGrid::DeleteCols}\label{wxgriddeletecols} | |
385 | ||
cc81d32f | 386 | \func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}} |
a660d684 | 387 | |
78c49c58 | 388 | Deletes one or more columns from a grid starting at the specified position and returns |
cc81d32f | 389 | true if successful. The updateLabels argument is not used at present. |
78c49c58 | 390 | |
4b39770c WS |
391 | If you are using a derived grid table class you will need to override |
392 | \helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See | |
78c49c58 | 393 | \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information. |
a660d684 | 394 | |
4b39770c WS |
395 | |
396 | ||
a660d684 KB |
397 | \membersection{wxGrid::DeleteRows}\label{wxgriddeleterows} |
398 | ||
cc81d32f | 399 | \func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}} |
78c49c58 MB |
400 | |
401 | Deletes one or more rows from a grid starting at the specified position and returns | |
cc81d32f | 402 | true if successful. The updateLabels argument is not used at present. |
78c49c58 | 403 | |
4b39770c WS |
404 | If you are using a derived grid table class you will need to override |
405 | \helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See | |
78c49c58 MB |
406 | \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information. |
407 | ||
4b39770c WS |
408 | |
409 | ||
78c49c58 MB |
410 | \membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol} |
411 | ||
412 | \func{void}{DisableCellEditControl}{\void} | |
413 | ||
4b39770c | 414 | Disables in-place editing of grid cells. |
cc81d32f | 415 | Equivalent to calling EnableCellEditControl(false). |
78c49c58 | 416 | |
4b39770c WS |
417 | |
418 | ||
d4175745 VZ |
419 | \membersection{wxGrid::DisableDragColMove}\label{wxgriddisabledragcolmove} |
420 | ||
421 | \func{void}{DisableDragColMove}{\void} | |
422 | ||
423 | Disables column moving by dragging with the mouse. Equivalent to passing false to | |
424 | \helpref{wxGrid::EnableDragColMove}{wxgridenabledragcolmove}. | |
425 | ||
426 | ||
427 | ||
78c49c58 MB |
428 | \membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize} |
429 | ||
430 | \func{void}{DisableDragColSize}{\void} | |
431 | ||
4b39770c WS |
432 | Disables column sizing by dragging with the mouse. Equivalent to passing false to |
433 | \helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}. | |
434 | ||
435 | ||
78c49c58 MB |
436 | |
437 | \membersection{wxGrid::DisableDragGridSize}\label{wxgriddisabledraggridsize} | |
438 | ||
439 | \func{void}{DisableDragGridSize}{\void} | |
440 | ||
441 | Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing | |
cc81d32f | 442 | false to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize} |
78c49c58 | 443 | |
4b39770c WS |
444 | |
445 | ||
78c49c58 MB |
446 | \membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize} |
447 | ||
448 | \func{void}{DisableDragRowSize}{\void} | |
449 | ||
4b39770c WS |
450 | Disables row sizing by dragging with the mouse. Equivalent to passing false to |
451 | \helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}. | |
452 | ||
453 | ||
78c49c58 MB |
454 | |
455 | \membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol} | |
456 | ||
cc81d32f | 457 | \func{void}{EnableCellEditControl}{\param{bool }{enable = true}} |
78c49c58 MB |
458 | |
459 | Enables or disables in-place editing of grid cell data. The grid will issue either a | |
e7240349 | 460 | wxEVT\_GRID\_EDITOR\_SHOWN or wxEVT\_GRID\_EDITOR\_HIDDEN event. |
78c49c58 | 461 | |
4b39770c WS |
462 | |
463 | ||
78c49c58 MB |
464 | \membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize} |
465 | ||
cc81d32f | 466 | \func{void}{EnableDragColSize}{\param{bool }{enable = true}} |
a660d684 | 467 | |
78c49c58 MB |
468 | Enables or disables column sizing by dragging with the mouse. |
469 | ||
4b39770c WS |
470 | |
471 | ||
d4175745 VZ |
472 | \membersection{wxGrid::EnableDragColMove}\label{wxgridenabledragcolmove} |
473 | ||
474 | \func{void}{EnableDragColMove}{\param{bool }{enable = true}} | |
475 | ||
476 | Enables or disables column moving by dragging with the mouse. | |
477 | ||
478 | ||
479 | ||
78c49c58 MB |
480 | \membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize} |
481 | ||
cc81d32f | 482 | \func{void}{EnableDragGridSize}{\param{bool }{enable = true}} |
78c49c58 MB |
483 | |
484 | Enables or disables row and column resizing by dragging gridlines with the mouse. | |
485 | ||
4b39770c WS |
486 | |
487 | ||
78c49c58 MB |
488 | \membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize} |
489 | ||
cc81d32f | 490 | \func{void}{EnableDragRowSize}{\param{bool }{enable = true}} |
78c49c58 MB |
491 | |
492 | Enables or disables row sizing by dragging with the mouse. | |
493 | ||
4b39770c WS |
494 | |
495 | ||
78c49c58 MB |
496 | \membersection{wxGrid::EnableEditing}\label{wxgridenableediting} |
497 | ||
498 | \func{void}{EnableEditing}{\param{bool }{edit}} | |
499 | ||
cc81d32f VS |
500 | If the edit argument is false this function sets the whole grid as read-only. If the |
501 | argument is true the grid is set to the default state where cells may be editable. In the | |
78c49c58 | 502 | default state you can set single grid cells and whole rows and columns to be editable or |
4b39770c | 503 | read-only via |
78c49c58 | 504 | \helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single |
4b39770c WS |
505 | cells you can also use the shortcut function |
506 | \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}. | |
78c49c58 | 507 | |
4b39770c WS |
508 | For more information about controlling grid cell attributes see the |
509 | \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the | |
78c49c58 MB |
510 | \helpref{wxGrid classes overview}{gridoverview}. |
511 | ||
4b39770c WS |
512 | |
513 | ||
78c49c58 MB |
514 | \membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines} |
515 | ||
cc81d32f | 516 | \func{void}{EnableGridLines}{\param{bool }{enable = true}} |
78c49c58 MB |
517 | |
518 | Turns the drawing of grid lines on or off. | |
a660d684 | 519 | |
4b39770c WS |
520 | |
521 | ||
a660d684 KB |
522 | \membersection{wxGrid::EndBatch}\label{wxgridendbatch} |
523 | ||
524 | \func{void}{EndBatch}{\void} | |
525 | ||
78c49c58 | 526 | Decrements the grid's batch count. When the count is greater than zero repainting of |
4b39770c | 527 | the grid is suppressed. Each previous call to |
78c49c58 MB |
528 | \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} must be matched by a later call to |
529 | EndBatch. Code that does a lot of grid modification can be enclosed between | |
530 | BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will | |
531 | cause the grid to be repainted. | |
532 | ||
b62f94ff VZ |
533 | \wxheading{See also} |
534 | ||
535 | \helpref{wxGridUpdateLocker}{wxgridupdatelocker} | |
536 | ||
4b39770c WS |
537 | |
538 | ||
608754c4 JS |
539 | \membersection{wxGrid::Fit}\label{wxgridfit} |
540 | ||
541 | \func{void}{Fit}{\void} | |
542 | ||
543 | Overridden wxWindow method. | |
544 | ||
4b39770c WS |
545 | |
546 | ||
78c49c58 | 547 | \membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh} |
a660d684 | 548 | |
78c49c58 MB |
549 | \func{void}{ForceRefresh}{\void} |
550 | ||
551 | Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh. | |
a660d684 | 552 | |
4b39770c WS |
553 | |
554 | ||
a660d684 KB |
555 | \membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount} |
556 | ||
ef316e23 | 557 | \constfunc{int}{GetBatchCount}{\void} |
a660d684 | 558 | |
78c49c58 MB |
559 | Returns the number of times that \helpref{wxGrid::BeginBatch}{wxgridbeginbatch} has been called |
560 | without (yet) matching calls to \helpref{wxGrid::EndBatch}{wxgridendbatch}. While | |
561 | the grid's batch count is greater than zero the display will not be updated. | |
a660d684 | 562 | |
4b39770c WS |
563 | |
564 | ||
78c49c58 | 565 | \membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment} |
a660d684 | 566 | |
ef316e23 | 567 | \constfunc{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}} |
a660d684 | 568 | |
78c49c58 MB |
569 | Sets the arguments to the horizontal and vertical text alignment values for the |
570 | grid cell at the specified location. | |
a660d684 | 571 | |
e7240349 GT |
572 | Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\ |
573 | Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
a660d684 | 574 | |
9722642d MB |
575 | \perlnote{This method only takes the parameters {\tt row} and {\tt col} and |
576 | returns a 2-element list {\tt ( horiz, vert )}.} | |
577 | ||
4b39770c WS |
578 | |
579 | ||
78c49c58 | 580 | \membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour} |
a660d684 | 581 | |
ef316e23 | 582 | \constfunc{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}} |
a660d684 | 583 | |
78c49c58 | 584 | Returns the background colour of the cell at the specified location. |
a660d684 | 585 | |
4b39770c WS |
586 | |
587 | ||
78c49c58 | 588 | \membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor} |
a660d684 | 589 | |
ef316e23 | 590 | \constfunc{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}} |
a660d684 | 591 | |
78c49c58 | 592 | Returns a pointer to the editor for the cell at the specified location. |
21f280f4 | 593 | |
78c49c58 MB |
594 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and |
595 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
a660d684 | 596 | |
4b39770c WS |
597 | |
598 | ||
78c49c58 | 599 | \membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont} |
a660d684 | 600 | |
ef316e23 | 601 | \constfunc{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}} |
a660d684 | 602 | |
78c49c58 | 603 | Returns the font for text in the grid cell at the specified location. |
a660d684 | 604 | |
4b39770c WS |
605 | |
606 | ||
78c49c58 | 607 | \membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer} |
21f280f4 | 608 | |
ef316e23 | 609 | \constfunc{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}} |
a660d684 | 610 | |
78c49c58 | 611 | Returns a pointer to the renderer for the grid cell at the specified location. |
a660d684 | 612 | |
78c49c58 MB |
613 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and |
614 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
a660d684 | 615 | |
4b39770c WS |
616 | |
617 | ||
a660d684 KB |
618 | \membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour} |
619 | ||
ef316e23 | 620 | \constfunc{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}} |
a660d684 | 621 | |
78c49c58 | 622 | Returns the text colour for the grid cell at the specified location. |
a660d684 | 623 | |
4b39770c WS |
624 | |
625 | ||
5c69031c MB |
626 | \membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue} |
627 | ||
ef316e23 | 628 | \constfunc{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}} |
5c69031c | 629 | |
ef316e23 | 630 | \constfunc{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}} |
5c69031c MB |
631 | |
632 | Returns the string contained in the cell at the specified location. For simple applications where a | |
633 | grid object automatically uses a default grid table of string values you use this function together | |
4b39770c | 634 | with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values. |
5c69031c MB |
635 | |
636 | For more complex applications where you have derived your own grid table class that contains | |
637 | various data types (e.g. numeric, boolean or user-defined custom types) then you only use this | |
4b39770c | 638 | function for those cells that contain string values. |
5c69031c MB |
639 | |
640 | See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas} | |
641 | and the \helpref{wxGrid overview}{gridoverview} for more information. | |
642 | ||
608754c4 | 643 | |
4b39770c | 644 | |
d4175745 VZ |
645 | \membersection{wxGrid::GetColAt}\label{wxgridgetcolat} |
646 | ||
647 | \constfunc{int}{GetColAt}{\param{int }{colPos}} | |
648 | ||
649 | Returns the column ID of the specified column position. | |
650 | ||
651 | ||
608754c4 JS |
652 | \membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft} |
653 | ||
654 | \constfunc{int}{GetColLeft}{\param{int }{col}} | |
655 | ||
4b39770c WS |
656 | |
657 | ||
78c49c58 | 658 | \membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment} |
a660d684 | 659 | |
ef316e23 | 660 | \constfunc{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}} |
21f280f4 | 661 | |
78c49c58 | 662 | Sets the arguments to the current column label alignment values. |
a660d684 | 663 | |
ce994095 JS |
664 | Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT.\\ |
665 | Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
a660d684 | 666 | |
9722642d MB |
667 | \perlnote{This method takes no parameters and |
668 | returns a 2-element list {\tt ( horiz, vert )}.} | |
669 | ||
4b39770c WS |
670 | |
671 | ||
78c49c58 | 672 | \membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize} |
a660d684 | 673 | |
ef316e23 | 674 | \constfunc{int}{GetColLabelSize}{\void} |
a660d684 | 675 | |
78c49c58 | 676 | Returns the current height of the column labels. |
21f280f4 | 677 | |
4b39770c WS |
678 | |
679 | ||
78c49c58 | 680 | \membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue} |
a660d684 | 681 | |
ef316e23 | 682 | \constfunc{wxString}{GetColLabelValue}{\param{int }{col}} |
a660d684 | 683 | |
2edb0bde | 684 | Returns the specified column label. The default grid table class provides column labels of |
4b39770c | 685 | the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override |
78c49c58 | 686 | \helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide |
4b39770c WS |
687 | your own labels. |
688 | ||
689 | ||
a660d684 | 690 | |
608754c4 JS |
691 | \membersection{wxGrid::GetColMinimalAcceptableWidth}\label{wxgridgetcolminimalacceptablewidth} |
692 | ||
ef316e23 | 693 | \constfunc{int}{GetColMinimalAcceptableWidth}{} |
608754c4 JS |
694 | |
695 | This returns the value of the lowest column width that can be handled correctly. See | |
696 | member \helpref{SetColMinimalAcceptableWidth}{wxgridsetcolminimalacceptablewidth} for details. | |
697 | ||
4b39770c WS |
698 | |
699 | ||
608754c4 JS |
700 | \membersection{wxGrid::GetColMinimalWidth}\label{wxgridgetcolminimalwidth} |
701 | ||
702 | \constfunc{int}{GetColMinimalWidth}{\param{int }{col}} | |
703 | ||
704 | Get the minimal width of the given column/row. | |
705 | ||
706 | ||
4b39770c | 707 | |
d4175745 VZ |
708 | \membersection{wxGrid::GetColPos}\label{wxgridgetcolpos} |
709 | ||
710 | \constfunc{int}{GetColPos}{\param{int }{colID}} | |
711 | ||
712 | Returns the position of the specified column. | |
713 | ||
714 | ||
715 | ||
608754c4 JS |
716 | \membersection{wxGrid::GetColRight}\label{wxgridgetcolright} |
717 | ||
718 | \constfunc{int}{GetColRight}{\param{int }{col}} | |
719 | ||
4b39770c WS |
720 | |
721 | ||
78c49c58 | 722 | \membersection{wxGrid::GetColSize}\label{wxgridgetcolsize} |
a660d684 | 723 | |
ef316e23 | 724 | \constfunc{int}{GetColSize}{\param{int }{col}} |
a660d684 | 725 | |
78c49c58 | 726 | Returns the width of the specified column. |
a660d684 | 727 | |
4b39770c WS |
728 | |
729 | ||
78c49c58 | 730 | \membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment} |
a660d684 | 731 | |
ef316e23 | 732 | \constfunc{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}} |
a660d684 | 733 | |
78c49c58 MB |
734 | Sets the arguments to the current default horizontal and vertical text alignment |
735 | values. | |
a660d684 | 736 | |
2eebb742 JS |
737 | Horizontal alignment will be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\ |
738 | Vertical alignment will be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
a660d684 | 739 | |
4b39770c WS |
740 | |
741 | ||
78c49c58 | 742 | \membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour} |
a660d684 | 743 | |
ef316e23 | 744 | \constfunc{wxColour}{GetDefaultCellBackgroundColour}{\void} |
a660d684 | 745 | |
78c49c58 | 746 | Returns the current default background colour for grid cells. |
a660d684 | 747 | |
4b39770c WS |
748 | |
749 | ||
78c49c58 | 750 | \membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont} |
a660d684 | 751 | |
ef316e23 | 752 | \constfunc{wxFont}{GetDefaultCellFont}{\void} |
a660d684 | 753 | |
78c49c58 | 754 | Returns the current default font for grid cell text. |
a660d684 | 755 | |
4b39770c WS |
756 | |
757 | ||
78c49c58 | 758 | \membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour} |
a660d684 | 759 | |
ef316e23 | 760 | \constfunc{wxColour}{GetDefaultCellTextColour}{\void} |
a660d684 | 761 | |
78c49c58 | 762 | Returns the current default colour for grid cell text. |
a660d684 | 763 | |
4b39770c WS |
764 | |
765 | ||
78c49c58 | 766 | \membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize} |
a660d684 | 767 | |
ef316e23 | 768 | \constfunc{int}{GetDefaultColLabelSize}{\void} |
a660d684 | 769 | |
78c49c58 | 770 | Returns the default height for column labels. |
c0b042fc | 771 | |
4b39770c WS |
772 | |
773 | ||
78c49c58 | 774 | \membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize} |
c0b042fc | 775 | |
ef316e23 | 776 | \constfunc{int}{GetDefaultColSize}{\void} |
c0b042fc | 777 | |
78c49c58 | 778 | Returns the current default width for grid columns. |
a660d684 | 779 | |
4b39770c WS |
780 | |
781 | ||
78c49c58 | 782 | \membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor} |
a660d684 | 783 | |
78c49c58 | 784 | \constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void} |
a660d684 | 785 | |
78c49c58 MB |
786 | Returns a pointer to the current default grid cell editor. |
787 | ||
788 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
789 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
790 | ||
4b39770c WS |
791 | |
792 | ||
608754c4 JS |
793 | \membersection{wxGrid::GetDefaultEditorForCell}\label{wxgridgetdefaulteditorforcell} |
794 | ||
795 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{int }{row}, \param{int }{col}} | |
796 | ||
797 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForCell}{\param{const wxGridCellCoords\& }{c}} | |
798 | ||
799 | ||
4b39770c | 800 | |
608754c4 JS |
801 | \membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype} |
802 | ||
803 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}} | |
804 | ||
805 | ||
4b39770c | 806 | |
78c49c58 MB |
807 | \membersection{wxGrid::GetDefaultRenderer}\label{wxgridgetdefaultrenderer} |
808 | ||
809 | \constfunc{wxGridCellRenderer*}{GetDefaultRenderer}{\void} | |
810 | ||
811 | Returns a pointer to the current default grid cell renderer. | |
812 | ||
813 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
814 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
a660d684 | 815 | |
4b39770c WS |
816 | |
817 | ||
608754c4 JS |
818 | \membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell} |
819 | ||
820 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}} | |
821 | ||
4b39770c WS |
822 | |
823 | ||
608754c4 JS |
824 | \membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype} |
825 | ||
826 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}} | |
827 | ||
828 | ||
829 | ||
78c49c58 | 830 | \membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize} |
a660d684 | 831 | |
ef316e23 | 832 | \constfunc{int}{GetDefaultRowLabelSize}{\void} |
78c49c58 MB |
833 | |
834 | Returns the default width for the row labels. | |
835 | ||
4b39770c WS |
836 | |
837 | ||
78c49c58 MB |
838 | \membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize} |
839 | ||
ef316e23 | 840 | \constfunc{int}{GetDefaultRowSize}{\void} |
78c49c58 MB |
841 | |
842 | Returns the current default height for grid rows. | |
843 | ||
4b39770c WS |
844 | |
845 | ||
78c49c58 MB |
846 | \membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol} |
847 | ||
ef316e23 | 848 | \constfunc{int}{GetGridCursorCol}{\void} |
78c49c58 MB |
849 | |
850 | Returns the current grid cell column position. | |
851 | ||
4b39770c WS |
852 | |
853 | ||
78c49c58 MB |
854 | \membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow} |
855 | ||
ef316e23 | 856 | \constfunc{int}{GetGridCursorRow}{\void} |
78c49c58 MB |
857 | |
858 | Returns the current grid cell row position. | |
859 | ||
4b39770c WS |
860 | |
861 | ||
78c49c58 MB |
862 | \membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour} |
863 | ||
ef316e23 | 864 | \constfunc{wxColour}{GetGridLineColour}{\void} |
78c49c58 MB |
865 | |
866 | Returns the colour used for grid lines. | |
867 | ||
3d3f3e37 VZ |
868 | \wxheading{See also} |
869 | ||
870 | \helpref{GetDefaultGridLinePen()}{wxgridgetdefaultgridlinepen} | |
871 | ||
872 | ||
873 | \membersection{wxGrid::GetDefaultGridLinePen}\label{wxgridgetdefaultgridlinepen} | |
874 | ||
875 | \func{wxPen}{GetDefaultGridLinePen}{\void} | |
876 | ||
877 | Returns the pen used for grid lines. This virtual function may be overridden in | |
878 | derived classes in order to change the appearance of grid lines. Note that | |
879 | currently the pen width must be $1$. | |
880 | ||
881 | \wxheading{See also} | |
882 | ||
883 | \helpref{GetColGridLinePen()}{wxgridgetcolgridlinepen},\\ | |
884 | \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} | |
885 | ||
886 | ||
887 | ||
888 | ||
889 | \membersection{wxGrid::GetRowGridLinePen}\label{wxgridgetrowgridlinepen} | |
890 | ||
891 | \func{wxPen}{GetRowGridLinePen}{\param{int }{row}} | |
892 | ||
893 | Returns the pen used for horizontal grid lines. This virtual function may be | |
894 | overridden in derived classes in order to change the appearance of individual | |
895 | grid line for the given row \arg{row}. | |
896 | ||
897 | Example: \\ | |
898 | \\ | |
899 | \begin{verbatim} | |
900 | // in a grid displaying music notation, use a solid black pen between | |
901 | // octaves (C0=row 127, C1=row 115 etc.) | |
902 | wxPen MidiGrid::GetRowGridLinePen(int row) | |
903 | { | |
904 | if ( row%12 == 7 ) | |
905 | return wxPen(*wxBLACK, 1, wxSOLID); | |
906 | else | |
907 | return GetDefaultGridLinePen(); | |
908 | } | |
909 | \end{verbatim} | |
910 | ||
911 | ||
912 | ||
913 | \membersection{wxGrid::GetColGridLinePen}\label{wxgridgetcolgridlinepen} | |
914 | ||
915 | \func{wxPen}{GetColGridLinePen}{\param{int }{col}} | |
916 | ||
917 | Returns the pen used for vertical grid lines. This virtual function may be | |
918 | overridden in derived classes in order to change the appearance of individual | |
919 | grid lines for the given column \arg{col}. | |
920 | ||
921 | See \helpref{GetRowGridLinePen()}{wxgridgetrowgridlinepen} for an example. | |
922 | ||
923 | ||
4b39770c WS |
924 | |
925 | ||
78c49c58 MB |
926 | \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled} |
927 | ||
ef316e23 | 928 | \constfunc{bool}{GridLinesEnabled}{\void} |
78c49c58 | 929 | |
cc81d32f | 930 | Returns true if drawing of grid lines is turned on, false otherwise. |
a660d684 | 931 | |
4b39770c WS |
932 | |
933 | ||
a660d684 KB |
934 | \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour} |
935 | ||
ef316e23 | 936 | \constfunc{wxColour}{GetLabelBackgroundColour}{\void} |
a660d684 | 937 | |
78c49c58 | 938 | Returns the colour used for the background of row and column labels. |
a660d684 | 939 | |
4b39770c WS |
940 | |
941 | ||
78c49c58 | 942 | \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont} |
a660d684 | 943 | |
ef316e23 | 944 | \constfunc{wxFont}{GetLabelFont}{\void} |
a660d684 | 945 | |
78c49c58 | 946 | Returns the font used for row and column labels. |
a660d684 | 947 | |
4b39770c WS |
948 | |
949 | ||
a660d684 KB |
950 | \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour} |
951 | ||
ef316e23 | 952 | \constfunc{wxColour}{GetLabelTextColour}{\void} |
a660d684 | 953 | |
78c49c58 | 954 | Returns the colour used for row and column label text. |
a660d684 | 955 | |
4b39770c WS |
956 | |
957 | ||
78c49c58 | 958 | \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols} |
a660d684 | 959 | |
ef316e23 | 960 | \constfunc{int}{GetNumberCols}{\void} |
a660d684 | 961 | |
78c49c58 MB |
962 | Returns the total number of grid columns (actually the number of columns in the underlying grid |
963 | table). | |
a660d684 | 964 | |
4b39770c WS |
965 | |
966 | ||
78c49c58 | 967 | \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows} |
a660d684 | 968 | |
ef316e23 | 969 | \constfunc{int}{GetNumberRows}{\void} |
a660d684 | 970 | |
78c49c58 | 971 | Returns the total number of grid rows (actually the number of rows in the underlying grid table). |
a660d684 | 972 | |
4b39770c WS |
973 | |
974 | ||
608754c4 JS |
975 | \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr} |
976 | ||
977 | \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}} | |
978 | ||
4b39770c WS |
979 | |
980 | ||
608754c4 JS |
981 | \membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight} |
982 | ||
ef316e23 | 983 | \constfunc{int}{GetRowMinimalAcceptableHeight}{} |
608754c4 JS |
984 | |
985 | This returns the value of the lowest row width that can be handled correctly. See | |
986 | member \helpref{SetRowMinimalAcceptableHeight}{wxgridsetrowminimalacceptableheight} for details. | |
987 | ||
988 | ||
4b39770c | 989 | |
608754c4 JS |
990 | \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight} |
991 | ||
992 | \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}} | |
993 | ||
4b39770c WS |
994 | |
995 | ||
78c49c58 | 996 | \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment} |
a660d684 | 997 | |
ef316e23 | 998 | \constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}} |
a660d684 | 999 | |
78c49c58 | 1000 | Sets the arguments to the current row label alignment values. |
a660d684 | 1001 | |
78c49c58 MB |
1002 | Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\ |
1003 | Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM. | |
a660d684 | 1004 | |
9722642d MB |
1005 | \perlnote{This method takes no parameters and |
1006 | returns a 2-element list {\tt ( horiz, vert )}.} | |
1007 | ||
4b39770c WS |
1008 | |
1009 | ||
78c49c58 | 1010 | \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize} |
a660d684 | 1011 | |
ef316e23 | 1012 | \constfunc{int}{GetRowLabelSize}{\void} |
a660d684 | 1013 | |
78c49c58 | 1014 | Returns the current width of the row labels. |
a660d684 | 1015 | |
4b39770c WS |
1016 | |
1017 | ||
78c49c58 | 1018 | \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue} |
a660d684 | 1019 | |
ef316e23 | 1020 | \constfunc{wxString}{GetRowLabelValue}{\param{int }{row}} |
a660d684 | 1021 | |
2edb0bde | 1022 | Returns the specified row label. The default grid table class provides numeric row labels. |
4b39770c | 1023 | If you are using a custom grid table you can override |
78c49c58 | 1024 | \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide |
4b39770c WS |
1025 | your own labels. |
1026 | ||
1027 | ||
a660d684 | 1028 | |
78c49c58 | 1029 | \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize} |
a660d684 | 1030 | |
ef316e23 | 1031 | \constfunc{int}{GetRowSize}{\param{int }{row}} |
a660d684 | 1032 | |
78c49c58 | 1033 | Returns the height of the specified row. |
a660d684 | 1034 | |
608754c4 | 1035 | |
4b39770c WS |
1036 | |
1037 | \membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex} | |
1038 | ||
1039 | \constfunc{int}{GetScrollLineX}{\void} | |
608754c4 JS |
1040 | |
1041 | Returns the number of pixels per horizontal scroll increment. The default is 15. | |
1042 | ||
4b39770c WS |
1043 | \wxheading{See also} |
1044 | ||
1045 | \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp | |
1046 | \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp | |
1047 | \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney} | |
1048 | ||
608754c4 | 1049 | |
4b39770c WS |
1050 | |
1051 | \membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney} | |
1052 | ||
1053 | \constfunc{int}{GetScrollLineY}{\void} | |
608754c4 JS |
1054 | |
1055 | Returns the number of pixels per vertical scroll increment. The default is 15. | |
1056 | ||
4b39770c WS |
1057 | \wxheading{See also} |
1058 | ||
1059 | \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp | |
1060 | \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp | |
1061 | \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney} | |
1062 | ||
1063 | ||
1064 | ||
aa5b8857 SN |
1065 | \membersection{wxGrid::GetSelectionMode}\label{wxgridgetselectionmode} |
1066 | ||
1067 | \constfunc{wxGrid::wxGridSelectionModes}{GetSelectionMode}{\void} | |
1068 | ||
1069 | Returns the current selection mode, see \helpref{wxGrid::SetSelectionMode}{wxgridsetselectionmode}. | |
1070 | ||
4b39770c WS |
1071 | |
1072 | ||
aa5b8857 SN |
1073 | \membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells} |
1074 | ||
1075 | \constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void} | |
1076 | ||
1077 | Returns an array of singly selected cells. | |
1078 | ||
4b39770c WS |
1079 | |
1080 | ||
aa5b8857 SN |
1081 | \membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols} |
1082 | ||
1083 | \constfunc{wxArrayInt}{GetSelectedCols}{\void} | |
1084 | ||
1085 | Returns an array of selected cols. | |
1086 | ||
4b39770c WS |
1087 | |
1088 | ||
aa5b8857 SN |
1089 | \membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows} |
1090 | ||
1091 | \constfunc{wxArrayInt}{GetSelectedRows}{\void} | |
1092 | ||
1093 | Returns an array of selected rows. | |
1094 | ||
4b39770c WS |
1095 | |
1096 | ||
608754c4 JS |
1097 | \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground} |
1098 | ||
1099 | \constfunc{wxColour}{GetSelectionBackground}{\void} | |
1100 | ||
1101 | Access or update the selection fore/back colours | |
1102 | ||
1103 | ||
4b39770c | 1104 | |
aa5b8857 SN |
1105 | \membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft} |
1106 | ||
1107 | \constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void} | |
1108 | ||
4b39770c | 1109 | Returns an array of the top left corners of blocks of selected cells, |
aa5b8857 SN |
1110 | see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}. |
1111 | ||
4b39770c WS |
1112 | |
1113 | ||
aa5b8857 SN |
1114 | \membersection{wxGrid::GetSelectionBlockBottomRight}\label{wxgridgetselectionblockbottomright} |
1115 | ||
1116 | \constfunc{wxGridCellCoordsArray}{GetSelectionBlockBottomRight}{\void} | |
1117 | ||
1118 | Returns an array of the bottom right corners of blocks of selected cells, | |
1119 | see \helpref{wxGrid::GetSelectionBlockTopLeft}{wxgridgetselectionblocktopleft}. | |
1120 | ||
4b39770c WS |
1121 | |
1122 | ||
608754c4 JS |
1123 | \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground} |
1124 | ||
1125 | \constfunc{wxColour}{GetSelectionForeground}{\void} | |
1126 | ||
1127 | ||
4b39770c | 1128 | |
78c49c58 | 1129 | \membersection{wxGrid::GetTable}\label{wxgridgettable} |
a660d684 | 1130 | |
78c49c58 | 1131 | \constfunc{wxGridTableBase *}{GetTable}{\void} |
a660d684 | 1132 | |
78c49c58 | 1133 | Returns a base pointer to the current table object. |
a660d684 | 1134 | |
4b39770c WS |
1135 | |
1136 | ||
608754c4 JS |
1137 | \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth} |
1138 | ||
ef316e23 | 1139 | \constfunc{int}{GetViewWidth}{\void} |
608754c4 JS |
1140 | |
1141 | Returned number of whole cols visible. | |
1142 | ||
4b39770c WS |
1143 | |
1144 | ||
78c49c58 | 1145 | \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol} |
a660d684 | 1146 | |
78c49c58 MB |
1147 | \func{void}{HideCellEditControl}{\void} |
1148 | ||
1149 | Hides the in-place cell edit control. | |
a660d684 | 1150 | |
4b39770c WS |
1151 | |
1152 | ||
608754c4 JS |
1153 | \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths} |
1154 | ||
1155 | \func{void}{InitColWidths}{\void} | |
1156 | ||
1157 | Init the m\_colWidths/Rights arrays | |
1158 | ||
4b39770c WS |
1159 | |
1160 | ||
608754c4 JS |
1161 | \membersection{wxGrid::InitRowHeights}\label{wxgridinitrowheights} |
1162 | ||
1163 | \func{void}{InitRowHeights}{\void} | |
1164 | ||
1165 | NB: {\it never} access m\_row/col arrays directly because they are created | |
1166 | on demand, {\it always} use accessor functions instead! | |
1167 | ||
1168 | Init the m\_rowHeights/Bottoms arrays with default values. | |
1169 | ||
4b39770c WS |
1170 | |
1171 | ||
a660d684 KB |
1172 | \membersection{wxGrid::InsertCols}\label{wxgridinsertcols} |
1173 | ||
cc81d32f | 1174 | \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}} |
78c49c58 MB |
1175 | |
1176 | Inserts one or more new columns into a grid with the first new column at the | |
cc81d32f | 1177 | specified position and returns true if successful. The updateLabels argument is not |
4b39770c | 1178 | used at present. |
a660d684 | 1179 | |
78c49c58 MB |
1180 | The sequence of actions begins with the grid object requesting the underlying grid |
1181 | table to insert new columns. If this is successful the table notifies the grid and the | |
d4175745 | 1182 | grid updates the display. For a default grid (one where you have called |
78c49c58 | 1183 | \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are |
4b39770c | 1184 | using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable}) |
d4175745 | 1185 | then you must override |
78c49c58 MB |
1186 | \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived |
1187 | table class. | |
a660d684 | 1188 | |
4b39770c WS |
1189 | |
1190 | ||
a660d684 KB |
1191 | \membersection{wxGrid::InsertRows}\label{wxgridinsertrows} |
1192 | ||
cc81d32f | 1193 | \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}} |
a660d684 | 1194 | |
78c49c58 | 1195 | Inserts one or more new rows into a grid with the first new row at the specified |
cc81d32f | 1196 | position and returns true if successful. The updateLabels argument is not used at |
4b39770c | 1197 | present. |
a660d684 | 1198 | |
78c49c58 MB |
1199 | The sequence of actions begins with the grid object requesting the underlying grid |
1200 | table to insert new rows. If this is successful the table notifies the grid and the | |
d4175745 | 1201 | grid updates the display. For a default grid (one where you have called |
78c49c58 | 1202 | \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are |
4b39770c | 1203 | using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable}) |
d4175745 | 1204 | then you must override |
78c49c58 MB |
1205 | \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived |
1206 | table class. | |
1207 | ||
4b39770c WS |
1208 | |
1209 | ||
78c49c58 MB |
1210 | \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled} |
1211 | ||
1212 | \constfunc{bool}{IsCellEditControlEnabled}{\void} | |
1213 | ||
cc81d32f | 1214 | Returns true if the in-place edit control is currently enabled. |
78c49c58 | 1215 | |
4b39770c WS |
1216 | |
1217 | ||
78c49c58 MB |
1218 | \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly} |
1219 | ||
1220 | \constfunc{bool}{IsCurrentCellReadOnly}{\void} | |
1221 | ||
cc81d32f | 1222 | Returns true if the current cell has been set to read-only |
78c49c58 MB |
1223 | (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}). |
1224 | ||
4b39770c WS |
1225 | |
1226 | ||
78c49c58 | 1227 | \membersection{wxGrid::IsEditable}\label{wxgridiseditable} |
a660d684 | 1228 | |
ef316e23 | 1229 | \constfunc{bool}{IsEditable}{\void} |
a660d684 | 1230 | |
cc81d32f | 1231 | Returns false if the whole grid has been set as read-only or true otherwise. |
78c49c58 MB |
1232 | See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about |
1233 | controlling the editing status of grid cells. | |
a660d684 | 1234 | |
4b39770c WS |
1235 | |
1236 | ||
aa5b8857 SN |
1237 | \membersection{wxGrid::IsInSelection}\label{wxgridisinselection} |
1238 | ||
1239 | \constfunc{bool}{IsInSelection}{\param{int }{row}, \param{int }{col}} | |
1240 | ||
1241 | \constfunc{bool}{IsInSelection}{\param{const wxGridCellCoords\& }{coords}} | |
1242 | ||
1243 | Is this cell currently selected. | |
1244 | ||
4b39770c WS |
1245 | |
1246 | ||
5c69031c MB |
1247 | \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly} |
1248 | ||
1249 | \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}} | |
1250 | ||
cc81d32f | 1251 | Returns true if the cell at the specified location can't be edited. |
5c69031c MB |
1252 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. |
1253 | ||
4b39770c WS |
1254 | |
1255 | ||
5c69031c MB |
1256 | \membersection{wxGrid::IsSelection}\label{wxgridisselection} |
1257 | ||
ef316e23 | 1258 | \constfunc{bool}{IsSelection}{\void} |
5c69031c | 1259 | |
cc81d32f | 1260 | Returns true if there are currently rows, columns or blocks of cells selected. |
5c69031c | 1261 | |
4b39770c WS |
1262 | |
1263 | ||
78c49c58 | 1264 | \membersection{wxGrid::IsVisible}\label{wxgridisvisible} |
a660d684 | 1265 | |
ef316e23 | 1266 | \constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}} |
a660d684 | 1267 | |
ef316e23 | 1268 | \constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}} |
a660d684 | 1269 | |
cc81d32f | 1270 | Returns true if a cell is either wholly visible (the default) or at least partially |
78c49c58 | 1271 | visible in the grid window. |
a660d684 | 1272 | |
4b39770c WS |
1273 | |
1274 | ||
78c49c58 | 1275 | \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible} |
a660d684 | 1276 | |
78c49c58 | 1277 | \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}} |
a660d684 | 1278 | |
78c49c58 | 1279 | \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}} |
a660d684 | 1280 | |
78c49c58 | 1281 | Brings the specified cell into the visible grid cell area with minimal scrolling. Does |
4b39770c WS |
1282 | nothing if the cell is already visible. |
1283 | ||
1284 | ||
a660d684 | 1285 | |
78c49c58 | 1286 | \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown} |
a660d684 | 1287 | |
78c49c58 | 1288 | \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}} |
a660d684 | 1289 | |
2eebb742 | 1290 | Moves the grid cursor down by one row. If a block of cells was previously selected it |
cc81d32f | 1291 | will expand if the argument is true or be cleared if the argument is false. |
a660d684 | 1292 | |
78c49c58 MB |
1293 | \wxheading{Keyboard}\\ |
1294 | This function is called for Down cursor key presses or Shift+Down to expand a selection. | |
a660d684 | 1295 | |
4b39770c WS |
1296 | |
1297 | ||
78c49c58 | 1298 | \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft} |
a660d684 | 1299 | |
78c49c58 | 1300 | \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}} |
a660d684 | 1301 | |
78c49c58 | 1302 | Moves the grid cursor left by one column. If a block of cells was previously selected it |
cc81d32f | 1303 | will expand if the argument is true or be cleared if the argument is false. |
a660d684 | 1304 | |
78c49c58 MB |
1305 | \wxheading{Keyboard}\\ |
1306 | This function is called for Left cursor key presses or Shift+Left to expand a selection. | |
a660d684 | 1307 | |
4b39770c WS |
1308 | |
1309 | ||
78c49c58 | 1310 | \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright} |
a660d684 | 1311 | |
78c49c58 | 1312 | \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}} |
a660d684 | 1313 | |
78c49c58 | 1314 | Moves the grid cursor right by one column. If a block of cells was previously selected it |
cc81d32f | 1315 | will expand if the argument is true or be cleared if the argument is false. |
a660d684 | 1316 | |
78c49c58 MB |
1317 | \wxheading{Keyboard}\\ |
1318 | This function is called for Right cursor key presses or Shift+Right to expand a selection. | |
a660d684 | 1319 | |
4b39770c WS |
1320 | |
1321 | ||
78c49c58 | 1322 | \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup} |
a660d684 | 1323 | |
78c49c58 | 1324 | \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}} |
a660d684 | 1325 | |
78c49c58 | 1326 | Moves the grid cursor up by one row. If a block of cells was previously selected it |
cc81d32f | 1327 | will expand if the argument is true or be cleared if the argument is false. |
a660d684 | 1328 | |
78c49c58 MB |
1329 | \wxheading{Keyboard}\\ |
1330 | This function is called for Up cursor key presses or Shift+Up to expand a selection. | |
a660d684 | 1331 | |
4b39770c WS |
1332 | |
1333 | ||
78c49c58 | 1334 | \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock} |
a660d684 | 1335 | |
78c49c58 | 1336 | \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}} |
a660d684 | 1337 | |
78c49c58 MB |
1338 | Moves the grid cursor down in the current column such that it skips to the beginning or |
1339 | end of a block of non-empty cells. If a block of cells was previously selected it | |
cc81d32f | 1340 | will expand if the argument is true or be cleared if the argument is false. |
a660d684 | 1341 | |
78c49c58 MB |
1342 | \wxheading{Keyboard}\\ |
1343 | This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection. | |
a660d684 | 1344 | |
4b39770c WS |
1345 | |
1346 | ||
78c49c58 | 1347 | \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock} |
a660d684 | 1348 | |
78c49c58 | 1349 | \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}} |
a660d684 | 1350 | |
78c49c58 MB |
1351 | Moves the grid cursor left in the current row such that it skips to the beginning or |
1352 | end of a block of non-empty cells. If a block of cells was previously selected it | |
cc81d32f | 1353 | will expand if the argument is true or be cleared if the argument is false. |
a660d684 | 1354 | |
78c49c58 MB |
1355 | \wxheading{Keyboard}\\ |
1356 | This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection. | |
a660d684 | 1357 | |
4b39770c WS |
1358 | |
1359 | ||
78c49c58 MB |
1360 | \membersection{wxGrid::MoveCursorRightBlock}\label{wxgridmovecursorrightblock} |
1361 | ||
1362 | \func{bool}{MoveCursorRightBlock}{\param{bool }{expandSelection}} | |
1363 | ||
1364 | Moves the grid cursor right in the current row such that it skips to the beginning or | |
1365 | end of a block of non-empty cells. If a block of cells was previously selected it | |
cc81d32f | 1366 | will expand if the argument is true or be cleared if the argument is false. |
78c49c58 MB |
1367 | |
1368 | \wxheading{Keyboard}\\ | |
1369 | This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection. | |
1370 | ||
4b39770c WS |
1371 | |
1372 | ||
78c49c58 MB |
1373 | \membersection{wxGrid::MoveCursorUpBlock}\label{wxgridmovecursorupblock} |
1374 | ||
1375 | \func{bool}{MoveCursorUpBlock}{\param{bool }{expandSelection}} | |
1376 | ||
1377 | Moves the grid cursor up in the current column such that it skips to the beginning or | |
1378 | end of a block of non-empty cells. If a block of cells was previously selected it | |
cc81d32f | 1379 | will expand if the argument is true or be cleared if the argument is false. |
78c49c58 MB |
1380 | |
1381 | \wxheading{Keyboard}\\ | |
1382 | This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection. | |
1383 | ||
4b39770c WS |
1384 | |
1385 | ||
78c49c58 MB |
1386 | \membersection{wxGrid::MovePageDown}\label{wxgridmovepagedown} |
1387 | ||
1388 | \func{bool}{MovePageDown}{\void} | |
1389 | ||
1390 | Moves the grid cursor down by some number of rows so that the previous bottom visible row | |
1391 | becomes the top visible row. | |
1392 | ||
1393 | \wxheading{Keyboard}\\ | |
1394 | This function is called for PgDn keypresses. | |
1395 | ||
4b39770c WS |
1396 | |
1397 | ||
78c49c58 MB |
1398 | \membersection{wxGrid::MovePageUp}\label{wxgridmovepageup} |
1399 | ||
1400 | \func{bool}{MovePageUp}{\void} | |
1401 | ||
1402 | Moves the grid cursor up by some number of rows so that the previous top visible row | |
1403 | becomes the bottom visible row. | |
1404 | ||
1405 | \wxheading{Keyboard}\\ | |
1406 | This function is called for PgUp keypresses. | |
1407 | ||
4b39770c WS |
1408 | |
1409 | ||
608754c4 JS |
1410 | \membersection{wxGrid::RegisterDataType}\label{wxgridregisterdatatype} |
1411 | ||
1412 | \func{void}{RegisterDataType}{\param{const wxString\& }{typeName}, \param{wxGridCellRenderer* }{renderer}, \param{wxGridCellEditor* }{editor}} | |
1413 | ||
1414 | Methods for a registry for mapping data types to Renderers/Editors | |
1415 | ||
4b39770c WS |
1416 | |
1417 | ||
78c49c58 MB |
1418 | \membersection{wxGrid::SaveEditControlValue}\label{wxgridsaveeditcontrolvalue} |
1419 | ||
1420 | \func{void}{SaveEditControlValue}{\void} | |
1421 | ||
1422 | Sets the value of the current grid cell to the current in-place edit control value. | |
1423 | This is called automatically when the grid cursor moves from the current cell to a | |
1424 | new cell. It is also a good idea to call this function when closing a grid since | |
1425 | any edits to the final cell location will not be saved otherwise. | |
a660d684 | 1426 | |
4b39770c WS |
1427 | |
1428 | ||
5c69031c MB |
1429 | \membersection{wxGrid::SelectAll}\label{wxgridselectall} |
1430 | ||
1431 | \func{void}{SelectAll}{\void} | |
1432 | ||
1433 | Selects all cells in the grid. | |
1434 | ||
4b39770c WS |
1435 | |
1436 | ||
5c69031c MB |
1437 | \membersection{wxGrid::SelectBlock}\label{wxgridselectblock} |
1438 | ||
4b39770c | 1439 | \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol}, |
cc81d32f | 1440 | \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}} |
5c69031c | 1441 | |
4b39770c | 1442 | \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft}, |
cc81d32f | 1443 | \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}} |
5c69031c | 1444 | |
cc81d32f | 1445 | Selects a rectangular block of cells. If addToSelected is false then any existing selection will be |
4b39770c WS |
1446 | deselected; if true the column will be added to the existing selection. |
1447 | ||
1448 | ||
5c69031c MB |
1449 | |
1450 | \membersection{wxGrid::SelectCol}\label{wxgridselectcol} | |
1451 | ||
cc81d32f | 1452 | \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}} |
5c69031c | 1453 | |
cc81d32f VS |
1454 | Selects the specified column. If addToSelected is false then any existing selection will be |
1455 | deselected; if true the column will be added to the existing selection. | |
5c69031c | 1456 | |
4b39770c WS |
1457 | |
1458 | ||
608754c4 JS |
1459 | \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect} |
1460 | ||
ef316e23 | 1461 | \constfunc{wxRect}{SelectionToDeviceRect}{\void} |
608754c4 JS |
1462 | |
1463 | This function returns the rectangle that encloses the selected cells | |
1464 | in device coords and clipped to the client size of the grid window. | |
1465 | ||
1466 | ||
4b39770c | 1467 | |
5c69031c MB |
1468 | \membersection{wxGrid::SelectRow}\label{wxgridselectrow} |
1469 | ||
cc81d32f | 1470 | \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}} |
5c69031c | 1471 | |
cc81d32f VS |
1472 | Selects the specified row. If addToSelected is false then any existing selection will be |
1473 | deselected; if true the row will be added to the existing selection. | |
5c69031c | 1474 | |
4b39770c WS |
1475 | |
1476 | ||
a660d684 KB |
1477 | \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment} |
1478 | ||
78c49c58 | 1479 | \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}} |
a660d684 | 1480 | |
2eebb742 JS |
1481 | \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}} |
1482 | ||
2edb0bde | 1483 | Sets the horizontal and vertical alignment for grid cell text at the specified location. |
a660d684 | 1484 | |
e7240349 GT |
1485 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. \\ |
1486 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
a660d684 | 1487 | |
4b39770c WS |
1488 | |
1489 | ||
608754c4 JS |
1490 | \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour} |
1491 | ||
1492 | \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}} | |
1493 | ||
1494 | ||
4b39770c | 1495 | |
78c49c58 | 1496 | \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor} |
21f280f4 | 1497 | |
78c49c58 MB |
1498 | \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}} |
1499 | ||
4b39770c | 1500 | Sets the editor for the grid cell at the specified location. |
78c49c58 MB |
1501 | The grid will take ownership of the pointer. |
1502 | ||
1503 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
1504 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1505 | ||
4b39770c WS |
1506 | |
1507 | ||
78c49c58 MB |
1508 | \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont} |
1509 | ||
deea56b1 | 1510 | \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}} |
78c49c58 MB |
1511 | |
1512 | Sets the font for text in the grid cell at the specified location. | |
a660d684 | 1513 | |
4b39770c WS |
1514 | |
1515 | ||
78c49c58 | 1516 | \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer} |
a660d684 | 1517 | |
78c49c58 | 1518 | \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}} |
a660d684 | 1519 | |
4b39770c | 1520 | Sets the renderer for the grid cell at the specified location. |
78c49c58 | 1521 | The grid will take ownership of the pointer. |
a660d684 | 1522 | |
78c49c58 MB |
1523 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and |
1524 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
21f280f4 | 1525 | |
4b39770c WS |
1526 | |
1527 | ||
a660d684 KB |
1528 | \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour} |
1529 | ||
68f30f26 | 1530 | \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}} |
a660d684 | 1531 | |
2eebb742 JS |
1532 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}} |
1533 | ||
deea56b1 | 1534 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}} |
2eebb742 | 1535 | |
78c49c58 | 1536 | Sets the text colour for the grid cell at the specified location. |
a660d684 | 1537 | |
4b39770c WS |
1538 | |
1539 | ||
5c69031c MB |
1540 | \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue} |
1541 | ||
1542 | \func{void}{SetCellValue}{\param{int }{row}, \param{int }{col}, \param{const wxString\& }{s}} | |
1543 | ||
1544 | \func{void}{SetCellValue}{\param{const wxGridCellCoords\& }{coords}, \param{const wxString\& }{s}} | |
1545 | ||
2eebb742 JS |
1546 | \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}} |
1547 | ||
5c69031c MB |
1548 | Sets the string value for the cell at the specified location. For simple applications where a |
1549 | grid object automatically uses a default grid table of string values you use this function together | |
4b39770c | 1550 | with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values. |
5c69031c MB |
1551 | |
1552 | For more complex applications where you have derived your own grid table class that contains | |
1553 | various data types (e.g. numeric, boolean or user-defined custom types) then you only use this | |
2eebb742 JS |
1554 | function for those cells that contain string values. |
1555 | ||
1556 | The last form is for backward compatibility only. | |
5c69031c | 1557 | |
d4175745 | 1558 | See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas} |
5c69031c MB |
1559 | and the \helpref{wxGrid overview}{gridoverview} for more information. |
1560 | ||
4b39770c WS |
1561 | |
1562 | ||
78c49c58 | 1563 | \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr} |
a660d684 | 1564 | |
78c49c58 | 1565 | \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}} |
21f280f4 | 1566 | |
78c49c58 | 1567 | Sets the cell attributes for all cells in the specified column. |
a660d684 | 1568 | |
d4175745 VZ |
1569 | For more information about controlling grid cell attributes see the |
1570 | \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the | |
78c49c58 | 1571 | \helpref{wxGrid classes overview}{gridoverview}. |
a660d684 | 1572 | |
4b39770c WS |
1573 | |
1574 | ||
78c49c58 | 1575 | \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool} |
a660d684 | 1576 | |
78c49c58 | 1577 | \func{void}{SetColFormatBool}{\param{int }{col}} |
a660d684 | 1578 | |
78c49c58 | 1579 | Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox. |
21f280f4 | 1580 | |
4b39770c WS |
1581 | |
1582 | ||
78c49c58 | 1583 | \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber} |
a660d684 | 1584 | |
78c49c58 | 1585 | \func{void}{SetColFormatNumber}{\param{int }{col}} |
a660d684 | 1586 | |
78c49c58 | 1587 | Sets the specified column to display integer values. |
a660d684 | 1588 | |
4b39770c WS |
1589 | |
1590 | ||
78c49c58 | 1591 | \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat} |
a660d684 | 1592 | |
78c49c58 | 1593 | \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}} |
a660d684 | 1594 | |
78c49c58 | 1595 | Sets the specified column to display floating point values with the given width and precision. |
a660d684 | 1596 | |
4b39770c WS |
1597 | |
1598 | ||
78c49c58 | 1599 | \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom} |
a660d684 | 1600 | |
78c49c58 | 1601 | \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}} |
a660d684 | 1602 | |
78c49c58 MB |
1603 | Sets the specified column to display data in a custom format. |
1604 | See the \helpref{wxGrid overview}{gridoverview} for more information on working | |
1605 | with custom data types. | |
a660d684 | 1606 | |
4b39770c WS |
1607 | |
1608 | ||
78c49c58 | 1609 | \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment} |
a660d684 | 1610 | |
78c49c58 | 1611 | \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} |
a660d684 | 1612 | |
78c49c58 | 1613 | Sets the horizontal and vertical alignment of column label text. |
a660d684 | 1614 | |
e7240349 | 1615 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. |
deea56b1 | 1616 | |
e7240349 | 1617 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. |
78c49c58 | 1618 | |
4b39770c WS |
1619 | |
1620 | ||
78c49c58 MB |
1621 | \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize} |
1622 | ||
1623 | \func{void}{SetColLabelSize}{\param{int }{height}} | |
1624 | ||
1625 | Sets the height of the column labels. | |
1626 | ||
c76f52c9 | 1627 | If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically |
733f486a VZ |
1628 | so that no label is truncated. Note that this could be slow for a large table. |
1629 | ||
4b39770c WS |
1630 | |
1631 | ||
78c49c58 MB |
1632 | \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue} |
1633 | ||
deea56b1 | 1634 | \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}} |
78c49c58 | 1635 | |
4b39770c | 1636 | Set the value for the given column label. If you are using a derived grid table you must |
78c49c58 MB |
1637 | override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue} |
1638 | for this to have any effect. | |
1639 | ||
4b39770c WS |
1640 | |
1641 | ||
78c49c58 MB |
1642 | \membersection{wxGrid::SetColMinimalWidth}\label{wxgridsetcolminimalwidth} |
1643 | ||
1644 | \func{void}{SetColMinimalWidth}{\param{int }{col}, \param{int }{width}} | |
1645 | ||
1646 | Sets the minimal width for the specified column. This should normally be called when creating the grid | |
1647 | because it will not resize a column that is already narrower than the minimal width. | |
b8d24d4e RG |
1648 | The width argument must be higher than the minimimal acceptable column width, see |
1649 | \helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}. | |
1650 | ||
4b39770c WS |
1651 | |
1652 | ||
b8d24d4e RG |
1653 | \membersection{wxGrid::SetColMinimalAcceptableWidth}\label{wxgridsetcolminimalacceptablewidth} |
1654 | ||
1655 | \func{void}{SetColMinimalAcceptableWidth}{\param{int }{width}} | |
1656 | ||
1657 | This modifies the minimum column width that can be handled correctly. Specifying a low value here | |
1658 | allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller | |
1659 | than the actual minimum size will incur a performance penalty in the functions which perform | |
1660 | grid cell index lookup on the basis of screen coordinates. | |
1661 | This should normally be called when creating the grid because it will not resize existing columns | |
4b39770c WS |
1662 | with sizes smaller than the value specified here. |
1663 | ||
1664 | ||
b8d24d4e | 1665 | |
d4175745 VZ |
1666 | \membersection{wxGrid::SetColPos}\label{wxgridsetcolpos} |
1667 | ||
1668 | \func{void}{SetColPos}{\param{int }{colID}, \param{int }{newPos}} | |
1669 | ||
1670 | Sets the position of the specified column. | |
1671 | ||
1672 | ||
1673 | ||
78c49c58 MB |
1674 | \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize} |
1675 | ||
1676 | \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}} | |
1677 | ||
4b39770c | 1678 | Sets the width of the specified column. |
78c49c58 MB |
1679 | |
1680 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
4b39770c | 1681 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. |
78c49c58 | 1682 | |
cc81d32f | 1683 | Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will |
78c49c58 MB |
1684 | also be set as the minimal width for the column. |
1685 | ||
2eebb742 | 1686 | \wxheading{Note}\\ |
78c49c58 | 1687 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c WS |
1688 | The memory requirements for this could become prohibitive if your grid is very large. |
1689 | ||
1690 | ||
78c49c58 MB |
1691 | |
1692 | \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment} | |
1693 | ||
1694 | \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}} | |
1695 | ||
2edb0bde | 1696 | Sets the default horizontal and vertical alignment for grid cell text. |
78c49c58 | 1697 | |
e7240349 | 1698 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. |
deea56b1 | 1699 | |
e7240349 | 1700 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. |
78c49c58 | 1701 | |
4b39770c WS |
1702 | |
1703 | ||
78c49c58 MB |
1704 | \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour} |
1705 | ||
deea56b1 | 1706 | \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}} |
78c49c58 MB |
1707 | |
1708 | Sets the default background colour for grid cells. | |
1709 | ||
4b39770c WS |
1710 | |
1711 | ||
78c49c58 MB |
1712 | \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont} |
1713 | ||
deea56b1 | 1714 | \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}} |
78c49c58 MB |
1715 | |
1716 | Sets the default font to be used for grid cell text. | |
1717 | ||
4b39770c WS |
1718 | |
1719 | ||
f6bb64a6 JS |
1720 | \membersection{wxGrid::SetDefaultCellTextColour}\label{wxgridsetdefaultcelltextcolour} |
1721 | ||
1722 | \func{void}{SetDefaultCellTextColour}{\param{const wxColour\&}{ colour}} | |
1723 | ||
1724 | Sets the current default colour for grid cell text. | |
1725 | ||
4b39770c WS |
1726 | |
1727 | ||
78c49c58 MB |
1728 | \membersection{wxGrid::SetDefaultEditor}\label{wxgridsetdefaulteditor} |
1729 | ||
1730 | \func{void}{SetDefaultEditor}{\param{wxGridCellEditor* }{editor}} | |
1731 | ||
1732 | Sets the default editor for grid cells. The grid will take ownership of the pointer. | |
1733 | ||
1734 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
1735 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1736 | ||
4b39770c WS |
1737 | |
1738 | ||
78c49c58 MB |
1739 | \membersection{wxGrid::SetDefaultRenderer}\label{wxgridsetdefaultrenderer} |
1740 | ||
1741 | \func{void}{SetDefaultRenderer}{\param{wxGridCellRenderer* }{renderer}} | |
1742 | ||
1743 | Sets the default renderer for grid cells. The grid will take ownership of the pointer. | |
1744 | ||
1745 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
1746 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1747 | ||
4b39770c WS |
1748 | |
1749 | ||
78c49c58 | 1750 | \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize} |
c0b042fc | 1751 | |
cc81d32f | 1752 | \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}} |
c0b042fc | 1753 | |
78c49c58 | 1754 | Sets the default width for columns in the grid. This will only affect columns subsequently added to |
4b39770c WS |
1755 | the grid unless resizeExistingCols is true. |
1756 | ||
1757 | ||
78c49c58 MB |
1758 | |
1759 | \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize} | |
1760 | ||
cc81d32f | 1761 | \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}} |
78c49c58 MB |
1762 | |
1763 | Sets the default height for rows in the grid. This will only affect rows subsequently added | |
cc81d32f | 1764 | to the grid unless resizeExistingRows is true. |
c0b042fc | 1765 | |
4b39770c WS |
1766 | |
1767 | ||
a660d684 KB |
1768 | \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor} |
1769 | ||
78c49c58 | 1770 | \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}} |
a660d684 | 1771 | |
4b39770c | 1772 | Set the grid cursor to the specified cell. |
78c49c58 | 1773 | This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}. |
a660d684 | 1774 | |
4b39770c WS |
1775 | |
1776 | ||
78c49c58 | 1777 | \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour} |
a660d684 | 1778 | |
deea56b1 | 1779 | \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}} |
a660d684 | 1780 | |
78c49c58 | 1781 | Sets the colour used to draw grid lines. |
a660d684 | 1782 | |
4b39770c WS |
1783 | |
1784 | ||
a660d684 KB |
1785 | \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour} |
1786 | ||
deea56b1 | 1787 | \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}} |
a660d684 | 1788 | |
78c49c58 | 1789 | Sets the background colour for row and column labels. |
a660d684 | 1790 | |
4b39770c WS |
1791 | |
1792 | ||
78c49c58 | 1793 | \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont} |
a660d684 | 1794 | |
deea56b1 | 1795 | \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}} |
a660d684 | 1796 | |
78c49c58 | 1797 | Sets the font for row and column labels. |
a660d684 | 1798 | |
4b39770c WS |
1799 | |
1800 | ||
a660d684 KB |
1801 | \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour} |
1802 | ||
deea56b1 | 1803 | \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}} |
a660d684 | 1804 | |
78c49c58 | 1805 | Sets the colour for row and column label text. |
a660d684 | 1806 | |
4b39770c WS |
1807 | |
1808 | ||
608754c4 JS |
1809 | \membersection{wxGrid::SetMargins}\label{wxgridsetmargins} |
1810 | ||
1811 | \func{void}{SetMargins}{\param{int }{extraWidth}, \param{int }{extraHeight}} | |
1812 | ||
1813 | A grid may occupy more space than needed for its rows/columns. This | |
1814 | function allows to set how big this extra space is | |
1815 | ||
4b39770c WS |
1816 | |
1817 | ||
608754c4 JS |
1818 | \membersection{wxGrid::SetOrCalcColumnSizes}\label{wxgridsetorcalccolumnsizes} |
1819 | ||
1820 | \func{int}{SetOrCalcColumnSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}} | |
1821 | ||
1822 | Common part of AutoSizeColumn/Row() and GetBestSize() | |
1823 | ||
4b39770c WS |
1824 | |
1825 | ||
608754c4 JS |
1826 | \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes} |
1827 | ||
1828 | \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}} | |
1829 | ||
4b39770c WS |
1830 | |
1831 | ||
5c69031c MB |
1832 | \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly} |
1833 | ||
cc81d32f | 1834 | \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}} |
5c69031c MB |
1835 | |
1836 | Makes the cell at the specified location read-only or editable. | |
1837 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. | |
1838 | ||
4b39770c WS |
1839 | |
1840 | ||
78c49c58 | 1841 | \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr} |
a660d684 | 1842 | |
78c49c58 | 1843 | \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}} |
a660d684 | 1844 | |
78c49c58 MB |
1845 | Sets the cell attributes for all cells in the specified row. |
1846 | See the \helpref{wxGridCellAttr}{wxgridcellattr} class for more information | |
1847 | about controlling cell attributes. | |
a660d684 | 1848 | |
4b39770c WS |
1849 | |
1850 | ||
78c49c58 | 1851 | \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment} |
a660d684 | 1852 | |
78c49c58 | 1853 | \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} |
a660d684 | 1854 | |
78c49c58 | 1855 | Sets the horizontal and vertical alignment of row label text. |
a660d684 | 1856 | |
e7240349 | 1857 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. |
deea56b1 | 1858 | |
e7240349 | 1859 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. |
a660d684 | 1860 | |
4b39770c WS |
1861 | |
1862 | ||
78c49c58 | 1863 | \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize} |
a660d684 | 1864 | |
78c49c58 | 1865 | \func{void}{SetRowLabelSize}{\param{int }{width}} |
a660d684 | 1866 | |
78c49c58 MB |
1867 | Sets the width of the row labels. |
1868 | ||
c76f52c9 | 1869 | If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically |
733f486a VZ |
1870 | so that no label is truncated. Note that this could be slow for a large table. |
1871 | ||
4b39770c WS |
1872 | |
1873 | ||
78c49c58 MB |
1874 | \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue} |
1875 | ||
deea56b1 | 1876 | \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}} |
78c49c58 | 1877 | |
4b39770c WS |
1878 | Set the value for the given row label. If you are using a derived grid table you must |
1879 | override \helpref{wxGridTableBase::SetRowLabelValue}{wxgridtablebasesetrowlabelvalue} | |
78c49c58 MB |
1880 | for this to have any effect. |
1881 | ||
4b39770c WS |
1882 | |
1883 | ||
78c49c58 MB |
1884 | \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight} |
1885 | ||
b8d24d4e | 1886 | \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}} |
78c49c58 MB |
1887 | |
1888 | Sets the minimal height for the specified row. This should normally be called when creating the grid | |
1889 | because it will not resize a row that is already shorter than the minimal height. | |
b8d24d4e RG |
1890 | The height argument must be higher than the minimimal acceptable row height, see |
1891 | \helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}. | |
1892 | ||
4b39770c WS |
1893 | |
1894 | ||
b8d24d4e RG |
1895 | \membersection{wxGrid::SetRowMinimalAcceptableHeight}\label{wxgridsetrowminimalacceptableheight} |
1896 | ||
1897 | \func{void}{SetRowMinimalAcceptableHeight}{\param{int }{height}} | |
1898 | ||
1899 | This modifies the minimum row width that can be handled correctly. Specifying a low value here | |
1900 | allows smaller grid cells to be dealt with correctly. Specifying a value here which is much smaller | |
1901 | than the actual minimum size will incur a performance penalty in the functions which perform | |
1902 | grid cell index lookup on the basis of screen coordinates. | |
1903 | This should normally be called when creating the grid because it will not resize existing rows | |
4b39770c WS |
1904 | with sizes smaller than the value specified here. |
1905 | ||
1906 | ||
b8d24d4e | 1907 | |
78c49c58 MB |
1908 | \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize} |
1909 | ||
1910 | \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}} | |
1911 | ||
4b39770c | 1912 | Sets the height of the specified row. |
78c49c58 MB |
1913 | |
1914 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
4b39770c | 1915 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. |
78c49c58 | 1916 | |
cc81d32f | 1917 | Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will |
78c49c58 MB |
1918 | also be set as the minimal width for the column. |
1919 | ||
deea56b1 JS |
1920 | \wxheading{Note} |
1921 | ||
78c49c58 | 1922 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. |
4b39770c | 1923 | The memory requirements for this could become prohibitive if your grid is very large. |
78c49c58 | 1924 | |
608754c4 | 1925 | |
4b39770c WS |
1926 | |
1927 | \membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex} | |
1928 | ||
1929 | \func{void}{SetScrollLineX}{\param{int }{x}} | |
608754c4 JS |
1930 | |
1931 | Sets the number of pixels per horizontal scroll increment. The default is 15. | |
1932 | Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding | |
1933 | errors: setting this to 1 can help. | |
1934 | ||
4b39770c WS |
1935 | \wxheading{See also} |
1936 | ||
1937 | \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp | |
1938 | \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp | |
1939 | \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney} | |
1940 | ||
608754c4 | 1941 | |
4b39770c WS |
1942 | |
1943 | \membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney} | |
1944 | ||
1945 | \func{void}{SetScrollLineY}{\param{int }{y}} | |
608754c4 JS |
1946 | |
1947 | Sets the number of pixels per vertical scroll increment. The default is 15. | |
1948 | Sometimes wxGrid has trouble setting the scrollbars correctly due to rounding | |
1949 | errors: setting this to 1 can help. | |
1950 | ||
4b39770c WS |
1951 | \wxheading{See also} |
1952 | ||
1953 | \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp | |
1954 | \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp | |
1955 | \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex} | |
1956 | ||
1957 | ||
1958 | ||
608754c4 JS |
1959 | \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground} |
1960 | ||
1961 | \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}} | |
1962 | ||
1963 | ||
4b39770c | 1964 | |
608754c4 JS |
1965 | \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground} |
1966 | ||
1967 | \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}} | |
1968 | ||
1969 | ||
4b39770c | 1970 | |
78c49c58 MB |
1971 | \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode} |
1972 | ||
deea56b1 | 1973 | \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}} |
78c49c58 MB |
1974 | |
1975 | Set the selection behaviour of the grid. | |
1976 | ||
1977 | \wxheading{Parameters} | |
1978 | ||
1979 | \docparam{wxGrid::wxGridSelectCells}{The default mode where individual cells are selected.} | |
1980 | ||
deea56b1 | 1981 | \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.} |
78c49c58 | 1982 | |
f6bb64a6 | 1983 | \docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.} |
78c49c58 | 1984 | |
4b39770c WS |
1985 | |
1986 | ||
78c49c58 MB |
1987 | \membersection{wxGrid::SetTable}\label{wxgridsettable} |
1988 | ||
cc81d32f | 1989 | \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}} |
78c49c58 | 1990 | |
2eebb742 | 1991 | Passes a pointer to a custom grid table to be used by the grid. This should be called |
78c49c58 | 1992 | after the grid constructor and before using the grid object. If takeOwnership is set to |
4b39770c | 1993 | true then the table will be deleted by the wxGrid destructor. |
78c49c58 MB |
1994 | |
1995 | Use this function instead of \helpref{wxGrid::CreateGrid}{wxgridcreategrid} when your | |
1996 | application involves complex or non-string data or data sets that are too large to fit | |
4b39770c WS |
1997 | wholly in memory. |
1998 | ||
1999 | ||
78c49c58 MB |
2000 | |
2001 | \membersection{wxGrid::ShowCellEditControl}\label{wxgridshowcelleditcontrol} | |
2002 | ||
2003 | \func{void}{ShowCellEditControl}{\void} | |
2004 | ||
2005 | Displays the in-place cell edit control for the current cell. | |
2006 | ||
4b39770c WS |
2007 | |
2008 | ||
78c49c58 MB |
2009 | \membersection{wxGrid::XToCol}\label{wxgridxtocol} |
2010 | ||
ef316e23 | 2011 | \constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}} |
d4175745 VZ |
2012 | |
2013 | \wxheading{Parameters} | |
2014 | \docparam{x}{The x position to evaluate.} | |
2015 | \docparam{clipToMinMax}{If true, rather than returning wxNOT\_FOUND, it returns either the first or last column depending on whether x is too far to the left or right respectively.} | |
78c49c58 | 2016 | |
d4175745 VZ |
2017 | \wxheading{Return value} |
2018 | The grid column that corresponds to the logical x coordinate. Returns | |
a8d08dbd | 2019 | {\tt wxNOT\_FOUND} if there is no column at the x position. |
78c49c58 | 2020 | |
4b39770c WS |
2021 | |
2022 | ||
78c49c58 MB |
2023 | \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol} |
2024 | ||
ef316e23 | 2025 | \constfunc{int}{XToEdgeOfCol}{\param{int }{x}} |
78c49c58 MB |
2026 | |
2027 | Returns the column whose right hand edge is close to the given logical x position. | |
a8d08dbd | 2028 | If no column edge is near to this position {\tt wxNOT\_FOUND} is returned. |
78c49c58 | 2029 | |
4b39770c WS |
2030 | |
2031 | ||
78c49c58 MB |
2032 | \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow} |
2033 | ||
ef316e23 | 2034 | \constfunc{int}{YToEdgeOfRow}{\param{int }{y}} |
78c49c58 MB |
2035 | |
2036 | Returns the row whose bottom edge is close to the given logical y position. | |
a8d08dbd | 2037 | If no row edge is near to this position {\tt wxNOT\_FOUND} is returned. |
78c49c58 | 2038 | |
4b39770c WS |
2039 | |
2040 | ||
78c49c58 MB |
2041 | \membersection{wxGrid::YToRow}\label{wxgridytorow} |
2042 | ||
ef316e23 | 2043 | \constfunc{int}{YToRow}{\param{int }{y}} |
78c49c58 | 2044 | |
d4175745 | 2045 | Returns the grid row that corresponds to the logical y coordinate. Returns |
a8d08dbd | 2046 | {\tt wxNOT\_FOUND} if there is no row at the y position. |
095e0f91 | 2047 |