]>
Commit | Line | Data |
---|---|---|
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
2 | %% Name: grid.tex | |
3 | %% Purpose: wxGrid | |
4 | %% Author: | |
5 | %% Modified by: Santiago Palacios | |
6 | %% Created: | |
7 | %% RCS-ID: $Id$ | |
8 | %% Copyright: (c) wxWidgets | |
9 | %% License: wxWindows license | |
10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | ||
12 | \section{\class{wxGrid}}\label{wxgrid} | |
13 | ||
14 | wxGrid and its related classes are used for displaying and editing tabular | |
15 | data. They provide a rich set of features for display, editing, and | |
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 | |
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 | |
20 | classes for custom grid views, grid data tables, cell editors and | |
21 | renderers. The \helpref{wxGrid classes overview}{gridoverview} has | |
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 | ||
26 | wxGrid has been greatly expanded and redesigned for wxWidgets 2.2 | |
27 | onwards. If you have been using the old wxGrid class you will probably | |
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 | |
31 | the previous implementation. | |
32 | ||
33 | \wxheading{Derived from} | |
34 | ||
35 | \helpref{wxScrolledWindow}{wxscrolledwindow}\\ | |
36 | \helpref{wxPanel}{wxpanel}\\ | |
37 | \helpref{wxWindow}{wxwindow}\\ | |
38 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
39 | \helpref{wxObject}{wxobject} | |
40 | ||
41 | \wxheading{Include files} | |
42 | ||
43 | <wx/grid.h> | |
44 | ||
45 | \wxheading{Library} | |
46 | ||
47 | \helpref{wxAdv}{librarieslist} | |
48 | ||
49 | \wxheading{Window styles} | |
50 | ||
51 | There are presently no specific window styles for wxGrid. | |
52 | ||
53 | \wxheading{Event handling} | |
54 | ||
55 | \input gridevt.inc | |
56 | ||
57 | The event handler for the following functions takes a | |
58 | \helpref{wxGridSizeEvent}{wxgridsizeevent} parameter. | |
59 | The ...\_CMD\_... variants also take a window identifier. | |
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.} | |
64 | \twocolitem{{\bf EVT\_GRID\_COL\_MOVE(func)}}{The user moved a column by dragging it. Processes a wxEVT\_GRID\_COL\_MOVE.} | |
65 | \twocolitem{{\bf EVT\_GRID\_ROW\_SIZE(func)}}{The user resized a row by dragging it. Processes a wxEVT\_GRID\_ROW\_SIZE.} | |
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.} | |
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.} | |
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.} | |
69 | \end{twocollist}% | |
70 | ||
71 | The event handler for the following functions takes a | |
72 | \helpref{wxGridRangeSelectEvent}{wxgridrangeselectevent} parameter. | |
73 | The ...\_CMD\_... variant also takes a window identifier. | |
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.} | |
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.} | |
79 | \end{twocollist}% | |
80 | ||
81 | The event handler for the following functions takes a | |
82 | \helpref{wxGridEditorCreatedEvent}{wxgrideditorcreatedevent} parameter. | |
83 | The ...\_CMD\_... variant also takes a window identifier. | |
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.} | |
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.} | |
89 | \end{twocollist}% | |
90 | ||
91 | \wxheading{See also} | |
92 | ||
93 | \helpref{wxGrid overview}{gridoverview} | |
94 | ||
95 | %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%% | |
96 | \latexignore{\rtfignore{\wxheading{Function groups}}} | |
97 | ||
98 | ||
99 | ||
100 | \membersection{Constructors and initialization}\label{wxgridconstructors} | |
101 | ||
102 | \helpref{wxGrid}{wxgridctor}\\ | |
103 | \helpref{\destruct{wxGrid}}{wxgriddtor}\\ | |
104 | \helpref{CreateGrid}{wxgridcreategrid}\\ | |
105 | \helpref{SetTable}{wxgridsettable} | |
106 | ||
107 | ||
108 | ||
109 | \membersection{Display format}\label{wxgriddisplayformat} | |
110 | ||
111 | ||
112 | ||
113 | \membersection{Selection functions}\label{wxgridselectionfunctions} | |
114 | ||
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}\\ | |
120 | \helpref{wxGrid::SelectRow}{wxgridselectrow} | |
121 | ||
122 | %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%% | |
123 | \helponly{\insertatlevel{2}{ | |
124 | ||
125 | \wxheading{Members} | |
126 | ||
127 | }} | |
128 | ||
129 | ||
130 | ||
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 | ||
139 | Constructor to create a grid object. Call either \helpref{wxGrid::CreateGrid}{wxgridcreategrid} or | |
140 | \helpref{wxGrid::SetTable}{wxgridsettable} directly after this to initialize the grid before using | |
141 | it. | |
142 | ||
143 | ||
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 | |
151 | table (see \helpref{wxGrid::SetTable}{wxgridsettable}). | |
152 | ||
153 | ||
154 | ||
155 | \membersection{wxGrid::AppendCols}\label{wxgridappendcols} | |
156 | ||
157 | \func{bool}{AppendCols}{\param{int }{numCols = 1}, \param{bool }{updateLabels = true}} | |
158 | ||
159 | Appends one or more new columns to the right of the grid and returns true if | |
160 | successful. The updateLabels argument is not used at present. | |
161 | ||
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 | ||
167 | ||
168 | \membersection{wxGrid::AppendRows}\label{wxgridappendrows} | |
169 | ||
170 | \func{bool}{AppendRows}{\param{int }{numRows = 1}, \param{bool }{updateLabels = true}} | |
171 | ||
172 | Appends one or more new rows to the bottom of the grid and returns true if | |
173 | successful. The updateLabels argument is not used at present. | |
174 | ||
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 | ||
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 | ||
187 | \wxheading{Note}\\ | |
188 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
189 | The memory requirements for this could become prohibitive if your grid is very large. | |
190 | ||
191 | ||
192 | ||
193 | \membersection{wxGrid::AutoSizeColLabelSize}\label{wxgridautosizecollabelsize} | |
194 | ||
195 | \func{void}{AutoSizeColLabelSize}{\param{int }{col}} | |
196 | ||
197 | Automatically adjusts width of the column to fit its label. | |
198 | ||
199 | ||
200 | ||
201 | \membersection{wxGrid::AutoSizeColumn}\label{wxgridautosizecolumn} | |
202 | ||
203 | \func{void}{AutoSizeColumn}{\param{int }{col}, \param{bool }{setAsMin = true}} | |
204 | ||
205 | Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will | |
206 | also be set as the minimal width for the column. | |
207 | ||
208 | \wxheading{Note}\\ | |
209 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
210 | The memory requirements for this could become prohibitive if your grid is very large. | |
211 | ||
212 | ||
213 | ||
214 | \membersection{wxGrid::AutoSizeColumns}\label{wxgridautosizecolumns} | |
215 | ||
216 | \func{void}{AutoSizeColumns}{\param{bool }{setAsMin = true}} | |
217 | ||
218 | Automatically sizes all columns to fit their contents. If setAsMin is true the calculated widths will | |
219 | also be set as the minimal widths for the columns. | |
220 | ||
221 | \wxheading{Note}\\ | |
222 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
223 | The memory requirements for this could become prohibitive if your grid is very large. | |
224 | ||
225 | ||
226 | ||
227 | \membersection{wxGrid::AutoSizeRow}\label{wxgridautosizerow} | |
228 | ||
229 | \func{void}{AutoSizeRow}{\param{int }{row}, \param{bool }{setAsMin = true}} | |
230 | ||
231 | Automatically sizes the row to fit its contents. If setAsMin is true the calculated height will | |
232 | also be set as the minimal height for the row. | |
233 | ||
234 | \wxheading{Note}\\ | |
235 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
236 | The memory requirements for this could become prohibitive if your grid is very large. | |
237 | ||
238 | ||
239 | ||
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 | ||
248 | \membersection{wxGrid::AutoSizeRows}\label{wxgridautosizerows} | |
249 | ||
250 | \func{void}{AutoSizeRows}{\param{bool }{setAsMin = true}} | |
251 | ||
252 | Automatically sizes all rows to fit their contents. If setAsMin is true the calculated heights will | |
253 | also be set as the minimal heights for the rows. | |
254 | ||
255 | \wxheading{Note}\\ | |
256 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
257 | The memory requirements for this could become prohibitive if your grid is very large. | |
258 | ||
259 | ||
260 | ||
261 | \membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch} | |
262 | ||
263 | \func{void}{BeginBatch}{\void} | |
264 | ||
265 | Increments the grid's batch count. When the count is greater than zero repainting of | |
266 | the grid is suppressed. Each call to BeginBatch must be matched by a later call to | |
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. | |
270 | ||
271 | \wxheading{See also} | |
272 | ||
273 | \helpref{wxGridUpdateLocker}{wxgridupdatelocker} | |
274 | ||
275 | ||
276 | ||
277 | \membersection{wxGrid::BlockToDeviceRect}\label{wxgridblocktodevicerect} | |
278 | ||
279 | \constfunc{wxRect}{BlockToDeviceRect}{\param{const wxGridCellCoords \& }{topLeft}, \param{const wxGridCellCoords \& }{bottomRight}} | |
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 | ||
286 | ||
287 | \membersection{wxGrid::CanDragColMove}\label{wxgridcandragcolmove} | |
288 | ||
289 | \constfunc{bool}{CanDragColMove}{\void} | |
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 | ||
296 | \membersection{wxGrid::CanDragColSize}\label{wxgridcandragcolsize} | |
297 | ||
298 | \constfunc{bool}{CanDragColSize}{\void} | |
299 | ||
300 | Returns true if columns can be resized by dragging with the mouse. Columns can be resized | |
301 | by dragging the edges of their labels. If grid line dragging is enabled they can also be | |
302 | resized by dragging the right edge of the column in the grid cell area | |
303 | (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}). | |
304 | ||
305 | ||
306 | ||
307 | \membersection{wxGrid::CanDragRowSize}\label{wxgridcandragrowsize} | |
308 | ||
309 | \constfunc{bool}{CanDragRowSize}{\void} | |
310 | ||
311 | Returns true if rows can be resized by dragging with the mouse. Rows can be resized | |
312 | by dragging the edges of their labels. If grid line dragging is enabled they can also be | |
313 | resized by dragging the lower edge of the row in the grid cell area | |
314 | (see \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize}). | |
315 | ||
316 | ||
317 | ||
318 | \membersection{wxGrid::CanDragGridSize}\label{wxgridcandraggridsize} | |
319 | ||
320 | \constfunc{bool}{CanDragGridSize}{\void} | |
321 | ||
322 | Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise. | |
323 | ||
324 | ||
325 | ||
326 | \membersection{wxGrid::CanEnableCellControl}\label{wxgridcanenablecellcontrol} | |
327 | ||
328 | \constfunc{bool}{CanEnableCellControl}{\void} | |
329 | ||
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). | |
332 | ||
333 | ||
334 | ||
335 | \membersection{wxGrid::CanHaveAttributes}\label{wxgridcanhaveattributes} | |
336 | ||
337 | \constfunc{bool}{CanHaveAttributes}{\void} | |
338 | ||
339 | Do we have some place to store attributes in? | |
340 | ||
341 | ||
342 | ||
343 | \membersection{wxGrid::CellToRect}\label{wxgridcelltorect} | |
344 | ||
345 | \constfunc{wxRect}{CellToRect}{\param{int }{row}, \param{int }{col}} | |
346 | ||
347 | \constfunc{wxRect}{CellToRect}{\param{const wxGridCellCoords\& }{coords}} | |
348 | ||
349 | Return the rectangle corresponding to the grid cell's size and position in logical | |
350 | coordinates. | |
351 | ||
352 | ||
353 | ||
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 | |
359 | this function. If you are using a derived table class then you need to override | |
360 | \helpref{wxGridTableBase::Clear}{wxgridtablebaseclear} for this function to have any effect. | |
361 | ||
362 | ||
363 | ||
364 | \membersection{wxGrid::ClearSelection}\label{wxgridclearselection} | |
365 | ||
366 | \func{void}{ClearSelection}{\void} | |
367 | ||
368 | Deselects all cells that are currently selected. | |
369 | ||
370 | ||
371 | ||
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 | |
383 | class and pass a table object to the grid with \helpref{wxGrid::SetTable}{wxgridsettable}. | |
384 | ||
385 | ||
386 | ||
387 | \membersection{wxGrid::DeleteCols}\label{wxgriddeletecols} | |
388 | ||
389 | \func{bool}{DeleteCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}} | |
390 | ||
391 | Deletes one or more columns from a grid starting at the specified position and returns | |
392 | true if successful. The updateLabels argument is not used at present. | |
393 | ||
394 | If you are using a derived grid table class you will need to override | |
395 | \helpref{wxGridTableBase::DeleteCols}{wxgridtablebasedeletecols}. See | |
396 | \helpref{wxGrid::InsertCols}{wxgridinsertcols} for further information. | |
397 | ||
398 | ||
399 | ||
400 | \membersection{wxGrid::DeleteRows}\label{wxgriddeleterows} | |
401 | ||
402 | \func{bool}{DeleteRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}} | |
403 | ||
404 | Deletes one or more rows from a grid starting at the specified position and returns | |
405 | true if successful. The updateLabels argument is not used at present. | |
406 | ||
407 | If you are using a derived grid table class you will need to override | |
408 | \helpref{wxGridTableBase::DeleteRows}{wxgridtablebasedeleterows}. See | |
409 | \helpref{wxGrid::InsertRows}{wxgridinsertrows} for further information. | |
410 | ||
411 | ||
412 | ||
413 | \membersection{wxGrid::DisableCellEditControl}\label{wxgriddisablecelleditcontrol} | |
414 | ||
415 | \func{void}{DisableCellEditControl}{\void} | |
416 | ||
417 | Disables in-place editing of grid cells. | |
418 | Equivalent to calling EnableCellEditControl(false). | |
419 | ||
420 | ||
421 | ||
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 | ||
431 | \membersection{wxGrid::DisableDragColSize}\label{wxgriddisabledragcolsize} | |
432 | ||
433 | \func{void}{DisableDragColSize}{\void} | |
434 | ||
435 | Disables column sizing by dragging with the mouse. Equivalent to passing false to | |
436 | \helpref{wxGrid::EnableDragColSize}{wxgridenabledragcolsize}. | |
437 | ||
438 | ||
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 | |
445 | false to \helpref{wxGrid::EnableDragGridSize}{wxgridenabledraggridsize} | |
446 | ||
447 | ||
448 | ||
449 | \membersection{wxGrid::DisableDragRowSize}\label{wxgriddisabledragrowsize} | |
450 | ||
451 | \func{void}{DisableDragRowSize}{\void} | |
452 | ||
453 | Disables row sizing by dragging with the mouse. Equivalent to passing false to | |
454 | \helpref{wxGrid::EnableDragRowSize}{wxgridenabledragrowsize}. | |
455 | ||
456 | ||
457 | ||
458 | \membersection{wxGrid::EnableCellEditControl}\label{wxgridenablecelleditcontrol} | |
459 | ||
460 | \func{void}{EnableCellEditControl}{\param{bool }{enable = true}} | |
461 | ||
462 | Enables or disables in-place editing of grid cell data. The grid will issue either a | |
463 | wxEVT\_GRID\_EDITOR\_SHOWN or wxEVT\_GRID\_EDITOR\_HIDDEN event. | |
464 | ||
465 | ||
466 | ||
467 | \membersection{wxGrid::EnableDragColSize}\label{wxgridenabledragcolsize} | |
468 | ||
469 | \func{void}{EnableDragColSize}{\param{bool }{enable = true}} | |
470 | ||
471 | Enables or disables column sizing by dragging with the mouse. | |
472 | ||
473 | ||
474 | ||
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 | ||
483 | \membersection{wxGrid::EnableDragGridSize}\label{wxgridenabledraggridsize} | |
484 | ||
485 | \func{void}{EnableDragGridSize}{\param{bool }{enable = true}} | |
486 | ||
487 | Enables or disables row and column resizing by dragging gridlines with the mouse. | |
488 | ||
489 | ||
490 | ||
491 | \membersection{wxGrid::EnableDragRowSize}\label{wxgridenabledragrowsize} | |
492 | ||
493 | \func{void}{EnableDragRowSize}{\param{bool }{enable = true}} | |
494 | ||
495 | Enables or disables row sizing by dragging with the mouse. | |
496 | ||
497 | ||
498 | ||
499 | \membersection{wxGrid::EnableEditing}\label{wxgridenableediting} | |
500 | ||
501 | \func{void}{EnableEditing}{\param{bool }{edit}} | |
502 | ||
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 | |
505 | default state you can set single grid cells and whole rows and columns to be editable or | |
506 | read-only via | |
507 | \helpref{wxGridCellAttribute::SetReadOnly}{wxgridcellattrsetreadonly}. For single | |
508 | cells you can also use the shortcut function | |
509 | \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}. | |
510 | ||
511 | For more information about controlling grid cell attributes see the | |
512 | \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the | |
513 | \helpref{wxGrid classes overview}{gridoverview}. | |
514 | ||
515 | ||
516 | ||
517 | \membersection{wxGrid::EnableGridLines}\label{wxgridenablegridlines} | |
518 | ||
519 | \func{void}{EnableGridLines}{\param{bool }{enable = true}} | |
520 | ||
521 | Turns the drawing of grid lines on or off. | |
522 | ||
523 | ||
524 | ||
525 | \membersection{wxGrid::EndBatch}\label{wxgridendbatch} | |
526 | ||
527 | \func{void}{EndBatch}{\void} | |
528 | ||
529 | Decrements the grid's batch count. When the count is greater than zero repainting of | |
530 | the grid is suppressed. Each previous call to | |
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 | ||
536 | \wxheading{See also} | |
537 | ||
538 | \helpref{wxGridUpdateLocker}{wxgridupdatelocker} | |
539 | ||
540 | ||
541 | ||
542 | \membersection{wxGrid::Fit}\label{wxgridfit} | |
543 | ||
544 | \func{void}{Fit}{\void} | |
545 | ||
546 | Overridden wxWindow method. | |
547 | ||
548 | ||
549 | ||
550 | \membersection{wxGrid::ForceRefresh}\label{wxgridforcerefresh} | |
551 | ||
552 | \func{void}{ForceRefresh}{\void} | |
553 | ||
554 | Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh. | |
555 | ||
556 | ||
557 | ||
558 | \membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount} | |
559 | ||
560 | \constfunc{int}{GetBatchCount}{\void} | |
561 | ||
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. | |
565 | ||
566 | ||
567 | ||
568 | \membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment} | |
569 | ||
570 | \constfunc{void}{GetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int* }{horiz}, \param{int* }{vert}} | |
571 | ||
572 | Sets the arguments to the horizontal and vertical text alignment values for the | |
573 | grid cell at the specified location. | |
574 | ||
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. | |
577 | ||
578 | \perlnote{This method only takes the parameters {\tt row} and {\tt col} and | |
579 | returns a 2-element list {\tt ( horiz, vert )}.} | |
580 | ||
581 | ||
582 | ||
583 | \membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour} | |
584 | ||
585 | \constfunc{wxColour}{GetCellBackgroundColour}{\param{int }{row}, \param{int }{col}} | |
586 | ||
587 | Returns the background colour of the cell at the specified location. | |
588 | ||
589 | ||
590 | ||
591 | \membersection{wxGrid::GetCellEditor}\label{wxgridgetcelleditor} | |
592 | ||
593 | \constfunc{wxGridCellEditor*}{GetCellEditor}{\param{int }{row}, \param{int }{col}} | |
594 | ||
595 | Returns a pointer to the editor for the cell at the specified location. | |
596 | ||
597 | See \helpref{wxGridCellEditor}{wxgridcelleditor} and | |
598 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
599 | ||
600 | ||
601 | ||
602 | \membersection{wxGrid::GetCellFont}\label{wxgridgetcellfont} | |
603 | ||
604 | \constfunc{wxFont}{GetCellFont}{\param{int }{row}, \param{int }{col}} | |
605 | ||
606 | Returns the font for text in the grid cell at the specified location. | |
607 | ||
608 | ||
609 | ||
610 | \membersection{wxGrid::GetCellRenderer}\label{wxgridgetcellrenderer} | |
611 | ||
612 | \constfunc{wxGridCellRenderer*}{GetCellRenderer}{\param{int }{row}, \param{int }{col}} | |
613 | ||
614 | Returns a pointer to the renderer for the grid cell at the specified location. | |
615 | ||
616 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
617 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
618 | ||
619 | ||
620 | ||
621 | \membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour} | |
622 | ||
623 | \constfunc{wxColour}{GetCellTextColour}{\param{int }{row}, \param{int }{col}} | |
624 | ||
625 | Returns the text colour for the grid cell at the specified location. | |
626 | ||
627 | ||
628 | ||
629 | \membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue} | |
630 | ||
631 | \constfunc{wxString}{GetCellValue}{\param{int }{row}, \param{int }{col}} | |
632 | ||
633 | \constfunc{wxString}{GetCellValue}{\param{const wxGridCellCoords\&}{coords}} | |
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 | |
637 | with \helpref{wxGrid::SetCellValue}{wxgridsetcellvalue} to access cell values. | |
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 | |
641 | function for those cells that contain string values. | |
642 | ||
643 | See \helpref{wxGridTableBase::CanGetValueAs}{wxgridtablebasecangetvalueas} | |
644 | and the \helpref{wxGrid overview}{gridoverview} for more information. | |
645 | ||
646 | ||
647 | ||
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 | ||
655 | \membersection{wxGrid::GetColLeft}\label{wxgridgetcolleft} | |
656 | ||
657 | \constfunc{int}{GetColLeft}{\param{int }{col}} | |
658 | ||
659 | ||
660 | ||
661 | \membersection{wxGrid::GetColLabelAlignment}\label{wxgridgetcollabelalignment} | |
662 | ||
663 | \constfunc{void}{GetColLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}} | |
664 | ||
665 | Sets the arguments to the current column label alignment values. | |
666 | ||
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. | |
669 | ||
670 | \perlnote{This method takes no parameters and | |
671 | returns a 2-element list {\tt ( horiz, vert )}.} | |
672 | ||
673 | ||
674 | ||
675 | \membersection{wxGrid::GetColLabelSize}\label{wxgridgetcollabelsize} | |
676 | ||
677 | \constfunc{int}{GetColLabelSize}{\void} | |
678 | ||
679 | Returns the current height of the column labels. | |
680 | ||
681 | ||
682 | ||
683 | \membersection{wxGrid::GetColLabelValue}\label{wxgridgetcollabelvalue} | |
684 | ||
685 | \constfunc{wxString}{GetColLabelValue}{\param{int }{col}} | |
686 | ||
687 | Returns the specified column label. The default grid table class provides column labels of | |
688 | the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override | |
689 | \helpref{wxGridTableBase::GetColLabelValue}{wxgridtablebasegetcollabelvalue} to provide | |
690 | your own labels. | |
691 | ||
692 | ||
693 | ||
694 | \membersection{wxGrid::GetColMinimalAcceptableWidth}\label{wxgridgetcolminimalacceptablewidth} | |
695 | ||
696 | \constfunc{int}{GetColMinimalAcceptableWidth}{} | |
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 | ||
701 | ||
702 | ||
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 | ||
710 | ||
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 | ||
719 | \membersection{wxGrid::GetColRight}\label{wxgridgetcolright} | |
720 | ||
721 | \constfunc{int}{GetColRight}{\param{int }{col}} | |
722 | ||
723 | ||
724 | ||
725 | \membersection{wxGrid::GetColSize}\label{wxgridgetcolsize} | |
726 | ||
727 | \constfunc{int}{GetColSize}{\param{int }{col}} | |
728 | ||
729 | Returns the width of the specified column. | |
730 | ||
731 | ||
732 | ||
733 | \membersection{wxGrid::GetDefaultCellAlignment}\label{wxgridgetdefaultcellalignment} | |
734 | ||
735 | \constfunc{void}{GetDefaultCellAlignment}{\param{int* }{horiz}, \param{int* }{vert}} | |
736 | ||
737 | Sets the arguments to the current default horizontal and vertical text alignment | |
738 | values. | |
739 | ||
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. | |
742 | ||
743 | ||
744 | ||
745 | \membersection{wxGrid::GetDefaultCellBackgroundColour}\label{wxgridgetdefaultcellbackgroundcolour} | |
746 | ||
747 | \constfunc{wxColour}{GetDefaultCellBackgroundColour}{\void} | |
748 | ||
749 | Returns the current default background colour for grid cells. | |
750 | ||
751 | ||
752 | ||
753 | \membersection{wxGrid::GetDefaultCellFont}\label{wxgridgetdefaultcellfont} | |
754 | ||
755 | \constfunc{wxFont}{GetDefaultCellFont}{\void} | |
756 | ||
757 | Returns the current default font for grid cell text. | |
758 | ||
759 | ||
760 | ||
761 | \membersection{wxGrid::GetDefaultCellTextColour}\label{wxgridgetdefaultcelltextcolour} | |
762 | ||
763 | \constfunc{wxColour}{GetDefaultCellTextColour}{\void} | |
764 | ||
765 | Returns the current default colour for grid cell text. | |
766 | ||
767 | ||
768 | ||
769 | \membersection{wxGrid::GetDefaultColLabelSize}\label{wxgridgetdefaultcollabelsize} | |
770 | ||
771 | \constfunc{int}{GetDefaultColLabelSize}{\void} | |
772 | ||
773 | Returns the default height for column labels. | |
774 | ||
775 | ||
776 | ||
777 | \membersection{wxGrid::GetDefaultColSize}\label{wxgridgetdefaultcolsize} | |
778 | ||
779 | \constfunc{int}{GetDefaultColSize}{\void} | |
780 | ||
781 | Returns the current default width for grid columns. | |
782 | ||
783 | ||
784 | ||
785 | \membersection{wxGrid::GetDefaultEditor}\label{wxgridgetdefaulteditor} | |
786 | ||
787 | \constfunc{wxGridCellEditor*}{GetDefaultEditor}{\void} | |
788 | ||
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 | ||
794 | ||
795 | ||
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 | ||
803 | ||
804 | \membersection{wxGrid::GetDefaultEditorForType}\label{wxgridgetdefaulteditorfortype} | |
805 | ||
806 | \constfunc{wxGridCellEditor*}{GetDefaultEditorForType}{\param{const wxString\& }{typeName}} | |
807 | ||
808 | ||
809 | ||
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. | |
818 | ||
819 | ||
820 | ||
821 | \membersection{wxGrid::GetDefaultRendererForCell}\label{wxgridgetdefaultrendererforcell} | |
822 | ||
823 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForCell}{\param{int }{row}, \param{int }{col}} | |
824 | ||
825 | ||
826 | ||
827 | \membersection{wxGrid::GetDefaultRendererForType}\label{wxgridgetdefaultrendererfortype} | |
828 | ||
829 | \constfunc{wxGridCellRenderer*}{GetDefaultRendererForType}{\param{const wxString\& }{typeName}} | |
830 | ||
831 | ||
832 | ||
833 | \membersection{wxGrid::GetDefaultRowLabelSize}\label{wxgridgetdefaultrowlabelsize} | |
834 | ||
835 | \constfunc{int}{GetDefaultRowLabelSize}{\void} | |
836 | ||
837 | Returns the default width for the row labels. | |
838 | ||
839 | ||
840 | ||
841 | \membersection{wxGrid::GetDefaultRowSize}\label{wxgridgetdefaultrowsize} | |
842 | ||
843 | \constfunc{int}{GetDefaultRowSize}{\void} | |
844 | ||
845 | Returns the current default height for grid rows. | |
846 | ||
847 | ||
848 | ||
849 | \membersection{wxGrid::GetGridCursorCol}\label{wxgridgetgridcursorcol} | |
850 | ||
851 | \constfunc{int}{GetGridCursorCol}{\void} | |
852 | ||
853 | Returns the current grid cell column position. | |
854 | ||
855 | ||
856 | ||
857 | \membersection{wxGrid::GetGridCursorRow}\label{wxgridgetgridcursorrow} | |
858 | ||
859 | \constfunc{int}{GetGridCursorRow}{\void} | |
860 | ||
861 | Returns the current grid cell row position. | |
862 | ||
863 | ||
864 | ||
865 | \membersection{wxGrid::GetGridLineColour}\label{wxgridgetgridlinecolour} | |
866 | ||
867 | \constfunc{wxColour}{GetGridLineColour}{\void} | |
868 | ||
869 | Returns the colour used for grid lines. | |
870 | ||
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 | ||
927 | ||
928 | ||
929 | \membersection{wxGrid::GridLinesEnabled}\label{wxgridgridlinesenabled} | |
930 | ||
931 | \constfunc{bool}{GridLinesEnabled}{\void} | |
932 | ||
933 | Returns true if drawing of grid lines is turned on, false otherwise. | |
934 | ||
935 | ||
936 | ||
937 | \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour} | |
938 | ||
939 | \constfunc{wxColour}{GetLabelBackgroundColour}{\void} | |
940 | ||
941 | Returns the colour used for the background of row and column labels. | |
942 | ||
943 | ||
944 | ||
945 | \membersection{wxGrid::GetLabelFont}\label{wxgridgetlabelfont} | |
946 | ||
947 | \constfunc{wxFont}{GetLabelFont}{\void} | |
948 | ||
949 | Returns the font used for row and column labels. | |
950 | ||
951 | ||
952 | ||
953 | \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour} | |
954 | ||
955 | \constfunc{wxColour}{GetLabelTextColour}{\void} | |
956 | ||
957 | Returns the colour used for row and column label text. | |
958 | ||
959 | ||
960 | ||
961 | \membersection{wxGrid::GetNumberCols}\label{wxgridgetnumbercols} | |
962 | ||
963 | \constfunc{int}{GetNumberCols}{\void} | |
964 | ||
965 | Returns the total number of grid columns (actually the number of columns in the underlying grid | |
966 | table). | |
967 | ||
968 | ||
969 | ||
970 | \membersection{wxGrid::GetNumberRows}\label{wxgridgetnumberrows} | |
971 | ||
972 | \constfunc{int}{GetNumberRows}{\void} | |
973 | ||
974 | Returns the total number of grid rows (actually the number of rows in the underlying grid table). | |
975 | ||
976 | ||
977 | ||
978 | \membersection{wxGrid::GetOrCreateCellAttr}\label{wxgridgetorcreatecellattr} | |
979 | ||
980 | \constfunc{wxGridCellAttr*}{GetOrCreateCellAttr}{\param{int }{row}, \param{int }{col}} | |
981 | ||
982 | ||
983 | ||
984 | \membersection{wxGrid::GetRowMinimalAcceptableHeight}\label{wxgridgetrowminimalacceptableheight} | |
985 | ||
986 | \constfunc{int}{GetRowMinimalAcceptableHeight}{} | |
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 | ||
992 | ||
993 | \membersection{wxGrid::GetRowMinimalHeight}\label{wxgridgetrowminimalheight} | |
994 | ||
995 | \constfunc{int}{GetRowMinimalHeight}{\param{int }{col}} | |
996 | ||
997 | ||
998 | ||
999 | \membersection{wxGrid::GetRowLabelAlignment}\label{wxgridgetrowlabelalignment} | |
1000 | ||
1001 | \constfunc{void}{GetRowLabelAlignment}{\param{int* }{horiz}, \param{int* }{vert}} | |
1002 | ||
1003 | Sets the arguments to the current row label alignment values. | |
1004 | ||
1005 | Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\ | |
1006 | Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM. | |
1007 | ||
1008 | \perlnote{This method takes no parameters and | |
1009 | returns a 2-element list {\tt ( horiz, vert )}.} | |
1010 | ||
1011 | ||
1012 | ||
1013 | \membersection{wxGrid::GetRowLabelSize}\label{wxgridgetrowlabelsize} | |
1014 | ||
1015 | \constfunc{int}{GetRowLabelSize}{\void} | |
1016 | ||
1017 | Returns the current width of the row labels. | |
1018 | ||
1019 | ||
1020 | ||
1021 | \membersection{wxGrid::GetRowLabelValue}\label{wxgridgetrowlabelvalue} | |
1022 | ||
1023 | \constfunc{wxString}{GetRowLabelValue}{\param{int }{row}} | |
1024 | ||
1025 | Returns the specified row label. The default grid table class provides numeric row labels. | |
1026 | If you are using a custom grid table you can override | |
1027 | \helpref{wxGridTableBase::GetRowLabelValue}{wxgridtablebasegetcollabelvalue} to provide | |
1028 | your own labels. | |
1029 | ||
1030 | ||
1031 | ||
1032 | \membersection{wxGrid::GetRowSize}\label{wxgridgetrowsize} | |
1033 | ||
1034 | \constfunc{int}{GetRowSize}{\param{int }{row}} | |
1035 | ||
1036 | Returns the height of the specified row. | |
1037 | ||
1038 | ||
1039 | ||
1040 | \membersection{wxGrid::GetScrollLineX}\label{wxgridgetscrolllinex} | |
1041 | ||
1042 | \constfunc{int}{GetScrollLineX}{\void} | |
1043 | ||
1044 | Returns the number of pixels per horizontal scroll increment. The default is 15. | |
1045 | ||
1046 | \wxheading{See also} | |
1047 | ||
1048 | \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp | |
1049 | \helpref{wxGrid::SetScrollLineX}{wxgridsetscrolllinex},\rtfsp | |
1050 | \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney} | |
1051 | ||
1052 | ||
1053 | ||
1054 | \membersection{wxGrid::GetScrollLineY}\label{wxgridgetscrollliney} | |
1055 | ||
1056 | \constfunc{int}{GetScrollLineY}{\void} | |
1057 | ||
1058 | Returns the number of pixels per vertical scroll increment. The default is 15. | |
1059 | ||
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 | ||
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 | ||
1074 | ||
1075 | ||
1076 | \membersection{wxGrid::GetSelectedCells}\label{wxgridgetselectedcells} | |
1077 | ||
1078 | \constfunc{wxGridCellCoordsArray}{GetSelectedCells}{\void} | |
1079 | ||
1080 | Returns an array of singly selected cells. | |
1081 | ||
1082 | ||
1083 | ||
1084 | \membersection{wxGrid::GetSelectedCols}\label{wxgridgetselectedcols} | |
1085 | ||
1086 | \constfunc{wxArrayInt}{GetSelectedCols}{\void} | |
1087 | ||
1088 | Returns an array of selected cols. | |
1089 | ||
1090 | ||
1091 | ||
1092 | \membersection{wxGrid::GetSelectedRows}\label{wxgridgetselectedrows} | |
1093 | ||
1094 | \constfunc{wxArrayInt}{GetSelectedRows}{\void} | |
1095 | ||
1096 | Returns an array of selected rows. | |
1097 | ||
1098 | ||
1099 | ||
1100 | \membersection{wxGrid::GetSelectionBackground}\label{wxgridgetselectionbackground} | |
1101 | ||
1102 | \constfunc{wxColour}{GetSelectionBackground}{\void} | |
1103 | ||
1104 | Access or update the selection fore/back colours | |
1105 | ||
1106 | ||
1107 | ||
1108 | \membersection{wxGrid::GetSelectionBlockTopLeft}\label{wxgridgetselectionblocktopleft} | |
1109 | ||
1110 | \constfunc{wxGridCellCoordsArray}{GetSelectionBlockTopLeft}{\void} | |
1111 | ||
1112 | Returns an array of the top left corners of blocks of selected cells, | |
1113 | see \helpref{wxGrid::GetSelectionBlockBottomRight}{wxgridgetselectionblockbottomright}. | |
1114 | ||
1115 | ||
1116 | ||
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 | ||
1124 | ||
1125 | ||
1126 | \membersection{wxGrid::GetSelectionForeground}\label{wxgridgetselectionforeground} | |
1127 | ||
1128 | \constfunc{wxColour}{GetSelectionForeground}{\void} | |
1129 | ||
1130 | ||
1131 | ||
1132 | \membersection{wxGrid::GetTable}\label{wxgridgettable} | |
1133 | ||
1134 | \constfunc{wxGridTableBase *}{GetTable}{\void} | |
1135 | ||
1136 | Returns a base pointer to the current table object. | |
1137 | ||
1138 | ||
1139 | ||
1140 | \membersection{wxGrid::GetViewWidth}\label{wxgridgetviewwidth} | |
1141 | ||
1142 | \constfunc{int}{GetViewWidth}{\void} | |
1143 | ||
1144 | Returned number of whole cols visible. | |
1145 | ||
1146 | ||
1147 | ||
1148 | \membersection{wxGrid::HideCellEditControl}\label{wxgridhidecelleditcontrol} | |
1149 | ||
1150 | \func{void}{HideCellEditControl}{\void} | |
1151 | ||
1152 | Hides the in-place cell edit control. | |
1153 | ||
1154 | ||
1155 | ||
1156 | \membersection{wxGrid::InitColWidths}\label{wxgridinitcolwidths} | |
1157 | ||
1158 | \func{void}{InitColWidths}{\void} | |
1159 | ||
1160 | Init the m\_colWidths/Rights arrays | |
1161 | ||
1162 | ||
1163 | ||
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 | ||
1173 | ||
1174 | ||
1175 | \membersection{wxGrid::InsertCols}\label{wxgridinsertcols} | |
1176 | ||
1177 | \func{bool}{InsertCols}{\param{int }{pos = 0}, \param{int }{numCols = 1}, \param{bool }{updateLabels = true}} | |
1178 | ||
1179 | Inserts one or more new columns into a grid with the first new column at the | |
1180 | specified position and returns true if successful. The updateLabels argument is not | |
1181 | used at present. | |
1182 | ||
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 | |
1185 | grid updates the display. For a default grid (one where you have called | |
1186 | \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are | |
1187 | using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable}) | |
1188 | then you must override | |
1189 | \helpref{wxGridTableBase::InsertCols}{wxgridtablebaseinsertcols} in your derived | |
1190 | table class. | |
1191 | ||
1192 | ||
1193 | ||
1194 | \membersection{wxGrid::InsertRows}\label{wxgridinsertrows} | |
1195 | ||
1196 | \func{bool}{InsertRows}{\param{int }{pos = 0}, \param{int }{numRows = 1}, \param{bool }{updateLabels = true}} | |
1197 | ||
1198 | Inserts one or more new rows into a grid with the first new row at the specified | |
1199 | position and returns true if successful. The updateLabels argument is not used at | |
1200 | present. | |
1201 | ||
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 | |
1204 | grid updates the display. For a default grid (one where you have called | |
1205 | \helpref{wxGrid::CreateGrid}{wxgridcreategrid}) this process is automatic. If you are | |
1206 | using a custom grid table (specified with \helpref{wxGrid::SetTable}{wxgridsettable}) | |
1207 | then you must override | |
1208 | \helpref{wxGridTableBase::InsertRows}{wxgridtablebaseinsertrows} in your derived | |
1209 | table class. | |
1210 | ||
1211 | ||
1212 | ||
1213 | \membersection{wxGrid::IsCellEditControlEnabled}\label{wxgridiscelleditcontrolenabled} | |
1214 | ||
1215 | \constfunc{bool}{IsCellEditControlEnabled}{\void} | |
1216 | ||
1217 | Returns true if the in-place edit control is currently enabled. | |
1218 | ||
1219 | ||
1220 | ||
1221 | \membersection{wxGrid::IsCurrentCellReadOnly}\label{wxgridiscurrentcellreadonly} | |
1222 | ||
1223 | \constfunc{bool}{IsCurrentCellReadOnly}{\void} | |
1224 | ||
1225 | Returns true if the current cell has been set to read-only | |
1226 | (see \helpref{wxGrid::SetReadOnly}{wxgridsetreadonly}). | |
1227 | ||
1228 | ||
1229 | ||
1230 | \membersection{wxGrid::IsEditable}\label{wxgridiseditable} | |
1231 | ||
1232 | \constfunc{bool}{IsEditable}{\void} | |
1233 | ||
1234 | Returns false if the whole grid has been set as read-only or true otherwise. | |
1235 | See \helpref{wxGrid::EnableEditing}{wxgridenableediting} for more information about | |
1236 | controlling the editing status of grid cells. | |
1237 | ||
1238 | ||
1239 | ||
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 | ||
1248 | ||
1249 | ||
1250 | \membersection{wxGrid::IsReadOnly}\label{wxgridisreadonly} | |
1251 | ||
1252 | \constfunc{bool}{IsReadOnly}{\param{int }{row}, \param{int }{col}} | |
1253 | ||
1254 | Returns true if the cell at the specified location can't be edited. | |
1255 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. | |
1256 | ||
1257 | ||
1258 | ||
1259 | \membersection{wxGrid::IsSelection}\label{wxgridisselection} | |
1260 | ||
1261 | \constfunc{bool}{IsSelection}{\void} | |
1262 | ||
1263 | Returns true if there are currently rows, columns or blocks of cells selected. | |
1264 | ||
1265 | ||
1266 | ||
1267 | \membersection{wxGrid::IsVisible}\label{wxgridisvisible} | |
1268 | ||
1269 | \constfunc{bool}{IsVisible}{\param{int }{row}, \param{int }{col}, \param{bool }{wholeCellVisible = true}} | |
1270 | ||
1271 | \constfunc{bool}{IsVisible}{\param{const wxGridCellCoords\& }{coords}, \param{bool }{wholeCellVisible = true}} | |
1272 | ||
1273 | Returns true if a cell is either wholly visible (the default) or at least partially | |
1274 | visible in the grid window. | |
1275 | ||
1276 | ||
1277 | ||
1278 | \membersection{wxGrid::MakeCellVisible}\label{wxgridmakecellvisible} | |
1279 | ||
1280 | \func{void}{MakeCellVisible}{\param{int }{row}, \param{int }{col}} | |
1281 | ||
1282 | \func{void}{MakeCellVisible}{\param{const wxGridCellCoords\& }{coords}} | |
1283 | ||
1284 | Brings the specified cell into the visible grid cell area with minimal scrolling. Does | |
1285 | nothing if the cell is already visible. | |
1286 | ||
1287 | ||
1288 | ||
1289 | \membersection{wxGrid::MoveCursorDown}\label{wxgridmovecursordown} | |
1290 | ||
1291 | \func{bool}{MoveCursorDown}{\param{bool }{expandSelection}} | |
1292 | ||
1293 | Moves the grid cursor down by one row. If a block of cells was previously selected it | |
1294 | will expand if the argument is true or be cleared if the argument is false. | |
1295 | ||
1296 | \wxheading{Keyboard}\\ | |
1297 | This function is called for Down cursor key presses or Shift+Down to expand a selection. | |
1298 | ||
1299 | ||
1300 | ||
1301 | \membersection{wxGrid::MoveCursorLeft}\label{wxgridmovecursorleft} | |
1302 | ||
1303 | \func{bool}{MoveCursorLeft}{\param{bool }{expandSelection}} | |
1304 | ||
1305 | Moves the grid cursor left by one column. If a block of cells was previously selected it | |
1306 | will expand if the argument is true or be cleared if the argument is false. | |
1307 | ||
1308 | \wxheading{Keyboard}\\ | |
1309 | This function is called for Left cursor key presses or Shift+Left to expand a selection. | |
1310 | ||
1311 | ||
1312 | ||
1313 | \membersection{wxGrid::MoveCursorRight}\label{wxgridmovecursorright} | |
1314 | ||
1315 | \func{bool}{MoveCursorRight}{\param{bool }{expandSelection}} | |
1316 | ||
1317 | Moves the grid cursor right by one column. If a block of cells was previously selected it | |
1318 | will expand if the argument is true or be cleared if the argument is false. | |
1319 | ||
1320 | \wxheading{Keyboard}\\ | |
1321 | This function is called for Right cursor key presses or Shift+Right to expand a selection. | |
1322 | ||
1323 | ||
1324 | ||
1325 | \membersection{wxGrid::MoveCursorUp}\label{wxgridmovecursorup} | |
1326 | ||
1327 | \func{bool}{MoveCursorUp}{\param{bool }{expandSelection}} | |
1328 | ||
1329 | Moves the grid cursor up by one row. If a block of cells was previously selected it | |
1330 | will expand if the argument is true or be cleared if the argument is false. | |
1331 | ||
1332 | \wxheading{Keyboard}\\ | |
1333 | This function is called for Up cursor key presses or Shift+Up to expand a selection. | |
1334 | ||
1335 | ||
1336 | ||
1337 | \membersection{wxGrid::MoveCursorDownBlock}\label{wxgridmovecursordownblock} | |
1338 | ||
1339 | \func{bool}{MoveCursorDownBlock}{\param{bool }{expandSelection}} | |
1340 | ||
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 | |
1343 | will expand if the argument is true or be cleared if the argument is false. | |
1344 | ||
1345 | \wxheading{Keyboard}\\ | |
1346 | This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection. | |
1347 | ||
1348 | ||
1349 | ||
1350 | \membersection{wxGrid::MoveCursorLeftBlock}\label{wxgridmovecursorleftblock} | |
1351 | ||
1352 | \func{bool}{MoveCursorLeftBlock}{\param{bool }{expandSelection}} | |
1353 | ||
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 | |
1356 | will expand if the argument is true or be cleared if the argument is false. | |
1357 | ||
1358 | \wxheading{Keyboard}\\ | |
1359 | This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection. | |
1360 | ||
1361 | ||
1362 | ||
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 | |
1369 | will expand if the argument is true or be cleared if the argument is false. | |
1370 | ||
1371 | \wxheading{Keyboard}\\ | |
1372 | This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection. | |
1373 | ||
1374 | ||
1375 | ||
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 | |
1382 | will expand if the argument is true or be cleared if the argument is false. | |
1383 | ||
1384 | \wxheading{Keyboard}\\ | |
1385 | This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection. | |
1386 | ||
1387 | ||
1388 | ||
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 | ||
1399 | ||
1400 | ||
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 | ||
1411 | ||
1412 | ||
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 | ||
1419 | ||
1420 | ||
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. | |
1429 | ||
1430 | ||
1431 | ||
1432 | \membersection{wxGrid::SelectAll}\label{wxgridselectall} | |
1433 | ||
1434 | \func{void}{SelectAll}{\void} | |
1435 | ||
1436 | Selects all cells in the grid. | |
1437 | ||
1438 | ||
1439 | ||
1440 | \membersection{wxGrid::SelectBlock}\label{wxgridselectblock} | |
1441 | ||
1442 | \func{void}{SelectBlock}{\param{int }{topRow}, \param{int }{leftCol}, | |
1443 | \param{int }{bottomRow}, \param{int }{rightCol}, \param{bool }{addToSelected = false}} | |
1444 | ||
1445 | \func{void}{SelectBlock}{\param{const wxGridCellCoords\& }{topLeft}, | |
1446 | \param{const wxGridCellCoords\& }{bottomRight}, \param{bool }{addToSelected = false}} | |
1447 | ||
1448 | Selects a rectangular block of cells. If addToSelected is false then any existing selection will be | |
1449 | deselected; if true the column will be added to the existing selection. | |
1450 | ||
1451 | ||
1452 | ||
1453 | \membersection{wxGrid::SelectCol}\label{wxgridselectcol} | |
1454 | ||
1455 | \func{void}{SelectCol}{\param{int }{col}, \param{bool }{addToSelected = false}} | |
1456 | ||
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. | |
1459 | ||
1460 | ||
1461 | ||
1462 | \membersection{wxGrid::SelectionToDeviceRect}\label{wxgridselectiontodevicerect} | |
1463 | ||
1464 | \constfunc{wxRect}{SelectionToDeviceRect}{\void} | |
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 | ||
1470 | ||
1471 | \membersection{wxGrid::SelectRow}\label{wxgridselectrow} | |
1472 | ||
1473 | \func{void}{SelectRow}{\param{int }{row}, \param{bool }{addToSelected = false}} | |
1474 | ||
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. | |
1477 | ||
1478 | ||
1479 | ||
1480 | \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment} | |
1481 | ||
1482 | \func{void}{SetCellAlignment}{\param{int }{row}, \param{int }{col}, \param{int }{horiz}, \param{int }{vert}} | |
1483 | ||
1484 | \func{void}{SetCellAlignment}{\param{int }{align}, \param{int }{row}, \param{int }{col}} | |
1485 | ||
1486 | Sets the horizontal and vertical alignment for grid cell text at the specified location. | |
1487 | ||
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. | |
1490 | ||
1491 | ||
1492 | ||
1493 | \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour} | |
1494 | ||
1495 | \func{void}{SetCellBackgroundColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}} | |
1496 | ||
1497 | ||
1498 | ||
1499 | \membersection{wxGrid::SetCellEditor}\label{wxgridsetcelleditor} | |
1500 | ||
1501 | \func{void}{SetCellEditor}{\param{int }{row}, \param{int }{col}, \param{wxGridCellEditor* }{editor}} | |
1502 | ||
1503 | Sets the editor for the grid cell at the specified location. | |
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 | ||
1509 | ||
1510 | ||
1511 | \membersection{wxGrid::SetCellFont}\label{wxgridsetcellfont} | |
1512 | ||
1513 | \func{void}{SetCellFont}{\param{int }{row}, \param{int }{col}, \param{const wxFont\&}{ font}} | |
1514 | ||
1515 | Sets the font for text in the grid cell at the specified location. | |
1516 | ||
1517 | ||
1518 | ||
1519 | \membersection{wxGrid::SetCellRenderer}\label{wxgridsetcellrenderer} | |
1520 | ||
1521 | \func{void}{SetCellRenderer}{\param{int }{row}, \param{int }{col}, \param{wxGridCellRenderer* }{renderer}} | |
1522 | ||
1523 | Sets the renderer for the grid cell at the specified location. | |
1524 | The grid will take ownership of the pointer. | |
1525 | ||
1526 | See \helpref{wxGridCellRenderer}{wxgridcellrenderer} and | |
1527 | the \helpref{wxGrid overview}{gridoverview} for more information about cell editors and renderers. | |
1528 | ||
1529 | ||
1530 | ||
1531 | \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour} | |
1532 | ||
1533 | \func{void}{SetCellTextColour}{\param{int }{row}, \param{int }{col}, \param{const wxColour\&}{ colour}} | |
1534 | ||
1535 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{val}, \param{int }{row}, \param{int }{col}} | |
1536 | ||
1537 | \func{void}{SetCellTextColour}{\param{const wxColour\& }{colour}} | |
1538 | ||
1539 | Sets the text colour for the grid cell at the specified location. | |
1540 | ||
1541 | ||
1542 | ||
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 | ||
1549 | \func{void}{SetCellValue}{\param{const wxString\& }{val}, \param{int }{row}, \param{int }{col}} | |
1550 | ||
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 | |
1553 | with \helpref{wxGrid::GetCellValue}{wxgridgetcellvalue} to access cell values. | |
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 | |
1557 | function for those cells that contain string values. | |
1558 | ||
1559 | The last form is for backward compatibility only. | |
1560 | ||
1561 | See \helpref{wxGridTableBase::CanSetValueAs}{wxgridtablebasecangetvalueas} | |
1562 | and the \helpref{wxGrid overview}{gridoverview} for more information. | |
1563 | ||
1564 | ||
1565 | ||
1566 | \membersection{wxGrid::SetColAttr}\label{wxgridsetcolattr} | |
1567 | ||
1568 | \func{void}{SetColAttr}{\param{int }{col}, \param{wxGridCellAttr* }{attr}} | |
1569 | ||
1570 | Sets the cell attributes for all cells in the specified column. | |
1571 | ||
1572 | For more information about controlling grid cell attributes see the | |
1573 | \helpref{wxGridCellAttr}{wxgridcellattr} cell attribute class and the | |
1574 | \helpref{wxGrid classes overview}{gridoverview}. | |
1575 | ||
1576 | ||
1577 | ||
1578 | \membersection{wxGrid::SetColFormatBool}\label{wxgridsetcolformatbool} | |
1579 | ||
1580 | \func{void}{SetColFormatBool}{\param{int }{col}} | |
1581 | ||
1582 | Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox. | |
1583 | ||
1584 | ||
1585 | ||
1586 | \membersection{wxGrid::SetColFormatNumber}\label{wxgridsetcolformatnumber} | |
1587 | ||
1588 | \func{void}{SetColFormatNumber}{\param{int }{col}} | |
1589 | ||
1590 | Sets the specified column to display integer values. | |
1591 | ||
1592 | ||
1593 | ||
1594 | \membersection{wxGrid::SetColFormatFloat}\label{wxgridsetcolformatfloat} | |
1595 | ||
1596 | \func{void}{SetColFormatFloat}{\param{int }{col}, \param{int }{width = -1}, \param{int }{precision = -1}} | |
1597 | ||
1598 | Sets the specified column to display floating point values with the given width and precision. | |
1599 | ||
1600 | ||
1601 | ||
1602 | \membersection{wxGrid::SetColFormatCustom}\label{wxgridsetcolformatcustom} | |
1603 | ||
1604 | \func{void}{SetColFormatCustom}{\param{int }{col}, \param{const wxString\& }{typeName}} | |
1605 | ||
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. | |
1609 | ||
1610 | ||
1611 | ||
1612 | \membersection{wxGrid::SetColLabelAlignment}\label{wxgridsetcollabelalignment} | |
1613 | ||
1614 | \func{void}{SetColLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} | |
1615 | ||
1616 | Sets the horizontal and vertical alignment of column label text. | |
1617 | ||
1618 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. | |
1619 | ||
1620 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
1621 | ||
1622 | ||
1623 | ||
1624 | \membersection{wxGrid::SetColLabelSize}\label{wxgridsetcollabelsize} | |
1625 | ||
1626 | \func{void}{SetColLabelSize}{\param{int }{height}} | |
1627 | ||
1628 | Sets the height of the column labels. | |
1629 | ||
1630 | If \arg{height} equals to \texttt{wxGRID\_AUTOSIZE} then height is calculated automatically | |
1631 | so that no label is truncated. Note that this could be slow for a large table. | |
1632 | ||
1633 | ||
1634 | ||
1635 | \membersection{wxGrid::SetColLabelValue}\label{wxgridsetcollabelvalue} | |
1636 | ||
1637 | \func{void}{SetColLabelValue}{\param{int }{col}, \param{const wxString\&}{ value}} | |
1638 | ||
1639 | Set the value for the given column label. If you are using a derived grid table you must | |
1640 | override \helpref{wxGridTableBase::SetColLabelValue}{wxgridtablebasesetcollabelvalue} | |
1641 | for this to have any effect. | |
1642 | ||
1643 | ||
1644 | ||
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. | |
1651 | The width argument must be higher than the minimimal acceptable column width, see | |
1652 | \helpref{wxGrid::GetColMinimalAcceptableWidth}{wxgridgetcolminimalacceptablewidth}. | |
1653 | ||
1654 | ||
1655 | ||
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 | |
1665 | with sizes smaller than the value specified here. | |
1666 | ||
1667 | ||
1668 | ||
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 | ||
1677 | \membersection{wxGrid::SetColSize}\label{wxgridsetcolsize} | |
1678 | ||
1679 | \func{void}{SetColSize}{\param{int }{col}, \param{int }{width}} | |
1680 | ||
1681 | Sets the width of the specified column. | |
1682 | ||
1683 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
1684 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. | |
1685 | ||
1686 | Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will | |
1687 | also be set as the minimal width for the column. | |
1688 | ||
1689 | \wxheading{Note}\\ | |
1690 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
1691 | The memory requirements for this could become prohibitive if your grid is very large. | |
1692 | ||
1693 | ||
1694 | ||
1695 | \membersection{wxGrid::SetDefaultCellAlignment}\label{wxgridsetdefaultcellalignment} | |
1696 | ||
1697 | \func{void}{SetDefaultCellAlignment}{\param{int }{horiz}, \param{int }{vert}} | |
1698 | ||
1699 | Sets the default horizontal and vertical alignment for grid cell text. | |
1700 | ||
1701 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. | |
1702 | ||
1703 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
1704 | ||
1705 | ||
1706 | ||
1707 | \membersection{wxGrid::SetDefaultCellBackgroundColour}\label{wxgridsetdefaultcellbackgroundcolour} | |
1708 | ||
1709 | \func{void}{SetDefaultCellBackgroundColour}{\param{const wxColour\&}{ colour}} | |
1710 | ||
1711 | Sets the default background colour for grid cells. | |
1712 | ||
1713 | ||
1714 | ||
1715 | \membersection{wxGrid::SetDefaultCellFont}\label{wxgridsetdefaultcellfont} | |
1716 | ||
1717 | \func{void}{SetDefaultCellFont}{\param{const wxFont\&}{ font}} | |
1718 | ||
1719 | Sets the default font to be used for grid cell text. | |
1720 | ||
1721 | ||
1722 | ||
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 | ||
1729 | ||
1730 | ||
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 | ||
1740 | ||
1741 | ||
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 | ||
1751 | ||
1752 | ||
1753 | \membersection{wxGrid::SetDefaultColSize}\label{wxgridsetdefaultcolsize} | |
1754 | ||
1755 | \func{void}{SetDefaultColSize}{\param{int }{width}, \param{bool }{resizeExistingCols = false}} | |
1756 | ||
1757 | Sets the default width for columns in the grid. This will only affect columns subsequently added to | |
1758 | the grid unless resizeExistingCols is true. | |
1759 | ||
1760 | ||
1761 | ||
1762 | \membersection{wxGrid::SetDefaultRowSize}\label{wxgridsetdefaultrowsize} | |
1763 | ||
1764 | \func{void}{SetDefaultRowSize}{\param{int }{height}, \param{bool }{resizeExistingRows = false}} | |
1765 | ||
1766 | Sets the default height for rows in the grid. This will only affect rows subsequently added | |
1767 | to the grid unless resizeExistingRows is true. | |
1768 | ||
1769 | ||
1770 | ||
1771 | \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor} | |
1772 | ||
1773 | \func{void}{SetGridCursor}{\param{int }{row}, \param{int }{col}} | |
1774 | ||
1775 | Set the grid cursor to the specified cell. | |
1776 | This function calls \helpref{wxGrid::MakeCellVisible}{wxgridmakecellvisible}. | |
1777 | ||
1778 | ||
1779 | ||
1780 | \membersection{wxGrid::SetGridLineColour}\label{wxgridsetgridlinecolour} | |
1781 | ||
1782 | \func{void}{SetGridLineColour}{\param{const wxColour\&}{colour}} | |
1783 | ||
1784 | Sets the colour used to draw grid lines. | |
1785 | ||
1786 | ||
1787 | ||
1788 | \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour} | |
1789 | ||
1790 | \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ colour}} | |
1791 | ||
1792 | Sets the background colour for row and column labels. | |
1793 | ||
1794 | ||
1795 | ||
1796 | \membersection{wxGrid::SetLabelFont}\label{wxgridsetlabelfont} | |
1797 | ||
1798 | \func{void}{SetLabelFont}{\param{const wxFont\&}{ font}} | |
1799 | ||
1800 | Sets the font for row and column labels. | |
1801 | ||
1802 | ||
1803 | ||
1804 | \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour} | |
1805 | ||
1806 | \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ colour}} | |
1807 | ||
1808 | Sets the colour for row and column label text. | |
1809 | ||
1810 | ||
1811 | ||
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 | ||
1819 | ||
1820 | ||
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 | ||
1827 | ||
1828 | ||
1829 | \membersection{wxGrid::SetOrCalcRowSizes}\label{wxgridsetorcalcrowsizes} | |
1830 | ||
1831 | \func{int}{SetOrCalcRowSizes}{\param{bool }{calcOnly}, \param{bool }{setAsMin = true}} | |
1832 | ||
1833 | ||
1834 | ||
1835 | \membersection{wxGrid::SetReadOnly}\label{wxgridsetreadonly} | |
1836 | ||
1837 | \func{void}{SetReadOnly}{\param{int }{row}, \param{int }{col}, \param{bool }{isReadOnly = true}} | |
1838 | ||
1839 | Makes the cell at the specified location read-only or editable. | |
1840 | See also \helpref{wxGrid::IsReadOnly}{wxgridisreadonly}. | |
1841 | ||
1842 | ||
1843 | ||
1844 | \membersection{wxGrid::SetRowAttr}\label{wxgridsetrowattr} | |
1845 | ||
1846 | \func{void}{SetRowAttr}{\param{int }{row}, \param{wxGridCellAttr* }{attr}} | |
1847 | ||
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. | |
1851 | ||
1852 | ||
1853 | ||
1854 | \membersection{wxGrid::SetRowLabelAlignment}\label{wxgridsetrowlabelalignment} | |
1855 | ||
1856 | \func{void}{SetRowLabelAlignment}{\param{int }{horiz}, \param{int }{vert}} | |
1857 | ||
1858 | Sets the horizontal and vertical alignment of row label text. | |
1859 | ||
1860 | Horizontal alignment should be one of wxALIGN\_LEFT, wxALIGN\_CENTRE or wxALIGN\_RIGHT. | |
1861 | ||
1862 | Vertical alignment should be one of wxALIGN\_TOP, wxALIGN\_CENTRE or wxALIGN\_BOTTOM. | |
1863 | ||
1864 | ||
1865 | ||
1866 | \membersection{wxGrid::SetRowLabelSize}\label{wxgridsetrowlabelsize} | |
1867 | ||
1868 | \func{void}{SetRowLabelSize}{\param{int }{width}} | |
1869 | ||
1870 | Sets the width of the row labels. | |
1871 | ||
1872 | If \arg{width} equals \texttt{wxGRID\_AUTOSIZE} then width is calculated automatically | |
1873 | so that no label is truncated. Note that this could be slow for a large table. | |
1874 | ||
1875 | ||
1876 | ||
1877 | \membersection{wxGrid::SetRowLabelValue}\label{wxgridsetrowlabelvalue} | |
1878 | ||
1879 | \func{void}{SetRowLabelValue}{\param{int }{row}, \param{const wxString\&}{ value}} | |
1880 | ||
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} | |
1883 | for this to have any effect. | |
1884 | ||
1885 | ||
1886 | ||
1887 | \membersection{wxGrid::SetRowMinimalHeight}\label{wxgridsetrowminimalheight} | |
1888 | ||
1889 | \func{void}{SetRowMinimalHeight}{\param{int }{row}, \param{int }{height}} | |
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. | |
1893 | The height argument must be higher than the minimimal acceptable row height, see | |
1894 | \helpref{wxGrid::GetRowMinimalAcceptableHeight}{wxgridgetrowminimalacceptableheight}. | |
1895 | ||
1896 | ||
1897 | ||
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 | |
1907 | with sizes smaller than the value specified here. | |
1908 | ||
1909 | ||
1910 | ||
1911 | \membersection{wxGrid::SetRowSize}\label{wxgridsetrowsize} | |
1912 | ||
1913 | \func{void}{SetRowSize}{\param{int }{row}, \param{int }{height}} | |
1914 | ||
1915 | Sets the height of the specified row. | |
1916 | ||
1917 | This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch | |
1918 | block you can use \helpref{wxGrid::ForceRefresh}{wxgridforcerefresh} to see the changes. | |
1919 | ||
1920 | Automatically sizes the column to fit its contents. If setAsMin is true the calculated width will | |
1921 | also be set as the minimal width for the column. | |
1922 | ||
1923 | \wxheading{Note} | |
1924 | ||
1925 | wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used. | |
1926 | The memory requirements for this could become prohibitive if your grid is very large. | |
1927 | ||
1928 | ||
1929 | ||
1930 | \membersection{wxGrid::SetScrollLineX}\label{wxgridsetscrolllinex} | |
1931 | ||
1932 | \func{void}{SetScrollLineX}{\param{int }{x}} | |
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 | ||
1938 | \wxheading{See also} | |
1939 | ||
1940 | \helpref{wxGrid::GetScrollLineX}{wxgridgetscrolllinex},\rtfsp | |
1941 | \helpref{wxGrid::GetScrollLineY}{wxgridgetscrollliney},\rtfsp | |
1942 | \helpref{wxGrid::SetScrollLineY}{wxgridsetscrollliney} | |
1943 | ||
1944 | ||
1945 | ||
1946 | \membersection{wxGrid::SetScrollLineY}\label{wxgridsetscrollliney} | |
1947 | ||
1948 | \func{void}{SetScrollLineY}{\param{int }{y}} | |
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 | ||
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 | ||
1962 | \membersection{wxGrid::SetSelectionBackground}\label{wxgridsetselectionbackground} | |
1963 | ||
1964 | \func{void}{SetSelectionBackground}{\param{const wxColour\& }{c}} | |
1965 | ||
1966 | ||
1967 | ||
1968 | \membersection{wxGrid::SetSelectionForeground}\label{wxgridsetselectionforeground} | |
1969 | ||
1970 | \func{void}{SetSelectionForeground}{\param{const wxColour\& }{c}} | |
1971 | ||
1972 | ||
1973 | ||
1974 | \membersection{wxGrid::SetSelectionMode}\label{wxgridsetselectionmode} | |
1975 | ||
1976 | \func{void}{SetSelectionMode}{\param{wxGrid::wxGridSelectionModes}{ selmode}} | |
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 | ||
1984 | \docparam{wxGrid::wxGridSelectRows}{Selections will consist of whole rows.} | |
1985 | ||
1986 | \docparam{wxGrid::wxGridSelectColumns}{Selections will consist of whole columns.} | |
1987 | ||
1988 | ||
1989 | ||
1990 | \membersection{wxGrid::SetTable}\label{wxgridsettable} | |
1991 | ||
1992 | \func{bool}{SetTable}{\param{wxGridTableBase* }{table}, \param{bool }{takeOwnership = false}, \param{wxGrid::wxGridSelectionModes }{selmode = wxGrid::wxGridSelectCells}} | |
1993 | ||
1994 | Passes a pointer to a custom grid table to be used by the grid. This should be called | |
1995 | after the grid constructor and before using the grid object. If takeOwnership is set to | |
1996 | true then the table will be deleted by the wxGrid destructor. | |
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 | |
2000 | wholly in memory. | |
2001 | ||
2002 | ||
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 | ||
2010 | ||
2011 | ||
2012 | \membersection{wxGrid::XToCol}\label{wxgridxtocol} | |
2013 | ||
2014 | \constfunc{int}{XToCol}{\param{int }{x}, \param{bool }{clipToMinMax = false}} | |
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.} | |
2019 | ||
2020 | \wxheading{Return value} | |
2021 | The grid column that corresponds to the logical x coordinate. Returns | |
2022 | {\tt wxNOT\_FOUND} if there is no column at the x position. | |
2023 | ||
2024 | ||
2025 | ||
2026 | \membersection{wxGrid::XToEdgeOfCol}\label{wxgridxtoedgeofcol} | |
2027 | ||
2028 | \constfunc{int}{XToEdgeOfCol}{\param{int }{x}} | |
2029 | ||
2030 | Returns the column whose right hand edge is close to the given logical x position. | |
2031 | If no column edge is near to this position {\tt wxNOT\_FOUND} is returned. | |
2032 | ||
2033 | ||
2034 | ||
2035 | \membersection{wxGrid::YToEdgeOfRow}\label{wxgridytoedgeofrow} | |
2036 | ||
2037 | \constfunc{int}{YToEdgeOfRow}{\param{int }{y}} | |
2038 | ||
2039 | Returns the row whose bottom edge is close to the given logical y position. | |
2040 | If no row edge is near to this position {\tt wxNOT\_FOUND} is returned. | |
2041 | ||
2042 | ||
2043 | ||
2044 | \membersection{wxGrid::YToRow}\label{wxgridytorow} | |
2045 | ||
2046 | \constfunc{int}{YToRow}{\param{int }{y}} | |
2047 | ||
2048 | Returns the grid row that corresponds to the logical y coordinate. Returns | |
2049 | {\tt wxNOT\_FOUND} if there is no row at the y position. | |
2050 |