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%ModuleHeaderCode 12#include <wx/headerctrl.h> 13%End 14 15 16//--------------------------------------------------------------------------- 17 18enum 19{ 20 wxHD_ALLOW_REORDER, 21 wxHD_ALLOW_HIDE, 22 wxHD_DEFAULT_STYLE 23}; 24 25wxEventType wxEVT_HEADER_CLICK /PyName=wxEVT_HEADER_CLICK/; 26 27wxEventType wxEVT_HEADER_RIGHT_CLICK /PyName=wxEVT_HEADER_RIGHT_CLICK/; 28 29wxEventType wxEVT_HEADER_MIDDLE_CLICK /PyName=wxEVT_HEADER_MIDDLE_CLICK/; 30 31wxEventType wxEVT_HEADER_DCLICK /PyName=wxEVT_HEADER_DCLICK/; 32 33wxEventType wxEVT_HEADER_RIGHT_DCLICK /PyName=wxEVT_HEADER_RIGHT_DCLICK/; 34 35wxEventType wxEVT_HEADER_MIDDLE_DCLICK /PyName=wxEVT_HEADER_MIDDLE_DCLICK/; 36 37wxEventType wxEVT_HEADER_SEPARATOR_DCLICK /PyName=wxEVT_HEADER_SEPARATOR_DCLICK/; 38 39wxEventType wxEVT_HEADER_BEGIN_RESIZE /PyName=wxEVT_HEADER_BEGIN_RESIZE/; 40 41wxEventType wxEVT_HEADER_RESIZING /PyName=wxEVT_HEADER_RESIZING/; 42 43wxEventType wxEVT_HEADER_END_RESIZE /PyName=wxEVT_HEADER_END_RESIZE/; 44 45wxEventType wxEVT_HEADER_BEGIN_REORDER /PyName=wxEVT_HEADER_BEGIN_REORDER/; 46 47wxEventType wxEVT_HEADER_END_REORDER /PyName=wxEVT_HEADER_END_REORDER/; 48 49wxEventType wxEVT_HEADER_DRAGGING_CANCELLED /PyName=wxEVT_HEADER_DRAGGING_CANCELLED/; 50 51const char* wxHeaderCtrlNameStr; 52 53class wxHeaderCtrl : wxControl 54{ 55 %Docstring 56 HeaderCtrl() 57 HeaderCtrl(parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr) 58 59 wxHeaderCtrl is the control containing the column headings which is 60 usually used for display of tabular data. 61 %End 62 %TypeHeaderCode 63 #include <wx/headerctrl.h> 64 %End 65 66public: 67 wxHeaderCtrl(); 68 %PreMethodCode 69 if (!wxPyCheckForApp()) return NULL; 70 %End 71 72 wxHeaderCtrl( 73 wxWindow * parent /TransferThis/, 74 wxWindowID winid = wxID_ANY, 75 const wxPoint & pos = wxDefaultPosition, 76 const wxSize & size = wxDefaultSize, 77 long style = wxHD_DEFAULT_STYLE, 78 const wxString & name = wxHeaderCtrlNameStr 79 ); 80 %PreMethodCode 81 if (!wxPyCheckForApp()) return NULL; 82 %End 83 84 bool Create( 85 wxWindow * parent /TransferThis/, 86 wxWindowID winid = wxID_ANY, 87 const wxPoint & pos = wxDefaultPosition, 88 const wxSize & size = wxDefaultSize, 89 long style = wxHD_DEFAULT_STYLE, 90 const wxString & name = wxHeaderCtrlNameStr 91 ); 92 %Docstring 93 Create(parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr) -> bool 94 95 Create the header control window. 96 %End 97 98 void SetColumnCount( 99 unsigned int count 100 ); 101 %Docstring 102 SetColumnCount(count) 103 104 Set the number of columns in the control. 105 %End 106 107 unsigned int GetColumnCount() const; 108 %Docstring 109 GetColumnCount() -> unsignedint 110 111 Return the number of columns in the control. 112 %End 113 114 bool IsEmpty() const; 115 %Docstring 116 IsEmpty() -> bool 117 118 Return whether the control has any columns. 119 %End 120 121 void UpdateColumn( 122 unsigned int idx 123 ); 124 %Docstring 125 UpdateColumn(idx) 126 127 Update the column with the given index. 128 %End 129 130 void SetColumnsOrder( 131 const wxArrayInt & order 132 ); 133 %Docstring 134 SetColumnsOrder(order) 135 136 Change the columns display order. 137 %End 138 139 wxArrayInt GetColumnsOrder() const; 140 %Docstring 141 GetColumnsOrder() -> ArrayInt 142 143 Return the array describing the columns display order. 144 %End 145 146 unsigned int GetColumnAt( 147 unsigned int pos 148 ) const; 149 %Docstring 150 GetColumnAt(pos) -> unsignedint 151 152 Return the index of the column displayed at the given position. 153 %End 154 155 unsigned int GetColumnPos( 156 unsigned int idx 157 ) const; 158 %Docstring 159 GetColumnPos(idx) -> unsignedint 160 161 Get the position at which this column is currently displayed. 162 %End 163 164 void ResetColumnsOrder(); 165 %Docstring 166 ResetColumnsOrder() 167 168 Reset the columns order to the natural one. 169 %End 170 171 bool ShowColumnsMenu( 172 const wxPoint & pt, 173 const wxString & title = wxString() 174 ); 175 %Docstring 176 ShowColumnsMenu(pt, title="") -> bool 177 178 Show the popup menu allowing the user to show or hide the columns. 179 %End 180 181 void AddColumnsItems( 182 wxMenu & menu, 183 int idColumnsBase = 0 184 ); 185 %Docstring 186 AddColumnsItems(menu, idColumnsBase=0) 187 188 Helper function appending the checkable items corresponding to all the 189 columns to the given menu. 190 %End 191 192 bool ShowCustomizeDialog(); 193 %Docstring 194 ShowCustomizeDialog() -> bool 195 196 Show the column customization dialog. 197 %End 198 199 int GetColumnTitleWidth( 200 const wxHeaderColumn & col 201 ); 202 %Docstring 203 GetColumnTitleWidth(col) -> int 204 205 Returns width needed for given column's title. 206 %End 207 208 static 209 void MoveColumnInOrderArray( 210 wxArrayInt & order, 211 unsigned int idx, 212 unsigned int pos 213 ); 214 %Docstring 215 MoveColumnInOrderArray(order, idx, pos) 216 217 Helper function to manipulate the array of column indices. 218 %End 219 220 public: 221 virtual wxPoint GetClientAreaOrigin() const; 222 virtual bool Validate(); 223 virtual bool TransferDataToWindow(); 224 virtual bool TransferDataFromWindow(); 225 virtual void InitDialog(); 226 virtual bool AcceptsFocus() const; 227 virtual bool AcceptsFocusRecursively() const; 228 virtual bool AcceptsFocusFromKeyboard() const; 229 virtual void AddChild( wxWindowBase *child ); 230 virtual void RemoveChild( wxWindowBase *child ); 231 virtual void InheritAttributes(); 232 virtual bool ShouldInheritColours() const; 233 virtual void OnInternalIdle(); 234 virtual wxWindow *GetMainWindowOfCompositeControl(); 235 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 236 virtual void SetCanFocus(bool canFocus); 237 virtual bool Destroy(); 238 virtual void SetValidator( const wxValidator &validator ); 239 virtual wxValidator* GetValidator(); 240 241 242 protected: 243 virtual bool ProcessEvent(wxEvent & event); 244 virtual void DoEnable(bool enable); 245 virtual void DoGetPosition(int *x, int *y) const; 246 virtual void DoGetSize(int *width, int *height) const; 247 virtual void DoGetClientSize(int *width, int *height) const; 248 virtual wxSize DoGetBestSize() const; 249 virtual wxSize DoGetBestClientSize() const; 250 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 251 virtual void DoSetClientSize(int width, int height); 252 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 253 virtual wxSize DoGetBorderSize() const; 254 virtual void DoMoveWindow(int x, int y, int width, int height); 255 virtual void DoSetWindowVariant( wxWindowVariant variant); 256 virtual wxBorder GetDefaultBorder() const; 257 virtual wxBorder GetDefaultBorderForControl() const; 258 virtual void DoFreeze(); 259 virtual void DoThaw(); 260 virtual bool HasTransparentBackground(); 261 virtual bool TryBefore(wxEvent& event); 262 virtual bool TryAfter(wxEvent& event); 263 264 265 public: 266 267 268 static 269 wxVisualAttributes GetClassDefaultAttributes( 270 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 271 ); 272 %Docstring 273 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 274 %End 275 %PreMethodCode 276 if (!wxPyCheckForApp()) return NULL; 277 %End 278 279 public: 280 281 282 %Property(name=ColumnCount, get=GetColumnCount, set=SetColumnCount) 283 %Property(name=ColumnsOrder, get=GetColumnsOrder, set=SetColumnsOrder) 284 285protected: 286 virtual 287 const wxHeaderColumn & GetColumn( 288 unsigned int idx 289 ) const = 0; 290 %Docstring 291 GetColumn(idx) -> HeaderColumn 292 293 Method to be implemented by the derived classes to return the 294 information for the given column. 295 %End 296 297 virtual 298 void UpdateColumnVisibility( 299 unsigned int idx, 300 bool show 301 ); 302 %Docstring 303 UpdateColumnVisibility(idx, show) 304 305 Method called when the column visibility is changed by the user. 306 %End 307 308 virtual 309 void UpdateColumnsOrder( 310 const wxArrayInt & order 311 ); 312 %Docstring 313 UpdateColumnsOrder(order) 314 315 Method called when the columns order is changed in the customization 316 dialog. 317 %End 318 319 virtual 320 bool UpdateColumnWidthToFit( 321 unsigned int idx, 322 int widthTitle 323 ); 324 %Docstring 325 UpdateColumnWidthToFit(idx, widthTitle) -> bool 326 327 Method which may be implemented by the derived classes to allow double 328 clicking the column separator to resize the column to fit its 329 contents. 330 %End 331 332 virtual 333 void OnColumnCountChanging( 334 unsigned int count 335 ); 336 %Docstring 337 OnColumnCountChanging(count) 338 339 Can be overridden in the derived class to update internal data 340 structures when the number of the columns in the control changes. 341 %End 342 343}; // end of class wxHeaderCtrl 344 345 346class wxHeaderCtrlSimple : wxHeaderCtrl 347{ 348 %Docstring 349 HeaderCtrlSimple() 350 HeaderCtrlSimple(parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr) 351 352 wxHeaderCtrlSimple is a concrete header control which can be used 353 directly, without inheriting from it as you need to do when using 354 wxHeaderCtrl itself. 355 %End 356 %TypeHeaderCode 357 #include <wx/headerctrl.h> 358 %End 359 360public: 361 wxHeaderCtrlSimple(); 362 %PreMethodCode 363 if (!wxPyCheckForApp()) return NULL; 364 %End 365 366 wxHeaderCtrlSimple( 367 wxWindow * parent /TransferThis/, 368 wxWindowID winid = wxID_ANY, 369 const wxPoint & pos = wxDefaultPosition, 370 const wxSize & size = wxDefaultSize, 371 long style = wxHD_DEFAULT_STYLE, 372 const wxString & name = wxHeaderCtrlNameStr 373 ); 374 %PreMethodCode 375 if (!wxPyCheckForApp()) return NULL; 376 %End 377 378 void InsertColumn( 379 const wxHeaderColumnSimple & col, 380 unsigned int idx 381 ); 382 %Docstring 383 InsertColumn(col, idx) 384 385 Insert the column at the given position. 386 %End 387 388 void AppendColumn( 389 const wxHeaderColumnSimple & col 390 ); 391 %Docstring 392 AppendColumn(col) 393 394 Append the column to the end of the control. 395 %End 396 397 void DeleteColumn( 398 unsigned int idx 399 ); 400 %Docstring 401 DeleteColumn(idx) 402 403 Delete the column at the given position. 404 %End 405 406 void ShowColumn( 407 unsigned int idx, 408 bool show = true 409 ); 410 %Docstring 411 ShowColumn(idx, show=True) 412 413 Show or hide the column. 414 %End 415 416 void HideColumn( 417 unsigned int idx 418 ); 419 %Docstring 420 HideColumn(idx) 421 422 Hide the column with the given index. 423 %End 424 425 void ShowSortIndicator( 426 unsigned int idx, 427 bool sortOrder = true 428 ); 429 %Docstring 430 ShowSortIndicator(idx, sortOrder=True) 431 432 Update the column sort indicator. 433 %End 434 435 void RemoveSortIndicator(); 436 %Docstring 437 RemoveSortIndicator() 438 439 Remove the sort indicator from the column being used as sort key. 440 %End 441 442 public: 443 virtual wxPoint GetClientAreaOrigin() const; 444 virtual bool Validate(); 445 virtual bool TransferDataToWindow(); 446 virtual bool TransferDataFromWindow(); 447 virtual void InitDialog(); 448 virtual bool AcceptsFocus() const; 449 virtual bool AcceptsFocusRecursively() const; 450 virtual bool AcceptsFocusFromKeyboard() const; 451 virtual void AddChild( wxWindowBase *child ); 452 virtual void RemoveChild( wxWindowBase *child ); 453 virtual void InheritAttributes(); 454 virtual bool ShouldInheritColours() const; 455 virtual void OnInternalIdle(); 456 virtual wxWindow *GetMainWindowOfCompositeControl(); 457 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 458 virtual void SetCanFocus(bool canFocus); 459 virtual bool Destroy(); 460 virtual void SetValidator( const wxValidator &validator ); 461 virtual wxValidator* GetValidator(); 462 463 464 protected: 465 virtual bool ProcessEvent(wxEvent & event); 466 virtual void DoEnable(bool enable); 467 virtual void DoGetPosition(int *x, int *y) const; 468 virtual void DoGetSize(int *width, int *height) const; 469 virtual void DoGetClientSize(int *width, int *height) const; 470 virtual wxSize DoGetBestSize() const; 471 virtual wxSize DoGetBestClientSize() const; 472 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 473 virtual void DoSetClientSize(int width, int height); 474 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 475 virtual wxSize DoGetBorderSize() const; 476 virtual void DoMoveWindow(int x, int y, int width, int height); 477 virtual void DoSetWindowVariant( wxWindowVariant variant); 478 virtual wxBorder GetDefaultBorder() const; 479 virtual wxBorder GetDefaultBorderForControl() const; 480 virtual void DoFreeze(); 481 virtual void DoThaw(); 482 virtual bool HasTransparentBackground(); 483 virtual bool TryBefore(wxEvent& event); 484 virtual bool TryAfter(wxEvent& event); 485 486 487 public: 488 489 490 static 491 wxVisualAttributes GetClassDefaultAttributes( 492 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 493 ); 494 %Docstring 495 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 496 %End 497 %PreMethodCode 498 if (!wxPyCheckForApp()) return NULL; 499 %End 500 501 502protected: 503 virtual 504 int GetBestFittingWidth( 505 unsigned int idx 506 ) const; 507 %Docstring 508 GetBestFittingWidth(idx) -> int 509 510 This function can be overridden in the classes deriving from this 511 control instead of overriding UpdateColumnWidthToFit(). 512 %End 513 514 virtual const wxHeaderColumn& GetColumn(unsigned int idx) const; 515 virtual void UpdateColumnVisibility(unsigned int idx, bool show); 516 virtual void UpdateColumnsOrder(const wxArrayInt& order); 517 virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle); 518 virtual void OnColumnCountChanging(unsigned int count); 519 520 521}; // end of class wxHeaderCtrlSimple 522 523 524class wxHeaderCtrlEvent : wxNotifyEvent 525{ 526 %Docstring 527 HeaderCtrlEvent(commandType=wxEVT_NULL, winid=0) 528 HeaderCtrlEvent(event) 529 530 Event class representing the events generated by wxHeaderCtrl. 531 %End 532 %TypeHeaderCode 533 #include <wx/headerctrl.h> 534 %End 535 536public: 537 wxHeaderCtrlEvent( 538 wxEventType commandType = wxEVT_NULL, 539 int winid = 0 540 ); 541 542 wxHeaderCtrlEvent( 543 const wxHeaderCtrlEvent & event 544 ); 545 546 int GetColumn() const; 547 %Docstring 548 GetColumn() -> int 549 550 Return the index of the column affected by this event. 551 %End 552 553 void SetColumn( 554 int col 555 ); 556 %Docstring 557 SetColumn(col) 558 %End 559 560 int GetWidth() const; 561 %Docstring 562 GetWidth() -> int 563 564 Return the current width of the column. 565 %End 566 567 void SetWidth( 568 int width 569 ); 570 %Docstring 571 SetWidth(width) 572 %End 573 574 unsigned int GetNewOrder() const; 575 %Docstring 576 GetNewOrder() -> unsignedint 577 578 Return the new order of the column. 579 %End 580 581 void SetNewOrder( 582 unsigned int order 583 ); 584 %Docstring 585 SetNewOrder(order) 586 %End 587 588 public: 589 virtual wxEvent* Clone() const /Factory/; 590 591 592 private: 593 wxHeaderCtrlEvent& operator=(const wxHeaderCtrlEvent&); 594 595 596 public: 597 598 599 %Property(name=Column, get=GetColumn, set=SetColumn) 600 %Property(name=NewOrder, get=GetNewOrder, set=SetNewOrder) 601 %Property(name=Width, get=GetWidth, set=SetWidth) 602}; // end of class wxHeaderCtrlEvent 603 604 605%Extract(id=pycode_core) 606EVT_HEADER_CLICK = wx.PyEventBinder( wxEVT_HEADER_CLICK ) 607EVT_HEADER_RIGHT_CLICK = wx.PyEventBinder( wxEVT_HEADER_RIGHT_CLICK ) 608EVT_HEADER_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_HEADER_MIDDLE_CLICK ) 609EVT_HEADER_DCLICK = wx.PyEventBinder( wxEVT_HEADER_DCLICK ) 610EVT_HEADER_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_HEADER_RIGHT_DCLICK ) 611EVT_HEADER_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_HEADER_MIDDLE_DCLICK ) 612EVT_HEADER_SEPARATOR_DCLICK = wx.PyEventBinder( wxEVT_HEADER_SEPARATOR_DCLICK ) 613EVT_HEADER_BEGIN_RESIZE = wx.PyEventBinder( wxEVT_HEADER_BEGIN_RESIZE ) 614EVT_HEADER_RESIZING = wx.PyEventBinder( wxEVT_HEADER_RESIZING ) 615EVT_HEADER_END_RESIZE = wx.PyEventBinder( wxEVT_HEADER_END_RESIZE ) 616EVT_HEADER_BEGIN_REORDER = wx.PyEventBinder( wxEVT_HEADER_BEGIN_REORDER ) 617EVT_HEADER_END_REORDER = wx.PyEventBinder( wxEVT_HEADER_END_REORDER ) 618EVT_HEADER_DRAGGING_CANCELLED = wx.PyEventBinder( wxEVT_HEADER_DRAGGING_CANCELLED ) 619 620# deprecated wxEVT aliases 621wxEVT_COMMAND_HEADER_CLICK = wxEVT_HEADER_CLICK 622wxEVT_COMMAND_HEADER_RIGHT_CLICK = wxEVT_HEADER_RIGHT_CLICK 623wxEVT_COMMAND_HEADER_MIDDLE_CLICK = wxEVT_HEADER_MIDDLE_CLICK 624wxEVT_COMMAND_HEADER_DCLICK = wxEVT_HEADER_DCLICK 625wxEVT_COMMAND_HEADER_RIGHT_DCLICK = wxEVT_HEADER_RIGHT_DCLICK 626wxEVT_COMMAND_HEADER_MIDDLE_DCLICK = wxEVT_HEADER_MIDDLE_DCLICK 627wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK = wxEVT_HEADER_SEPARATOR_DCLICK 628wxEVT_COMMAND_HEADER_BEGIN_RESIZE = wxEVT_HEADER_BEGIN_RESIZE 629wxEVT_COMMAND_HEADER_RESIZING = wxEVT_HEADER_RESIZING 630wxEVT_COMMAND_HEADER_END_RESIZE = wxEVT_HEADER_END_RESIZE 631wxEVT_COMMAND_HEADER_BEGIN_REORDER = wxEVT_HEADER_BEGIN_REORDER 632wxEVT_COMMAND_HEADER_END_REORDER = wxEVT_HEADER_END_REORDER 633wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED = wxEVT_HEADER_DRAGGING_CANCELLED 634 635%End 636 637 638//--------------------------------------------------------------------------- 639 640