| 423 | } |
| 424 | |
| 425 | void ControlToolBar::ReCreateButtons() |
| 426 | { |
| 427 | bool playDown = false; |
| 428 | bool playShift = false; |
| 429 | bool pauseDown = false; |
| 430 | bool recordDown = false; |
| 431 | bool recordShift = false; |
| 432 | bool loopDown = false; |
| 433 | |
| 434 | // ToolBar::ReCreateButtons() will get rid of its sizer and |
| 435 | // since we've attached our sizer to it, ours will get deleted too |
| 436 | // so clean ours up first. |
| 437 | if( mSizer ) |
| 438 | { |
| 439 | playDown = mPlay->IsDown(); |
| 440 | playShift = mPlay->WasShiftDown(); |
| 441 | pauseDown = mPause->IsDown(); |
| 442 | recordDown = mRecord->IsDown(); |
| 443 | recordShift = mRecord->WasShiftDown(); |
| 444 | loopDown = mLoop->IsDown(); |
| 445 | Detach( mSizer ); |
| 446 | |
| 447 | std::unique_ptr < wxSizer > {mSizer}; // DELETE it |
| 448 | mSizer = NULL; |
| 449 | } |
| 450 | |
| 451 | ToolBar::ReCreateButtons(); |
| 452 | |
| 453 | if (playDown) |
| 454 | { |
| 455 | ControlToolBar::PlayAppearance appearance = |
| 456 | playShift ? ControlToolBar::PlayAppearance::Looped |
| 457 | : ControlToolBar::PlayAppearance::Straight; |
| 458 | SetPlay(playDown, appearance); |
| 459 | } |
| 460 | |
| 461 | if (pauseDown) |
| 462 | { |
| 463 | mPause->PushDown(); |
| 464 | } |
| 465 | |
| 466 | if (recordDown) |
| 467 | { |
| 468 | mRecord->SetAlternateIdx(recordShift ? 1 : 0); |
| 469 | mRecord->PushDown(); |
| 470 | } |
| 471 | |
| 472 | if (loopDown) |
| 473 | mLoop->PushDown(); |
| 474 | |
| 475 | EnableDisableButtons(); |
| 476 | |
| 477 | RegenerateTooltips(); |
| 478 | } |
| 479 | |
| 480 | void ControlToolBar::Repaint( wxDC *dc ) |
| 481 | { |
nothing calls this directly
no test coverage detected