void MythUIType::SetEnabled(bool enable) { if (m_Enabled != enable) m_Enabled = enable; if (enable) emit Enabling(); else emit Disabling(); }
MythUICheckBox::MythUICheckBox(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_currentCheckState = MythUIStateType::Off; m_state = "active"; m_BackgroundState = m_CheckState = NULL; connect(this, SIGNAL(TakingFocus()), this, SLOT(Select())); connect(this, SIGNAL(LosingFocus()), this, SLOT(Deselect())); connect(this, SIGNAL(Enabling()), this, SLOT(Enable())); connect(this, SIGNAL(Disabling()), this, SLOT(Disable())); SetCanTakeFocus(true); }
MythUIButton::MythUIButton(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_clickTimer = new QTimer(); m_clickTimer->setSingleShot(true); m_Pushed = false; m_Lockable = false; m_Text = NULL; m_BackgroundState = NULL; connect(m_clickTimer, SIGNAL(timeout()), SLOT(UnPush())); connect(this, SIGNAL(TakingFocus()), SLOT(Select())); connect(parent, SIGNAL(LosingFocus()), SLOT(Deselect())); connect(this, SIGNAL(LosingFocus()), SLOT(Deselect())); connect(this, SIGNAL(Enabling()), SLOT(Enable())); connect(this, SIGNAL(Disabling()), SLOT(Disable())); SetCanTakeFocus(true); }