void MythUIButton::SetState(QString state) { if (m_state == state) return; if (m_Pushed && state != "pushed") UnPush(); m_state = state; if (!m_BackgroundState) return; m_BackgroundState->DisplayState(m_state); MythUIGroup *activeState = dynamic_cast<MythUIGroup*> (m_BackgroundState->GetCurrentState()); if (activeState) m_Text = dynamic_cast<MythUIText*>(activeState->GetChild("text")); if (m_Text) { m_Text->SetFontState(m_state); m_Text->SetText(m_Message); } }
void MythUIButton::SetText(const QString &msg) { if (m_Message == msg) return; m_Message = msg; MythUIGroup *activeState = dynamic_cast<MythUIGroup*> (m_BackgroundState->GetCurrentState()); if (activeState) m_Text = dynamic_cast<MythUIText*>(activeState->GetChild("text")); if (m_Text) m_Text->SetText(msg); }
bool ThemeChooser::Create(void) { // Load the theme for this screen if (!LoadWindowFromXML("settings-ui.xml", "themechooser", this)) return false; bool err = false; UIUtilE::Assign(this, m_themes, "themes", &err); UIUtilW::Assign(this, m_preview, "preview"); UIUtilW::Assign(this, m_fullPreviewStateType, "fullpreviewstate"); if (m_fullPreviewStateType) { MythUIGroup *state = dynamic_cast<MythUIGroup*> (m_fullPreviewStateType->GetChild("fullscreen")); if (state) { m_fullScreenName = dynamic_cast<MythUIText*>(state->GetChild("fullscreenname")); m_fullScreenPreview = dynamic_cast<MythUIImage*>(state->GetChild("fullscreenpreview")); } } if (err) { LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot load screen 'themechooser'"); return false; } connect(m_themes, SIGNAL(itemClicked(MythUIButtonListItem*)), this, SLOT(saveAndReload(MythUIButtonListItem*))); connect(m_themes, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(itemChanged(MythUIButtonListItem*))); BuildFocusList(); LoadInBackground(); return true; }
void MythUIGroup::CreateCopy(MythUIType *parent) { MythUIGroup *group = new MythUIGroup(parent, objectName()); group->CopyFrom(this); }