1 \section{\class{wxGrid
}}\label{wxgrid
}
3 wxGrid and its related classes are used for displaying and editing tabular
4 data. They provide a rich set of features for display, editing, and
5 interacting with a variety of data sources. For simple applications, and to
6 help you get started, wxGrid is the only class you need to refer to
7 directly. It will set up default instances of the other classes and manage
8 them for you. For more complex applications you can derive your own
9 classes for custom grid views, grid data tables, cell editors and
10 renderers. The
\helpref{wxGrid classes overview
}{gridoverview
} has
11 examples of simple and more complex applications, explains the
12 relationship between the various grid classes and has a summary of the
13 keyboard shortcuts and mouse functions provided by wxGrid.
15 wxGrid has been greatly expanded and redesigned for wxWindows
2.2
16 onwards. If you have been using the old wxGrid class you will probably
17 want to have a look at the
\helpref{wxGrid classes
18 overview
}{gridoverview
} to see how things have changed. The new grid
19 classes are reasonably backward-compatible but there are some
20 exceptions. There are also easier ways of doing many things compared to
21 the previous implementation.
24 \wxheading{Derived from
}
26 \helpref{wxScrolledWindow
}{wxscrolledwindow
}\\
27 \helpref{wxWindow
}{wxwindow
}\\
28 \helpref{wxEvtHandler
}{wxevthandler
}\\
29 \helpref{wxObject
}{wxobject
}
31 \wxheading{Include files
}
35 \wxheading{Window styles
}
37 There are presently no specific window styles for wxGrid.
39 \wxheading{Event handling
}
43 \helpref{wxGrid overview
}{gridoverview
}
45 %%%%%%%%%%% FUNCTION GROUPS %%%%%%%%%%%%%
46 \latexignore{\rtfignore{\wxheading{Function groups
}}}
48 \membersection{Constructors and initialization
}
50 \helpref{wxGrid
}{wxgridctor
} \\
51 \helpref{\destruct{wxGrid
}}{wxgriddtor
} \\
52 \helpref{CreateGrid
}{wxgridcreategrid
} \\
53 \helpref{SetTable
}{wxgridsettable
}
55 \membersection{Display format
}
57 \membersection{Selection functions
}
59 %%%%%%%%% MEMBER FUNCTIONS %%%%%%%%%%
60 \helponly{\insertatlevel{2}{
66 \membersection{wxGrid::wxGrid
}\label{wxgridctor
}
68 \func{}{wxGrid
}{\void}
72 \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
}}
74 Constructor to create a grid object. Call either
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} or
75 \helpref{wxGrid::SetTable
}{wxgridsettable
} directly after this to initialize the grid before using
78 \membersection{wxGrid::
\destruct{wxGrid
}}\label{wxgriddtor
}
80 \func{}{\destruct{wxGrid
}}{\void}
82 Destructor. This will also destroy the associated grid table unless you passed a table
83 object to the grid and specified that the grid should not take ownership of the
84 table (see
\helpref{wxGrid::SetTable
}{wxgridsettable
}).
86 \membersection{wxGrid::AppendCols
}\label{wxgridappendcols
}
88 \func{bool
}{AppendCols
}{\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
90 Appends one or more new columns to the right of the grid and returns TRUE if
91 successful. The updateLabels argument is not used at present.
93 If you are using a derived grid table class you will need to override
94 \helpref{wxGridTableBase::AppendCols
}{wxgridtablebaseappendcols
}. See
95 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
97 \membersection{wxGrid::AppendRows
}\label{wxgridappendrows
}
99 \func{bool
}{AppendRows
}{\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
101 Appends one or more new rows to the bottom of the grid and returns TRUE if
102 successful. The updateLabels argument is not used at present.
104 If you are using a derived grid table class you will need to override
105 \helpref{wxGridTableBase::AppendRows
}{wxgridtablebaseappendrows
}. See
106 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
108 \membersection{wxGrid::AutoSize
}\label{wxgridautosize
}
110 \func{void
}{AutoSize
}{\void}
112 Automatically sets the height and width of all rows and columns to fit their contents.
115 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
116 The memory requirements for this could become prohibitive if your grid is very large.
118 \membersection{wxGrid::AutoSizeColumn
}\label{wxgridautosizecolumn
}
120 \func{void
}{AutoSizeColumn
}{\param{int
}{col
},
\param{bool
}{setAsMin = TRUE
}}
122 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
123 also be set as the minimal width for the column.
126 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
127 The memory requirements for this could become prohibitive if your grid is very large.
129 \membersection{wxGrid::AutoSizeColumns
}\label{wxgridautosizecolumns
}
131 \func{void
}{AutoSizeColumns
}{\param{bool
}{setAsMin = TRUE
}}
133 Automatically sizes all columns to fit their contents. If setAsMin is TRUE the calculated widths will
134 also be set as the minimal widths for the columns.
137 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
138 The memory requirements for this could become prohibitive if your grid is very large.
140 \membersection{wxGrid::AutoSizeRow
}\label{wxgridautosizerow
}
142 \func{void
}{AutoSizeRow
}{\param{int
}{row
},
\param{bool
}{setAsMin = TRUE
}}
144 Automatically sizes the row to fit its contents. If setAsMin is TRUE the calculated height will
145 also be set as the minimal height for the row.
148 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
149 The memory requirements for this could become prohibitive if your grid is very large.
151 \membersection{wxGrid::AutoSizeRows
}\label{wxgridautosizerows
}
153 \func{void
}{AutoSizeRows
}{\param{bool
}{setAsMin = TRUE
}}
155 Automatically sizes all rows to fit their contents. If setAsMin is TRUE the calculated heights will
156 also be set as the minimal heights for the rows.
159 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
160 The memory requirements for this could become prohibitive if your grid is very large.
162 \membersection{wxGrid::BeginBatch
}\label{wxgridbeginbatch
}
164 \func{void
}{BeginBatch
}{\void}
166 Increments the grid's batch count. When the count is greater than zero repainting of
167 the grid is suppressed. Each call to BeginBatch must be matched by a later call to
168 \helpref{wxGrid::EndBatch
}{wxgridendbatch
}. Code that does a lot of grid
169 modification can be enclosed between BeginBatch and EndBatch calls to avoid
170 screen flicker. The final EndBatch will cause the grid to be repainted.
172 \membersection{wxGrid::CanDragColSize
}\label{wxgridcandragcolsize
}
174 \func{bool
}{CanDragColSize
}{\void}
176 Returns TRUE if columns can be resized by dragging with the mouse. Columns can be resized
177 by dragging the edges of their labels. If grid line dragging is enabled they can also be
178 resized by dragging the right edge of the column in the grid cell area
179 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
181 \membersection{wxGrid::CanDragRowSize
}\label{wxgridcandragrowsize
}
183 \func{bool
}{CanDragRowSize
}{\void}
185 Returns TRUE if rows can be resized by dragging with the mouse. Rows can be resized
186 by dragging the edges of their labels. If grid line dragging is enabled they can also be
187 resized by dragging the lower edge of the row in the grid cell area
188 (see
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}).
190 \membersection{wxGrid::CanDragGridSize
}\label{wxgridcandraggridsize
}
192 \func{bool
}{CanDragGridSize
}{\void}
194 Return TRUE if the dragging of grid lines to resize rows and columns is enabled or FALSE otherwise.
196 \membersection{wxGrid::CanEnableCellControl
}\label{wxgridcanenablecellcontrol
}
198 \constfunc{bool
}{CanEnableCellControl
}{\void}
200 Returns TRUE if the in-place edit control for the current grid cell can be used and
201 FALSE otherwise (e.g. if the current cell is read-only).
203 \membersection{wxGrid::CellToRect
}\label{wxgridcelltorect
}
205 \func{wxRect
}{CellToRect
}{\param{int
}{row
},
\param{int
}{col
}}
207 \func{wxRect
}{CellToRect
}{\param{const wxGridCellCoords\&
}{coords
}}
209 Return the rectangle corresponding to the grid cell's size and position in logical
212 \membersection{wxGrid::ClearGrid
}\label{wxgridcleargrid
}
214 \func{void
}{ClearGrid
}{\void}
216 Clears all data in the underlying grid table and repaints the grid. The table is not deleted by
217 this function. If you are using a derived table class then you need to override
218 \helpref{wxGridTableBase::Clear
}{wxgridtablebaseclear
} for this function to have any effect.
220 \membersection{wxGrid::CreateGrid
}\label{wxgridcreategrid
}
222 \func{bool
}{CreateGrid
}{\param{int
}{numRows
},
\param{int
}{numCols
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
224 Creates a grid with the specified initial number of rows and columns.
225 Call this directly after the grid constructor. When you use this
226 function wxGrid will create and manage a simple table of string values
227 for you. All of the grid data will be stored in memory.
229 For applications with more complex data types or relationships, or for
230 dealing with very large datasets, you should derive your own grid table
231 class and pass a table object to the grid with
\helpref{wxGrid::SetTable
}{wxgridsettable
}.
233 \membersection{wxGrid::DeleteCols
}\label{wxgriddeletecols
}
235 \func{bool
}{DeleteCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
237 Deletes one or more columns from a grid starting at the specified position and returns
238 TRUE if successful. The updateLabels argument is not used at present.
240 If you are using a derived grid table class you will need to override
241 \helpref{wxGridTableBase::DeleteCols
}{wxgridtablebasedeletecols
}. See
242 \helpref{wxGrid::InsertCols
}{wxgridinsertcols
} for further information.
244 \membersection{wxGrid::DeleteRows
}\label{wxgriddeleterows
}
246 \func{bool
}{DeleteRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
248 Deletes one or more rows from a grid starting at the specified position and returns
249 TRUE if successful. The updateLabels argument is not used at present.
251 If you are using a derived grid table class you will need to override
252 \helpref{wxGridTableBase::DeleteRows
}{wxgridtablebasedeleterows
}. See
253 \helpref{wxGrid::InsertRows
}{wxgridinsertrows
} for further information.
255 \membersection{wxGrid::DisableCellEditControl
}\label{wxgriddisablecelleditcontrol
}
257 \func{void
}{DisableCellEditControl
}{\void}
259 Disables in-place editing of grid cells.
260 Equivalent to calling EnableCellEditControl(FALSE).
262 \membersection{wxGrid::DisableDragColSize
}\label{wxgriddisabledragcolsize
}
264 \func{void
}{DisableDragColSize
}{\void}
266 Disables column sizing by dragging with the mouse. Equivalent to passing FALSE to
267 \helpref{wxGrid::EnableDragColSize
}{wxgridenabledragcolsize
}.
269 \membersection{wxGrid::DisableDragGridSize
}\label{wxgriddisabledraggridsize
}
271 \func{void
}{DisableDragGridSize
}{\void}
273 Disable mouse dragging of grid lines to resize rows and columns. Equivalent to passing
274 FALSE to
\helpref{wxGrid::EnableDragGridSize
}{wxgridenabledraggridsize
}
276 \membersection{wxGrid::DisableDragRowSize
}\label{wxgriddisabledragrowsize
}
278 \func{void
}{DisableDragRowSize
}{\void}
280 Disables row sizing by dragging with the mouse. Equivalent to passing FALSE to
281 \helpref{wxGrid::EnableDragRowSize
}{wxgridenabledragrowsize
}.
283 \membersection{wxGrid::EnableCellEditControl
}\label{wxgridenablecelleditcontrol
}
285 \func{void
}{EnableCellEditControl
}{\param{bool
}{enable = TRUE
}}
287 Enables or disables in-place editing of grid cell data. The grid will issue either a
288 wxEVT_GRID_EDITOR_SHOWN or wxEVT_GRID_EDITOR_HIDDEN event.
290 \membersection{wxGrid::EnableDragColSize
}\label{wxgridenabledragcolsize
}
292 \func{void
}{EnableDragColSize
}{\param{bool
}{enable = TRUE
}}
294 Enables or disables column sizing by dragging with the mouse.
296 \membersection{wxGrid::EnableDragGridSize
}\label{wxgridenabledraggridsize
}
298 \func{void
}{EnableDragGridSize
}{\param{bool
}{enable = TRUE
}}
300 Enables or disables row and column resizing by dragging gridlines with the mouse.
302 \membersection{wxGrid::EnableDragRowSize
}\label{wxgridenabledragrowsize
}
304 \func{void
}{EnableDragRowSize
}{\param{bool
}{enable = TRUE
}}
306 Enables or disables row sizing by dragging with the mouse.
308 \membersection{wxGrid::EnableEditing
}\label{wxgridenableediting
}
310 \func{void
}{EnableEditing
}{\param{bool
}{edit
}}
312 If the edit argument is FALSE this function sets the whole grid as read-only. If the
313 argument is TRUE the grid is set to the default state where cells may be editable. In the
314 default state you can set single grid cells and whole rows and columns to be editable or
316 \helpref{wxGridCellAttribute::SetReadOnly
}{wxgridcellattrsetreadonly
}. For single
317 cells you can also use the shortcut function
318 \helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}.
320 For more information about controlling grid cell attributes see the
321 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
322 \helpref{wxGrid classes overview
}{gridoverview
}.
324 \membersection{wxGrid::EnableGridLines
}\label{wxgridenablegridlines
}
326 \func{void
}{EnableGridLines
}{\param{bool
}{enable = TRUE
}}
328 Turns the drawing of grid lines on or off.
330 \membersection{wxGrid::EndBatch
}\label{wxgridendbatch
}
332 \func{void
}{EndBatch
}{\void}
334 Decrements the grid's batch count. When the count is greater than zero repainting of
335 the grid is suppressed. Each previous call to
336 \helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} must be matched by a later call to
337 EndBatch. Code that does a lot of grid modification can be enclosed between
338 BeginBatch and EndBatch calls to avoid screen flicker. The final EndBatch will
339 cause the grid to be repainted.
341 \membersection{wxGrid::ForceRefresh
}\label{wxgridforcerefresh
}
343 \func{void
}{ForceRefresh
}{\void}
345 Causes immediate repainting of the grid. Use this instead of the usual wxWindow::Refresh.
347 \membersection{wxGrid::GetBatchCount
}\label{wxgridgetbatchcount
}
349 \func{int
}{GetBatchCount
}{\void}
351 Returns the number of times that
\helpref{wxGrid::BeginBatch
}{wxgridbeginbatch
} has been called
352 without (yet) matching calls to
\helpref{wxGrid::EndBatch
}{wxgridendbatch
}. While
353 the grid's batch count is greater than zero the display will not be updated.
355 \membersection{wxGrid::GetCellAlignment
}\label{wxgridgetcellalignment
}
357 \func{void
}{GetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int*
}{horiz
},
\param{int*
}{vert
}}
359 Sets the arguments to the horizontal and vertical text alignment values for the
360 grid cell at the specified location.
362 Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
363 Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
365 \membersection{wxGrid::GetCellBackgroundColour
}\label{wxgridgetcellbackgroundcolour
}
367 \func{wxColour
}{GetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
}}
369 Returns the background colour of the cell at the specified location.
371 \membersection{wxGrid::GetCellEditor
}\label{wxgridgetcelleditor
}
373 \func{wxGridCellEditor*
}{GetCellEditor
}{\param{int
}{row
},
\param{int
}{col
}}
375 Returns a pointer to the editor for the cell at the specified location.
377 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
378 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
380 \membersection{wxGrid::GetCellFont
}\label{wxgridgetcellfont
}
382 \func{wxFont
}{GetCellFont
}{\param{int
}{row
},
\param{int
}{col
}}
384 Returns the font for text in the grid cell at the specified location.
386 \membersection{wxGrid::GetCellRenderer
}\label{wxgridgetcellrenderer
}
388 \func{wxGridCellRenderer*
}{GetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
}}
390 Returns a pointer to the renderer for the grid cell at the specified location.
392 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
393 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
395 \membersection{wxGrid::GetCellTextColour
}\label{wxgridgetcelltextcolour
}
397 \func{wxColour
}{GetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
}}
399 Returns the text colour for the grid cell at the specified location.
401 \membersection{wxGrid::GetColLabelAlignment
}\label{wxgridgetcollabelalignment
}
403 \func{void
}{GetColLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
405 Sets the arguments to the current column label alignment values.
407 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
408 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
410 \membersection{wxGrid::GetColLabelSize
}\label{wxgridgetcollabelsize
}
412 \func{int
}{GetColLabelSize
}{\void}
414 Returns the current height of the column labels.
416 \membersection{wxGrid::GetColLabelValue
}\label{wxgridgetcollabelvalue
}
418 \func{wxString
}{GetColLabelValue
}{\param{int
}{col
}}
420 Returns the specifed column label. The default grid table class provides column labels of
421 the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override
422 \helpref{wxGridTableBase::GetColLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
425 \membersection{wxGrid::GetColSize
}\label{wxgridgetcolsize
}
427 \func{int
}{GetColSize
}{\param{int
}{col
}}
429 Returns the width of the specified column.
431 \membersection{wxGrid::GetDefaultCellAlignment
}\label{wxgridgetdefaultcellalignment
}
433 \func{void
}{GetDefaultCellAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
435 Sets the arguments to the current default horizontal and vertical text alignment
438 Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
439 Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
441 \membersection{wxGrid::GetDefaultCellBackgroundColour
}\label{wxgridgetdefaultcellbackgroundcolour
}
443 \func{wxColour
}{GetDefaultCellBackgroundColour
}{\void}
445 Returns the current default background colour for grid cells.
447 \membersection{wxGrid::GetDefaultCellFont
}\label{wxgridgetdefaultcellfont
}
449 \func{wxFont
}{GetDefaultCellFont
}{\void}
451 Returns the current default font for grid cell text.
453 \membersection{wxGrid::GetDefaultCellTextColour
}\label{wxgridgetdefaultcelltextcolour
}
455 \func{wxColour
}{GetDefaultCellTextColour
}{\void}
457 Returns the current default colour for grid cell text.
459 \membersection{wxGrid::GetDefaultColLabelSize
}\label{wxgridgetdefaultcollabelsize
}
461 \func{int
}{GetDefaultColLabelSize
}{\void}
463 Returns the default height for column labels.
465 \membersection{wxGrid::GetDefaultColSize
}\label{wxgridgetdefaultcolsize
}
467 \func{int
}{GetDefaultColSize
}{\void}
469 Returns the current default width for grid columns.
471 \membersection{wxGrid::GetDefaultEditor
}\label{wxgridgetdefaulteditor
}
473 \constfunc{wxGridCellEditor*
}{GetDefaultEditor
}{\void}
475 Returns a pointer to the current default grid cell editor.
477 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
478 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
480 \membersection{wxGrid::GetDefaultRenderer
}\label{wxgridgetdefaultrenderer
}
482 \constfunc{wxGridCellRenderer*
}{GetDefaultRenderer
}{\void}
484 Returns a pointer to the current default grid cell renderer.
486 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
487 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
489 \membersection{wxGrid::GetDefaultRowLabelSize
}\label{wxgridgetdefaultrowlabelsize
}
491 \func{int
}{GetDefaultRowLabelSize
}{\void}
493 Returns the default width for the row labels.
495 \membersection{wxGrid::GetDefaultRowSize
}\label{wxgridgetdefaultrowsize
}
497 \func{int
}{GetDefaultRowSize
}{\void}
499 Returns the current default height for grid rows.
501 \membersection{wxGrid::GetGridCursorCol
}\label{wxgridgetgridcursorcol
}
503 \func{int
}{GetGridCursorCol
}{\void}
505 Returns the current grid cell column position.
507 \membersection{wxGrid::GetGridCursorRow
}\label{wxgridgetgridcursorrow
}
509 \func{int
}{GetGridCursorRow
}{\void}
511 Returns the current grid cell row position.
513 \membersection{wxGrid::GetGridLineColour
}\label{wxgridgetgridlinecolour
}
515 \func{wxColour
}{GetGridLineColour
}{\void}
517 Returns the colour used for grid lines.
519 \membersection{wxGrid::GridLinesEnabled
}\label{wxgridgridlinesenabled
}
521 \func{bool
}{GridLinesEnabled
}{\void}
523 Returnes TRUE if drawing of grid lines is turned on, FALSE otherwise.
525 \membersection{wxGrid::GetLabelBackgroundColour
}\label{wxgridgetlabelbackgroundcolour
}
527 \func{wxColour
}{GetLabelBackgroundColour
}{\void}
529 Returns the colour used for the background of row and column labels.
531 \membersection{wxGrid::GetLabelFont
}\label{wxgridgetlabelfont
}
533 \func{wxFont
}{GetLabelFont
}{\void}
535 Returns the font used for row and column labels.
537 \membersection{wxGrid::GetLabelTextColour
}\label{wxgridgetlabeltextcolour
}
539 \func{wxColour
}{GetLabelTextColour
}{\void}
541 Returns the colour used for row and column label text.
543 \membersection{wxGrid::GetNumberCols
}\label{wxgridgetnumbercols
}
545 \func{int
}{GetNumberCols
}{\void}
547 Returns the total number of grid columns (actually the number of columns in the underlying grid
550 \membersection{wxGrid::GetNumberRows
}\label{wxgridgetnumberrows
}
552 \func{int
}{GetNumberRows
}{\void}
554 Returns the total number of grid rows (actually the number of rows in the underlying grid table).
556 \membersection{wxGrid::GetRowLabelAlignment
}\label{wxgridgetrowlabelalignment
}
558 \func{void
}{GetRowLabelAlignment
}{\param{int*
}{horiz
},
\param{int*
}{vert
}}
560 Sets the arguments to the current row label alignment values.
562 Horizontal alignment will be one of wxLEFT, wxCENTRE or wxRIGHT. \\
563 Vertical alignment will be one of wxTOP, wxCENTRE or wxBOTTOM.
565 \membersection{wxGrid::GetRowLabelSize
}\label{wxgridgetrowlabelsize
}
567 \func{int
}{GetRowLabelSize
}{\void}
569 Returns the current width of the row labels.
571 \membersection{wxGrid::GetRowLabelValue
}\label{wxgridgetrowlabelvalue
}
573 \func{wxString
}{GetRowLabelValue
}{\param{int
}{row
}}
575 Returns the specifed row label. The default grid table class provides numeric row labels.
576 If you are using a custom grid table you can override
577 \helpref{wxGridTableBase::GetRowLabelValue
}{wxgridtablebasegetcollabelvalue
} to provide
580 \membersection{wxGrid::GetRowSize
}\label{wxgridgetrowsize
}
582 \func{int
}{GetRowSize
}{\param{int
}{row
}}
584 Returns the height of the specified row.
586 \membersection{wxGrid::GetTable
}\label{wxgridgettable
}
588 \constfunc{wxGridTableBase *
}{GetTable
}{\void}
590 Returns a base pointer to the current table object.
592 \membersection{wxGrid::HideCellEditControl
}\label{wxgridhidecelleditcontrol
}
594 \func{void
}{HideCellEditControl
}{\void}
596 Hides the in-place cell edit control.
598 \membersection{wxGrid::InsertCols
}\label{wxgridinsertcols
}
600 \func{bool
}{InsertCols
}{\param{int
}{pos =
0},
\param{int
}{numCols =
1},
\param{bool
}{updateLabels = TRUE
}}
602 Inserts one or more new columns into a grid with the first new column at the
603 specified position and returns TRUE if successful. The updateLabels argument is not
606 The sequence of actions begins with the grid object requesting the underlying grid
607 table to insert new columns. If this is successful the table notifies the grid and the
608 grid updates the display. For a default grid (one where you have called
609 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
610 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
611 then you must override
612 \helpref{wxGridTableBase::InsertCols
}{wxgridtablebaseinsertcols
} in your derived
615 \membersection{wxGrid::InsertRows
}\label{wxgridinsertrows
}
617 \func{bool
}{InsertRows
}{\param{int
}{pos =
0},
\param{int
}{numRows =
1},
\param{bool
}{updateLabels = TRUE
}}
619 Inserts one or more new rows into a grid with the first new row at the specified
620 position and returns TRUE if successful. The updateLabels argument is not used at
623 The sequence of actions begins with the grid object requesting the underlying grid
624 table to insert new rows. If this is successful the table notifies the grid and the
625 grid updates the display. For a default grid (one where you have called
626 \helpref{wxGrid::CreateGrid
}{wxgridcreategrid
}) this process is automatic. If you are
627 using a custom grid table (specified with
\helpref{wxGrid::SetTable
}{wxgridsettable
})
628 then you must override
629 \helpref{wxGridTableBase::InsertRows
}{wxgridtablebaseinsertrows
} in your derived
632 \membersection{wxGrid::IsCellEditControlEnabled
}\label{wxgridiscelleditcontrolenabled
}
634 \constfunc{bool
}{IsCellEditControlEnabled
}{\void}
636 Returns TRUE if the in-place edit control is currently enabled.
638 \membersection{wxGrid::IsCurrentCellReadOnly
}\label{wxgridiscurrentcellreadonly
}
640 \constfunc{bool
}{IsCurrentCellReadOnly
}{\void}
642 Returns TRUE if the current cell has been set to read-only
643 (see
\helpref{wxGrid::SetReadOnly
}{wxgridsetreadonly
}).
645 \membersection{wxGrid::IsEditable
}\label{wxgridiseditable
}
647 \func{bool
}{IsEditable
}{\void}
649 Returns FALSE if the whole grid has been set as read-only or TRUE otherwise.
650 See
\helpref{wxGrid::EnableEditing
}{wxgridenableediting
} for more information about
651 controlling the editing status of grid cells.
653 \membersection{wxGrid::IsVisible
}\label{wxgridisvisible
}
655 \func{bool
}{IsVisible
}{\param{int
}{row
},
\param{int
}{col
},
656 \param{bool
}{wholeCellVisible = TRUE
}
658 \func{bool
}{IsVisible
}{\param{const wxGridCellCoords\&
}{coords
},
659 \param{bool
}{wholeCellVisible = TRUE
}}
661 Returns TRUE if a cell is either wholly visible (the default) or at least partially
662 visible in the grid window.
664 \membersection{wxGrid::MakeCellVisible
}\label{wxgridmakecellvisible
}
666 \func{void
}{MakeCellVisible
}{\param{int
}{row
},
\param{int
}{col
}}
668 \func{void
}{MakeCellVisible
}{\param{const wxGridCellCoords\&
}{coords
}}
670 Brings the specified cell into the visible grid cell area with minimal scrolling. Does
671 nothing if the cell is already visible.
673 \membersection{wxGrid::MoveCursorDown
}\label{wxgridmovecursordown
}
675 \func{bool
}{MoveCursorDown
}{\param{bool
}{expandSelection
}}
677 Moves the grid cursor down by one row. If a block of cells was previously selected it
678 will expand if the argument is TRUE or be cleared if the argument is FALSE.
680 \wxheading{Keyboard
}\\
681 This function is called for Down cursor key presses or Shift+Down to expand a selection.
683 \membersection{wxGrid::MoveCursorLeft
}\label{wxgridmovecursorleft
}
685 \func{bool
}{MoveCursorLeft
}{\param{bool
}{expandSelection
}}
687 Moves the grid cursor left by one column. If a block of cells was previously selected it
688 will expand if the argument is TRUE or be cleared if the argument is FALSE.
690 \wxheading{Keyboard
}\\
691 This function is called for Left cursor key presses or Shift+Left to expand a selection.
693 \membersection{wxGrid::MoveCursorRight
}\label{wxgridmovecursorright
}
695 \func{bool
}{MoveCursorRight
}{\param{bool
}{expandSelection
}}
697 Moves the grid cursor right by one column. If a block of cells was previously selected it
698 will expand if the argument is TRUE or be cleared if the argument is FALSE.
700 \wxheading{Keyboard
}\\
701 This function is called for Right cursor key presses or Shift+Right to expand a selection.
703 \membersection{wxGrid::MoveCursorUp
}\label{wxgridmovecursorup
}
705 \func{bool
}{MoveCursorUp
}{\param{bool
}{expandSelection
}}
707 Moves the grid cursor up by one row. If a block of cells was previously selected it
708 will expand if the argument is TRUE or be cleared if the argument is FALSE.
710 \wxheading{Keyboard
}\\
711 This function is called for Up cursor key presses or Shift+Up to expand a selection.
713 \membersection{wxGrid::MoveCursorDownBlock
}\label{wxgridmovecursordownblock
}
715 \func{bool
}{MoveCursorDownBlock
}{\param{bool
}{expandSelection
}}
717 Moves the grid cursor down in the current column such that it skips to the beginning or
718 end of a block of non-empty cells. If a block of cells was previously selected it
719 will expand if the argument is TRUE or be cleared if the argument is FALSE.
721 \wxheading{Keyboard
}\\
722 This function is called for the Ctrl+Down key combination. Shift+Ctrl+Down expands a selection.
724 \membersection{wxGrid::MoveCursorLeftBlock
}\label{wxgridmovecursorleftblock
}
726 \func{bool
}{MoveCursorLeftBlock
}{\param{bool
}{expandSelection
}}
728 Moves the grid cursor left in the current row such that it skips to the beginning or
729 end of a block of non-empty cells. If a block of cells was previously selected it
730 will expand if the argument is TRUE or be cleared if the argument is FALSE.
732 \wxheading{Keyboard
}\\
733 This function is called for the Ctrl+Left key combination. Shift+Ctrl+left expands a selection.
735 \membersection{wxGrid::MoveCursorRightBlock
}\label{wxgridmovecursorrightblock
}
737 \func{bool
}{MoveCursorRightBlock
}{\param{bool
}{expandSelection
}}
739 Moves the grid cursor right in the current row such that it skips to the beginning or
740 end of a block of non-empty cells. If a block of cells was previously selected it
741 will expand if the argument is TRUE or be cleared if the argument is FALSE.
743 \wxheading{Keyboard
}\\
744 This function is called for the Ctrl+Right key combination. Shift+Ctrl+Right expands a selection.
746 \membersection{wxGrid::MoveCursorUpBlock
}\label{wxgridmovecursorupblock
}
748 \func{bool
}{MoveCursorUpBlock
}{\param{bool
}{expandSelection
}}
750 Moves the grid cursor up in the current column such that it skips to the beginning or
751 end of a block of non-empty cells. If a block of cells was previously selected it
752 will expand if the argument is TRUE or be cleared if the argument is FALSE.
754 \wxheading{Keyboard
}\\
755 This function is called for the Ctrl+Up key combination. Shift+Ctrl+Up expands a selection.
757 \membersection{wxGrid::MovePageDown
}\label{wxgridmovepagedown
}
759 \func{bool
}{MovePageDown
}{\void}
761 Moves the grid cursor down by some number of rows so that the previous bottom visible row
762 becomes the top visible row.
764 \wxheading{Keyboard
}\\
765 This function is called for PgDn keypresses.
767 \membersection{wxGrid::MovePageUp
}\label{wxgridmovepageup
}
769 \func{bool
}{MovePageUp
}{\void}
771 Moves the grid cursor up by some number of rows so that the previous top visible row
772 becomes the bottom visible row.
774 \wxheading{Keyboard
}\\
775 This function is called for PgUp keypresses.
777 \membersection{wxGrid::SaveEditControlValue
}\label{wxgridsaveeditcontrolvalue
}
779 \func{void
}{SaveEditControlValue
}{\void}
781 Sets the value of the current grid cell to the current in-place edit control value.
782 This is called automatically when the grid cursor moves from the current cell to a
783 new cell. It is also a good idea to call this function when closing a grid since
784 any edits to the final cell location will not be saved otherwise.
786 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
788 \func{void
}{SetCellAlignment
}{\param{int
}{row
},
\param{int
}{col
},
\param{int
}{horiz
},
\param{int
}{vert
}}
790 Sets the horizontal and vertial alignment for grid cell text at the specified location.
792 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
793 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
795 \membersection{wxGrid::SetCellEditor
}\label{wxgridsetcelleditor
}
797 \func{void
}{SetCellEditor
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellEditor*
}{editor
}}
799 Sets the editor for the grid cell at the specified location.
800 The grid will take ownership of the pointer.
802 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
803 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
805 \membersection{wxGrid::SetCellFont
}\label{wxgridsetcellfont
}
807 \func{void
}{SetCellFont
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxFont\&
}}
809 Sets the font for text in the grid cell at the specified location.
811 \membersection{wxGrid::SetCellRenderer
}\label{wxgridsetcellrenderer
}
813 \func{void
}{SetCellRenderer
}{\param{int
}{row
},
\param{int
}{col
},
\param{wxGridCellRenderer*
}{renderer
}}
815 Sets the renderer for the grid cell at the specified location.
816 The grid will take ownership of the pointer.
818 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
819 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
821 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
823 \func{void
}{SetCellTextColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxColour\&
}}
825 Sets the text colour for the grid cell at the specified location.
827 \membersection{wxGrid::SetColAttr
}\label{wxgridsetcolattr
}
829 \func{void
}{SetColAttr
}{\param{int
}{col
},
\param{wxGridCellAttr*
}{attr
}}
831 Sets the cell attributes for all cells in the specified column.
833 For more information about controlling grid cell attributes see the
834 \helpref{wxGridCellAttr
}{wxgridcellattr
} cell attribute class and the
835 \helpref{wxGrid classes overview
}{gridoverview
}.
837 \membersection{wxGrid::SetColFormatBool
}\label{wxgridsetcolformatbool
}
839 \func{void
}{SetColFormatBool
}{\param{int
}{col
}}
841 Sets the specified column to display boolean values. wxGrid displays boolean values with a checkbox.
843 \membersection{wxGrid::SetColFormatNumber
}\label{wxgridsetcolformatnumber
}
845 \func{void
}{SetColFormatNumber
}{\param{int
}{col
}}
847 Sets the specified column to display integer values.
849 \membersection{wxGrid::SetColFormatFloat
}\label{wxgridsetcolformatfloat
}
851 \func{void
}{SetColFormatFloat
}{\param{int
}{col
},
\param{int
}{width = -
1},
\param{int
}{precision = -
1}}
853 Sets the specified column to display floating point values with the given width and precision.
855 \membersection{wxGrid::SetColFormatCustom
}\label{wxgridsetcolformatcustom
}
857 \func{void
}{SetColFormatCustom
}{\param{int
}{col
},
\param{const wxString\&
}{typeName
}}
859 Sets the specified column to display data in a custom format.
860 See the
\helpref{wxGrid overview
}{gridoverview
} for more information on working
861 with custom data types.
863 \membersection{wxGrid::SetColLabelAlignment
}\label{wxgridsetcollabelalignment
}
865 \func{void
}{SetColLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
867 Sets the horizontal and vertical alignment of column label text.
869 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
870 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
872 \membersection{wxGrid::SetColLabelSize
}\label{wxgridsetcollabelsize
}
874 \func{void
}{SetColLabelSize
}{\param{int
}{height
}}
876 Sets the height of the column labels.
878 \membersection{wxGrid::SetColLabelValue
}\label{wxgridsetcollabelvalue
}
880 \func{void
}{SetColLabelValue
}{\param{int
}{col
},
\param{const
}{wxString\&
}}
882 Set the value for the given column label. If you are using a derived grid table you must
883 override
\helpref{wxGridTableBase::SetColLabelValue
}{wxgridtablebasesetcollabelvalue
}
884 for this to have any effect.
886 \membersection{wxGrid::SetColMinimalWidth
}\label{wxgridsetcolminimalwidth
}
888 \func{void
}{SetColMinimalWidth
}{\param{int
}{col
},
\param{int
}{width
}}
890 Sets the minimal width for the specified column. This should normally be called when creating the grid
891 because it will not resize a column that is already narrower than the minimal width.
893 \membersection{wxGrid::SetColSize
}\label{wxgridsetcolsize
}
895 \func{void
}{SetColSize
}{\param{int
}{col
},
\param{int
}{width
}}
897 Sets the width of the specified column.
899 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
900 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
902 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
903 also be set as the minimal width for the column.
906 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
907 The memory requirements for this could become prohibitive if your grid is very large.
909 \membersection{wxGrid::SetDefaultCellAlignment
}\label{wxgridsetdefaultcellalignment
}
911 \func{void
}{SetDefaultCellAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
913 Sets the default horizontal and vertial alignment for grid cell text.
915 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
916 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
918 \membersection{wxGrid::SetDefaultCellBackgroundColour
}\label{wxgridsetdefaultcellbackgroundcolour
}
920 \func{void
}{SetDefaultCellBackgroundColour
}{\param{const
}{wxColour\&
}}
922 Sets the default background colour for grid cells.
924 \membersection{wxGrid::SetDefaultCellFont
}\label{wxgridsetdefaultcellfont
}
926 \func{void
}{SetDefaultCellFont
}{\param{const
}{wxFont\&
}}
928 Sets the default font to be used for grid cell text.
930 \membersection{wxGrid::SetDefaultEditor
}\label{wxgridsetdefaulteditor
}
932 \func{void
}{SetDefaultEditor
}{\param{wxGridCellEditor*
}{editor
}}
934 Sets the default editor for grid cells. The grid will take ownership of the pointer.
936 See
\helpref{wxGridCellEditor
}{wxgridcelleditor
} and
937 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
939 \membersection{wxGrid::SetDefaultRenderer
}\label{wxgridsetdefaultrenderer
}
941 \func{void
}{SetDefaultRenderer
}{\param{wxGridCellRenderer*
}{renderer
}}
943 Sets the default renderer for grid cells. The grid will take ownership of the pointer.
945 See
\helpref{wxGridCellRenderer
}{wxgridcellrenderer
} and
946 the
\helpref{wxGrid overview
}{gridoverview
} for more information about cell editors and renderers.
948 \membersection{wxGrid::SetDefaultColSize
}\label{wxgridsetdefaultcolsize
}
950 \func{void
}{SetDefaultColSize
}{\param{int
}{width
},
\param{bool
}{resizeExistingCols = FALSE
}}
952 Sets the default width for columns in the grid. This will only affect columns subsequently added to
953 the grid unless resizeExistingCols is TRUE.
955 \membersection{wxGrid::SetDefaultRowSize
}\label{wxgridsetdefaultrowsize
}
957 \func{void
}{SetDefaultRowSize
}{\param{int
}{height
},
\param{bool
}{resizeExistingRows = FALSE
}}
959 Sets the default height for rows in the grid. This will only affect rows subsequently added
960 to the grid unless resizeExistingRows is TRUE.
962 \membersection{wxGrid::SetGridCursor
}\label{wxgridsetgridcursor
}
964 \func{void
}{SetGridCursor
}{\param{int
}{row
},
\param{int
}{col
}}
966 Set the grid cursor to the specified cell.
967 This function calls
\helpref{wxGrid::MakeCellVisible
}{wxgridmakecellvisible
}.
969 \membersection{wxGrid::SetGridLineColour
}\label{wxgridsetgridlinecolour
}
971 \func{void
}{SetGridLineColour
}{\param{const
}{wxColour\&
}}
973 Sets the colour used to draw grid lines.
975 \membersection{wxGrid::SetLabelBackgroundColour
}\label{wxgridsetlabelbackgroundcolour
}
977 \func{void
}{SetLabelBackgroundColour
}{\param{const
}{wxColour\&
}}
979 Sets the background colour for row and column labels.
981 \membersection{wxGrid::SetLabelFont
}\label{wxgridsetlabelfont
}
983 \func{void
}{SetLabelFont
}{\param{const
}{wxFont\&
}}
985 Sets the font for row and column labels.
987 \membersection{wxGrid::SetLabelTextColour
}\label{wxgridsetlabeltextcolour
}
989 \func{void
}{SetLabelTextColour
}{\param{const
}{wxColour\&
}}
991 Sets the colour for row and column label text.
993 \membersection{wxGrid::SetRowAttr
}\label{wxgridsetrowattr
}
995 \func{void
}{SetRowAttr
}{\param{int
}{row
},
\param{wxGridCellAttr*
}{attr
}}
997 Sets the cell attributes for all cells in the specified row.
998 See the
\helpref{wxGridCellAttr
}{wxgridcellattr
} class for more information
999 about controlling cell attributes.
1001 \membersection{wxGrid::SetRowLabelAlignment
}\label{wxgridsetrowlabelalignment
}
1003 \func{void
}{SetRowLabelAlignment
}{\param{int
}{horiz
},
\param{int
}{vert
}}
1005 Sets the horizontal and vertical alignment of row label text.
1007 Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. \\
1008 Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.
1010 \membersection{wxGrid::SetRowLabelSize
}\label{wxgridsetrowlabelsize
}
1012 \func{void
}{SetRowLabelSize
}{\param{int
}{width
}}
1014 Sets the width of the row labels.
1016 \membersection{wxGrid::SetRowLabelValue
}\label{wxgridsetrowlabelvalue
}
1018 \func{void
}{SetRowLabelValue
}{\param{int
}{row
},
\param{const
}{wxString\&
}}
1020 Set the value for the given row label. If you are using a derived grid table you must
1021 override
\helpref{wxGridTableBase::SetRowLabelValue
}{wxgridtablebasesetrowlabelvalue
}
1022 for this to have any effect.
1024 \membersection{wxGrid::SetRowMinimalHeight
}\label{wxgridsetrowminimalheight
}
1026 \func{void
}{SetRowMinimalHeight
}{\param{int
}{row
},
\param{int
}{width
}}
1028 Sets the minimal height for the specified row. This should normally be called when creating the grid
1029 because it will not resize a row that is already shorter than the minimal height.
1031 \membersection{wxGrid::SetRowSize
}\label{wxgridsetrowsize
}
1033 \func{void
}{SetRowSize
}{\param{int
}{row
},
\param{int
}{height
}}
1035 Sets the height of the specified row.
1037 This function does not refresh the grid. If you are calling it outside of a BeginBatch / EndBatch
1038 block you can use
\helpref{wxGrid::ForceRefresh
}{wxgridforcerefresh
} to see the changes.
1040 Automatically sizes the column to fit its contents. If setAsMin is TRUE the calculated width will
1041 also be set as the minimal width for the column.
1044 wxGrid sets up arrays to store individual row and column sizes when non-default sizes are used.
1045 The memory requirements for this could become prohibitive if your grid is very large.
1047 \membersection{wxGrid::SetSelectionMode
}\label{wxgridsetselectionmode
}
1049 \func{void
}{SetSelectionMode
}{\param{wxGrid::wxGridSelectionModes
}{selmode
}}
1051 Set the selection behaviour of the grid.
1053 \wxheading{Parameters
}
1055 \docparam{wxGrid::wxGridSelectCells
}{The default mode where individual cells are selected.
}
1057 \docparam(wxGrid::wxGridSelectRows
}{Selections will consist of whole rows.
}
1059 \docparam{wxGrid::wxGridSelectionColumns
}{Selections will consist of whole columns.
}
1061 \membersection{wxGrid::SetTable
}\label{wxgridsettable
}
1063 \func{bool
}{SetTable
}{\param{wxGridTableBase*
}{table
},
\param{bool
}{takeOwnership = FALSE
},
\param{wxGrid::wxGridSelectionModes
}{selmode = wxGrid::wxGridSelectCells
}}
1065 Passes a pointer to a custom grid table to be used by the grid. This should be called
1066 after the grid constructor and before using the grid object. If takeOwnership is set to
1067 TRUE then the table will be deleted by the wxGrid destructor.
1069 Use this function instead of
\helpref{wxGrid::CreateGrid
}{wxgridcreategrid
} when your
1070 application involves complex or non-string data or data sets that are too large to fit
1073 \membersection{wxGrid::ShowCellEditControl
}\label{wxgridshowcelleditcontrol
}
1075 \func{void
}{ShowCellEditControl
}{\void}
1077 Displays the in-place cell edit control for the current cell.
1079 \membersection{wxGrid::XToCol
}\label{wxgridxtocol
}
1081 \func{int
}{XToCol
}{\param{int
}{x
}}
1083 Returns the grid column that corresponds to the logical x coordinate. Returns
1084 wxNOT_FOUND if there is no column at the x position.
1086 \membersection{wxGrid::XToEdgeOfCol
}\label{wxgridxtoedgeofcol
}
1088 \func{int
}{XToEdgeOfCol
}{\param{int
}{x
}}
1090 Returns the column whose right hand edge is close to the given logical x position.
1091 If no column edge is near to this position wxNOT_FOUND is returned.
1093 \membersection{wxGrid::YToEdgeOfRow
}\label{wxgridytoedgeofrow
}
1095 \func{int
}{YToEdgeOfRow
}{\param{int
}{y
}}
1097 Returns the row whose bottom edge is close to the given logical y position.
1098 If no row edge is near to this position wxNOT_FOUND is returned.
1100 \membersection{wxGrid::YToRow
}\label{wxgridytorow
}
1102 \func{int
}{YToRow
}{\param{int
}{y
}}
1104 Returns the grid row that corresponds to the logical y coordinate. Returns
1105 wxNOT_FOUND if there is no row at the y position.
1109 \membersection{wxGrid::GetCellValue
}\label{wxgridgetcellvalue
}
1111 \func{wxString
}{GetCellValue
}{\param{int
}{row
},
\param{int
}{col
}}
1113 \func{wxString
}{GetCellValue
}{\param{const wxGridCellCoords\&
}{coords
}}
1116 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
1118 \func{void
}{SetCellValue
}{\param{int
}{row
},
\param{int
}{col
},
\param{const wxString\&
}{s
}}
1120 \func{void
}{SetCellValue
}{\param{const wxGridCellCoords\&
}{coords
},
\param{const wxString\&
}{s
}}
1123 \membersection{wxGrid::IsReadOnly
}\label{wxgridisreadonly
}
1125 \constfunc{bool
}{IsReadOnly
}{\param{int
}{row
},
\param{int
}{col
}}
1127 returns TRUE if the cell can't be edited
1130 \membersection{wxGrid::SetReadOnly
}\label{wxgridsetreadonly
}
1132 \func{void
}{SetReadOnly
}{\param{int
}{row
},
\param{int
}{col
},
\param{bool
}{isReadOnly = TRUE
}}
1134 make the cell editable/readonly
1137 \membersection{wxGrid::SelectRow
}\label{wxgridselectrow
}
1139 \func{void
}{SelectRow
}{\param{int
}{row
},
\param{bool
}{addToSelected = FALSE
}}
1141 ------ selections of blocks of cells
1144 \membersection{wxGrid::SelectCol
}\label{wxgridselectcol
}
1146 \func{void
}{SelectCol
}{\param{int
}{col
},
\param{bool
}{addToSelected = FALSE
}}
1149 \membersection{wxGrid::SelectBlock
}\label{wxgridselectblock
}
1151 \func{void
}{SelectBlock
}{\param{int
}{topRow
},
\param{int
}{leftCol
},
\param{int
}{bottomRow
},
\param{int
}{rightCol
}}
1153 \func{void
}{SelectBlock
}{\param{const wxGridCellCoords\&
}{topLeft
},
\param{const wxGridCellCoords\&
}{bottomRight
}}
1156 \membersection{wxGrid::SelectAll
}\label{wxgridselectall
}
1158 \func{void
}{SelectAll
}{\void}
1161 \membersection{wxGrid::IsSelection
}\label{wxgridisselection
}
1163 \func{bool
}{IsSelection
}{\void}
1166 \membersection{wxGrid::ClearSelection
}\label{wxgridclearselection
}
1168 \func{void
}{ClearSelection
}{\void}
1171 \membersection{wxGrid::IsInSelection
}\label{wxgridisinselection
}
1173 \func{bool
}{IsInSelection
}{\param{int
}{row
},
\param{int
}{col
}}
1175 \func{bool
}{IsInSelection
}{\param{const wxGridCellCoords\&
}{coords
}}
1178 \membersection{wxGrid::BlockToDeviceRect
}\label{wxgridblocktodevicerect
}
1180 \func{wxRect
}{BlockToDeviceRect
}{\param{const wxGridCellCoords \&
}{topLeft
},
\param{const wxGridCellCoords \&
}{bottomRight
}}
1182 This function returns the rectangle that encloses the block of cells
1183 limited by TopLeft and BottomRight cell in device coords and clipped
1184 to the client size of the grid window.
1187 \membersection{wxGrid::SelectionToDeviceRect
}\label{wxgridselectiontodevicerect
}
1189 \func{wxRect
}{SelectionToDeviceRect
}{\void}
1191 This function returns the rectangle that encloses the selected cells
1192 in device coords and clipped to the client size of the grid window.
1195 \membersection{wxGrid::GetSelectionBackground
}\label{wxgridgetselectionbackground
}
1197 \constfunc{wxColour
}{GetSelectionBackground
}{\void}
1199 Access or update the selection fore/back colours
1202 \membersection{wxGrid::GetSelectionForeground
}\label{wxgridgetselectionforeground
}
1204 \constfunc{wxColour
}{GetSelectionForeground
}{\void}
1207 \membersection{wxGrid::SetSelectionBackground
}\label{wxgridsetselectionbackground
}
1209 \func{void
}{SetSelectionBackground
}{\param{const wxColour\&
}{c
}}
1212 \membersection{wxGrid::SetSelectionForeground
}\label{wxgridsetselectionforeground
}
1214 \func{void
}{SetSelectionForeground
}{\param{const wxColour\&
}{c
}}
1217 \membersection{wxGrid::RegisterDataType
}\label{wxgridregisterdatatype
}
1219 \func{void
}{RegisterDataType
}{\param{const wxString\&
}{typeName
},
\param{wxGridCellRenderer*
}{renderer
},
\param{wxGridCellEditor*
}{editor
}}
1221 Methods for a registry for mapping data types to Renderers/Editors
1224 \membersection{wxGrid::GetDefaultEditorForCell
}\label{wxgridgetdefaulteditorforcell
}
1226 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1228 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForCell
}{\param{const wxGridCellCoords\&
}{c
}}
1231 \membersection{wxGrid::GetDefaultRendererForCell
}\label{wxgridgetdefaultrendererforcell
}
1233 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForCell
}{\param{int
}{row
},
\param{int
}{col
}}
1236 \membersection{wxGrid::GetDefaultEditorForType
}\label{wxgridgetdefaulteditorfortype
}
1238 \constfunc{wxGridCellEditor*
}{GetDefaultEditorForType
}{\param{const wxString\&
}{typeName
}}
1241 \membersection{wxGrid::GetDefaultRendererForType
}\label{wxgridgetdefaultrendererfortype
}
1243 \constfunc{wxGridCellRenderer*
}{GetDefaultRendererForType
}{\param{const wxString\&
}{typeName
}}
1246 \membersection{wxGrid::SetMargins
}\label{wxgridsetmargins
}
1248 \func{void
}{SetMargins
}{\param{int
}{extraWidth
},
\param{int
}{extraHeight
}}
1250 grid may occupy more space than needed for its rows/columns, this
1251 function allows to set how big this extra space is
1254 \membersection{wxGrid::wxGrid
}\label{wxgridwxgrid
}
1256 \func{}{wxGrid
}{\param{wxWindow*
}{parent
},
\param{int
}{x
},
\param{int
}{y
},
\param{int
}{w = -
1},
\param{int
}{h = -
1},
\param{long
}{style = wxWANTS
\_CHARS},
\param{const wxString\&
}{name = wxPanelNameStr
}}
1258 ------ For compatibility with previous wxGrid only...
1260 ** Don't use these in new code because they **
1261 ** are liable to disappear in a future **
1266 \membersection{wxGrid::SetCellValue
}\label{wxgridsetcellvalue
}
1268 \func{void
}{SetCellValue
}{\param{const wxString\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
1271 \membersection{wxGrid::UpdateDimensions
}\label{wxgridupdatedimensions
}
1273 \func{void
}{UpdateDimensions
}{\void}
1276 \membersection{wxGrid::GetRows
}\label{wxgridgetrows
}
1278 \func{int
}{GetRows
}{\void}
1281 \membersection{wxGrid::GetCols
}\label{wxgridgetcols
}
1283 \func{int
}{GetCols
}{\void}
1286 \membersection{wxGrid::GetCursorRow
}\label{wxgridgetcursorrow
}
1288 \func{int
}{GetCursorRow
}{\void}
1291 \membersection{wxGrid::GetCursorColumn
}\label{wxgridgetcursorcolumn
}
1293 \func{int
}{GetCursorColumn
}{\void}
1296 \membersection{wxGrid::GetScrollPosX
}\label{wxgridgetscrollposx
}
1298 \func{int
}{GetScrollPosX
}{\void}
1301 \membersection{wxGrid::GetScrollPosY
}\label{wxgridgetscrollposy
}
1303 \func{int
}{GetScrollPosY
}{\void}
1306 \membersection{wxGrid::SetScrollX
}\label{wxgridsetscrollx
}
1308 \func{void
}{SetScrollX
}{\param{int
}{WXUNUSED(x)
}}
1311 \membersection{wxGrid::SetScrollY
}\label{wxgridsetscrolly
}
1313 \func{void
}{SetScrollY
}{\param{int
}{WXUNUSED(y)
}}
1316 \membersection{wxGrid::SetColumnWidth
}\label{wxgridsetcolumnwidth
}
1318 \func{void
}{SetColumnWidth
}{\param{int
}{col
},
\param{int
}{width
}}
1321 \membersection{wxGrid::GetColumnWidth
}\label{wxgridgetcolumnwidth
}
1323 \func{int
}{GetColumnWidth
}{\param{int
}{col
}}
1326 \membersection{wxGrid::SetRowHeight
}\label{wxgridsetrowheight
}
1328 \func{void
}{SetRowHeight
}{\param{int
}{row
},
\param{int
}{height
}}
1331 \membersection{wxGrid::GetViewHeight
}\label{wxgridgetviewheight
}
1333 \func{int
}{GetViewHeight
}{\void}
1335 GetRowHeight() is below
1336 returned num whole rows visible
1339 \membersection{wxGrid::GetViewWidth
}\label{wxgridgetviewwidth
}
1341 \func{int
}{GetViewWidth
}{\void}
1343 returned num whole cols visible
1346 \membersection{wxGrid::SetLabelSize
}\label{wxgridsetlabelsize
}
1348 \func{void
}{SetLabelSize
}{\param{int
}{orientation
},
\param{int
}{sz
}}
1351 \membersection{wxGrid::GetLabelSize
}\label{wxgridgetlabelsize
}
1353 \func{int
}{GetLabelSize
}{\param{int
}{orientation
}}
1356 \membersection{wxGrid::SetLabelAlignment
}\label{wxgridsetlabelalignment
}
1358 \func{void
}{SetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{align
}}
1361 \membersection{wxGrid::GetLabelAlignment
}\label{wxgridgetlabelalignment
}
1363 \func{int
}{GetLabelAlignment
}{\param{int
}{orientation
},
\param{int
}{WXUNUSED(align)
}}
1366 \membersection{wxGrid::SetLabelValue
}\label{wxgridsetlabelvalue
}
1368 \func{void
}{SetLabelValue
}{\param{int
}{orientation
},
\param{const wxString\&
}{val
},
\param{int
}{pos
}}
1371 \membersection{wxGrid::GetLabelValue
}\label{wxgridgetlabelvalue
}
1373 \func{wxString
}{GetLabelValue
}{\param{int
}{orientation
},
\param{int
}{pos
}}
1376 \membersection{wxGrid::GetCellTextFont
}\label{wxgridgetcelltextfont
}
1378 \constfunc{wxFont
}{GetCellTextFont
}{\void}
1381 \membersection{wxGrid::GetCellTextFont
}\label{wxgridgetcelltextfont
}
1383 \constfunc{wxFont
}{GetCellTextFont
}{\param{int
}{WXUNUSED(row)
},
\param{int
}{WXUNUSED(col)
}}
1386 \membersection{wxGrid::SetCellTextFont
}\label{wxgridsetcelltextfont
}
1388 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
}}
1391 \membersection{wxGrid::SetCellTextFont
}\label{wxgridsetcelltextfont
}
1393 \func{void
}{SetCellTextFont
}{\param{const wxFont\&
}{fnt
},
\param{int
}{row
},
\param{int
}{col
}}
1396 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
1398 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{val
},
\param{int
}{row
},
\param{int
}{col
}}
1401 \membersection{wxGrid::SetCellTextColour
}\label{wxgridsetcelltextcolour
}
1403 \func{void
}{SetCellTextColour
}{\param{const wxColour\&
}{col
}}
1406 \membersection{wxGrid::SetCellBackgroundColour
}\label{wxgridsetcellbackgroundcolour
}
1408 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{col
}}
1410 \func{void
}{SetCellBackgroundColour
}{\param{int
}{row
},
\param{int
}{col
},
\param{const
}{wxColour\&
}}
1412 \func{void
}{SetCellBackgroundColour
}{\param{const wxColour\&
}{colour
},
\param{int
}{row
},
\param{int
}{col
}}
1415 \membersection{wxGrid::GetEditable
}\label{wxgridgeteditable
}
1417 \func{bool
}{GetEditable
}{\void}
1420 \membersection{wxGrid::SetEditable
}\label{wxgridseteditable
}
1422 \func{void
}{SetEditable
}{\param{bool
}{edit = TRUE
}}
1425 \membersection{wxGrid::GetEditInPlace
}\label{wxgridgeteditinplace
}
1427 \func{bool
}{GetEditInPlace
}{\void}
1430 \membersection{wxGrid::SetEditInPlace
}\label{wxgridseteditinplace
}
1432 \func{void
}{SetEditInPlace
}{\param{bool
}{WXUNUSED(edit) = TRUE
}}
1435 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
1437 \func{void
}{SetCellAlignment
}{\param{int
}{align
},
\param{int
}{row
},
\param{int
}{col
}}
1440 \membersection{wxGrid::SetCellAlignment
}\label{wxgridsetcellalignment
}
1442 \func{void
}{SetCellAlignment
}{\param{int
}{WXUNUSED(align)
}}
1445 \membersection{wxGrid::SetCellBitmap
}\label{wxgridsetcellbitmap
}
1447 \func{void
}{SetCellBitmap
}{\param{wxBitmap*
}{WXUNUSED(bitmap)
},
\param{int
}{WXUNUSED(row)
},
\param{int
}{WXUNUSED(col)
}}
1450 \membersection{wxGrid::SetDividerPen
}\label{wxgridsetdividerpen
}
1452 \func{void
}{SetDividerPen
}{\param{const wxPen\&
}{WXUNUSED(pen)
}}
1455 \membersection{wxGrid::GetDividerPen
}\label{wxgridgetdividerpen
}
1457 \constfunc{wxPen\&
}{GetDividerPen
}{\void}
1460 \membersection{wxGrid::OnActivate
}\label{wxgridonactivate
}
1462 \func{void
}{OnActivate
}{\param{bool
}{WXUNUSED(active)
}}
1465 \membersection{wxGrid::Fit
}\label{wxgridfit
}
1467 \func{void
}{Fit
}{\void}
1469 overridden wxWindow methods
1472 \membersection{wxGrid::DoGetBestSize
}\label{wxgriddogetbestsize
}
1474 \constfunc{wxSize
}{DoGetBestSize
}{\void}
1477 \membersection{wxGrid::InitRowHeights
}\label{wxgridinitrowheights
}
1479 \func{void
}{InitRowHeights
}{\void}
1481 NB: *never* access m
\_row/col arrays directly because they are created
1482 on demand, *always* use accessor functions instead!
1483 init the m
\_rowHeights/Bottoms arrays with default values
1486 \membersection{wxGrid::InitColWidths
}\label{wxgridinitcolwidths
}
1488 \func{void
}{InitColWidths
}{\void}
1490 init the m
\_colWidths/Rights arrays
1493 \membersection{wxGrid::GetColWidth
}\label{wxgridgetcolwidth
}
1495 \constfunc{int
}{GetColWidth
}{\param{int
}{col
}}
1497 get the col/row coords
1500 \membersection{wxGrid::GetColLeft
}\label{wxgridgetcolleft
}
1502 \constfunc{int
}{GetColLeft
}{\param{int
}{col
}}
1505 \membersection{wxGrid::GetColRight
}\label{wxgridgetcolright
}
1507 \constfunc{int
}{GetColRight
}{\param{int
}{col
}}
1510 \membersection{wxGrid::GetRowHeight
}\label{wxgridgetrowheight
}
1512 \constfunc{int
}{GetRowHeight
}{\param{int
}{row
}}
1514 this function must be public for compatibility...
1517 \membersection{wxGrid::GetRowTop
}\label{wxgridgetrowtop
}
1519 \constfunc{int
}{GetRowTop
}{\param{int
}{row
}}
1522 \membersection{wxGrid::GetRowBottom
}\label{wxgridgetrowbottom
}
1524 \constfunc{int
}{GetRowBottom
}{\param{int
}{row
}}
1527 \membersection{wxGrid::SetOrCalcColumnSizes
}\label{wxgridsetorcalccolumnsizes
}
1529 \func{int
}{SetOrCalcColumnSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1531 common part of AutoSizeColumn/Row() and GetBestSize()
1534 \membersection{wxGrid::SetOrCalcRowSizes
}\label{wxgridsetorcalcrowsizes
}
1536 \func{int
}{SetOrCalcRowSizes
}{\param{bool
}{calcOnly
},
\param{bool
}{setAsMin = TRUE
}}
1539 \membersection{wxGrid::AutoSizeColOrRow
}\label{wxgridautosizecolorrow
}
1541 \func{void
}{AutoSizeColOrRow
}{\param{int
}{n
},
\param{bool
}{setAsMin
},
\param{bool
}{column
}}
1543 common part of AutoSizeColumn/Row()
1546 \membersection{wxGrid::GetColMinimalWidth
}\label{wxgridgetcolminimalwidth
}
1548 \constfunc{int
}{GetColMinimalWidth
}{\param{int
}{col
}}
1550 get the minimal width of the given column/row
1553 \membersection{wxGrid::GetRowMinimalHeight
}\label{wxgridgetrowminimalheight
}
1555 \constfunc{int
}{GetRowMinimalHeight
}{\param{int
}{col
}}
1558 \membersection{wxGrid::CanHaveAttributes
}\label{wxgridcanhaveattributes
}
1560 \func{bool
}{CanHaveAttributes
}{\void}
1562 do we have some place to store attributes in?
1565 \membersection{wxGrid::GetOrCreateCellAttr
}\label{wxgridgetorcreatecellattr
}
1567 \constfunc{wxGridCellAttr*
}{GetOrCreateCellAttr
}{\param{int
}{row
},
\param{int
}{col
}