MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / OnClicked

Method OnClicked

Source/IDrawableModule.cpp:671–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671void IDrawableModule::OnClicked(float x, float y, bool right)
672{
673 float w, h;
674 GetModuleDimensions(w, h);
675
676 if (IsResizable() && mHoveringOverResizeHandle)
677 {
678 TheSynth->SetResizeModule(this);
679 return;
680 }
681
682 if (y < 0)
683 {
684 if (mEnabledCheckbox && x < 20)
685 {
686 //"enabled" area
687 }
688 else if (x < GetMinimizedWidth() && CanMinimize())
689 {
690 mWasMinimizeAreaClicked = true;
691 return;
692 }
693 else if (!Minimized() && IsSaveable())
694 {
695 if (x > w - 10)
696 {
697 if (TheSaveDataPanel->GetModule() == this)
698 TheSaveDataPanel->SetModule(nullptr);
699 else
700 TheSaveDataPanel->SetModule(this);
701 }
702 else if (x > w - 30 && mKeyboardFocusListener != nullptr && mKeyboardFocusListener->CanTakeFocus())
703 {
704 IKeyboardFocusListener::SetActiveKeyboardFocus(mKeyboardFocusListener);
705 }
706 }
707 }
708
709 for (int i = 0; i < mUIControls.size(); ++i)
710 {
711 if (mUIControls[i]->TestClick(x, y, right))
712 break;
713 }
714 for (int i = 0; i < mChildren.size(); ++i)
715 {
716 if (mChildren[i]->TestClick(x, y, right))
717 break;
718 }
719
720 for (auto* seq : ControlSequencer::sControlSequencers)
721 {
722 for (int i = 0; i < mUIControls.size(); ++i)
723 {
724 if (mUIControls[i] == seq->GetUIControl())
725 TheSynth->MoveToFront(seq);
726 }
727 }
728 TheSynth->MoveToFront(this);

Callers

nothing calls this directly

Calls 8

SetResizeModuleMethod · 0.80
GetModuleMethod · 0.80
SetModuleMethod · 0.80
sizeMethod · 0.80
CanTakeFocusMethod · 0.45
TestClickMethod · 0.45
GetUIControlMethod · 0.45
MoveToFrontMethod · 0.45

Tested by

no test coverage detected