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