1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _core.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13enum wxFlexSizerGrowMode 14{ 15 wxFLEX_GROWMODE_NONE, 16 wxFLEX_GROWMODE_SPECIFIED, 17 wxFLEX_GROWMODE_ALL 18}; 19 20class wxSizerItem : wxObject 21{ 22 %Docstring 23 SizerItem(window, flags) 24 SizerItem(window, proportion=0, flag=0, border=0, userData=None) 25 SizerItem(sizer, flags) 26 SizerItem(sizer, proportion=0, flag=0, border=0, userData=None) 27 SizerItem(width, height, proportion=0, flag=0, border=0, userData=None) 28 29 The wxSizerItem class is used to track the position, size and other 30 attributes of each item managed by a wxSizer. 31 %End 32 %TypeHeaderCode 33 #include <wx/sizer.h> 34 %End 35 36public: 37 wxSizerItem( 38 wxWindow * window, 39 const wxSizerFlags & flags 40 ); 41 42 wxSizerItem( 43 wxWindow * window, 44 int proportion = 0, 45 int flag = 0, 46 int border = 0, 47 wxPyUserData* userData /Transfer/ = NULL 48 ); 49 50 wxSizerItem( 51 wxSizer * sizer /Transfer/, 52 const wxSizerFlags & flags 53 ); 54 55 wxSizerItem( 56 wxSizer * sizer /Transfer/, 57 int proportion = 0, 58 int flag = 0, 59 int border = 0, 60 wxPyUserData* userData /Transfer/ = NULL 61 ); 62 63 wxSizerItem( 64 int width, 65 int height, 66 int proportion = 0, 67 int flag = 0, 68 int border = 0, 69 wxPyUserData* userData /Transfer/ = NULL 70 ); 71 72 ~wxSizerItem(); 73 74 void AssignSpacer( 75 const wxSize & size 76 ); 77 %Docstring 78 AssignSpacer(size) 79 AssignSpacer(w, h) 80 81 Set the size of the spacer tracked by this item. 82 %End 83 84 void AssignSpacer( 85 int w, 86 int h 87 ); 88 89 void SetRatio( 90 int width, 91 int height 92 ); 93 %Docstring 94 SetRatio(width, height) 95 SetRatio(size) 96 SetRatio(ratio) 97 98 Set the ratio item attribute. 99 %End 100 101 void SetRatio( 102 wxSize size 103 ); 104 105 void SetRatio( 106 float ratio 107 ); 108 109 void AssignWindow( 110 wxWindow * window 111 ); 112 %Docstring 113 AssignWindow(window) 114 115 Set the window to be tracked by this item. 116 %End 117 118 void AssignSizer( 119 wxSizer * sizer /Transfer/ 120 ); 121 %Docstring 122 AssignSizer(sizer) 123 124 Set the sizer tracked by this item. 125 %End 126 127 wxSize CalcMin(); 128 %Docstring 129 CalcMin() -> Size 130 131 Calculates the minimum desired size for the item, including any space 132 needed by borders. 133 %End 134 135 void DeleteWindows(); 136 %Docstring 137 DeleteWindows() 138 139 Destroy the window or the windows in a subsizer, depending on the type 140 of item. 141 %End 142 143 void DetachSizer(); 144 %Docstring 145 DetachSizer() 146 147 Enable deleting the SizerItem without destroying the contained sizer. 148 %End 149 150 int GetBorder() const; 151 %Docstring 152 GetBorder() -> int 153 154 Return the border attribute. 155 %End 156 157 int GetFlag() const; 158 %Docstring 159 GetFlag() -> int 160 161 Return the flags attribute. 162 %End 163 164 int GetId() const; 165 %Docstring 166 GetId() -> int 167 168 Return the numeric id of wxSizerItem, or wxID_NONE if the id has not 169 been set. 170 %End 171 172 wxSize GetMinSize() const; 173 %Docstring 174 GetMinSize() -> Size 175 176 Get the minimum size needed for the item. 177 %End 178 179 void SetMinSize( 180 const wxSize & size 181 ); 182 %Docstring 183 SetMinSize(size) 184 SetMinSize(x, y) 185 186 Sets the minimum size to be allocated for this item. 187 %End 188 189 void SetMinSize( 190 int x, 191 int y 192 ); 193 194 wxPoint GetPosition() const; 195 %Docstring 196 GetPosition() -> Point 197 198 What is the current position of the item, as set in the last Layout. 199 %End 200 201 int GetProportion() const; 202 %Docstring 203 GetProportion() -> int 204 205 Get the proportion item attribute. 206 %End 207 208 float GetRatio() const; 209 %Docstring 210 GetRatio() -> float 211 212 Get the ration item attribute. 213 %End 214 215 wxRect GetRect(); 216 %Docstring 217 GetRect() -> Rect 218 219 Get the rectangle of the item on the parent window, excluding borders. 220 %End 221 222 wxSize GetSize() const; 223 %Docstring 224 GetSize() -> Size 225 226 Get the current size of the item, as set in the last Layout. 227 %End 228 229 wxSizer * GetSizer() const; 230 %Docstring 231 GetSizer() -> Sizer 232 233 If this item is tracking a sizer, return it. 234 %End 235 236 wxSize GetSpacer() const; 237 %Docstring 238 GetSpacer() -> Size 239 240 If this item is tracking a spacer, return its size. 241 %End 242 243 wxPyUserData* GetUserData() const; 244 %Docstring 245 GetUserData() -> PyUserData 246 247 Get the userData item attribute. 248 %End 249 %MethodCode 250 PyErr_Clear(); 251 Py_BEGIN_ALLOW_THREADS 252 sipRes = _wxSizerItem_GetUserData(sipCpp); 253 Py_END_ALLOW_THREADS 254 if (PyErr_Occurred()) sipIsErr = 1; 255 %End 256 %TypeCode 257 wxPyUserData* _wxSizerItem_GetUserData(const wxSizerItem* self) 258 { 259 return dynamic_cast<wxPyUserData*>(self->GetUserData()); 260 } 261 %End 262 263 wxWindow * GetWindow() const; 264 %Docstring 265 GetWindow() -> Window 266 267 If this item is tracking a window then return it. 268 %End 269 270 bool IsShown() const; 271 %Docstring 272 IsShown() -> bool 273 274 Returns true if this item is a window or a spacer and it is shown or 275 if this item is a sizer and not all of its elements are hidden. 276 %End 277 278 bool IsSizer() const; 279 %Docstring 280 IsSizer() -> bool 281 282 Is this item a sizer? 283 %End 284 285 bool IsSpacer() const; 286 %Docstring 287 IsSpacer() -> bool 288 289 Is this item a spacer? 290 %End 291 292 bool IsWindow() const; 293 %Docstring 294 IsWindow() -> bool 295 296 Is this item a window? 297 %End 298 299 void SetBorder( 300 int border 301 ); 302 %Docstring 303 SetBorder(border) 304 305 Set the border item attribute. 306 %End 307 308 void SetDimension( 309 const wxPoint & pos, 310 const wxSize & size 311 ); 312 %Docstring 313 SetDimension(pos, size) 314 315 Set the position and size of the space allocated to the sizer, and 316 adjust the position and size of the item to be within that space 317 taking alignment and borders into account. 318 %End 319 320 void SetFlag( 321 int flag 322 ); 323 %Docstring 324 SetFlag(flag) 325 326 Set the flag item attribute. 327 %End 328 329 void SetId( 330 int id 331 ); 332 %Docstring 333 SetId(id) 334 335 Sets the numeric id of the wxSizerItem to id. 336 %End 337 338 void SetInitSize( 339 int x, 340 int y 341 ); 342 %Docstring 343 SetInitSize(x, y) 344 %End 345 346 void SetProportion( 347 int proportion 348 ); 349 %Docstring 350 SetProportion(proportion) 351 352 Set the proportion item attribute. 353 %End 354 355 void SetUserData( 356 wxPyUserData* userData /Transfer/ 357 ); 358 %Docstring 359 SetUserData(userData) 360 %End 361 362 void Show( 363 bool show 364 ); 365 %Docstring 366 Show(show) 367 368 Set the show item attribute, which sizers use to determine if the item 369 is to be made part of the layout or not. 370 %End 371 372 private: 373 wxSizerItem(const wxSizerItem&); 374 375 376 public: 377 378 379 %Property(name=Border, get=GetBorder, set=SetBorder) 380 %Property(name=Flag, get=GetFlag, set=SetFlag) 381 %Property(name=Id, get=GetId, set=SetId) 382 %Property(name=MinSize, get=GetMinSize, set=SetMinSize) 383 %Property(name=Position, get=GetPosition) 384 %Property(name=Proportion, get=GetProportion, set=SetProportion) 385 %Property(name=Ratio, get=GetRatio, set=SetRatio) 386 %Property(name=Rect, get=GetRect) 387 %Property(name=Size, get=GetSize) 388 %Property(name=Sizer, get=GetSizer) 389 %Property(name=Spacer, get=GetSpacer) 390 %Property(name=UserData, get=GetUserData, set=SetUserData) 391 %Property(name=Window, get=GetWindow) 392}; // end of class wxSizerItem 393 394 395class wxSizerFlags 396{ 397 %Docstring 398 SizerFlags(proportion=0) 399 400 Container for sizer items flags providing readable names for them. 401 %End 402 %TypeHeaderCode 403 #include <wx/sizer.h> 404 %End 405 406public: 407 wxSizerFlags( 408 int proportion = 0 409 ); 410 411 wxSizerFlags & Align( 412 int alignment 413 ); 414 %Docstring 415 Align(alignment) -> SizerFlags 416 417 Sets the alignment of this wxSizerFlags to align. 418 %End 419 420 wxSizerFlags & Border( 421 int direction, 422 int borderinpixels 423 ); 424 %Docstring 425 Border(direction, borderinpixels) -> SizerFlags 426 Border(direction=ALL) -> SizerFlags 427 428 Sets the wxSizerFlags to have a border of a number of pixels specified 429 by borderinpixels with the directions specified by direction. 430 %End 431 432 wxSizerFlags & Border( 433 int direction = wxALL 434 ); 435 436 wxSizerFlags & Bottom(); 437 %Docstring 438 Bottom() -> SizerFlags 439 440 Aligns the object to the bottom, similar for Align(wxALIGN_BOTTOM). 441 %End 442 443 wxSizerFlags & Center(); 444 %Docstring 445 Center() -> SizerFlags 446 447 Sets the object of the wxSizerFlags to center itself in the area it is 448 given. 449 %End 450 451 wxSizerFlags & Centre(); 452 %Docstring 453 Centre() -> SizerFlags 454 455 Center() for people with the other dialect of English. 456 %End 457 458 wxSizerFlags & DoubleBorder( 459 int direction = wxALL 460 ); 461 %Docstring 462 DoubleBorder(direction=ALL) -> SizerFlags 463 464 Sets the border in the given direction having twice the default border 465 size. 466 %End 467 468 wxSizerFlags & DoubleHorzBorder(); 469 %Docstring 470 DoubleHorzBorder() -> SizerFlags 471 472 Sets the border in left and right directions having twice the default 473 border size. 474 %End 475 476 wxSizerFlags & Expand(); 477 %Docstring 478 Expand() -> SizerFlags 479 480 Sets the object of the wxSizerFlags to expand to fill as much area as 481 it can. 482 %End 483 484 wxSizerFlags & FixedMinSize(); 485 %Docstring 486 FixedMinSize() -> SizerFlags 487 488 Set the wxFIXED_MINSIZE flag which indicates that the initial size of 489 the window should be also set as its minimal size. 490 %End 491 492 wxSizerFlags & ReserveSpaceEvenIfHidden(); 493 %Docstring 494 ReserveSpaceEvenIfHidden() -> SizerFlags 495 496 Set the wxRESERVE_SPACE_EVEN_IF_HIDDEN flag. 497 %End 498 499 wxSizerFlags & Left(); 500 %Docstring 501 Left() -> SizerFlags 502 503 Aligns the object to the left, similar for Align(wxALIGN_LEFT). 504 %End 505 506 wxSizerFlags & Proportion( 507 int proportion 508 ); 509 %Docstring 510 Proportion(proportion) -> SizerFlags 511 512 Sets the proportion of this wxSizerFlags to proportion. 513 %End 514 515 wxSizerFlags & Right(); 516 %Docstring 517 Right() -> SizerFlags 518 519 Aligns the object to the right, similar for Align(wxALIGN_RIGHT). 520 %End 521 522 wxSizerFlags & Shaped(); 523 %Docstring 524 Shaped() -> SizerFlags 525 526 Set the wx_SHAPED flag which indicates that the elements should always 527 keep the fixed width to height ratio equal to its original value. 528 %End 529 530 wxSizerFlags & Top(); 531 %Docstring 532 Top() -> SizerFlags 533 534 Aligns the object to the top, similar for Align(wxALIGN_TOP). 535 %End 536 537 wxSizerFlags & TripleBorder( 538 int direction = wxALL 539 ); 540 %Docstring 541 TripleBorder(direction=ALL) -> SizerFlags 542 543 Sets the border in the given direction having thrice the default 544 border size. 545 %End 546 547 static 548 int GetDefaultBorder(); 549 %Docstring 550 GetDefaultBorder() -> int 551 552 Returns the border used by default in Border() method. 553 %End 554 555}; // end of class wxSizerFlags 556 557 558class wxSizer : wxObject 559{ 560 %Docstring 561 Sizer() 562 563 wxSizer is the abstract base class used for laying out subwindows in a 564 window. 565 %End 566 %TypeHeaderCode 567 #include <wx/sizer.h> 568 %End 569 570public: 571 wxSizer(); 572 573 ~wxSizer(); 574 575 wxSizerItemList & GetChildren() /NoCopy/; 576 %Docstring 577 GetChildren() -> SizerItemList 578 579 Returns the list of the items in this sizer. 580 %End 581 582 bool SetItemMinSize( 583 wxWindow * window, 584 int width, 585 int height 586 ); 587 %Docstring 588 SetItemMinSize(window, width, height) -> bool 589 SetItemMinSize(window, size) -> bool 590 SetItemMinSize(sizer, width, height) -> bool 591 SetItemMinSize(sizer, size) -> bool 592 SetItemMinSize(index, width, height) -> bool 593 SetItemMinSize(index, size) -> bool 594 595 Set an item's minimum size by window, sizer, or position. 596 %End 597 598 bool SetItemMinSize( 599 wxWindow * window, 600 const wxSize & size 601 ); 602 603 bool SetItemMinSize( 604 wxSizer * sizer, 605 int width, 606 int height 607 ); 608 609 bool SetItemMinSize( 610 wxSizer * sizer, 611 const wxSize & size 612 ); 613 614 bool SetItemMinSize( 615 size_t index, 616 int width, 617 int height 618 ); 619 620 bool SetItemMinSize( 621 size_t index, 622 const wxSize & size 623 ); 624 625 wxSizerItem * Add( 626 wxWindow * window, 627 const wxSizerFlags & flags 628 ); 629 %Docstring 630 Add(window, flags) -> SizerItem 631 Add(window, proportion=0, flag=0, border=0, userData=None) -> SizerItem 632 Add(sizer, flags) -> SizerItem 633 Add(sizer, proportion=0, flag=0, border=0, userData=None) -> SizerItem 634 Add(width, height, proportion=0, flag=0, border=0, userData=None) -> SizerItem 635 Add(width, height, flags) -> SizerItem 636 Add(item) -> SizerItem 637 Add(size, proportion=0, flag=0, border=0, /Transfer/=None) -> SizerItem 638 Add(size, flags) -> SizerItem 639 640 Appends a child to the sizer. 641 %End 642 643 wxSizerItem * Add( 644 wxWindow * window, 645 int proportion = 0, 646 int flag = 0, 647 int border = 0, 648 wxPyUserData* userData /Transfer/ = NULL 649 ); 650 651 wxSizerItem * Add( 652 wxSizer * sizer /Transfer/, 653 const wxSizerFlags & flags 654 ); 655 656 wxSizerItem * Add( 657 wxSizer * sizer /Transfer/, 658 int proportion = 0, 659 int flag = 0, 660 int border = 0, 661 wxPyUserData* userData /Transfer/ = NULL 662 ); 663 664 wxSizerItem * Add( 665 int width, 666 int height, 667 int proportion = 0, 668 int flag = 0, 669 int border = 0, 670 wxPyUserData* userData /Transfer/ = NULL 671 ); 672 673 wxSizerItem * Add( 674 int width, 675 int height, 676 const wxSizerFlags & flags 677 ); 678 679 wxSizerItem * Add( 680 wxSizerItem * item /Transfer/ 681 ); 682 683 wxSizerItem* Add(const wxSize& size, int proportion=0, int flag=0, int border=0, wxPyUserData* userData /Transfer/ = NULL); 684 %MethodCode 685 PyErr_Clear(); 686 Py_BEGIN_ALLOW_THREADS 687 sipRes = _wxSizer_Add(sipCpp, size, proportion, flag, border, userData); 688 Py_END_ALLOW_THREADS 689 if (PyErr_Occurred()) sipIsErr = 1; 690 %End 691 %TypeCode 692 wxSizerItem* _wxSizer_Add(wxSizer* self, const wxSize* size, int proportion, int flag, int border, wxPyUserData* userData ) 693 { 694 return self->Add(size->x, size->y, proportion, flag, border, userData); 695 } 696 %End 697 698 wxSizerItem* Add(const wxSize& size, const wxSizerFlags& flags); 699 %MethodCode 700 PyErr_Clear(); 701 Py_BEGIN_ALLOW_THREADS 702 sipRes = _wxSizer_Add(sipCpp, size, flags); 703 Py_END_ALLOW_THREADS 704 if (PyErr_Occurred()) sipIsErr = 1; 705 %End 706 %TypeCode 707 wxSizerItem* _wxSizer_Add(wxSizer* self, const wxSize* size, const wxSizerFlags* flags) 708 { 709 return self->Add(size->x, size->y, *flags); 710 } 711 %End 712 713 wxSizerItem * AddSpacer( 714 int size 715 ); 716 %Docstring 717 AddSpacer(size) -> SizerItem 718 719 This base function adds non-stretchable space to both the horizontal 720 and vertical orientation of the sizer. 721 %End 722 723 wxSizerItem * AddStretchSpacer( 724 int prop = 1 725 ); 726 %Docstring 727 AddStretchSpacer(prop=1) -> SizerItem 728 729 Adds stretchable space to the sizer. 730 %End 731 732 virtual 733 wxSize CalcMin() = 0; 734 %Docstring 735 CalcMin() -> Size 736 737 This method is abstract and has to be overwritten by any derived 738 class. 739 %End 740 741 void Clear( 742 bool delete_windows = false 743 ); 744 %Docstring 745 Clear(delete_windows=False) 746 747 Detaches all children from the sizer. 748 %End 749 750 wxSize ComputeFittingClientSize( 751 wxWindow * window 752 ); 753 %Docstring 754 ComputeFittingClientSize(window) -> Size 755 756 Computes client area size for window so that it matches the sizer's 757 minimal size. 758 %End 759 760 wxSize ComputeFittingWindowSize( 761 wxWindow * window 762 ); 763 %Docstring 764 ComputeFittingWindowSize(window) -> Size 765 766 Like ComputeFittingClientSize(), but converts the result into window 767 size. 768 %End 769 770 bool Detach( 771 wxWindow * window 772 ); 773 %Docstring 774 Detach(window) -> bool 775 Detach(sizer) -> bool 776 Detach(index) -> bool 777 778 Detach the child window from the sizer without destroying it. 779 %End 780 781 bool Detach( 782 wxSizer * sizer 783 ); 784 785 bool Detach( 786 int index 787 ); 788 789 wxSize Fit( 790 wxWindow * window 791 ); 792 %Docstring 793 Fit(window) -> Size 794 795 Tell the sizer to resize the window so that its client area matches 796 the sizer's minimal size (ComputeFittingClientSize() is called to 797 determine it). 798 %End 799 800 void FitInside( 801 wxWindow * window 802 ); 803 %Docstring 804 FitInside(window) 805 806 Tell the sizer to resize the virtual size of the window to match the 807 sizer's minimal size. 808 %End 809 810 bool InformFirstDirection( 811 int direction, 812 int size, 813 int availableOtherDir 814 ); 815 %Docstring 816 InformFirstDirection(direction, size, availableOtherDir) -> bool 817 818 Inform sizer about the first direction that has been decided (by 819 parent item). 820 %End 821 822 wxWindow * GetContainingWindow() const; 823 %Docstring 824 GetContainingWindow() -> Window 825 826 Returns the window this sizer is used in or NULL if none. 827 %End 828 829 void SetContainingWindow( 830 wxWindow * window 831 ); 832 %Docstring 833 SetContainingWindow(window) 834 835 Set the window this sizer is used in. 836 %End 837 838 size_t GetItemCount() const; 839 %Docstring 840 GetItemCount() -> size_t 841 842 Returns the number of items in the sizer. 843 %End 844 845 wxSizerItem * GetItem( 846 wxWindow * window, 847 bool recursive = false 848 ); 849 %Docstring 850 GetItem(window, recursive=False) -> SizerItem 851 GetItem(sizer, recursive=False) -> SizerItem 852 GetItem(index) -> SizerItem 853 854 Finds wxSizerItem which holds the given window. 855 %End 856 857 wxSizerItem * GetItem( 858 wxSizer * sizer, 859 bool recursive = false 860 ); 861 862 wxSizerItem * GetItem( 863 size_t index 864 ); 865 866 wxSizerItem * GetItemById( 867 int id, 868 bool recursive = false 869 ); 870 %Docstring 871 GetItemById(id, recursive=False) -> SizerItem 872 873 Finds item of the sizer which has the given id. 874 %End 875 876 wxSize GetMinSize(); 877 %Docstring 878 GetMinSize() -> Size 879 880 Returns the minimal size of the sizer. 881 %End 882 883 wxPoint GetPosition() const; 884 %Docstring 885 GetPosition() -> Point 886 887 Returns the current position of the sizer. 888 %End 889 890 wxSize GetSize() const; 891 %Docstring 892 GetSize() -> Size 893 894 Returns the current size of the sizer. 895 %End 896 897 bool Hide( 898 wxWindow * window, 899 bool recursive = false 900 ); 901 %Docstring 902 Hide(window, recursive=False) -> bool 903 Hide(sizer, recursive=False) -> bool 904 Hide(index) -> bool 905 906 Hides the child window. 907 %End 908 909 bool Hide( 910 wxSizer * sizer, 911 bool recursive = false 912 ); 913 914 bool Hide( 915 size_t index 916 ); 917 918 wxSizerItem * Insert( 919 size_t index, 920 wxWindow * window, 921 const wxSizerFlags & flags 922 ); 923 %Docstring 924 Insert(index, window, flags) -> SizerItem 925 Insert(index, window, proportion=0, flag=0, border=0, userData=None) -> SizerItem 926 Insert(index, sizer, flags) -> SizerItem 927 Insert(index, sizer, proportion=0, flag=0, border=0, userData=None) -> SizerItem 928 Insert(index, width, height, proportion=0, flag=0, border=0, userData=None) -> SizerItem 929 Insert(index, width, height, flags) -> SizerItem 930 Insert(index, item) -> SizerItem 931 Insert(index, size, proportion=0, flag=0, border=0, /Transfer/=None) -> SizerItem 932 Insert(index, size, flags) -> SizerItem 933 934 Insert a child into the sizer before any existing item at index. 935 %End 936 937 wxSizerItem * Insert( 938 size_t index, 939 wxWindow * window, 940 int proportion = 0, 941 int flag = 0, 942 int border = 0, 943 wxPyUserData* userData /Transfer/ = NULL 944 ); 945 946 wxSizerItem * Insert( 947 size_t index, 948 wxSizer * sizer /Transfer/, 949 const wxSizerFlags & flags 950 ); 951 952 wxSizerItem * Insert( 953 size_t index, 954 wxSizer * sizer /Transfer/, 955 int proportion = 0, 956 int flag = 0, 957 int border = 0, 958 wxPyUserData* userData /Transfer/ = NULL 959 ); 960 961 wxSizerItem * Insert( 962 size_t index, 963 int width, 964 int height, 965 int proportion = 0, 966 int flag = 0, 967 int border = 0, 968 wxPyUserData* userData /Transfer/ = NULL 969 ); 970 971 wxSizerItem * Insert( 972 size_t index, 973 int width, 974 int height, 975 const wxSizerFlags & flags 976 ); 977 978 wxSizerItem * Insert( 979 size_t index, 980 wxSizerItem * item /Transfer/ 981 ); 982 983 wxSizerItem* Insert(ulong index, const wxSize& size, int proportion=0, int flag=0, int border=0, wxPyUserData* userData /Transfer/ = NULL); 984 %MethodCode 985 PyErr_Clear(); 986 Py_BEGIN_ALLOW_THREADS 987 sipRes = _wxSizer_Insert(sipCpp, index, size, proportion, flag, border, userData); 988 Py_END_ALLOW_THREADS 989 if (PyErr_Occurred()) sipIsErr = 1; 990 %End 991 %TypeCode 992 wxSizerItem* _wxSizer_Insert(wxSizer* self, ulong index, const wxSize* size, int proportion, int flag, int border, wxPyUserData* userData ) 993 { 994 return self->Insert(index, size->x, size->y, proportion, flag, border, userData); 995 } 996 %End 997 998 wxSizerItem* Insert(ulong index, const wxSize& size, const wxSizerFlags& flags); 999 %MethodCode 1000 PyErr_Clear(); 1001 Py_BEGIN_ALLOW_THREADS 1002 sipRes = _wxSizer_Insert(sipCpp, index, size, flags); 1003 Py_END_ALLOW_THREADS 1004 if (PyErr_Occurred()) sipIsErr = 1; 1005 %End 1006 %TypeCode 1007 wxSizerItem* _wxSizer_Insert(wxSizer* self, ulong index, const wxSize* size, const wxSizerFlags* flags) 1008 { 1009 return self->Insert(index, size->x, size->y, *flags); 1010 } 1011 %End 1012 1013 wxSizerItem * InsertSpacer( 1014 size_t index, 1015 int size 1016 ); 1017 %Docstring 1018 InsertSpacer(index, size) -> SizerItem 1019 1020 Inserts non-stretchable space to the sizer. 1021 %End 1022 1023 wxSizerItem * InsertStretchSpacer( 1024 size_t index, 1025 int prop = 1 1026 ); 1027 %Docstring 1028 InsertStretchSpacer(index, prop=1) -> SizerItem 1029 1030 Inserts stretchable space to the sizer. 1031 %End 1032 1033 bool IsEmpty() const; 1034 %Docstring 1035 IsEmpty() -> bool 1036 1037 Return true if the sizer has no elements. 1038 %End 1039 1040 bool IsShown( 1041 wxWindow * window 1042 ) const; 1043 %Docstring 1044 IsShown(window) -> bool 1045 IsShown(sizer) -> bool 1046 IsShown(index) -> bool 1047 1048 Returns true if the window is shown. 1049 %End 1050 1051 bool IsShown( 1052 wxSizer * sizer 1053 ) const; 1054 1055 bool IsShown( 1056 size_t index 1057 ) const; 1058 1059 void Layout(); 1060 %Docstring 1061 Layout() 1062 1063 Call this to force layout of the children anew, e.g. after having 1064 added a child to or removed a child (window, other sizer or space) 1065 from the sizer while keeping the current dimension. 1066 %End 1067 1068 wxSizerItem * Prepend( 1069 wxWindow * window, 1070 const wxSizerFlags & flags 1071 ); 1072 %Docstring 1073 Prepend(window, flags) -> SizerItem 1074 Prepend(window, proportion=0, flag=0, border=0, userData=None) -> SizerItem 1075 Prepend(sizer, flags) -> SizerItem 1076 Prepend(sizer, proportion=0, flag=0, border=0, userData=None) -> SizerItem 1077 Prepend(width, height, proportion=0, flag=0, border=0, userData=None) -> SizerItem 1078 Prepend(width, height, flags) -> SizerItem 1079 Prepend(item) -> SizerItem 1080 Prepend(size, proportion=0, flag=0, border=0, /Transfer/=None) -> SizerItem 1081 Prepend(size, flags) -> SizerItem 1082 1083 Same as Add(), but prepends the items to the beginning of the list of 1084 items (windows, subsizers or spaces) owned by this sizer. 1085 %End 1086 1087 wxSizerItem * Prepend( 1088 wxWindow * window, 1089 int proportion = 0, 1090 int flag = 0, 1091 int border = 0, 1092 wxPyUserData* userData /Transfer/ = NULL 1093 ); 1094 1095 wxSizerItem * Prepend( 1096 wxSizer * sizer /Transfer/, 1097 const wxSizerFlags & flags 1098 ); 1099 1100 wxSizerItem * Prepend( 1101 wxSizer * sizer /Transfer/, 1102 int proportion = 0, 1103 int flag = 0, 1104 int border = 0, 1105 wxPyUserData* userData /Transfer/ = NULL 1106 ); 1107 1108 wxSizerItem * Prepend( 1109 int width, 1110 int height, 1111 int proportion = 0, 1112 int flag = 0, 1113 int border = 0, 1114 wxPyUserData* userData /Transfer/ = NULL 1115 ); 1116 1117 wxSizerItem * Prepend( 1118 int width, 1119 int height, 1120 const wxSizerFlags & flags 1121 ); 1122 1123 wxSizerItem * Prepend( 1124 wxSizerItem * item /Transfer/ 1125 ); 1126 1127 wxSizerItem* Prepend(const wxSize& size, int proportion=0, int flag=0, int border=0, wxPyUserData* userData /Transfer/ = NULL); 1128 %MethodCode 1129 PyErr_Clear(); 1130 Py_BEGIN_ALLOW_THREADS 1131 sipRes = _wxSizer_Prepend(sipCpp, size, proportion, flag, border, userData); 1132 Py_END_ALLOW_THREADS 1133 if (PyErr_Occurred()) sipIsErr = 1; 1134 %End 1135 %TypeCode 1136 wxSizerItem* _wxSizer_Prepend(wxSizer* self, const wxSize* size, int proportion, int flag, int border, wxPyUserData* userData ) 1137 { 1138 return self->Prepend(size->x, size->y, proportion, flag, border, userData); 1139 } 1140 %End 1141 1142 wxSizerItem* Prepend(const wxSize& size, const wxSizerFlags& flags); 1143 %MethodCode 1144 PyErr_Clear(); 1145 Py_BEGIN_ALLOW_THREADS 1146 sipRes = _wxSizer_Prepend(sipCpp, size, flags); 1147 Py_END_ALLOW_THREADS 1148 if (PyErr_Occurred()) sipIsErr = 1; 1149 %End 1150 %TypeCode 1151 wxSizerItem* _wxSizer_Prepend(wxSizer* self, const wxSize* size, const wxSizerFlags* flags) 1152 { 1153 return self->Prepend(size->x, size->y, *flags); 1154 } 1155 %End 1156 1157 wxSizerItem * PrependSpacer( 1158 int size 1159 ); 1160 %Docstring 1161 PrependSpacer(size) -> SizerItem 1162 1163 Prepends non-stretchable space to the sizer. 1164 %End 1165 1166 wxSizerItem * PrependStretchSpacer( 1167 int prop = 1 1168 ); 1169 %Docstring 1170 PrependStretchSpacer(prop=1) -> SizerItem 1171 1172 Prepends stretchable space to the sizer. 1173 %End 1174 1175 virtual 1176 void RecalcSizes() = 0; 1177 %Docstring 1178 RecalcSizes() 1179 1180 This method is abstract and has to be overwritten by any derived 1181 class. 1182 %End 1183 1184 bool Remove( 1185 wxSizer * sizer 1186 ); 1187 %Docstring 1188 Remove(sizer) -> bool 1189 Remove(index) -> bool 1190 1191 Removes a sizer child from the sizer and destroys it. 1192 %End 1193 1194 bool Remove( 1195 int index 1196 ); 1197 1198 bool Replace( 1199 wxWindow * oldwin, 1200 wxWindow * newwin, 1201 bool recursive = false 1202 ); 1203 %Docstring 1204 Replace(oldwin, newwin, recursive=False) -> bool 1205 Replace(oldsz, newsz, recursive=False) -> bool 1206 Replace(index, newitem) -> bool 1207 1208 Detaches the given oldwin from the sizer and replaces it with the 1209 given newwin. 1210 %End 1211 1212 bool Replace( 1213 wxSizer * oldsz, 1214 wxSizer * newsz, 1215 bool recursive = false 1216 ); 1217 1218 bool Replace( 1219 size_t index, 1220 wxSizerItem * newitem 1221 ); 1222 1223 void SetDimension( 1224 int x, 1225 int y, 1226 int width, 1227 int height 1228 ); 1229 %Docstring 1230 SetDimension(x, y, width, height) 1231 SetDimension(pos, size) 1232 1233 Call this to force the sizer to take the given dimension and thus 1234 force the items owned by the sizer to resize themselves according to 1235 the rules defined by the parameter in the Add() and Prepend() methods. 1236 %End 1237 1238 void SetDimension( 1239 const wxPoint & pos, 1240 const wxSize & size 1241 ); 1242 1243 void SetMinSize( 1244 const wxSize & size 1245 ); 1246 %Docstring 1247 SetMinSize(size) 1248 SetMinSize(width, height) 1249 1250 Call this to give the sizer a minimal size. 1251 %End 1252 1253 void SetMinSize( 1254 int width, 1255 int height 1256 ); 1257 1258 void SetSizeHints( 1259 wxWindow * window 1260 ); 1261 %Docstring 1262 SetSizeHints(window) 1263 1264 This method first calls Fit() and then 1265 wxTopLevelWindow::SetSizeHints() on the window passed to it. 1266 %End 1267 1268 void SetVirtualSizeHints( 1269 wxWindow * window 1270 ) /Deprecated/; 1271 %Docstring 1272 SetVirtualSizeHints(window) 1273 1274 Tell the sizer to set the minimal size of the window virtual area to 1275 match the sizer's minimal size. 1276 %End 1277 1278 bool Show( 1279 wxWindow * window, 1280 bool show = true, 1281 bool recursive = false 1282 ); 1283 %Docstring 1284 Show(window, show=True, recursive=False) -> bool 1285 Show(sizer, show=True, recursive=False) -> bool 1286 Show(index, show=True) -> bool 1287 1288 Shows or hides the window. 1289 %End 1290 1291 bool Show( 1292 wxSizer * sizer, 1293 bool show = true, 1294 bool recursive = false 1295 ); 1296 1297 bool Show( 1298 size_t index, 1299 bool show = true 1300 ); 1301 1302 void ShowItems( 1303 bool show 1304 ); 1305 %Docstring 1306 ShowItems(show) 1307 1308 Show or hide all items managed by the sizer. 1309 %End 1310 1311 private: 1312 wxSizer(const wxSizer&); 1313 1314 1315 private: 1316 wxSizer& operator=(const wxSizer&); 1317 1318 1319 public: 1320 1321 1322 %Property(name=Children, get=GetChildren) 1323 %Property(name=ContainingWindow, get=GetContainingWindow, set=SetContainingWindow) 1324 %Property(name=ItemCount, get=GetItemCount) 1325 %Property(name=MinSize, get=GetMinSize, set=SetMinSize) 1326 %Property(name=Position, get=GetPosition) 1327 %Property(name=Size, get=GetSize) 1328}; // end of class wxSizer 1329 1330 1331%Extract(id=pycode_core) 1332def _Sizer_AddMany(self, items): 1333 """ 1334 :meth:`AddMany` is a convenience method for adding several items to a sizer 1335 at one time. Simply pass it a list of tuples, where each tuple 1336 consists of the parameters that you would normally pass to the :meth:`Add` 1337 method. 1338 """ 1339 for item in items: 1340 if not isinstance(item, (tuple, list)): 1341 item = (item, ) 1342 self.Add(*item) 1343Sizer.AddMany = _Sizer_AddMany 1344del _Sizer_AddMany 1345%End 1346 1347%Extract(id=pycode_core) 1348def _Sizer___nonzero__(self): 1349 """ 1350 Can be used to test if the C++ part of the sizer still exists, with 1351 code like this:: 1352 1353 if theSizer: 1354 doSomething() 1355 """ 1356 import wx.siplib 1357 return not wx.siplib.isdeleted(self) 1358Sizer.__nonzero__ = _Sizer___nonzero__ 1359del _Sizer___nonzero__ 1360%End 1361 1362%Extract(id=pycode_core) 1363def _Sizer___iter__(self): 1364 """ 1365 A Py convenience method that allows Sizers to act as iterables that will yield their wx.SizerItems. 1366 """ 1367 for item in self.GetChildren(): yield item 1368Sizer.__iter__ = _Sizer___iter__ 1369del _Sizer___iter__ 1370%End 1371 1372%Extract(id=pycode_core) 1373Sizer.__bool__ = Sizer.__nonzero__ 1374 1375%End 1376 1377class wxBoxSizer : wxSizer 1378{ 1379 %Docstring 1380 BoxSizer(orient=HORIZONTAL) 1381 1382 The basic idea behind a box sizer is that windows will most often be 1383 laid out in rather simple basic geometry, typically in a row or a 1384 column or several hierarchies of either. 1385 %End 1386 %TypeHeaderCode 1387 #include <wx/sizer.h> 1388 %End 1389 1390public: 1391 wxBoxSizer( 1392 int orient = wxHORIZONTAL 1393 ); 1394 1395 wxSizerItem * AddSpacer( 1396 int size 1397 ); 1398 %Docstring 1399 AddSpacer(size) -> SizerItem 1400 1401 Adds non-stretchable space to the main orientation of the sizer only. 1402 %End 1403 1404 virtual 1405 wxSize CalcMin(); 1406 %Docstring 1407 CalcMin() -> Size 1408 1409 Implements the calculation of a box sizer's minimal. 1410 %End 1411 1412 int GetOrientation() const; 1413 %Docstring 1414 GetOrientation() -> int 1415 1416 Returns the orientation of the box sizer, either wxVERTICAL or 1417 wxHORIZONTAL. 1418 %End 1419 1420 void SetOrientation( 1421 int orient 1422 ); 1423 %Docstring 1424 SetOrientation(orient) 1425 1426 Sets the orientation of the box sizer, either wxVERTICAL or 1427 wxHORIZONTAL. 1428 %End 1429 1430 virtual 1431 void RecalcSizes(); 1432 %Docstring 1433 RecalcSizes() 1434 1435 Implements the calculation of a box sizer's dimensions and then sets 1436 the size of its children (calling wxWindow::SetSize if the child is a 1437 window). 1438 %End 1439 1440 public: 1441 1442 1443 %Property(name=Orientation, get=GetOrientation, set=SetOrientation) 1444}; // end of class wxBoxSizer 1445 1446 1447class wxStaticBoxSizer : wxBoxSizer 1448{ 1449 %Docstring 1450 StaticBoxSizer(box, orient=HORIZONTAL) 1451 StaticBoxSizer(orient, parent, label=EmptyString) 1452 1453 wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static 1454 box around the sizer. 1455 %End 1456 %TypeHeaderCode 1457 #include <wx/sizer.h> 1458 %End 1459 1460public: 1461 wxStaticBoxSizer( 1462 wxStaticBox * box, 1463 int orient = wxHORIZONTAL 1464 ); 1465 1466 wxStaticBoxSizer( 1467 int orient, 1468 wxWindow * parent, 1469 const wxString & label = wxEmptyString 1470 ); 1471 1472 wxStaticBox * GetStaticBox() const; 1473 %Docstring 1474 GetStaticBox() -> StaticBox 1475 1476 Returns the static box associated with the sizer. 1477 %End 1478 1479 virtual 1480 wxSize CalcMin(); 1481 %Docstring 1482 CalcMin() -> Size 1483 1484 Implements the calculation of a box sizer's minimal. 1485 %End 1486 1487 virtual 1488 void RecalcSizes(); 1489 %Docstring 1490 RecalcSizes() 1491 1492 Implements the calculation of a box sizer's dimensions and then sets 1493 the size of its children (calling wxWindow::SetSize if the child is a 1494 window). 1495 %End 1496 1497 public: 1498 1499 1500 %Property(name=StaticBox, get=GetStaticBox) 1501}; // end of class wxStaticBoxSizer 1502 1503 1504class wxGridSizer : wxSizer 1505{ 1506 %Docstring 1507 GridSizer(cols, vgap, hgap) 1508 GridSizer(cols, gap=Size(0,0)) 1509 GridSizer(rows, cols, vgap, hgap) 1510 GridSizer(rows, cols, gap) 1511 1512 A grid sizer is a sizer which lays out its children in a two- 1513 dimensional table with all table fields having the same size, i.e. 1514 %End 1515 %TypeHeaderCode 1516 #include <wx/sizer.h> 1517 %End 1518 1519public: 1520 wxGridSizer( 1521 int cols, 1522 int vgap, 1523 int hgap 1524 ); 1525 1526 wxGridSizer( 1527 int cols, 1528 const wxSize & gap = wxSize(0, 0) 1529 ); 1530 1531 wxGridSizer( 1532 int rows, 1533 int cols, 1534 int vgap, 1535 int hgap 1536 ); 1537 1538 wxGridSizer( 1539 int rows, 1540 int cols, 1541 const wxSize & gap 1542 ); 1543 1544 int GetCols() const; 1545 %Docstring 1546 GetCols() -> int 1547 1548 Returns the number of columns that has been specified for the sizer. 1549 %End 1550 1551 int GetRows() const; 1552 %Docstring 1553 GetRows() -> int 1554 1555 Returns the number of rows that has been specified for the sizer. 1556 %End 1557 1558 int GetEffectiveColsCount() const; 1559 %Docstring 1560 GetEffectiveColsCount() -> int 1561 1562 Returns the number of columns currently used by the sizer. 1563 %End 1564 1565 int GetEffectiveRowsCount() const; 1566 %Docstring 1567 GetEffectiveRowsCount() -> int 1568 1569 Returns the number of rows currently used by the sizer. 1570 %End 1571 1572 int GetHGap() const; 1573 %Docstring 1574 GetHGap() -> int 1575 1576 Returns the horizontal gap (in pixels) between cells in the sizer. 1577 %End 1578 1579 int GetVGap() const; 1580 %Docstring 1581 GetVGap() -> int 1582 1583 Returns the vertical gap (in pixels) between the cells in the sizer. 1584 %End 1585 1586 void SetCols( 1587 int cols 1588 ); 1589 %Docstring 1590 SetCols(cols) 1591 1592 Sets the number of columns in the sizer. 1593 %End 1594 1595 void SetHGap( 1596 int gap 1597 ); 1598 %Docstring 1599 SetHGap(gap) 1600 1601 Sets the horizontal gap (in pixels) between cells in the sizer. 1602 %End 1603 1604 void SetRows( 1605 int rows 1606 ); 1607 %Docstring 1608 SetRows(rows) 1609 1610 Sets the number of rows in the sizer. 1611 %End 1612 1613 void SetVGap( 1614 int gap 1615 ); 1616 %Docstring 1617 SetVGap(gap) 1618 1619 Sets the vertical gap (in pixels) between the cells in the sizer. 1620 %End 1621 1622 virtual 1623 wxSize CalcMin(); 1624 %Docstring 1625 CalcMin() -> Size 1626 1627 This method is abstract and has to be overwritten by any derived 1628 class. 1629 %End 1630 1631 virtual 1632 void RecalcSizes(); 1633 %Docstring 1634 RecalcSizes() 1635 1636 This method is abstract and has to be overwritten by any derived 1637 class. 1638 %End 1639 1640 public: 1641 1642 1643 %Property(name=Cols, get=GetCols, set=SetCols) 1644 %Property(name=EffectiveColsCount, get=GetEffectiveColsCount) 1645 %Property(name=EffectiveRowsCount, get=GetEffectiveRowsCount) 1646 %Property(name=HGap, get=GetHGap, set=SetHGap) 1647 %Property(name=Rows, get=GetRows, set=SetRows) 1648 %Property(name=VGap, get=GetVGap, set=SetVGap) 1649}; // end of class wxGridSizer 1650 1651 1652%Extract(id=pycode_core) 1653def _GridSizer_CalcRowsCols(self): 1654 """ 1655 CalcRowsCols() -> (rows, cols) 1656 1657 Calculates how many rows and columns will be in the sizer based 1658 on the current number of items and also the rows, cols specified 1659 in the constructor. 1660 """ 1661 nitems = len(self.GetChildren()) 1662 rows = self.GetRows() 1663 cols = self.GetCols() 1664 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" 1665 if cols != 0: 1666 rows = (nitems + cols - 1) / cols 1667 elif rows != 0: 1668 cols = (nitems + rows - 1) / rows 1669 return (rows, cols) 1670GridSizer.CalcRowsCols = _GridSizer_CalcRowsCols 1671del _GridSizer_CalcRowsCols 1672%End 1673 1674class wxFlexGridSizer : wxGridSizer 1675{ 1676 %Docstring 1677 FlexGridSizer(cols, vgap, hgap) 1678 FlexGridSizer(cols, gap=Size(0,0)) 1679 FlexGridSizer(rows, cols, vgap, hgap) 1680 FlexGridSizer(rows, cols, gap) 1681 1682 A flex grid sizer is a sizer which lays out its children in a two- 1683 dimensional table with all table fields in one row having the same 1684 height and all fields in one column having the same width, but all 1685 rows or all columns are not necessarily the same height or width as in 1686 the wxGridSizer. 1687 %End 1688 %TypeHeaderCode 1689 #include <wx/sizer.h> 1690 %End 1691 1692public: 1693 wxFlexGridSizer( 1694 int cols, 1695 int vgap, 1696 int hgap 1697 ); 1698 1699 wxFlexGridSizer( 1700 int cols, 1701 const wxSize & gap = wxSize(0, 0) 1702 ); 1703 1704 wxFlexGridSizer( 1705 int rows, 1706 int cols, 1707 int vgap, 1708 int hgap 1709 ); 1710 1711 wxFlexGridSizer( 1712 int rows, 1713 int cols, 1714 const wxSize & gap 1715 ); 1716 1717 void AddGrowableCol( 1718 size_t idx, 1719 int proportion = 0 1720 ); 1721 %Docstring 1722 AddGrowableCol(idx, proportion=0) 1723 1724 Specifies that column idx (starting from zero) should be grown if 1725 there is extra space available to the sizer. 1726 %End 1727 1728 void AddGrowableRow( 1729 size_t idx, 1730 int proportion = 0 1731 ); 1732 %Docstring 1733 AddGrowableRow(idx, proportion=0) 1734 1735 Specifies that row idx (starting from zero) should be grown if there 1736 is extra space available to the sizer. 1737 %End 1738 1739 int GetFlexibleDirection() const; 1740 %Docstring 1741 GetFlexibleDirection() -> int 1742 1743 Returns a wxOrientation value that specifies whether the sizer 1744 flexibly resizes its columns, rows, or both (default). 1745 %End 1746 1747 wxFlexSizerGrowMode GetNonFlexibleGrowMode() const; 1748 %Docstring 1749 GetNonFlexibleGrowMode() -> FlexSizerGrowMode 1750 1751 Returns the value that specifies how the sizer grows in the "non- 1752 flexible" direction if there is one. 1753 %End 1754 1755 bool IsColGrowable( 1756 size_t idx 1757 ); 1758 %Docstring 1759 IsColGrowable(idx) -> bool 1760 1761 Returns true if column idx is growable. 1762 %End 1763 1764 bool IsRowGrowable( 1765 size_t idx 1766 ); 1767 %Docstring 1768 IsRowGrowable(idx) -> bool 1769 1770 Returns true if row idx is growable. 1771 %End 1772 1773 void RemoveGrowableCol( 1774 size_t idx 1775 ); 1776 %Docstring 1777 RemoveGrowableCol(idx) 1778 1779 Specifies that the idx column index is no longer growable. 1780 %End 1781 1782 void RemoveGrowableRow( 1783 size_t idx 1784 ); 1785 %Docstring 1786 RemoveGrowableRow(idx) 1787 1788 Specifies that the idx row index is no longer growable. 1789 %End 1790 1791 void SetFlexibleDirection( 1792 int direction 1793 ); 1794 %Docstring 1795 SetFlexibleDirection(direction) 1796 1797 Specifies whether the sizer should flexibly resize its columns, rows, 1798 or both. 1799 %End 1800 1801 void SetNonFlexibleGrowMode( 1802 wxFlexSizerGrowMode mode 1803 ); 1804 %Docstring 1805 SetNonFlexibleGrowMode(mode) 1806 1807 Specifies how the sizer should grow in the non-flexible direction if 1808 there is one (so SetFlexibleDirection() must have been called 1809 previously). 1810 %End 1811 1812 const wxArrayInt & GetRowHeights() const; 1813 %Docstring 1814 GetRowHeights() -> ArrayInt 1815 1816 Returns a read-only array containing the heights of the rows in the 1817 sizer. 1818 %End 1819 1820 const wxArrayInt & GetColWidths() const; 1821 %Docstring 1822 GetColWidths() -> ArrayInt 1823 1824 Returns a read-only array containing the widths of the columns in the 1825 sizer. 1826 %End 1827 1828 virtual 1829 void RecalcSizes(); 1830 %Docstring 1831 RecalcSizes() 1832 1833 This method is abstract and has to be overwritten by any derived 1834 class. 1835 %End 1836 1837 virtual 1838 wxSize CalcMin(); 1839 %Docstring 1840 CalcMin() -> Size 1841 1842 This method is abstract and has to be overwritten by any derived 1843 class. 1844 %End 1845 1846 public: 1847 1848 1849 %Property(name=ColWidths, get=GetColWidths) 1850 %Property(name=FlexibleDirection, get=GetFlexibleDirection, set=SetFlexibleDirection) 1851 %Property(name=NonFlexibleGrowMode, get=GetNonFlexibleGrowMode, set=SetNonFlexibleGrowMode) 1852 %Property(name=RowHeights, get=GetRowHeights) 1853}; // end of class wxFlexGridSizer 1854 1855 1856class wxStdDialogButtonSizer : wxBoxSizer 1857{ 1858 %Docstring 1859 StdDialogButtonSizer() 1860 1861 This class creates button layouts which conform to the standard button 1862 spacing and ordering defined by the platform or toolkit's user 1863 interface guidelines (if such things exist). 1864 %End 1865 %TypeHeaderCode 1866 #include <wx/sizer.h> 1867 %End 1868 1869public: 1870 wxStdDialogButtonSizer(); 1871 1872 void AddButton( 1873 wxButton * button 1874 ); 1875 %Docstring 1876 AddButton(button) 1877 1878 Adds a button to the wxStdDialogButtonSizer. 1879 %End 1880 1881 void Realize(); 1882 %Docstring 1883 Realize() 1884 1885 Rearranges the buttons and applies proper spacing between buttons to 1886 make them match the platform or toolkit's interface guidelines. 1887 %End 1888 1889 void SetAffirmativeButton( 1890 wxButton * button 1891 ); 1892 %Docstring 1893 SetAffirmativeButton(button) 1894 1895 Sets the affirmative button for the sizer. 1896 %End 1897 1898 void SetCancelButton( 1899 wxButton * button 1900 ); 1901 %Docstring 1902 SetCancelButton(button) 1903 1904 Sets the cancel button for the sizer. 1905 %End 1906 1907 void SetNegativeButton( 1908 wxButton * button 1909 ); 1910 %Docstring 1911 SetNegativeButton(button) 1912 1913 Sets the negative button for the sizer. 1914 %End 1915 1916 virtual 1917 void RecalcSizes(); 1918 %Docstring 1919 RecalcSizes() 1920 1921 Implements the calculation of a box sizer's dimensions and then sets 1922 the size of its children (calling wxWindow::SetSize if the child is a 1923 window). 1924 %End 1925 1926 virtual 1927 wxSize CalcMin(); 1928 %Docstring 1929 CalcMin() -> Size 1930 1931 Implements the calculation of a box sizer's minimal. 1932 %End 1933 1934 public: 1935 1936 1937}; // end of class wxStdDialogButtonSizer 1938 1939 1940%Extract(id=pycode_core) 1941PySizer = wx.deprecated(Sizer, 'Use Sizer instead.') 1942 1943%End 1944 1945class wxSizerItemList_iterator /Abstract/ 1946{ 1947 // the C++ implementation of this class 1948 %TypeHeaderCode 1949 1950 class wxSizerItemList_iterator { 1951 public: 1952 wxSizerItemList_iterator(wxSizerItemList::compatibility_iterator start) 1953 : m_node(start) {} 1954 1955 wxSizerItem* __next__() { 1956 wxSizerItem* obj = NULL; 1957 if (m_node) { 1958 obj = (wxSizerItem*) m_node->GetData(); 1959 m_node = m_node->GetNext(); 1960 } 1961 else { 1962 PyErr_SetString(PyExc_StopIteration, ""); 1963 } 1964 return (wxSizerItem*)obj; 1965 } 1966 private: 1967 wxSizerItemList::compatibility_iterator m_node; 1968 }; 1969 %End 1970public: 1971 wxSizerItem* __next__(); 1972 %MethodCode 1973 sipRes = sipCpp->__next__(); 1974 if (PyErr_Occurred()) 1975 return NULL; 1976 %End 1977}; 1978 1979class wxSizerItemList 1980{ 1981 %TypeHeaderCode 1982 1983 %End 1984public: 1985 SIP_SSIZE_T __len__(); 1986 %MethodCode 1987 sipRes = sipCpp->size(); 1988 %End 1989 1990 wxSizerItem* __getitem__(long index); 1991 %MethodCode 1992 if (0 > index) 1993 index += sipCpp->size(); 1994 1995 if (index < sipCpp->size() && (0 <= index)) { 1996 wxSizerItemList::compatibility_iterator node = sipCpp->Item(index); 1997 if (node) 1998 sipRes = (wxSizerItem*)node->GetData(); 1999 } 2000 else { 2001 wxPyErr_SetString(PyExc_IndexError, "sequence index out of range"); 2002 sipError = sipErrorFail; 2003 } 2004 %End 2005 2006 int __contains__(const wxSizerItem* obj); 2007 %MethodCode 2008 wxSizerItemList::compatibility_iterator node; 2009 node = sipCpp->Find((wxSizerItem*)obj); 2010 sipRes = node != NULL; 2011 %End 2012 2013 wxSizerItemList_iterator* __iter__() /Factory/; 2014 %MethodCode 2015 sipRes = new wxSizerItemList_iterator(sipCpp->GetFirst()); 2016 %End 2017 2018 // TODO: add support for index(value, [start, [stop]]) 2019 int index(wxSizerItem* obj); 2020 %MethodCode 2021 int idx = sipCpp->IndexOf((wxSizerItem*)obj); 2022 if (idx == wxNOT_FOUND) { 2023 sipError = sipErrorFail; 2024 wxPyErr_SetString(PyExc_ValueError, 2025 "sequence.index(x): x not in sequence"); 2026 } 2027 sipRes = idx; 2028 %End 2029 2030 2031}; 2032 2033%Extract(id=pycode_core) 2034def _SizerItemList___repr__(self): 2035 return "SizerItemList: " + repr(list(self)) 2036SizerItemList.__repr__ = _SizerItemList___repr__ 2037del _SizerItemList___repr__ 2038%End 2039 2040 2041 2042//--------------------------------------------------------------------------- 2043 2044