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