Escape closes the about dialog
This commit is contained in:
parent
aa1b79936f
commit
280a14f922
3 changed files with 25 additions and 2 deletions
|
|
@ -223,6 +223,24 @@ CMouseEventResult SAboutDialog::onMouseDown(CPoint& where, const CButtonState& b
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t SAboutDialog::onKeyDown (const VstKeyCode& keyCode, CFrame* frame)
|
||||||
|
{
|
||||||
|
if (keyCode.virt == VKEY_ESCAPE) {
|
||||||
|
setVisible(false);
|
||||||
|
frame->unregisterKeyboardHook(this);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t SAboutDialog::onKeyUp (const VstKeyCode& keyCode, CFrame* frame)
|
||||||
|
{
|
||||||
|
(void)keyCode;
|
||||||
|
(void)frame;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void SAboutDialog::valueChanged(CControl *ctl)
|
void SAboutDialog::valueChanged(CControl *ctl)
|
||||||
{
|
{
|
||||||
int32_t tag = ctl->getTag();
|
int32_t tag = ctl->getTag();
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
using namespace VSTGUI;
|
using namespace VSTGUI;
|
||||||
|
|
||||||
class SAboutDialog : public CViewContainer, public IControlListener {
|
class SAboutDialog : public CViewContainer, public IControlListener, public IKeyboardHook{
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kTagButtonSfztools,
|
kTagButtonSfztools,
|
||||||
|
|
@ -28,6 +28,8 @@ public:
|
||||||
|
|
||||||
void setPluginFormat(const std::string& pluginFormat);
|
void setPluginFormat(const std::string& pluginFormat);
|
||||||
void setPluginHost(const std::string& pluginHost);
|
void setPluginHost(const std::string& pluginHost);
|
||||||
|
int32_t onKeyDown (const VstKeyCode& code, CFrame* frame) override;
|
||||||
|
int32_t onKeyUp (const VstKeyCode& code, CFrame* frame) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CMouseEventResult onMouseDown(CPoint& where, const CButtonState& buttons) override;
|
CMouseEventResult onMouseDown(CPoint& where, const CButtonState& buttons) override;
|
||||||
|
|
|
||||||
|
|
@ -2128,7 +2128,10 @@ void Editor::Impl::valueChanged(CControl* ctl)
|
||||||
if (value != 1)
|
if (value != 1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Call::later([this]() { aboutDialog_->setVisible(true); });
|
Call::later([this]() {
|
||||||
|
aboutDialog_->setVisible(true);
|
||||||
|
frame_->registerKeyboardHook(aboutDialog_);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kTagThemeMenu:
|
case kTagThemeMenu:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue