]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxGrid}}\label{wxgrid} |
2 | ||
3 | wxGrid is a class for displaying and editing tabular information. | |
4 | ||
fa482912 JS |
5 | {\bf Note:} there is a new grid implementation from wxWindows 2.1.14, |
6 | with an API that is backwardly compatible with the one documented here. | |
7 | This documentation is awaiting updates for the new and improved API. | |
8 | ||
a660d684 KB |
9 | \wxheading{Derived from} |
10 | ||
11 | \helpref{wxPanel}{wxpanel}\\ | |
12 | \helpref{wxWindow}{wxwindow}\\ | |
13 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
14 | \helpref{wxObject}{wxobject} | |
15 | ||
954b8ae6 JS |
16 | \wxheading{Include files} |
17 | ||
18 | <wx/grid.h> | |
19 | ||
a660d684 KB |
20 | \wxheading{Window styles} |
21 | ||
c0b042fc VZ |
22 | There are no specific window styles for this class, but you may use different |
23 | SetXXX() functions to change the controls behaviour (for example, to enable | |
24 | in-place editing). | |
a660d684 KB |
25 | |
26 | See also \helpref{window styles overview}{windowstyles}. | |
27 | ||
28 | \wxheading{See also} | |
29 | ||
30 | \helpref{wxGrid classes overview}{gridoverview} | |
31 | ||
32 | \latexignore{\rtfignore{\wxheading{Members}}} | |
33 | ||
34 | \membersection{wxGrid::wxGrid}\label{wxgridconstr} | |
35 | ||
eaaa6a06 JS |
36 | \func{void}{wxGrid}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id}, \param{const wxPoint\&}{ pos}, |
37 | \rtfsp\param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="grid"}} | |
a660d684 KB |
38 | |
39 | Constructor. Before using a wxGrid object, you must call CreateGrid to set up the required rows and columns. | |
40 | ||
41 | \membersection{wxGrid::AdjustScrollbars}\label{wxgridadjustscrollbars} | |
42 | ||
43 | \func{void}{AdjustScrollbars}{\void} | |
44 | ||
45 | Call this function whenever a change has been made via the API that might alter the scrollbar characteristics: | |
46 | particularly when adding or deleting rows, or changing row or column dimensions. For example, | |
47 | removing rows might make it unnecessary to show the vertical scrollbar. | |
48 | ||
49 | \membersection{wxGrid::AppendCols}\label{wxgridappendcols} | |
50 | ||
51 | \func{bool}{AppendCols}{\param{int}{ n=1}, \param{bool}{ updateLabels=TRUE}} | |
52 | ||
53 | Appends {\it n} columns to the grid. If {\it updateLabels} is TRUE, | |
54 | the function OnChangeLabels is called to give the application the opportunity to relabel. | |
55 | ||
56 | \membersection{wxGrid::AppendRows}\label{wxgridappendrows} | |
57 | ||
58 | \func{bool}{AppendRows}{\param{int}{ n=1}, \param{bool}{ updateLabels=TRUE}} | |
59 | ||
60 | Appends {\it n} rows to the grid. If {\it updateLabels} is TRUE, | |
61 | the function OnChangeLabels is called to give the application the opportunity to relabel. | |
62 | ||
63 | \membersection{wxGrid::BeginBatch}\label{wxgridbeginbatch} | |
64 | ||
65 | \func{void}{BeginBatch}{\void} | |
66 | ||
67 | Start a BeginBatch/EndBatch pair between which, calls to SetCellValue or | |
68 | SetCellBitmap will not cause a refresh. This allows you to speed up some operations | |
69 | (for example, setting several hundred cell values). You can nest, but not overlap, | |
70 | these two functions. | |
71 | ||
72 | See also \helpref{wxGrid::EndBatch}{wxgridendbatch}, \helpref{wxGrid::GetBatchCount}{wxgridgetbatchcount}. | |
73 | ||
74 | \membersection{wxGrid::CellHitTest}\label{wxgridcellhittest} | |
75 | ||
76 | \func{bool}{CellHitTest}{\param{int}{ x}, \param{int}{ y}, \param{int *}{row}, \param{int *}{col}} | |
77 | ||
78 | Returns TRUE if the x, y panel position coincides with a cell. If so, {\it row} and {\it col} are | |
79 | returned. | |
80 | ||
81 | \membersection{wxGrid::CreateGrid}\label{wxgridcreategrid} | |
82 | ||
83 | \func{bool}{CreateGrid}{\param{int}{ rows}, \param{int}{ cols}, \param{wxString **}{cellValues=NULL}, | |
84 | \param{short *}{widths=NULL}, \param{short}{ defaultWidth=wxGRID\_DEFAULT\_CELL\_WIDTH}, | |
85 | \param{short}{ defaultHeight=wxGRID\_DEFAULT\_CELL\_HEIGHT}} | |
86 | ||
87 | Creates a grid {\it rows} high and {\it cols} wide. You can optionally specify an array of initial values | |
88 | and widths, and/or default cell width and height. | |
89 | ||
90 | Call this function after creating the wxGrid object. | |
91 | ||
c9110876 | 92 | \pythonnote{Currently the {\tt cellValues} and {\tt widths} parameters |
21f280f4 RD |
93 | don't exisit in the wxPython version of this method. So in other |
94 | words, the definition of the wxPython version of this method looks like this: | |
95 | \begin{verbatim} | |
96 | CreateGrid(rows, cols, | |
97 | defaultWidth = wxGRID_DEFAULT_CELL_WIDTH, | |
98 | defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT) | |
99 | \end{verbatim} | |
100 | } | |
101 | ||
a660d684 KB |
102 | \membersection{wxGrid::CurrentCellVisible}\label{wxgridcurrentcellvisible} |
103 | ||
104 | \func{bool}{CurrentCellVisible}{\void} | |
105 | ||
106 | Returns TRUE if the currently selected cell is visible, FALSE otherwise. | |
107 | ||
108 | \membersection{wxGrid::DeleteCols}\label{wxgriddeletecols} | |
109 | ||
110 | \func{bool}{DeleteCols}{\param{int}{ pos=0}, \param{int}{ n=1}, \param{bool}{ updateLabels=TRUE}} | |
111 | ||
112 | Deletes {\it n} columns from the grid at position {\it pos}. If {\it updateLabels} is TRUE, | |
113 | the function OnChangeLabels is called to give the application the opportunity to relabel. | |
114 | ||
115 | \membersection{wxGrid::DeleteRows}\label{wxgriddeleterows} | |
116 | ||
117 | \func{bool}{DeleteRows}{\param{int}{ pos=0}, \param{int}{ n=1}, \param{bool}{ updateLabels=TRUE}} | |
118 | ||
119 | Deletes {\it n} rows from the grid at position {\it pos}. If {\it updateLabels} is TRUE, | |
120 | the function OnChangeLabels is called to give the application the opportunity to relabel. | |
121 | ||
122 | \membersection{wxGrid::EndBatch}\label{wxgridendbatch} | |
123 | ||
124 | \func{void}{EndBatch}{\void} | |
125 | ||
126 | End a BeginBatch/EndBatch pair between which, calls to SetCellValue or | |
127 | SetCellBitmap will not cause a refresh. This allows you to speed up some operations | |
128 | (for example, setting several hundred cell values). You can nest, but not overlap, | |
129 | these two functions. | |
130 | ||
131 | See also \helpref{wxGrid::BeginBatch}{wxgridbeginbatch}, \helpref{wxGrid::GetBatchCount}{wxgridgetbatchcount}. | |
132 | ||
133 | \membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount} | |
134 | ||
c0ed460c | 135 | \constfunc{int}{GetBatchCount}{\void} |
a660d684 KB |
136 | |
137 | Return the level of batch nesting. This is initially zero, and will be incremented | |
138 | every time BeginBatch is called, and decremented when EndBatch is called. When the | |
139 | batch count is more zero, some functions (such as SetCellValue and SetCellBitmap) will | |
140 | not refresh the cell. | |
141 | ||
142 | See also \helpref{wxGrid::BeginBatch}{wxgridbeginbatch}, \helpref{wxGrid::EndBatch}{wxgridendbatch}. | |
143 | ||
144 | \membersection{wxGrid::GetCell}\label{wxgridgetcell} | |
145 | ||
c0ed460c | 146 | \constfunc{wxGridCell *}{GetCell}{\param{int}{ row}, \param{int}{ col}} |
a660d684 KB |
147 | |
148 | Returns the grid cell object associated with this position. | |
149 | ||
150 | wxGenericGrid implementation only. | |
151 | ||
152 | \membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment} | |
153 | ||
c0ed460c | 154 | \constfunc{int}{GetCellAlignment}{\param{int}{ row}, \param{int}{ col}} |
a660d684 | 155 | |
c0ed460c | 156 | \constfunc{int}{GetCellAlignment}{\void} |
a660d684 KB |
157 | |
158 | Sets the text alignment for the cell at the given position, or the global alignment value. | |
159 | The return value is wxLEFT, wxRIGHT or wxCENTRE. | |
160 | ||
21f280f4 RD |
161 | \pythonnote{In place of a single overloaded method name, wxPython |
162 | implements the following methods:\par | |
163 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
164 | \twocolitem{{\bf GetCellAlignment(row, col)}}{} |
165 | \twocolitem{{\bf GetDefCellAlignment()}}{} | |
21f280f4 RD |
166 | \end{twocollist}} |
167 | } | |
168 | ||
a660d684 KB |
169 | \membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour} |
170 | ||
c0ed460c | 171 | \constfunc{wxColour\&}{GetCellBackgroundColour}{\param{int}{ row}, \param{int}{ col}} |
a660d684 | 172 | |
c0ed460c | 173 | \constfunc{wxColour\&}{GetCellBackgroundColour}{\void} |
a660d684 KB |
174 | |
175 | Gets the background colour for the cell at the given position, or the global background colour. | |
176 | ||
21f280f4 RD |
177 | \pythonnote{In place of a single overloaded method name, wxPython |
178 | implements the following methods:\par | |
179 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
180 | \twocolitem{{\bf GetCellBackgroundColour(row, col)}}{} |
181 | \twocolitem{{\bf GetDefCellBackgroundColourt()}}{} | |
21f280f4 RD |
182 | \end{twocollist}} |
183 | } | |
184 | ||
a660d684 KB |
185 | \membersection{wxGrid::GetCells}\label{wxgridgetcells} |
186 | ||
c0ed460c | 187 | \constfunc{wxGridCell ***}{GetCells}{\void} |
a660d684 KB |
188 | |
189 | Returns the array of grid cell object associated with this wxGrid. | |
190 | ||
191 | \membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour} | |
192 | ||
c0ed460c | 193 | \constfunc{wxColour\&}{GetCellTextColour}{\param{int}{ row}, \param{int}{ col}} |
a660d684 | 194 | |
c0ed460c | 195 | \constfunc{wxColour\&}{GetCellTextColour}{\void} |
a660d684 KB |
196 | |
197 | Gets the text colour for the cell at the given position, or the global text colour. | |
198 | ||
21f280f4 RD |
199 | \pythonnote{In place of a single overloaded method name, wxPython |
200 | implements the following methods:\par | |
201 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
202 | \twocolitem{{\bf GetCellTextColour(row, col)}}{} |
203 | \twocolitem{{\bf GetDefCellTextColour()}}{} | |
21f280f4 RD |
204 | \end{twocollist}} |
205 | } | |
206 | ||
a660d684 KB |
207 | \membersection{wxGrid::GetCellTextFont}\label{wxgridgetcelltextfont} |
208 | ||
c0ed460c | 209 | \constfunc{const wxFont\&}{GetCellTextFont}{\param{int}{ row}, \param{int}{ col}} |
a660d684 | 210 | |
c0ed460c | 211 | \constfunc{wxFont\&}{GetCellTextFont}{\void} |
a660d684 KB |
212 | |
213 | Gets the text font for the cell at the given position, or the global text font. | |
214 | ||
21f280f4 RD |
215 | \pythonnote{In place of a single overloaded method name, wxPython |
216 | implements the following methods:\par | |
217 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
218 | \twocolitem{{\bf GetCellTextFont(row, col)}}{} |
219 | \twocolitem{{\bf GetDefCellTextFont()}}{} | |
21f280f4 RD |
220 | \end{twocollist}} |
221 | } | |
222 | ||
a660d684 KB |
223 | \membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue} |
224 | ||
c0ed460c | 225 | \constfunc{wxString\&}{GetCellValue}{\param{int}{ row}, \param{int}{ col}} |
a660d684 KB |
226 | |
227 | Returns the cell value at the given position. | |
228 | ||
229 | \membersection{wxGrid::GetCols}\label{wxgridgetcols} | |
230 | ||
c0ed460c | 231 | \constfunc{int}{GetCols}{\void} |
a660d684 KB |
232 | |
233 | Returns the number of columns in the grid. | |
234 | ||
235 | \membersection{wxGrid::GetColumnWidth}\label{wxgridcolumnwidth} | |
236 | ||
c0ed460c | 237 | \constfunc{int}{GetColumnWidth}{\param{int}{ col}} |
a660d684 KB |
238 | |
239 | Gets the width in pixels for column {\it col}. | |
240 | ||
241 | \membersection{wxGrid::GetCurrentRect}\label{wxgridgetcurrentrect} | |
242 | ||
c0ed460c | 243 | \constfunc{wxRectangle *}{GetCurrentRect}{\void} |
a660d684 KB |
244 | |
245 | Returns a pointer to the rectangle enclosing the currently selected cell. | |
246 | Do not delete this pointer. | |
247 | ||
248 | \membersection{wxGrid::GetCursorColumn}\label{wxgridgetcursorcolumn} | |
249 | ||
c0ed460c | 250 | \constfunc{int}{GetCursorColumn}{\void} |
a660d684 KB |
251 | |
252 | Returns the column position of the currently selected cell. | |
253 | ||
254 | \membersection{wxGrid::GetCursorRow}\label{wxgridgetcursorrow} | |
255 | ||
c0ed460c | 256 | \constfunc{int}{GetCursorRow}{\void} |
a660d684 KB |
257 | |
258 | Returns the row position of the currently selected cell. | |
259 | ||
260 | \membersection{wxGrid::GetEditable}\label{wxgridgeteditable} | |
261 | ||
c0ed460c | 262 | \constfunc{bool}{GetEditable}{\void} |
a660d684 KB |
263 | |
264 | Returns TRUE if the grid cells can be edited. | |
265 | ||
c0b042fc VZ |
266 | \membersection{wxGrid::GetEditInPlace}\label{wxgridgeteditinplace} |
267 | ||
268 | \constfunc{bool}{GetEditInPlace}{\void} | |
269 | ||
270 | Returns TRUE if editing in-place is enabled. | |
271 | ||
a660d684 KB |
272 | \membersection{wxGrid::GetHorizScrollBar}\label{wxgridgethorizscrollbar} |
273 | ||
c0ed460c | 274 | \constfunc{wxScrollBar *}{GetHorizScrollBar}{\void} |
a660d684 KB |
275 | |
276 | Returns a pointer to the horizontal scrollbar. | |
277 | ||
278 | \membersection{wxGrid::GetLabelAlignment}\label{wxgridgetlabelalignment} | |
279 | ||
c0ed460c | 280 | \constfunc{int}{GetLabelAlignment}{\param{int}{ orientation}} |
a660d684 KB |
281 | |
282 | Gets the row or column label alignment. {\it orientation} should | |
283 | be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp | |
284 | {\it alignment} should be wxCENTRE, wxLEFT or wxRIGHT. | |
285 | ||
286 | \membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour} | |
287 | ||
c0ed460c | 288 | \constfunc{wxColour\&}{GetLabelBackgroundColour}{\void} |
a660d684 KB |
289 | |
290 | Gets a row and column label text colour. | |
291 | ||
292 | \membersection{wxGrid::GetLabelSize}\label{wxgridgetlabelsize} | |
293 | ||
c0ed460c | 294 | \constfunc{int}{GetLabelSize}{\param{int}{ orientation}} |
a660d684 KB |
295 | |
296 | Gets the row label height, or column label width, in pixels. {\it orientation} should | |
297 | be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label. | |
298 | ||
299 | \membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour} | |
300 | ||
c0ed460c | 301 | \constfunc{wxColour\&}{GetLabelTextColour}{\void} |
a660d684 KB |
302 | |
303 | Gets a row and column label text colour. | |
304 | ||
305 | \membersection{wxGrid::GetLabelTextFont}\label{wxgridgetlabeltextfont} | |
306 | ||
c0ed460c | 307 | \constfunc{wxFont\&}{GetLabelTextFont}{\void} |
a660d684 KB |
308 | |
309 | Gets the font to be used for the row and column labels. | |
310 | ||
311 | \membersection{wxGrid::GetLabelValue}\label{wxgridgetlabelvalue} | |
312 | ||
c0ed460c | 313 | \constfunc{wxString\&}{GetLabelValue}{\param{int}{ orientation}, \param{int}{ pos}} |
a660d684 KB |
314 | |
315 | Gets a row or column label value. {\it orientation} should | |
316 | be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp | |
317 | {\it pos} is the label position. | |
318 | ||
319 | \membersection{wxGrid::GetRowHeight}\label{wxgridgetrowheight} | |
320 | ||
c0ed460c | 321 | \constfunc{int}{GetRowHeight}{\param{int}{ row}} |
a660d684 KB |
322 | |
323 | Gets the height in pixels for row {\it row}. | |
324 | ||
325 | \membersection{wxGrid::GetRows}\label{wxgridgetrows} | |
326 | ||
c0ed460c | 327 | \constfunc{int}{GetRows}{\void} |
a660d684 KB |
328 | |
329 | Returns the number of rows in the grid. | |
330 | ||
331 | \membersection{wxGrid::GetScrollPosX}\label{wxgridgetscrollposx} | |
332 | ||
c0ed460c | 333 | \constfunc{int}{GetScrollPosX}{\void} |
a660d684 KB |
334 | |
335 | Returns the column scroll position. | |
336 | ||
337 | \membersection{wxGrid::GetScrollPosY}\label{wxgridgetscrollposy} | |
338 | ||
c0ed460c | 339 | \constfunc{int}{GetScrollPosY}{\void} |
a660d684 KB |
340 | |
341 | Returns the row scroll position. | |
342 | ||
343 | \membersection{wxGrid::GetTextItem}\label{wxgridgettextitem} | |
344 | ||
fa482912 | 345 | \constfunc{wxTextCtrl *}{GetTextItem}{\void} |
a660d684 KB |
346 | |
347 | Returns a pointer to the text item used for entering text into a cell. | |
348 | ||
349 | \membersection{wxGrid::GetVertScrollBar}\label{wxgridgetvertscrollbar} | |
350 | ||
c0ed460c | 351 | \constfunc{wxScrollBar *}{GetVertScrollBar}{\void} |
a660d684 KB |
352 | |
353 | Returns a pointer to the vertical scrollbar. | |
354 | ||
355 | \membersection{wxGrid::InsertCols}\label{wxgridinsertcols} | |
356 | ||
357 | \func{bool}{InsertCols}{\param{int}{ pos=0}, \param{int}{ n=1}, \param{bool}{ updateLabels=TRUE}} | |
358 | ||
359 | Inserts {\it n} number of columns before position {\it pos}. If {\it updateLabels} is TRUE, | |
360 | the function OnChangeLabels is called to give the application the opportunity to relabel. | |
361 | ||
362 | \membersection{wxGrid::InsertRows}\label{wxgridinsertrows} | |
363 | ||
364 | \func{bool}{InsertRows}{\param{int}{ pos=0}, \param{int}{ n=1}, \param{bool}{ updateLabels=TRUE}} | |
365 | ||
366 | Inserts {\it n} number of rows before position {\it pos}. If {\it updateLabels} is TRUE, | |
367 | the function OnChangeLabels is called to give the application the opportunity to relabel. | |
368 | ||
369 | \membersection{wxGrid::OnActivate}\label{wxgridonactivate} | |
370 | ||
371 | \func{void}{OnActivate}{\param{bool}{ active}} | |
372 | ||
373 | Sets the text item to have the focus. Call this function when the wxGrid window should have the | |
374 | focus, for example from wxFrame::OnActivate. | |
375 | ||
376 | \membersection{wxGrid::OnChangeLabels}\label{wxgridonchangelabels} | |
377 | ||
378 | \func{void}{OnChangeLabels}{\void} | |
379 | ||
380 | Called when rows and columns are created or deleted, to allow the application an | |
381 | opportunity to update the labels. By default, columns are labelled alphabetically, | |
382 | and rows numerically. | |
383 | ||
384 | \membersection{wxGrid::OnChangeSelectionLabel}\label{wxgridonchangeselectionlabel} | |
385 | ||
386 | \func{void}{OnChangeSelectionLabel}{\void} | |
387 | ||
388 | Called when a cell is selected, to allow the application an | |
fa482912 | 389 | opportunity to update the selection label (the label of the wxTextCtrl |
a660d684 KB |
390 | used for entering cell text). By default, the cell column letter and row |
391 | number are concatenated to form the selection label. | |
392 | ||
393 | \membersection{wxGrid::OnCreateCell}\label{wxgridoncreatecell} | |
394 | ||
395 | \func{wxGridCell *}{OnCreateCell}{\void} | |
396 | ||
397 | Override this virtual function if you want to replace the normal wxGridCell with a derived | |
398 | class. | |
399 | ||
400 | \membersection{wxGrid::OnCellLeftClick}\label{wxgridoncellleftclick} | |
401 | ||
402 | \func{void}{OnLeftClick}{\param{int}{ row}, \param{int}{ col}, \param{int}{ x}, \param{int}{ y}, \param{bool}{ control}, \param{bool}{ shift}} | |
403 | ||
404 | Virtual function called when the left button is depressed within a cell, just after OnSelectCell is called. | |
405 | ||
406 | \membersection{wxGrid::OnCellRightClick}\label{wxgridoncellrightclick} | |
407 | ||
408 | \func{void}{OnRightClick}{\param{int}{ row}, \param{int}{ col}, \param{int}{ x}, \param{int}{ y}, \param{bool}{ control}, \param{bool}{ shift}} | |
409 | ||
410 | Virtual function called when the right button is depressed within a cell, just after OnSelectCell is called. | |
411 | ||
412 | \membersection{wxGrid::OnLabelLeftClick}\label{wxgridonlabelleftclick} | |
413 | ||
414 | \func{void}{OnLeftClick}{\param{int}{ row}, \param{int}{ col}, \param{int}{ x}, \param{int}{ y}, \param{bool}{ control}, \param{bool}{ shift}} | |
415 | ||
416 | Virtual function called when the left button is depressed within a | |
21f280f4 | 417 | label. |
a660d684 KB |
418 | |
419 | {\it row} will be {\it -1} if the click is in the top labels. | |
420 | ||
421 | {\it col} will be {\it -1} if the click is in the left labels. | |
422 | ||
423 | {\it row} and {\it col} will be {\it -1} if the click is in the upper | |
424 | left corner. | |
425 | ||
426 | \membersection{wxGrid::OnLabelRightClick}\label{wxgridonlabelrightclick} | |
427 | ||
428 | \func{void}{OnRightClick}{\param{int}{ row}, \param{int}{ col}, \param{int}{ x}, \param{int}{ y}, \param{bool}{ control}, \param{bool}{ shift}} | |
429 | ||
430 | Virtual function called when the right button is depressed within a label. | |
431 | ||
432 | {\it row} will be {\it -1} if the click is in the top labels. | |
433 | ||
434 | {\it col} will be {\it -1} if the click is in the left labels. | |
435 | ||
436 | {\it row} and {\it col} will be {\it -1} if the click is in the upper | |
437 | left corner. | |
438 | ||
439 | \membersection{wxGrid::OnSelectCell}\label{wxgridonselectcell} | |
440 | ||
441 | \func{void}{OnSelectCell}{\param{int}{ row}, \param{int}{ col}} | |
442 | ||
443 | Virtual function called when the user left-clicks on a cell. | |
444 | ||
445 | \membersection{wxGrid::OnSelectCellImplementation}\label{wxgridonselectcellimplementation} | |
446 | ||
447 | \func{void}{OnSelectCellImplementation}{\param{wxDC *}{dc}, \param{int}{ row}, \param{int}{ col}} | |
448 | ||
449 | Virtual function called when the user left-clicks on a cell. If you override this function, | |
450 | call wxGrid::OnSelectCell to apply the default behaviour. | |
451 | ||
452 | \membersection{wxGrid::SetCellAlignment}\label{wxgridsetcellalignment} | |
453 | ||
454 | \func{void}{SetCellAlignment}{\param{int}{ alignment}, \param{int}{ row}, \param{int}{ col}} | |
455 | ||
456 | \func{void}{SetCellAlignment}{\param{int}{ alignment}} | |
457 | ||
458 | Sets the text alignment for the cell at the given position, or for the whole grid. {\it alignment} may be wxLEFT, wxRIGHT or wxCENTRE. | |
459 | ||
21f280f4 RD |
460 | \pythonnote{In place of a single overloaded method name, wxPython |
461 | implements the following methods:\par | |
462 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
463 | \twocolitem{{\bf SetCellAlignment(alignment, row, col)}}{} |
464 | \twocolitem{{\bf SetDefCellAlignment(alignment)}}{} | |
21f280f4 RD |
465 | \end{twocollist}} |
466 | } | |
467 | ||
a660d684 KB |
468 | \membersection{wxGrid::SetCellBackgroundColour}\label{wxgridsetcellbackgroundcolour} |
469 | ||
470 | \func{void}{SetCellBackgroundColour}{\param{const wxColour\&}{ colour}, \param{int}{ row}, \param{int}{ col}} | |
471 | ||
472 | \func{void}{SetCellBackgroundColour}{\param{const wxColour\&}{ colour}} | |
473 | ||
474 | Sets the background colour for the cell at the given position, or for the whole grid. | |
475 | ||
21f280f4 RD |
476 | \pythonnote{In place of a single overloaded method name, wxPython |
477 | implements the following methods:\par | |
478 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
479 | \twocolitem{{\bf SetCellBackgroundColour(colour, row, col)}}{} |
480 | \twocolitem{{\bf SetDefCellBackgroundColour(colour)}}{} | |
21f280f4 RD |
481 | \end{twocollist}} |
482 | } | |
483 | ||
a660d684 KB |
484 | \membersection{wxGrid::SetCellTextColour}\label{wxgridsetcelltextcolour} |
485 | ||
486 | \func{void}{SetCellTextColour}{\param{const wxColour\&}{ colour}, \param{int}{ row}, \param{int}{ col}} | |
487 | ||
488 | \func{void}{SetCellTextColour}{\param{const wxColour\&}{ colour}} | |
489 | ||
490 | Sets the text colour for the cell at the given position, or for the whole grid. | |
491 | ||
21f280f4 RD |
492 | \pythonnote{In place of a single overloaded method name, wxPython |
493 | implements the following methods:\par | |
494 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
495 | \twocolitem{{\bf SetCellTextColour(colour, row, col)}}{} |
496 | \twocolitem{{\bf SetDefCellTextColour(colour)}}{} | |
21f280f4 RD |
497 | \end{twocollist}} |
498 | } | |
499 | ||
a660d684 KB |
500 | \membersection{wxGrid::SetCellTextFont}\label{wxgridsetcelltextfont} |
501 | ||
c0ed460c | 502 | \func{void}{SetCellTextFont}{\param{const wxFont\&}{ font}, \param{int}{ row}, \param{int}{ col}} |
a660d684 | 503 | |
c0ed460c | 504 | \func{void}{SetCellTextFont}{\param{const wxFont\&}{ font}} |
a660d684 KB |
505 | |
506 | Sets the text font for the cell at the given position, or for the whole grid. | |
507 | ||
21f280f4 RD |
508 | \pythonnote{In place of a single overloaded method name, wxPython |
509 | implements the following methods:\par | |
510 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
511 | \twocolitem{{\bf SetCellTextFont(font, row, col)}}{} |
512 | \twocolitem{{\bf SetDefCellTextFont(font)}}{} | |
21f280f4 RD |
513 | \end{twocollist}} |
514 | } | |
515 | ||
a660d684 KB |
516 | \membersection{wxGrid::SetCellValue}\label{wxgridsetcellvalue} |
517 | ||
518 | \func{void}{SetCellValue}{\param{const wxString\&}{ val}, \param{int}{ row}, \param{int}{ col}} | |
519 | ||
520 | Sets the cell value at the given position. | |
521 | ||
522 | \membersection{wxGrid::SetColumnWidth}\label{wxgridsetcolumnwidth} | |
523 | ||
524 | \func{void}{SetColumnWidth}{\param{int}{ col}, \param{int}{ width}} | |
525 | ||
526 | Sets the width in pixels for column {\it col}. | |
527 | ||
528 | \membersection{wxGrid::SetDividerPen}\label{wxgridsetdividerpen} | |
529 | ||
c0ed460c | 530 | \func{void}{SetDividerPen}{\param{const wxPen\&}{ pen}} |
a660d684 KB |
531 | |
532 | Specifies the pen to be used for drawing the divisions between cells. The default | |
533 | is a light grey. If NULL is specified, the divisions will not be drawn. | |
534 | ||
535 | \membersection{wxGrid::SetEditable}\label{wxgridseteditable} | |
536 | ||
537 | \func{void}{SetEditable}{\param{bool}{ editable}} | |
538 | ||
539 | If {\it editable} is TRUE (the default), the grid cells will be editable by means of the | |
540 | text edit control. If FALSE, the text edit control will be hidden and the user will not | |
541 | be able to edit the cell contents. | |
542 | ||
c0b042fc VZ |
543 | \membersection{wxGrid::SetEditInPlace}\label{wxgridseteditinplace} |
544 | ||
545 | \func{void}{SetEditInPlace}{\param{bool}{ edit = TRUE}} | |
546 | ||
547 | Enables (if {\it edit} is TRUE, default value) or disables in-place editing. | |
548 | When it is enabled, the cells contents can be changed by typing text directly | |
549 | in the cell. | |
550 | ||
a660d684 KB |
551 | \membersection{wxGrid::SetGridCursor}\label{wxgridsetgridcursor} |
552 | ||
553 | \func{void}{SetGridCursor}{\param{int }{row}, \param{int}{ col}} | |
554 | ||
555 | Sets the position of the selected cell. | |
556 | ||
557 | \membersection{wxGrid::SetLabelAlignment}\label{wxgridsetlabelalignment} | |
558 | ||
559 | \func{void}{SetLabelAlignment}{\param{int}{ orientation}, \param{int}{ alignment}} | |
560 | ||
561 | Sets the row or column label alignment. {\it orientation} should | |
562 | be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp | |
563 | {\it alignment} should be wxCENTRE, wxLEFT or wxRIGHT. | |
564 | ||
565 | \membersection{wxGrid::SetLabelBackgroundColour}\label{wxgridsetlabelbackgroundcolour} | |
566 | ||
567 | \func{void}{SetLabelBackgroundColour}{\param{const wxColour\&}{ value}} | |
568 | ||
569 | Sets a row or column label background colour. | |
570 | ||
571 | \membersection{wxGrid::SetLabelSize}\label{wxgridsetlabelsize} | |
572 | ||
573 | \func{void}{SetLabelSize}{\param{int}{ orientation}, \param{int}{ size}} | |
574 | ||
575 | Sets the row label height, or column label width, in pixels. {\it orientation} should | |
576 | be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label. | |
577 | ||
578 | If a dimension of zero is specified, the row or column labels will not be | |
579 | shown. | |
580 | ||
581 | \membersection{wxGrid::SetLabelTextColour}\label{wxgridsetlabeltextcolour} | |
582 | ||
583 | \func{void}{SetLabelTextColour}{\param{const wxColour\&}{ value}} | |
584 | ||
585 | Sets a row and column label text colour. | |
586 | ||
587 | \membersection{wxGrid::SetLabelTextFont}\label{wxgridsetlabeltextfont} | |
588 | ||
c0ed460c | 589 | \func{void}{SetLabelTextFont}{\param{const wxFont\&}{ font}} |
a660d684 KB |
590 | |
591 | Sets the font to be used for the row and column labels. | |
592 | ||
593 | \membersection{wxGrid::SetLabelValue}\label{wxgridsetlabelvalue} | |
594 | ||
595 | \func{void}{SetLabelValue}{\param{int}{ orientation}, \param{const wxString\&}{ value}, \param{int}{ pos}} | |
596 | ||
597 | Sets a row or column label value. {\it orientation} should | |
598 | be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp | |
599 | {\it pos} is the label position. | |
600 | ||
601 | \membersection{wxGrid::SetRowHeight}\label{wxgridsetrowheight} | |
602 | ||
603 | \func{void}{SetRowHeight}{\param{int}{ row}, \param{int}{ height}} | |
604 | ||
605 | Sets the height in pixels for row {\it row}. | |
606 | ||
607 | \membersection{wxGrid::UpdateDimensions}\label{wxgridupdatedimensions} | |
608 | ||
609 | \func{void}{UpdateDimensions}{\void} | |
610 | ||
611 | Call this function whenever a change has been made via the API that | |
612 | might alter size characteristics. You may also need to follow it with | |
613 | a call to AdjustScrollbars. | |
614 |