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