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 _propgrid.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13const char* wxPropertyGridManagerNameStr; 14 15class wxPropertyGridPage : wxEvtHandler, wxPropertyGridInterface, wxPropertyGridPageState 16{ 17 %Docstring 18 PropertyGridPage() 19 20 Holder of property grid page information. 21 %End 22 %TypeHeaderCode 23 #include <wx/propgrid/manager.h> 24 %End 25 26public: 27 wxPropertyGridPage(); 28 29 virtual 30 ~wxPropertyGridPage(); 31 32 virtual 33 void Clear(); 34 %Docstring 35 Clear() 36 37 Deletes all properties on page. 38 %End 39 40 wxSize FitColumns(); 41 %Docstring 42 FitColumns() -> wx.Size 43 44 Reduces column sizes to minimum possible that contents are still 45 visibly (naturally some margin space will be applied as well). 46 %End 47 48 int GetIndex() const; 49 %Docstring 50 GetIndex() -> int 51 52 Returns page index in manager;. 53 %End 54 55 wxPGProperty * GetRoot() const; 56 %Docstring 57 GetRoot() -> PGProperty 58 59 Returns "root property". 60 %End 61 62 int GetSplitterPosition( 63 int col = 0 64 ) const; 65 %Docstring 66 GetSplitterPosition(col=0) -> int 67 68 Returns x-coordinate position of splitter on a page. 69 %End 70 71 int GetToolId() const; 72 %Docstring 73 GetToolId() -> int 74 75 Returns id of the tool bar item that represents this page on 76 wxPropertyGridManager's wxToolBar. 77 %End 78 79 virtual 80 void Init(); 81 %Docstring 82 Init() 83 84 Do any member initialization in this method. 85 %End 86 87 virtual 88 bool IsHandlingAllEvents() const; 89 %Docstring 90 IsHandlingAllEvents() -> bool 91 92 Return false here to indicate unhandled events should be propagated to 93 manager's parent, as normal. 94 %End 95 96 virtual 97 void OnShow(); 98 %Docstring 99 OnShow() 100 101 Called every time page is about to be shown. 102 %End 103 104 virtual 105 void RefreshProperty( 106 wxPGProperty * p 107 ); 108 %Docstring 109 RefreshProperty(p) 110 111 Refreshes given property on page. 112 %End 113 114 void SetSplitterPosition( 115 int splitterPos, 116 int col = 0 117 ); 118 %Docstring 119 SetSplitterPosition(splitterPos, col=0) 120 121 Sets splitter position on page. 122 %End 123 124 public: 125 126 127 %Property(name=Index, get=GetIndex) 128 %Property(name=Root, get=GetRoot) 129 %Property(name=SplitterPosition, get=GetSplitterPosition, set=SetSplitterPosition) 130 %Property(name=ToolId, get=GetToolId) 131}; // end of class wxPropertyGridPage 132 133 134class wxPropertyGridManager : wxPanel, wxPropertyGridInterface 135{ 136 %Docstring 137 PropertyGridManager() 138 PropertyGridManager(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=PGMAN_DEFAULT_STYLE, name=PropertyGridManagerNameStr) 139 140 wxPropertyGridManager is an efficient multi-page version of 141 wxPropertyGrid, which can optionally have toolbar for mode and page 142 selection, a help text box, and a header. 143 %End 144 %TypeHeaderCode 145 #include <wx/propgrid/manager.h> 146 %End 147 148public: 149 wxPropertyGridManager(); 150 %PreMethodCode 151 if (!wxPyCheckForApp()) return NULL; 152 %End 153 154 wxPropertyGridManager( 155 wxWindow * parent /TransferThis/, 156 wxWindowID id = wxID_ANY, 157 const wxPoint & pos = wxDefaultPosition, 158 const wxSize & size = wxDefaultSize, 159 long style = wxPGMAN_DEFAULT_STYLE, 160 const wxString & name = wxPropertyGridManagerNameStr 161 ); 162 %PreMethodCode 163 if (!wxPyCheckForApp()) return NULL; 164 %End 165 166 virtual 167 ~wxPropertyGridManager(); 168 169 wxPropertyGridPage * AddPage( 170 const wxString & label = wxEmptyString, 171 const wxBitmap & bmp = wxPG_NULL_BITMAP, 172 wxPropertyGridPage * pageObj /Transfer/ = NULL 173 ); 174 %Docstring 175 AddPage(label=wx.EmptyString, bmp=PG_NULL_BITMAP, pageObj=None) -> PropertyGridPage 176 177 Creates new property page. 178 %End 179 180 virtual 181 void Clear(); 182 %Docstring 183 Clear() 184 185 Deletes all properties and all pages. 186 %End 187 188 void ClearPage( 189 int page 190 ); 191 %Docstring 192 ClearPage(page) 193 194 Deletes all properties on given page. 195 %End 196 197 bool CommitChangesFromEditor( 198 wxUint32 flags = 0 199 ); 200 %Docstring 201 CommitChangesFromEditor(flags=0) -> bool 202 203 Forces updating the value of property from the editor control. 204 %End 205 206 bool Create( 207 wxWindow * parent /TransferThis/, 208 wxWindowID id = wxID_ANY, 209 const wxPoint & pos = wxDefaultPosition, 210 const wxSize & size = wxDefaultSize, 211 long style = wxPGMAN_DEFAULT_STYLE, 212 const wxString & name = wxPropertyGridManagerNameStr 213 ); 214 %Docstring 215 Create(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=PGMAN_DEFAULT_STYLE, name=PropertyGridManagerNameStr) -> bool 216 217 Two step creation. 218 %End 219 220 bool EnableCategories( 221 bool enable 222 ); 223 %Docstring 224 EnableCategories(enable) -> bool 225 226 Enables or disables (shows/hides) categories according to parameter 227 enable. 228 %End 229 230 bool EnsureVisible( 231 const wxPGPropArgCls & id 232 ); 233 %Docstring 234 EnsureVisible(id) -> bool 235 236 Selects page, scrolls and/or expands items to ensure that the given 237 item is visible. 238 %End 239 240 int GetColumnCount( 241 int page = -1 242 ) const; 243 %Docstring 244 GetColumnCount(page=-1) -> int 245 246 Returns number of columns on given page. 247 %End 248 249 int GetDescBoxHeight() const; 250 %Docstring 251 GetDescBoxHeight() -> int 252 253 Returns height of the description text box. 254 %End 255 256 wxPropertyGrid * GetGrid(); 257 %Docstring 258 GetGrid() -> PropertyGrid 259 260 Returns pointer to the contained wxPropertyGrid. 261 %End 262 263 virtual 264 wxPGVIterator GetVIterator( 265 int flags 266 ) const; 267 %Docstring 268 GetVIterator(flags) -> PGVIterator 269 270 Similar to GetIterator, but instead returns wxPGVIterator instance, 271 which can be useful for forward-iterating through arbitrary property 272 containers. 273 %End 274 275 wxPropertyGridPage * GetCurrentPage() const; 276 %Docstring 277 GetCurrentPage() -> PropertyGridPage 278 279 Returns currently selected page. 280 %End 281 282 wxPropertyGridPage * GetPage( 283 unsigned int ind 284 ) const; 285 %Docstring 286 GetPage(ind) -> PropertyGridPage 287 GetPage(name) -> PropertyGridPage 288 289 Returns page object for given page index. 290 %End 291 292 wxPropertyGridPage * GetPage( 293 const wxString & name 294 ) const; 295 296 int GetPageByName( 297 const wxString & name 298 ) const; 299 %Docstring 300 GetPageByName(name) -> int 301 302 Returns index for a page name. 303 %End 304 305 size_t GetPageCount() const; 306 %Docstring 307 GetPageCount() -> size_t 308 309 Returns number of managed pages. 310 %End 311 312 const wxString & GetPageName( 313 int index 314 ) const; 315 %Docstring 316 GetPageName(index) -> String 317 318 Returns name of given page. 319 %End 320 321 wxPGProperty * GetPageRoot( 322 int index 323 ) const; 324 %Docstring 325 GetPageRoot(index) -> PGProperty 326 327 Returns "root property" of the given page. 328 %End 329 330 int GetSelectedPage() const; 331 %Docstring 332 GetSelectedPage() -> int 333 334 Returns index to currently selected page. 335 %End 336 337 wxPGProperty * GetSelectedProperty() const; 338 %Docstring 339 GetSelectedProperty() -> PGProperty 340 341 Alias for GetSelection(). 342 %End 343 344 wxPGProperty * GetSelection() const; 345 %Docstring 346 GetSelection() -> PGProperty 347 348 Shortcut for GetGrid()->GetSelection(). 349 %End 350 351 wxToolBar * GetToolBar() const; 352 %Docstring 353 GetToolBar() -> wx.ToolBar 354 355 Returns a pointer to the toolbar currently associated with the 356 wxPropertyGridManager (if any). 357 %End 358 359 virtual 360 wxPropertyGridPage * InsertPage( 361 int index, 362 const wxString & label, 363 const wxBitmap & bmp = wxNullBitmap, 364 wxPropertyGridPage * pageObj = NULL 365 ); 366 %Docstring 367 InsertPage(index, label, bmp=wx.NullBitmap, pageObj=None) -> PropertyGridPage 368 369 Creates new property page. 370 %End 371 372 bool IsAnyModified() const; 373 %Docstring 374 IsAnyModified() -> bool 375 376 Returns true if any property on any page has been modified by the 377 user. 378 %End 379 380 bool IsFrozen() const; 381 %Docstring 382 IsFrozen() -> bool 383 384 Returns true if updating is frozen (ie. 385 %End 386 387 bool IsPageModified( 388 size_t index 389 ) const; 390 %Docstring 391 IsPageModified(index) -> bool 392 393 Returns true if any property on given page has been modified by the 394 user. 395 %End 396 397 virtual 398 bool IsPropertySelected( 399 const wxPGPropArgCls & id 400 ) const; 401 %Docstring 402 IsPropertySelected(id) -> bool 403 404 Returns true if property is selected. 405 %End 406 407 virtual 408 bool RemovePage( 409 int page 410 ); 411 %Docstring 412 RemovePage(page) -> bool 413 414 Removes a page. 415 %End 416 417 void SelectPage( 418 int index 419 ); 420 %Docstring 421 SelectPage(index) 422 SelectPage(label) 423 SelectPage(page) 424 425 Select and displays a given page. 426 %End 427 428 void SelectPage( 429 const wxString & label 430 ); 431 432 void SelectPage( 433 wxPropertyGridPage * page 434 ); 435 436 bool SelectProperty( 437 const wxPGPropArgCls & id, 438 bool focus = false 439 ); 440 %Docstring 441 SelectProperty(id, focus=False) -> bool 442 443 Select a property. 444 %End 445 446 void SetColumnCount( 447 int colCount, 448 int page = -1 449 ); 450 %Docstring 451 SetColumnCount(colCount, page=-1) 452 453 Sets number of columns on given page (default is current page). 454 %End 455 456 void SetColumnTitle( 457 int idx, 458 const wxString & title 459 ); 460 %Docstring 461 SetColumnTitle(idx, title) 462 463 Sets a column title. 464 %End 465 466 void SetDescription( 467 const wxString & label, 468 const wxString & content 469 ); 470 %Docstring 471 SetDescription(label, content) 472 473 Sets label and text in description box. 474 %End 475 476 void SetDescBoxHeight( 477 int ht, 478 bool refresh = true 479 ); 480 %Docstring 481 SetDescBoxHeight(ht, refresh=True) 482 483 Sets y coordinate of the description box splitter. 484 %End 485 486 void SetSplitterLeft( 487 bool subProps = false, 488 bool allPages = true 489 ); 490 %Docstring 491 SetSplitterLeft(subProps=False, allPages=True) 492 493 Moves splitter as left as possible, while still allowing all labels to 494 be shown in full. 495 %End 496 497 void SetPageSplitterLeft( 498 int page, 499 bool subProps = false 500 ); 501 %Docstring 502 SetPageSplitterLeft(page, subProps=False) 503 504 Moves splitter as left as possible on an individual page, while still 505 allowing all labels to be shown in full. 506 %End 507 508 void SetPageSplitterPosition( 509 int page, 510 int pos, 511 int column = 0 512 ); 513 %Docstring 514 SetPageSplitterPosition(page, pos, column=0) 515 516 Sets splitter position on individual page. 517 %End 518 519 void SetSplitterPosition( 520 int pos, 521 int column = 0 522 ); 523 %Docstring 524 SetSplitterPosition(pos, column=0) 525 526 Sets splitter position for all pages. 527 %End 528 529 void ShowHeader( 530 bool show = true 531 ); 532 %Docstring 533 ShowHeader(show=True) 534 535 Show or hide the property grid header control. 536 %End 537 538 static 539 wxVisualAttributes GetClassDefaultAttributes( 540 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 541 ); 542 %Docstring 543 GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes 544 %End 545 %PreMethodCode 546 if (!wxPyCheckForApp()) return NULL; 547 %End 548 549 public: 550 551 552 %Property(name=ColumnCount, get=GetColumnCount, set=SetColumnCount) 553 %Property(name=CurrentPage, get=GetCurrentPage) 554 %Property(name=DescBoxHeight, get=GetDescBoxHeight, set=SetDescBoxHeight) 555 %Property(name=Grid, get=GetGrid) 556 %Property(name=PageCount, get=GetPageCount) 557 %Property(name=SelectedPage, get=GetSelectedPage) 558 %Property(name=SelectedProperty, get=GetSelectedProperty) 559 %Property(name=Selection, get=GetSelection) 560 %Property(name=ToolBar, get=GetToolBar) 561 562protected: 563 virtual 564 wxPropertyGrid * CreatePropertyGrid() const; 565 %Docstring 566 CreatePropertyGrid() -> PropertyGrid 567 568 Creates property grid for the manager. 569 %End 570 571}; // end of class wxPropertyGridManager 572 573 574%Extract(id=pycode_propgrid) 575_PropertyGridManager__init__orig = PropertyGridManager.__init__ 576def _PropertyGridManager__init__(self, *args, **kw): 577 _PropertyGridManager__init__orig(self, *args, **kw) 578 self.DoDefaultTypeMappings() 579 self.edited_objects = {} 580 self.DoDefaultValueTypeMappings() 581 if not hasattr(self.__class__, '_vt2setter'): 582 self.__class__._vt2setter = {} 583PropertyGridManager.__init__ = _PropertyGridManager__init__ 584 585%End 586 587 588//--------------------------------------------------------------------------- 589 590