| 574 | } |
| 575 | |
| 576 | void TitleBar::ButtonClicked(ClickButton* button, double time) |
| 577 | { |
| 578 | if (button == mSaveLayoutButton) |
| 579 | { |
| 580 | if (GetKeyModifiers() == kModifier_Shift) |
| 581 | TheSynth->SaveLayoutAsPopup(); |
| 582 | else |
| 583 | TheSynth->SaveLayout(); |
| 584 | } |
| 585 | if (button == mSaveStateButton) |
| 586 | TheSynth->SaveCurrentState(); |
| 587 | if (button == mSaveStateAsButton) |
| 588 | TheSynth->SaveStatePopup(); |
| 589 | if (button == mLoadStateButton) |
| 590 | TheSynth->LoadStatePopup(); |
| 591 | if (button == mWriteAudioButton) |
| 592 | TheSynth->SaveOutput(); |
| 593 | if (button == mDisplayHelpButton) |
| 594 | { |
| 595 | float x, y, w, h, butW, butH; |
| 596 | mDisplayHelpButton->GetPosition(x, y); |
| 597 | mDisplayHelpButton->GetDimensions(butW, butH); |
| 598 | mHelpDisplay->GetDimensions(w, h); |
| 599 | mHelpDisplay->SetPosition(x - w + butW, y + butH); |
| 600 | mHelpDisplay->SetOwningContainer(GetOwningContainer()); |
| 601 | mHelpDisplay->Show(); |
| 602 | TheSynth->PushModalFocusItem(mHelpDisplay); |
| 603 | sShowInitialHelpOverlay = false; |
| 604 | } |
| 605 | if (button == mDisplayUserPrefsEditorButton) |
| 606 | TheSynth->GetUserPrefsEditor()->Show(); |
| 607 | if (button == mHomeButton) |
| 608 | TheSynth->GetLocationZoomer()->GoHome(); |
| 609 | if (button == mResetLayoutButton) |
| 610 | { |
| 611 | auto buttonRect = mResetLayoutButton->GetRect(); |
| 612 | mNewPatchConfirmPopup.SetOwningContainer(GetOwningContainer()); |
| 613 | mNewPatchConfirmPopup.SetPosition(buttonRect.x, buttonRect.y + buttonRect.height + 2); |
| 614 | TheSynth->PushModalFocusItem(&mNewPatchConfirmPopup); |
| 615 | } |
| 616 | if (button == mPlayPauseButton) |
| 617 | TheSynth->SetAudioPaused(!TheSynth->IsAudioPaused()); |
| 618 | } |
| 619 | |
| 620 | void NewPatchConfirmPopup::CreateUIControls() |
| 621 | { |
nothing calls this directly
no test coverage detected