Handle ToolDock events
| 436 | // Handle ToolDock events |
| 437 | // |
| 438 | void ToolDock::Dock( ToolBar *bar, bool deflate, ToolBarConfiguration::Position position ) |
| 439 | { |
| 440 | #ifndef __WXMAC__ |
| 441 | // Apply the deflate fix only on Mac, else you introduce the opposite bug on others |
| 442 | deflate = false; |
| 443 | #endif |
| 444 | |
| 445 | // Adopt the toolbar into our family |
| 446 | bar->Reparent( this ); |
| 447 | mBars[ bar->GetSection() ] = bar; |
| 448 | |
| 449 | // Reset size |
| 450 | bar->SetSize( |
| 451 | // Undo the expansion that was applied when un-docking |
| 452 | bar->GetSize().x - (deflate ? 2 * ToolBarFloatMargin : 0), |
| 453 | // Don't need to adjust y the same way. |
| 454 | bar->GetDockedSize().y |
| 455 | ); |
| 456 | |
| 457 | // Park the NEW bar in the correct berth |
| 458 | if (!mConfiguration.Contains(bar) && bar->IsVisible()) |
| 459 | mConfiguration.Insert( bar, position ); |
| 460 | |
| 461 | // Inform toolbar of change |
| 462 | bar->SetDocked( this, false ); |
| 463 | } |
| 464 | |
| 465 | // Initial docking of bars |
| 466 | void ToolDock::LoadConfig() |
no test coverage detected