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 14{ 15 wxCC_SPECIAL_DCLICK, 16 wxCC_STD_BUTTON 17}; 18 19class wxComboPopup 20{ 21 %Docstring 22 ComboPopup() 23 24 In order to use a custom popup with wxComboCtrl, an interface class 25 must be derived from wxComboPopup. 26 %End 27 %TypeHeaderCode 28 #include <wx/combo.h> 29 %End 30 31public: 32 wxComboPopup(); 33 %PreMethodCode 34 if (!wxPyCheckForApp()) return NULL; 35 %End 36 37 virtual 38 bool Create( 39 wxWindow * parent 40 ) = 0; 41 %Docstring 42 Create(parent) -> bool 43 44 The derived class must implement this to create the popup control. 45 %End 46 47 virtual 48 void DestroyPopup(); 49 %Docstring 50 DestroyPopup() 51 52 You only need to implement this member function if you create your 53 popup class in non-standard way. 54 %End 55 56 void Dismiss(); 57 %Docstring 58 Dismiss() 59 60 Utility function that hides the popup. 61 %End 62 63 virtual 64 bool FindItem( 65 const wxString & item, 66 wxString * trueItem = NULL 67 ); 68 %Docstring 69 FindItem(item, trueItem=None) -> bool 70 71 Implement to customize matching of value string to an item container 72 entry. 73 %End 74 75 virtual 76 wxSize GetAdjustedSize( 77 int minWidth, 78 int prefHeight, 79 int maxHeight 80 ); 81 %Docstring 82 GetAdjustedSize(minWidth, prefHeight, maxHeight) -> Size 83 84 The derived class may implement this to return adjusted size for the 85 popup control, according to the variables given. 86 %End 87 88 wxComboCtrl * GetComboCtrl() const; 89 %Docstring 90 GetComboCtrl() -> ComboCtrl 91 92 Returns pointer to the associated parent wxComboCtrl. 93 %End 94 95 virtual 96 wxWindow * GetControl() = 0; 97 %Docstring 98 GetControl() -> Window 99 100 The derived class must implement this to return pointer to the 101 associated control created in Create(). 102 %End 103 104 virtual 105 wxString GetStringValue() const = 0; 106 %Docstring 107 GetStringValue() -> String 108 109 The derived class must implement this to return string representation 110 of the value. 111 %End 112 113 virtual 114 void Init(); 115 %Docstring 116 Init() 117 118 The derived class must implement this to initialize its internal 119 variables. 120 %End 121 122 bool IsCreated() const; 123 %Docstring 124 IsCreated() -> bool 125 126 Utility method that returns true if Create has been called. 127 %End 128 129 virtual 130 bool LazyCreate(); 131 %Docstring 132 LazyCreate() -> bool 133 134 The derived class may implement this to return true if it wants to 135 delay call to Create() until the popup is shown for the first time. 136 %End 137 138 virtual 139 void OnComboDoubleClick(); 140 %Docstring 141 OnComboDoubleClick() 142 143 The derived class may implement this to do something when the parent 144 wxComboCtrl gets double-clicked. 145 %End 146 147 virtual 148 void OnComboKeyEvent( 149 wxKeyEvent & event 150 ); 151 %Docstring 152 OnComboKeyEvent(event) 153 154 The derived class may implement this to receive key events from the 155 parent wxComboCtrl. 156 %End 157 158 virtual 159 void OnDismiss(); 160 %Docstring 161 OnDismiss() 162 163 The derived class may implement this to do special processing when 164 popup is hidden. 165 %End 166 167 virtual 168 void OnPopup(); 169 %Docstring 170 OnPopup() 171 172 The derived class may implement this to do special processing when 173 popup is shown. 174 %End 175 176 virtual 177 void PaintComboControl( 178 wxDC & dc, 179 const wxRect & rect 180 ); 181 %Docstring 182 PaintComboControl(dc, rect) 183 184 The derived class may implement this to paint the parent wxComboCtrl. 185 %End 186 187 virtual 188 void SetStringValue( 189 const wxString & value 190 ); 191 %Docstring 192 SetStringValue(value) 193 194 The derived class must implement this to receive string value changes 195 from wxComboCtrl. 196 %End 197 198 public: 199 200 201 %Property(name=ComboCtrl, get=GetComboCtrl) 202 %Property(name=Control, get=GetControl) 203 %Property(name=StringValue, get=GetStringValue, set=SetStringValue) 204}; // end of class wxComboPopup 205 206 207struct wxComboCtrlFeatures 208{ 209 %Docstring 210 Features enabled for wxComboCtrl. 211 %End 212 %TypeHeaderCode 213 #include <wx/combo.h> 214 %End 215 216 enum 217 { 218 MovableButton, 219 BitmapButton, 220 ButtonSpacing, 221 TextIndent, 222 PaintControl, 223 PaintWritable, 224 Borderless, 225 All 226 }; 227 228}; // end of class wxComboCtrlFeatures 229 230 231class wxComboCtrl : wxControl, wxTextEntry 232{ 233 %Docstring 234 ComboCtrl() 235 ComboCtrl(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ComboBoxNameStr) 236 237 A combo control is a generic combobox that allows totally custom 238 popup. 239 %End 240 %TypeHeaderCode 241 #include <wx/combo.h> 242 %End 243 244public: 245 wxComboCtrl(); 246 %PreMethodCode 247 if (!wxPyCheckForApp()) return NULL; 248 %End 249 250 wxComboCtrl( 251 wxWindow * parent /TransferThis/, 252 wxWindowID id = wxID_ANY, 253 const wxString & value = wxEmptyString, 254 const wxPoint & pos = wxDefaultPosition, 255 const wxSize & size = wxDefaultSize, 256 long style = 0, 257 const wxValidator & validator = wxDefaultValidator, 258 const wxString & name = wxComboBoxNameStr 259 ); 260 %PreMethodCode 261 if (!wxPyCheckForApp()) return NULL; 262 %End 263 264 ~wxComboCtrl(); 265 266 bool SetMargins( 267 const wxPoint & pt 268 ); 269 %Docstring 270 SetMargins(pt) -> bool 271 SetMargins(left, top=-1) -> bool 272 273 Attempts to set the control margins. 274 %End 275 276 bool SetMargins( 277 wxCoord left, 278 wxCoord top = -1 279 ); 280 281 void Copy(); 282 %Docstring 283 Copy() 284 285 Copies the selected text to the clipboard. 286 %End 287 288 bool Create( 289 wxWindow * parent /TransferThis/, 290 wxWindowID id = wxID_ANY, 291 const wxString & value = wxEmptyString, 292 const wxPoint & pos = wxDefaultPosition, 293 const wxSize & size = wxDefaultSize, 294 long style = 0, 295 const wxValidator & validator = wxDefaultValidator, 296 const wxString & name = wxComboBoxNameStr 297 ); 298 %Docstring 299 Create(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ComboBoxNameStr) -> bool 300 301 Creates the combo control for two-step construction. 302 %End 303 304 void Cut(); 305 %Docstring 306 Cut() 307 308 Copies the selected text to the clipboard and removes the selection. 309 %End 310 311 virtual 312 void Dismiss(); 313 %Docstring 314 Dismiss() 315 316 Dismisses the popup window. 317 %End 318 319 void EnablePopupAnimation( 320 bool enable = true 321 ); 322 %Docstring 323 EnablePopupAnimation(enable=True) 324 325 Enables or disables popup animation, if any, depending on the value of 326 the argument. 327 %End 328 329 virtual 330 bool IsKeyPopupToggle( 331 const wxKeyEvent & event 332 ) const; 333 %Docstring 334 IsKeyPopupToggle(event) -> bool 335 336 Returns true if given key combination should toggle the popup. 337 %End 338 339 void PrepareBackground( 340 wxDC & dc, 341 const wxRect & rect, 342 int flags 343 ) const; 344 %Docstring 345 PrepareBackground(dc, rect, flags) 346 347 Prepare background of combo control or an item in a dropdown list in a 348 way typical on platform. 349 %End 350 351 bool ShouldDrawFocus() const; 352 %Docstring 353 ShouldDrawFocus() -> bool 354 355 Returns true if focus indicator should be drawn in the control. 356 %End 357 358 const wxBitmap & GetBitmapDisabled() const; 359 %Docstring 360 GetBitmapDisabled() -> Bitmap 361 362 Returns disabled button bitmap that has been set with 363 SetButtonBitmaps(). 364 %End 365 366 const wxBitmap & GetBitmapHover() const; 367 %Docstring 368 GetBitmapHover() -> Bitmap 369 370 Returns button mouse hover bitmap that has been set with 371 SetButtonBitmaps(). 372 %End 373 374 const wxBitmap & GetBitmapNormal() const; 375 %Docstring 376 GetBitmapNormal() -> Bitmap 377 378 Returns default button bitmap that has been set with 379 SetButtonBitmaps(). 380 %End 381 382 const wxBitmap & GetBitmapPressed() const; 383 %Docstring 384 GetBitmapPressed() -> Bitmap 385 386 Returns depressed button bitmap that has been set with 387 SetButtonBitmaps(). 388 %End 389 390 wxSize GetButtonSize(); 391 %Docstring 392 GetButtonSize() -> Size 393 394 Returns current size of the dropdown button. 395 %End 396 397 int GetCustomPaintWidth() const; 398 %Docstring 399 GetCustomPaintWidth() -> int 400 401 Returns custom painted area in control. 402 %End 403 404 wxString GetHint() const; 405 %Docstring 406 GetHint() -> String 407 408 Returns the current hint string. 409 %End 410 411 long GetInsertionPoint() const; 412 %Docstring 413 GetInsertionPoint() -> long 414 415 Returns the insertion point for the combo control's text field. 416 %End 417 418 long GetLastPosition() const; 419 %Docstring 420 GetLastPosition() -> long 421 422 Returns the last position in the combo control text field. 423 %End 424 425 wxPoint GetMargins() const; 426 %Docstring 427 GetMargins() -> Point 428 429 Returns the margins used by the control. 430 %End 431 432 wxComboPopup * GetPopupControl(); 433 %Docstring 434 GetPopupControl() -> ComboPopup 435 436 Returns current popup interface that has been set with 437 SetPopupControl(). 438 %End 439 440 wxWindow * GetPopupWindow() const; 441 %Docstring 442 GetPopupWindow() -> Window 443 444 Returns popup window containing the popup control. 445 %End 446 447 wxTextCtrl * GetTextCtrl() const; 448 %Docstring 449 GetTextCtrl() -> TextCtrl 450 451 Get the text control which is part of the combo control. 452 %End 453 454 wxCoord GetTextIndent() const /Deprecated/; 455 %Docstring 456 GetTextIndent() -> Coord 457 458 Returns actual indentation in pixels. 459 %End 460 461 const wxRect & GetTextRect() const; 462 %Docstring 463 GetTextRect() -> Rect 464 465 Returns area covered by the text field (includes everything except 466 borders and the dropdown button). 467 %End 468 469 wxString GetValue() const; 470 %Docstring 471 GetValue() -> String 472 473 Returns text representation of the current value. 474 %End 475 476 virtual 477 void HidePopup( 478 bool generateEvent = false 479 ) /Deprecated/; 480 %Docstring 481 HidePopup(generateEvent=False) 482 483 Dismisses the popup window. 484 %End 485 486 bool IsPopupShown() const; 487 %Docstring 488 IsPopupShown() -> bool 489 490 Returns true if the popup is currently shown. 491 %End 492 493 bool IsPopupWindowState( 494 int state 495 ) const; 496 %Docstring 497 IsPopupWindowState(state) -> bool 498 499 Returns true if the popup window is in the given state. 500 %End 501 502 virtual 503 void OnButtonClick(); 504 %Docstring 505 OnButtonClick() 506 507 Implement in a derived class to define what happens on dropdown button 508 click. 509 %End 510 511 void Paste(); 512 %Docstring 513 Paste() 514 515 Pastes text from the clipboard to the text field. 516 %End 517 518 void Popup(); 519 %Docstring 520 Popup() 521 522 Shows the popup portion of the combo control. 523 %End 524 525 void Remove( 526 long frm, 527 long to 528 ); 529 %Docstring 530 Remove(frm, to) 531 532 Removes the text between the two positions in the combo control text 533 field. 534 %End 535 536 void Replace( 537 long frm, 538 long to, 539 const wxString & text 540 ); 541 %Docstring 542 Replace(frm, to, text) 543 544 Replaces the text between two positions with the given text, in the 545 combo control text field. 546 %End 547 548 void SetButtonBitmaps( 549 const wxBitmap & bmpNormal, 550 bool pushButtonBg = false, 551 const wxBitmap & bmpPressed = wxNullBitmap, 552 const wxBitmap & bmpHover = wxNullBitmap, 553 const wxBitmap & bmpDisabled = wxNullBitmap 554 ); 555 %Docstring 556 SetButtonBitmaps(bmpNormal, pushButtonBg=False, bmpPressed=NullBitmap, bmpHover=NullBitmap, bmpDisabled=NullBitmap) 557 558 Sets custom dropdown button graphics. 559 %End 560 561 void SetButtonPosition( 562 int width = -1, 563 int height = -1, 564 int side = wxRIGHT, 565 int spacingX = 0 566 ); 567 %Docstring 568 SetButtonPosition(width=-1, height=-1, side=RIGHT, spacingX=0) 569 570 Sets size and position of dropdown button. 571 %End 572 573 void SetCustomPaintWidth( 574 int width 575 ); 576 %Docstring 577 SetCustomPaintWidth(width) 578 579 Set width, in pixels, of custom painted area in control without 580 wxCB_READONLY style. 581 %End 582 583 bool SetHint( 584 const wxString & hint 585 ); 586 %Docstring 587 SetHint(hint) -> bool 588 589 Sets a hint shown in an empty unfocused combo control. 590 %End 591 592 void SetInsertionPoint( 593 long pos 594 ); 595 %Docstring 596 SetInsertionPoint(pos) 597 598 Sets the insertion point in the text field. 599 %End 600 601 void SetInsertionPointEnd(); 602 %Docstring 603 SetInsertionPointEnd() 604 605 Sets the insertion point at the end of the combo control text field. 606 %End 607 608 void SetPopupAnchor( 609 int anchorSide 610 ); 611 %Docstring 612 SetPopupAnchor(anchorSide) 613 614 Set side of the control to which the popup will align itself. 615 %End 616 617 void SetPopupControl( 618 wxComboPopup * popup /Transfer/ 619 ); 620 %Docstring 621 SetPopupControl(popup) 622 623 Set popup interface class derived from wxComboPopup. 624 %End 625 626 void SetPopupExtents( 627 int extLeft, 628 int extRight 629 ); 630 %Docstring 631 SetPopupExtents(extLeft, extRight) 632 633 Extends popup size horizontally, relative to the edges of the combo 634 control. 635 %End 636 637 void SetPopupMaxHeight( 638 int height 639 ); 640 %Docstring 641 SetPopupMaxHeight(height) 642 643 Sets preferred maximum height of the popup. 644 %End 645 646 void SetPopupMinWidth( 647 int width 648 ); 649 %Docstring 650 SetPopupMinWidth(width) 651 652 Sets minimum width of the popup. 653 %End 654 655 void SetSelection( 656 long frm, 657 long to 658 ); 659 %Docstring 660 SetSelection(frm, to) 661 662 Selects the text between the two positions, in the combo control text 663 field. 664 %End 665 666 void SetText( 667 const wxString & value 668 ); 669 %Docstring 670 SetText(value) 671 672 Sets the text for the text field without affecting the popup. 673 %End 674 675 void SetTextCtrlStyle( 676 int style 677 ); 678 %Docstring 679 SetTextCtrlStyle(style) 680 681 Set a custom window style for the embedded wxTextCtrl. 682 %End 683 684 void SetTextIndent( 685 int indent 686 ) /Deprecated/; 687 %Docstring 688 SetTextIndent(indent) 689 690 This will set the space in pixels between left edge of the control and 691 the text, regardless whether control is read-only or not. 692 %End 693 694 void SetValue( 695 const wxString & value 696 ); 697 %Docstring 698 SetValue(value) 699 700 Sets the text for the combo control text field. 701 %End 702 703 void SetValueByUser( 704 const wxString & value 705 ); 706 %Docstring 707 SetValueByUser(value) 708 709 Changes value of the control as if user had done it by selecting an 710 item from a combo box drop-down list. 711 %End 712 713 virtual 714 void ShowPopup() /Deprecated/; 715 %Docstring 716 ShowPopup() 717 718 Show the popup. 719 %End 720 721 void Undo(); 722 %Docstring 723 Undo() 724 725 Undoes the last edit in the text field. 726 %End 727 728 void UseAltPopupWindow( 729 bool enable = true 730 ); 731 %Docstring 732 UseAltPopupWindow(enable=True) 733 734 Enable or disable usage of an alternative popup window, which 735 guarantees ability to focus the popup control, and allows common 736 native controls to function normally. 737 %End 738 739 static 740 int GetFeatures(); 741 %Docstring 742 GetFeatures() -> int 743 744 Returns features supported by wxComboCtrl. 745 %End 746 747 public: 748 virtual wxPoint GetClientAreaOrigin() const; 749 virtual bool Validate(); 750 virtual bool TransferDataToWindow(); 751 virtual bool TransferDataFromWindow(); 752 virtual void InitDialog(); 753 virtual bool AcceptsFocus() const; 754 virtual bool AcceptsFocusRecursively() const; 755 virtual bool AcceptsFocusFromKeyboard() const; 756 virtual void AddChild( wxWindowBase *child ); 757 virtual void RemoveChild( wxWindowBase *child ); 758 virtual void InheritAttributes(); 759 virtual bool ShouldInheritColours() const; 760 virtual void OnInternalIdle(); 761 virtual wxWindow *GetMainWindowOfCompositeControl(); 762 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 763 virtual void SetCanFocus(bool canFocus); 764 virtual bool Destroy(); 765 virtual void SetValidator( const wxValidator &validator ); 766 virtual wxValidator* GetValidator(); 767 768 769 protected: 770 virtual bool ProcessEvent(wxEvent & event); 771 virtual void DoEnable(bool enable); 772 virtual void DoGetPosition(int *x, int *y) const; 773 virtual void DoGetSize(int *width, int *height) const; 774 virtual void DoGetClientSize(int *width, int *height) const; 775 virtual wxSize DoGetBestSize() const; 776 virtual wxSize DoGetBestClientSize() const; 777 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 778 virtual void DoSetClientSize(int width, int height); 779 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 780 virtual wxSize DoGetBorderSize() const; 781 virtual void DoMoveWindow(int x, int y, int width, int height); 782 virtual void DoSetWindowVariant( wxWindowVariant variant); 783 virtual wxBorder GetDefaultBorder() const; 784 virtual wxBorder GetDefaultBorderForControl() const; 785 virtual void DoFreeze(); 786 virtual void DoThaw(); 787 virtual bool HasTransparentBackground(); 788 virtual bool TryBefore(wxEvent& event); 789 virtual bool TryAfter(wxEvent& event); 790 791 792 public: 793 794 795 static 796 wxVisualAttributes GetClassDefaultAttributes( 797 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 798 ); 799 %Docstring 800 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 801 %End 802 %PreMethodCode 803 if (!wxPyCheckForApp()) return NULL; 804 %End 805 806 public: 807 808 809 %Property(name=BitmapDisabled, get=GetBitmapDisabled) 810 %Property(name=BitmapHover, get=GetBitmapHover) 811 %Property(name=BitmapNormal, get=GetBitmapNormal) 812 %Property(name=BitmapPressed, get=GetBitmapPressed) 813 %Property(name=ButtonSize, get=GetButtonSize) 814 %Property(name=CustomPaintWidth, get=GetCustomPaintWidth, set=SetCustomPaintWidth) 815 %Property(name=Hint, get=GetHint, set=SetHint) 816 %Property(name=InsertionPoint, get=GetInsertionPoint, set=SetInsertionPoint) 817 %Property(name=LastPosition, get=GetLastPosition) 818 %Property(name=Margins, get=GetMargins, set=SetMargins) 819 %Property(name=PopupControl, get=GetPopupControl, set=SetPopupControl) 820 %Property(name=PopupWindow, get=GetPopupWindow) 821 %Property(name=TextCtrl, get=GetTextCtrl) 822 %Property(name=TextIndent, get=GetTextIndent, set=SetTextIndent) 823 %Property(name=TextRect, get=GetTextRect) 824 %Property(name=Value, get=GetValue, set=SetValue) 825 826protected: 827 virtual 828 bool AnimateShow( 829 const wxRect & rect, 830 int flags 831 ); 832 %Docstring 833 AnimateShow(rect, flags) -> bool 834 835 This member function is not normally called in application code. 836 %End 837 838 virtual 839 void DoSetPopupControl( 840 wxComboPopup * popup 841 ); 842 %Docstring 843 DoSetPopupControl(popup) 844 845 This member function is not normally called in application code. 846 %End 847 848 virtual 849 void DoShowPopup( 850 const wxRect & rect, 851 int flags 852 ); 853 %Docstring 854 DoShowPopup(rect, flags) 855 856 This member function is not normally called in application code. 857 %End 858 859}; // end of class wxComboCtrl 860 861 862 863//--------------------------------------------------------------------------- 864 865