1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895
|
<HTML>
<head><title>wxGrid</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxgrid"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx108.htm#wxgenericvalidator"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx110.htm#wxhashtable"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxGrid</H2>
<P>
wxGrid is a class for displaying and editing tabular information.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx166.htm#wxpanel">wxPanel</A><BR>
<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>
<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/grid.h><P>
<B><FONT COLOR="#FF0000">Window styles</FONT></B><P>
There are no specific window styles for this class.<P>
See also <A HREF="wx305.htm#windowstyles">window styles overview</A>.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx311.htm#gridoverview">wxGrid classes overview</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxgridconstr">wxGrid::wxGrid</A><BR>
<A HREF="#wxgridadjustscrollbars">wxGrid::AdjustScrollbars</A><BR>
<A HREF="#wxgridappendcols">wxGrid::AppendCols</A><BR>
<A HREF="#wxgridappendrows">wxGrid::AppendRows</A><BR>
<A HREF="#wxgridbeginbatch">wxGrid::BeginBatch</A><BR>
<A HREF="#wxgridcellhittest">wxGrid::CellHitTest</A><BR>
<A HREF="#wxgridcreategrid">wxGrid::CreateGrid</A><BR>
<A HREF="#wxgridcurrentcellvisible">wxGrid::CurrentCellVisible</A><BR>
<A HREF="#wxgriddeletecols">wxGrid::DeleteCols</A><BR>
<A HREF="#wxgriddeleterows">wxGrid::DeleteRows</A><BR>
<A HREF="#wxgridendbatch">wxGrid::EndBatch</A><BR>
<A HREF="#wxgridgetbatchcount">wxGrid::GetBatchCount</A><BR>
<A HREF="#wxgridgetcell">wxGrid::GetCell</A><BR>
<A HREF="#wxgridgetcellalignment">wxGrid::GetCellAlignment</A><BR>
<A HREF="#wxgridgetcellbackgroundcolour">wxGrid::GetCellBackgroundColour</A><BR>
<A HREF="#wxgridgetcells">wxGrid::GetCells</A><BR>
<A HREF="#wxgridgetcelltextcolour">wxGrid::GetCellTextColour</A><BR>
<A HREF="#wxgridgetcelltextfont">wxGrid::GetCellTextFont</A><BR>
<A HREF="#wxgridgetcellvalue">wxGrid::GetCellValue</A><BR>
<A HREF="#wxgridgetcols">wxGrid::GetCols</A><BR>
<A HREF="#wxgridcolumnwidth">wxGrid::GetColumnWidth</A><BR>
<A HREF="#wxgridgetcurrentrect">wxGrid::GetCurrentRect</A><BR>
<A HREF="#wxgridgetcursorcolumn">wxGrid::GetCursorColumn</A><BR>
<A HREF="#wxgridgetcursorrow">wxGrid::GetCursorRow</A><BR>
<A HREF="#wxgridgeteditable">wxGrid::GetEditable</A><BR>
<A HREF="#wxgridgethorizscrollbar">wxGrid::GetHorizScrollBar</A><BR>
<A HREF="#wxgridgetlabelalignment">wxGrid::GetLabelAlignment</A><BR>
<A HREF="#wxgridgetlabelbackgroundcolour">wxGrid::GetLabelBackgroundColour</A><BR>
<A HREF="#wxgridgetlabelsize">wxGrid::GetLabelSize</A><BR>
<A HREF="#wxgridgetlabeltextcolour">wxGrid::GetLabelTextColour</A><BR>
<A HREF="#wxgridgetlabeltextfont">wxGrid::GetLabelTextFont</A><BR>
<A HREF="#wxgridgetlabelvalue">wxGrid::GetLabelValue</A><BR>
<A HREF="#wxgridgetrowheight">wxGrid::GetRowHeight</A><BR>
<A HREF="#wxgridgetrows">wxGrid::GetRows</A><BR>
<A HREF="#wxgridgetscrollposx">wxGrid::GetScrollPosX</A><BR>
<A HREF="#wxgridgetscrollposy">wxGrid::GetScrollPosY</A><BR>
<A HREF="#wxgridgettextitem">wxGrid::GetTextItem</A><BR>
<A HREF="#wxgridgetvertscrollbar">wxGrid::GetVertScrollBar</A><BR>
<A HREF="#wxgridinsertcols">wxGrid::InsertCols</A><BR>
<A HREF="#wxgridinsertrows">wxGrid::InsertRows</A><BR>
<A HREF="#wxgridonactivate">wxGrid::OnActivate</A><BR>
<A HREF="#wxgridonchangelabels">wxGrid::OnChangeLabels</A><BR>
<A HREF="#wxgridonchangeselectionlabel">wxGrid::OnChangeSelectionLabel</A><BR>
<A HREF="#wxgridoncreatecell">wxGrid::OnCreateCell</A><BR>
<A HREF="#wxgridoncellleftclick">wxGrid::OnCellLeftClick</A><BR>
<A HREF="#wxgridoncellrightclick">wxGrid::OnCellRightClick</A><BR>
<A HREF="#wxgridonlabelleftclick">wxGrid::OnLabelLeftClick</A><BR>
<A HREF="#wxgridonlabelrightclick">wxGrid::OnLabelRightClick</A><BR>
<A HREF="#wxgridonselectcell">wxGrid::OnSelectCell</A><BR>
<A HREF="#wxgridonselectcellimplementation">wxGrid::OnSelectCellImplementation</A><BR>
<A HREF="#wxgridsetcellalignment">wxGrid::SetCellAlignment</A><BR>
<A HREF="#wxgridsetcellbackgroundcolour">wxGrid::SetCellBackgroundColour</A><BR>
<A HREF="#wxgridsetcelltextcolour">wxGrid::SetCellTextColour</A><BR>
<A HREF="#wxgridsetcelltextfont">wxGrid::SetCellTextFont</A><BR>
<A HREF="#wxgridsetcellvalue">wxGrid::SetCellValue</A><BR>
<A HREF="#wxgridsetcolumnwidth">wxGrid::SetColumnWidth</A><BR>
<A HREF="#wxgridsetdividerpen">wxGrid::SetDividerPen</A><BR>
<A HREF="#wxgridseteditable">wxGrid::SetEditable</A><BR>
<A HREF="#wxgridsetgridcursor">wxGrid::SetGridCursor</A><BR>
<A HREF="#wxgridsetlabelalignment">wxGrid::SetLabelAlignment</A><BR>
<A HREF="#wxgridsetlabelbackgroundcolour">wxGrid::SetLabelBackgroundColour</A><BR>
<A HREF="#wxgridsetlabelsize">wxGrid::SetLabelSize</A><BR>
<A HREF="#wxgridsetlabeltextcolour">wxGrid::SetLabelTextColour</A><BR>
<A HREF="#wxgridsetlabeltextfont">wxGrid::SetLabelTextFont</A><BR>
<A HREF="#wxgridsetlabelvalue">wxGrid::SetLabelValue</A><BR>
<A HREF="#wxgridsetrowheight">wxGrid::SetRowHeight</A><BR>
<A HREF="#wxgridupdatedimensions">wxGrid::UpdateDimensions</A><BR>
<P>
<HR>
<A NAME="wxgridconstr"></A>
<H3>wxGrid::wxGrid</H3>
<P>
<B>void</B> <B>wxGrid</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID</B><I> id</I>, <B>const wxPoint&</B><I> pos</I>,
<B>const wxSize&</B><I> size</I>, <B>long</B><I> style=0</I>, <B>const wxString& </B><I>name="grid"</I>)<P>
Constructor. Before using a wxGrid object, you must call CreateGrid to set up the required rows and columns.<P>
<HR>
<A NAME="wxgridadjustscrollbars"></A>
<H3>wxGrid::AdjustScrollbars</H3>
<P>
<B>void</B> <B>AdjustScrollbars</B>()<P>
Call this function whenever a change has been made via the API that might alter the scrollbar characteristics:
particularly when adding or deleting rows, or changing row or column dimensions. For example,
removing rows might make it unnecessary to show the vertical scrollbar.<P>
<HR>
<A NAME="wxgridappendcols"></A>
<H3>wxGrid::AppendCols</H3>
<P>
<B>bool</B> <B>AppendCols</B>(<B>int</B><I> n=1</I>, <B>bool</B><I> updateLabels=TRUE</I>)<P>
Appends <I>n</I> columns to the grid. If <I>updateLabels</I> is TRUE,
the function OnChangeLabels is called to give the application the opportunity to relabel.<P>
<HR>
<A NAME="wxgridappendrows"></A>
<H3>wxGrid::AppendRows</H3>
<P>
<B>bool</B> <B>AppendRows</B>(<B>int</B><I> n=1</I>, <B>bool</B><I> updateLabels=TRUE</I>)<P>
Appends <I>n</I> rows to the grid. If <I>updateLabels</I> is TRUE,
the function OnChangeLabels is called to give the application the opportunity to relabel.<P>
<HR>
<A NAME="wxgridbeginbatch"></A>
<H3>wxGrid::BeginBatch</H3>
<P>
<B>void</B> <B>BeginBatch</B>()<P>
Start a BeginBatch/EndBatch pair between which, calls to SetCellValue or
SetCellBitmap will not cause a refresh. This allows you to speed up some operations
(for example, setting several hundred cell values). You can nest, but not overlap,
these two functions.<P>
See also <A HREF="wx109.htm#wxgridendbatch">wxGrid::EndBatch</A>, <A HREF="wx109.htm#wxgridgetbatchcount">wxGrid::GetBatchCount</A>.<P>
<HR>
<A NAME="wxgridcellhittest"></A>
<H3>wxGrid::CellHitTest</H3>
<P>
<B>bool</B> <B>CellHitTest</B>(<B>int</B><I> x</I>, <B>int</B><I> y</I>, <B>int *</B><I>row</I>, <B>int *</B><I>col</I>)<P>
Returns TRUE if the x, y panel position coincides with a cell. If so, <I>row</I> and <I>col</I> are
returned.<P>
<HR>
<A NAME="wxgridcreategrid"></A>
<H3>wxGrid::CreateGrid</H3>
<P>
<B>bool</B> <B>CreateGrid</B>(<B>int</B><I> rows</I>, <B>int</B><I> cols</I>, <B>wxString **</B><I>cellValues=NULL</I>,
<B>short *</B><I>widths=NULL</I>, <B>short</B><I> defaultWidth=wxGRID_DEFAULT_CELL_WIDTH</I>,
<B>short</B><I> defaultHeight=wxGRID_DEFAULT_CELL_HEIGHT</I>)<P>
Creates a grid <I>rows</I> high and <I>cols</I> wide. You can optionally specify an array of initial values
and widths, and/or default cell width and height.<P>
Call this function after creating the wxGrid object.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
Currently the <TT>cellValues</TT> and <TT>widths</TT> parameters
don't exisit in the wxPython version of this method. So in other
words, the definition of the wxPython version of this method looks like this:
<PRE>
CreateGrid(rows, cols,
defaultWidth = wxGRID_DEFAULT_CELL_WIDTH,
defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT)
</PRE>
<P>
<HR>
<A NAME="wxgridcurrentcellvisible"></A>
<H3>wxGrid::CurrentCellVisible</H3>
<P>
<B>bool</B> <B>CurrentCellVisible</B>()<P>
Returns TRUE if the currently selected cell is visible, FALSE otherwise.<P>
<HR>
<A NAME="wxgriddeletecols"></A>
<H3>wxGrid::DeleteCols</H3>
<P>
<B>bool</B> <B>DeleteCols</B>(<B>int</B><I> pos=0</I>, <B>int</B><I> n=1</I>, <B>bool</B><I> updateLabels=TRUE</I>)<P>
Deletes <I>n</I> columns from the grid at position <I>pos</I>. If <I>updateLabels</I> is TRUE,
the function OnChangeLabels is called to give the application the opportunity to relabel.<P>
<HR>
<A NAME="wxgriddeleterows"></A>
<H3>wxGrid::DeleteRows</H3>
<P>
<B>bool</B> <B>DeleteRows</B>(<B>int</B><I> pos=0</I>, <B>int</B><I> n=1</I>, <B>bool</B><I> updateLabels=TRUE</I>)<P>
Deletes <I>n</I> rows from the grid at position <I>pos</I>. If <I>updateLabels</I> is TRUE,
the function OnChangeLabels is called to give the application the opportunity to relabel.<P>
<HR>
<A NAME="wxgridendbatch"></A>
<H3>wxGrid::EndBatch</H3>
<P>
<B>void</B> <B>EndBatch</B>()<P>
End a BeginBatch/EndBatch pair between which, calls to SetCellValue or
SetCellBitmap will not cause a refresh. This allows you to speed up some operations
(for example, setting several hundred cell values). You can nest, but not overlap,
these two functions.<P>
See also <A HREF="wx109.htm#wxgridbeginbatch">wxGrid::BeginBatch</A>, <A HREF="wx109.htm#wxgridgetbatchcount">wxGrid::GetBatchCount</A>.<P>
<HR>
<A NAME="wxgridgetbatchcount"></A>
<H3>wxGrid::GetBatchCount</H3>
<P>
<B>int</B> <B>GetBatchCount</B>() <B>const</B><P>
Return the level of batch nesting. This is initially zero, and will be incremented
every time BeginBatch is called, and decremented when EndBatch is called. When the
batch count is more zero, some functions (such as SetCellValue and SetCellBitmap) will
not refresh the cell.<P>
See also <A HREF="wx109.htm#wxgridbeginbatch">wxGrid::BeginBatch</A>, <A HREF="wx109.htm#wxgridendbatch">wxGrid::EndBatch</A>.<P>
<HR>
<A NAME="wxgridgetcell"></A>
<H3>wxGrid::GetCell</H3>
<P>
<B>wxGridCell *</B> <B>GetCell</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>) <B>const</B><P>
Returns the grid cell object associated with this position.<P>
wxGenericGrid implementation only.<P>
<HR>
<A NAME="wxgridgetcellalignment"></A>
<H3>wxGrid::GetCellAlignment</H3>
<P>
<B>int</B> <B>GetCellAlignment</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>) <B>const</B><P>
<B>int</B> <B>GetCellAlignment</B>() <B>const</B><P>
Sets the text alignment for the cell at the given position, or the global alignment value.
The return value is wxLEFT, wxRIGHT or wxCENTRE.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>GetCellAlignment(row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>GetDefCellAlignment()</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridgetcellbackgroundcolour"></A>
<H3>wxGrid::GetCellBackgroundColour</H3>
<P>
<B>wxColour&</B> <B>GetCellBackgroundColour</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>) <B>const</B><P>
<B>wxColour&</B> <B>GetCellBackgroundColour</B>() <B>const</B><P>
Gets the background colour for the cell at the given position, or the global background colour.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>GetCellBackgroundColour(row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>GetDefCellBackgroundColourt()</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridgetcells"></A>
<H3>wxGrid::GetCells</H3>
<P>
<B>wxGridCell ***</B> <B>GetCells</B>() <B>const</B><P>
Returns the array of grid cell object associated with this wxGrid.<P>
<HR>
<A NAME="wxgridgetcelltextcolour"></A>
<H3>wxGrid::GetCellTextColour</H3>
<P>
<B>wxColour&</B> <B>GetCellTextColour</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>) <B>const</B><P>
<B>wxColour&</B> <B>GetCellTextColour</B>() <B>const</B><P>
Gets the text colour for the cell at the given position, or the global text colour.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>GetCellTextColour(row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>GetDefCellTextColour()</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridgetcelltextfont"></A>
<H3>wxGrid::GetCellTextFont</H3>
<P>
<B>const wxFont&</B> <B>GetCellTextFont</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>) <B>const</B><P>
<B>wxFont&</B> <B>GetCellTextFont</B>() <B>const</B><P>
Gets the text font for the cell at the given position, or the global text font.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>GetCellTextFont(row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>GetDefCellTextFont()</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridgetcellvalue"></A>
<H3>wxGrid::GetCellValue</H3>
<P>
<B>wxString&</B> <B>GetCellValue</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>) <B>const</B><P>
Returns the cell value at the given position.<P>
<HR>
<A NAME="wxgridgetcols"></A>
<H3>wxGrid::GetCols</H3>
<P>
<B>int</B> <B>GetCols</B>() <B>const</B><P>
Returns the number of columns in the grid.<P>
<HR>
<A NAME="wxgridcolumnwidth"></A>
<H3>wxGrid::GetColumnWidth</H3>
<P>
<B>int</B> <B>GetColumnWidth</B>(<B>int</B><I> col</I>) <B>const</B><P>
Gets the width in pixels for column <I>col</I>.<P>
<HR>
<A NAME="wxgridgetcurrentrect"></A>
<H3>wxGrid::GetCurrentRect</H3>
<P>
<B>wxRectangle *</B> <B>GetCurrentRect</B>() <B>const</B><P>
Returns a pointer to the rectangle enclosing the currently selected cell.
Do not delete this pointer.<P>
<HR>
<A NAME="wxgridgetcursorcolumn"></A>
<H3>wxGrid::GetCursorColumn</H3>
<P>
<B>int</B> <B>GetCursorColumn</B>() <B>const</B><P>
Returns the column position of the currently selected cell.<P>
<HR>
<A NAME="wxgridgetcursorrow"></A>
<H3>wxGrid::GetCursorRow</H3>
<P>
<B>int</B> <B>GetCursorRow</B>() <B>const</B><P>
Returns the row position of the currently selected cell.<P>
<HR>
<A NAME="wxgridgeteditable"></A>
<H3>wxGrid::GetEditable</H3>
<P>
<B>bool</B> <B>GetEditable</B>() <B>const</B><P>
Returns TRUE if the grid cells can be edited.<P>
<HR>
<A NAME="wxgridgethorizscrollbar"></A>
<H3>wxGrid::GetHorizScrollBar</H3>
<P>
<B>wxScrollBar *</B> <B>GetHorizScrollBar</B>() <B>const</B><P>
Returns a pointer to the horizontal scrollbar.<P>
<HR>
<A NAME="wxgridgetlabelalignment"></A>
<H3>wxGrid::GetLabelAlignment</H3>
<P>
<B>int</B> <B>GetLabelAlignment</B>(<B>int</B><I> orientation</I>) <B>const</B><P>
Gets the row or column label alignment. <I>orientation</I> should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.
<I>alignment</I> should be wxCENTRE, wxLEFT or wxRIGHT.<P>
<HR>
<A NAME="wxgridgetlabelbackgroundcolour"></A>
<H3>wxGrid::GetLabelBackgroundColour</H3>
<P>
<B>wxColour&</B> <B>GetLabelBackgroundColour</B>() <B>const</B><P>
Gets a row and column label text colour.<P>
<HR>
<A NAME="wxgridgetlabelsize"></A>
<H3>wxGrid::GetLabelSize</H3>
<P>
<B>int</B> <B>GetLabelSize</B>(<B>int</B><I> orientation</I>) <B>const</B><P>
Gets the row label height, or column label width, in pixels. <I>orientation</I> should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.<P>
<HR>
<A NAME="wxgridgetlabeltextcolour"></A>
<H3>wxGrid::GetLabelTextColour</H3>
<P>
<B>wxColour&</B> <B>GetLabelTextColour</B>() <B>const</B><P>
Gets a row and column label text colour.<P>
<HR>
<A NAME="wxgridgetlabeltextfont"></A>
<H3>wxGrid::GetLabelTextFont</H3>
<P>
<B>wxFont&</B> <B>GetLabelTextFont</B>() <B>const</B><P>
Gets the font to be used for the row and column labels.<P>
<HR>
<A NAME="wxgridgetlabelvalue"></A>
<H3>wxGrid::GetLabelValue</H3>
<P>
<B>wxString&</B> <B>GetLabelValue</B>(<B>int</B><I> orientation</I>, <B>int</B><I> pos</I>) <B>const</B><P>
Gets a row or column label value. <I>orientation</I> should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.
<I>pos</I> is the label position.<P>
<HR>
<A NAME="wxgridgetrowheight"></A>
<H3>wxGrid::GetRowHeight</H3>
<P>
<B>int</B> <B>GetRowHeight</B>(<B>int</B><I> row</I>) <B>const</B><P>
Gets the height in pixels for row <I>row</I>.<P>
<HR>
<A NAME="wxgridgetrows"></A>
<H3>wxGrid::GetRows</H3>
<P>
<B>int</B> <B>GetRows</B>() <B>const</B><P>
Returns the number of rows in the grid.<P>
<HR>
<A NAME="wxgridgetscrollposx"></A>
<H3>wxGrid::GetScrollPosX</H3>
<P>
<B>int</B> <B>GetScrollPosX</B>() <B>const</B><P>
Returns the column scroll position.<P>
<HR>
<A NAME="wxgridgetscrollposy"></A>
<H3>wxGrid::GetScrollPosY</H3>
<P>
<B>int</B> <B>GetScrollPosY</B>() <B>const</B><P>
Returns the row scroll position.<P>
<HR>
<A NAME="wxgridgettextitem"></A>
<H3>wxGrid::GetTextItem</H3>
<P>
<B>wxText *</B> <B>GetTextItem</B>() <B>const</B><P>
Returns a pointer to the text item used for entering text into a cell.<P>
<HR>
<A NAME="wxgridgetvertscrollbar"></A>
<H3>wxGrid::GetVertScrollBar</H3>
<P>
<B>wxScrollBar *</B> <B>GetVertScrollBar</B>() <B>const</B><P>
Returns a pointer to the vertical scrollbar.<P>
<HR>
<A NAME="wxgridinsertcols"></A>
<H3>wxGrid::InsertCols</H3>
<P>
<B>bool</B> <B>InsertCols</B>(<B>int</B><I> pos=0</I>, <B>int</B><I> n=1</I>, <B>bool</B><I> updateLabels=TRUE</I>)<P>
Inserts <I>n</I> number of columns before position <I>pos</I>. If <I>updateLabels</I> is TRUE,
the function OnChangeLabels is called to give the application the opportunity to relabel.<P>
<HR>
<A NAME="wxgridinsertrows"></A>
<H3>wxGrid::InsertRows</H3>
<P>
<B>bool</B> <B>InsertRows</B>(<B>int</B><I> pos=0</I>, <B>int</B><I> n=1</I>, <B>bool</B><I> updateLabels=TRUE</I>)<P>
Inserts <I>n</I> number of rows before position <I>pos</I>. If <I>updateLabels</I> is TRUE,
the function OnChangeLabels is called to give the application the opportunity to relabel.<P>
<HR>
<A NAME="wxgridonactivate"></A>
<H3>wxGrid::OnActivate</H3>
<P>
<B>void</B> <B>OnActivate</B>(<B>bool</B><I> active</I>)<P>
Sets the text item to have the focus. Call this function when the wxGrid window should have the
focus, for example from wxFrame::OnActivate.<P>
<HR>
<A NAME="wxgridonchangelabels"></A>
<H3>wxGrid::OnChangeLabels</H3>
<P>
<B>void</B> <B>OnChangeLabels</B>()<P>
Called when rows and columns are created or deleted, to allow the application an
opportunity to update the labels. By default, columns are labelled alphabetically,
and rows numerically.<P>
<HR>
<A NAME="wxgridonchangeselectionlabel"></A>
<H3>wxGrid::OnChangeSelectionLabel</H3>
<P>
<B>void</B> <B>OnChangeSelectionLabel</B>()<P>
Called when a cell is selected, to allow the application an
opportunity to update the selection label (the label of the wxText item
used for entering cell text). By default, the cell column letter and row
number are concatenated to form the selection label.<P>
<HR>
<A NAME="wxgridoncreatecell"></A>
<H3>wxGrid::OnCreateCell</H3>
<P>
<B>wxGridCell *</B> <B>OnCreateCell</B>()<P>
Override this virtual function if you want to replace the normal wxGridCell with a derived
class.<P>
<HR>
<A NAME="wxgridoncellleftclick"></A>
<H3>wxGrid::OnCellLeftClick</H3>
<P>
<B>void</B> <B>OnLeftClick</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>, <B>int</B><I> x</I>, <B>int</B><I> y</I>, <B>bool</B><I> control</I>, <B>bool</B><I> shift</I>)<P>
Virtual function called when the left button is depressed within a cell, just after OnSelectCell is called.<P>
<HR>
<A NAME="wxgridoncellrightclick"></A>
<H3>wxGrid::OnCellRightClick</H3>
<P>
<B>void</B> <B>OnRightClick</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>, <B>int</B><I> x</I>, <B>int</B><I> y</I>, <B>bool</B><I> control</I>, <B>bool</B><I> shift</I>)<P>
Virtual function called when the right button is depressed within a cell, just after OnSelectCell is called.<P>
<HR>
<A NAME="wxgridonlabelleftclick"></A>
<H3>wxGrid::OnLabelLeftClick</H3>
<P>
<B>void</B> <B>OnLeftClick</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>, <B>int</B><I> x</I>, <B>int</B><I> y</I>, <B>bool</B><I> control</I>, <B>bool</B><I> shift</I>)<P>
Virtual function called when the left button is depressed within a
label.<P>
<I>row</I> will be <I>-1</I> if the click is in the top labels.<P>
<I>col</I> will be <I>-1</I> if the click is in the left labels.<P>
<I>row</I> and <I>col</I> will be <I>-1</I> if the click is in the upper
left corner.<P>
<HR>
<A NAME="wxgridonlabelrightclick"></A>
<H3>wxGrid::OnLabelRightClick</H3>
<P>
<B>void</B> <B>OnRightClick</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>, <B>int</B><I> x</I>, <B>int</B><I> y</I>, <B>bool</B><I> control</I>, <B>bool</B><I> shift</I>)<P>
Virtual function called when the right button is depressed within a label.<P>
<I>row</I> will be <I>-1</I> if the click is in the top labels.<P>
<I>col</I> will be <I>-1</I> if the click is in the left labels.<P>
<I>row</I> and <I>col</I> will be <I>-1</I> if the click is in the upper
left corner.<P>
<HR>
<A NAME="wxgridonselectcell"></A>
<H3>wxGrid::OnSelectCell</H3>
<P>
<B>void</B> <B>OnSelectCell</B>(<B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
Virtual function called when the user left-clicks on a cell.<P>
<HR>
<A NAME="wxgridonselectcellimplementation"></A>
<H3>wxGrid::OnSelectCellImplementation</H3>
<P>
<B>void</B> <B>OnSelectCellImplementation</B>(<B>wxDC *</B><I>dc</I>, <B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
Virtual function called when the user left-clicks on a cell. If you override this function,
call wxGrid::OnSelectCell to apply the default behaviour.<P>
<HR>
<A NAME="wxgridsetcellalignment"></A>
<H3>wxGrid::SetCellAlignment</H3>
<P>
<B>void</B> <B>SetCellAlignment</B>(<B>int</B><I> alignment</I>, <B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
<B>void</B> <B>SetCellAlignment</B>(<B>int</B><I> alignment</I>)<P>
Sets the text alignment for the cell at the given position, or for the whole grid. <I>alignment</I> may be wxLEFT, wxRIGHT or wxCENTRE.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>SetCellAlignment(alignment, row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>SetDefCellAlignment(alignment)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridsetcellbackgroundcolour"></A>
<H3>wxGrid::SetCellBackgroundColour</H3>
<P>
<B>void</B> <B>SetCellBackgroundColour</B>(<B>const wxColour&</B><I> colour</I>, <B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
<B>void</B> <B>SetCellBackgroundColour</B>(<B>const wxColour&</B><I> colour</I>)<P>
Sets the background colour for the cell at the given position, or for the whole grid.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>SetCellBackgroundColour(colour, row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>SetDefCellBackgroundColour(colour)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridsetcelltextcolour"></A>
<H3>wxGrid::SetCellTextColour</H3>
<P>
<B>void</B> <B>SetCellTextColour</B>(<B>const wxColour&</B><I> colour</I>, <B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
<B>void</B> <B>SetCellTextColour</B>(<B>const wxColour&</B><I> colour</I>)<P>
Sets the text colour for the cell at the given position, or for the whole grid.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>SetCellTextColour(colour, row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>SetDefCellTextColour(colour)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridsetcelltextfont"></A>
<H3>wxGrid::SetCellTextFont</H3>
<P>
<B>void</B> <B>SetCellTextFont</B>(<B>const wxFont&</B><I> font</I>, <B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
<B>void</B> <B>SetCellTextFont</B>(<B>const wxFont&</B><I> font</I>)<P>
Sets the text font for the cell at the given position, or for the whole grid.<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
In place of a single overloaded method name, wxPython
implements the following methods:<P>
<UL><UL>
<TABLE>
<TR><TD VALIGN=TOP>
<B>SetCellTextFont(font, row, col)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
<TR><TD VALIGN=TOP>
<B>SetDefCellTextFont(font)</B>
</TD>
<TD VALIGN=TOP>
</TD></TR>
</TABLE>
</UL></UL>
<P>
<HR>
<A NAME="wxgridsetcellvalue"></A>
<H3>wxGrid::SetCellValue</H3>
<P>
<B>void</B> <B>SetCellValue</B>(<B>const wxString&</B><I> val</I>, <B>int</B><I> row</I>, <B>int</B><I> col</I>)<P>
Sets the cell value at the given position.<P>
<HR>
<A NAME="wxgridsetcolumnwidth"></A>
<H3>wxGrid::SetColumnWidth</H3>
<P>
<B>void</B> <B>SetColumnWidth</B>(<B>int</B><I> col</I>, <B>int</B><I> width</I>)<P>
Sets the width in pixels for column <I>col</I>.<P>
<HR>
<A NAME="wxgridsetdividerpen"></A>
<H3>wxGrid::SetDividerPen</H3>
<P>
<B>void</B> <B>SetDividerPen</B>(<B>const wxPen&</B><I> pen</I>)<P>
Specifies the pen to be used for drawing the divisions between cells. The default
is a light grey. If NULL is specified, the divisions will not be drawn.<P>
<HR>
<A NAME="wxgridseteditable"></A>
<H3>wxGrid::SetEditable</H3>
<P>
<B>void</B> <B>SetEditable</B>(<B>bool</B><I> editable</I>)<P>
If <I>editable</I> is TRUE (the default), the grid cells will be editable by means of the
text edit control. If FALSE, the text edit control will be hidden and the user will not
be able to edit the cell contents.<P>
<HR>
<A NAME="wxgridsetgridcursor"></A>
<H3>wxGrid::SetGridCursor</H3>
<P>
<B>void</B> <B>SetGridCursor</B>(<B>int </B><I>row</I>, <B>int</B><I> col</I>)<P>
Sets the position of the selected cell.<P>
<HR>
<A NAME="wxgridsetlabelalignment"></A>
<H3>wxGrid::SetLabelAlignment</H3>
<P>
<B>void</B> <B>SetLabelAlignment</B>(<B>int</B><I> orientation</I>, <B>int</B><I> alignment</I>)<P>
Sets the row or column label alignment. <I>orientation</I> should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.
<I>alignment</I> should be wxCENTRE, wxLEFT or wxRIGHT.<P>
<HR>
<A NAME="wxgridsetlabelbackgroundcolour"></A>
<H3>wxGrid::SetLabelBackgroundColour</H3>
<P>
<B>void</B> <B>SetLabelBackgroundColour</B>(<B>const wxColour&</B><I> value</I>)<P>
Sets a row or column label background colour.<P>
<HR>
<A NAME="wxgridsetlabelsize"></A>
<H3>wxGrid::SetLabelSize</H3>
<P>
<B>void</B> <B>SetLabelSize</B>(<B>int</B><I> orientation</I>, <B>int</B><I> size</I>)<P>
Sets the row label height, or column label width, in pixels. <I>orientation</I> should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.<P>
If a dimension of zero is specified, the row or column labels will not be
shown.<P>
<HR>
<A NAME="wxgridsetlabeltextcolour"></A>
<H3>wxGrid::SetLabelTextColour</H3>
<P>
<B>void</B> <B>SetLabelTextColour</B>(<B>const wxColour&</B><I> value</I>)<P>
Sets a row and column label text colour.<P>
<HR>
<A NAME="wxgridsetlabeltextfont"></A>
<H3>wxGrid::SetLabelTextFont</H3>
<P>
<B>void</B> <B>SetLabelTextFont</B>(<B>const wxFont&</B><I> font</I>)<P>
Sets the font to be used for the row and column labels.<P>
<HR>
<A NAME="wxgridsetlabelvalue"></A>
<H3>wxGrid::SetLabelValue</H3>
<P>
<B>void</B> <B>SetLabelValue</B>(<B>int</B><I> orientation</I>, <B>const wxString&</B><I> value</I>, <B>int</B><I> pos</I>)<P>
Sets a row or column label value. <I>orientation</I> should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.
<I>pos</I> is the label position.<P>
<HR>
<A NAME="wxgridsetrowheight"></A>
<H3>wxGrid::SetRowHeight</H3>
<P>
<B>void</B> <B>SetRowHeight</B>(<B>int</B><I> row</I>, <B>int</B><I> height</I>)<P>
Sets the height in pixels for row <I>row</I>.<P>
<HR>
<A NAME="wxgridupdatedimensions"></A>
<H3>wxGrid::UpdateDimensions</H3>
<P>
<B>void</B> <B>UpdateDimensions</B>()<P>
Call this function whenever a change has been made via the API that
might alter size characteristics. You may also need to follow it with
a call to AdjustScrollbars.<P>
</BODY></HTML>
|