void SongSettingWidget::on_toolButtonInfoFont_clicked() { bool ok; QFont font = QFontDialog::getFont(&ok,mySettings.infoFont,this); if(ok) { mySettings.infoFont = font; mySettings.isChangedInfoFont = true; } ui->labelInfoFont->setText(getFontText(mySettings.infoFont)); }
void SongSettingWidget::on_toolButtonEndingFont2_clicked() { bool ok; QFont font = QFontDialog::getFont(&ok,mySettings2.endingFont,this); if(ok) { mySettings2.endingFont = font; mySettings2.isChangedEndingFont = true; } ui->labelEndingFont2->setText(getFontText(mySettings2.endingFont)); }
LRESULT UILabel::onEvent(UINT msg, WPARAM wp, LPARAM lp, UINT flag, Point pt) { switch (msg) { case WM_SETTEXT: setFontText((LPCTSTR)lp); invalidate(); return getFontLength(); case WM_GETTEXT: ASSERT(lp); *(CString*)(lp) = getFontText(); return getFontLength(); case WM_GETTEXTLENGTH: return getFontLength(); } return UIControl::onEvent(msg, wp, lp, flag, pt); }
void SongSettingWidget::loadSettings() { QPalette p; // Text Font ui->checkBoxCommonFont->setChecked(mySettings.isNotCommonFont); on_checkBoxCommonFont_stateChanged(mySettings.isNotCommonFont); ui->labelFont->setText(getFontText(mySettings.textFont)); ui->checkBoxCommonFont2->setChecked(mySettings2.isNotCommonFont); on_checkBoxCommonFont2_stateChanged(mySettings2.isNotCommonFont); ui->labelFont2->setText(getFontText(mySettings2.textFont)); // Text Color ui->checkBoxCommonColor->setChecked(mySettings.isNotCommonColor); on_checkBoxCommonColor_stateChanged(mySettings.isNotCommonColor); p.setColor(QPalette::Base,mySettings.textColor); ui->graphicViewTextColor->setPalette(p); ui->checkBoxCommonColor2->setChecked(mySettings2.isNotCommonColor); on_checkBoxCommonColor2_stateChanged(mySettings2.isNotCommonColor); p.setColor(QPalette::Base,mySettings2.textColor); ui->graphicViewTextColor2->setPalette(p); // Text Shadow Color p.setColor(QPalette::Base,mySettings.textShadowColor); ui->graphicViewShadowColor->setPalette(p); p.setColor(QPalette::Base,mySettings2.textShadowColor); ui->graphicViewShadowColor2->setPalette(p); // Alingment ui->comboBoxVerticalAling->setCurrentIndex(mySettings.textAlingmentV); ui->comboBoxHorizontalAling->setCurrentIndex(mySettings.textAlingmentH); ui->comboBoxVerticalAling2->setCurrentIndex(mySettings2.textAlingmentV); ui->comboBoxHorizontalAling2->setCurrentIndex(mySettings2.textAlingmentH); // Song Information ui->checkBoxStanzaTitle->setChecked(mySettings.showStanzaTitle); ui->checkBoxSongKey->setChecked(mySettings.showSongKey); ui->checkBoxSongNumber->setChecked(mySettings.showSongNumber); ui->checkBoxSameInfoFont->setChecked(mySettings.isNotSameInfoFont); on_checkBoxSameInfoFont_stateChanged(mySettings.isNotSameInfoFont); ui->labelInfoFont->setText(getFontText(mySettings.infoFont)); ui->checkBoxSameInfoColor->setChecked(mySettings.isNotSameInfoColor); on_checkBoxSameInfoColor_stateChanged(mySettings.isNotSameInfoColor); p.setColor(QPalette::Base,mySettings.infoColor); ui->graphicViewInfoColor->setPalette(p); p.setColor(QPalette::Base,mySettings.infoShadowColor); ui->graphicViewInfoShadowColor->setPalette(p); ui->comboBoxInfoAlign->setCurrentIndex(mySettings.infoAling); updateInfoButtons(); ui->checkBoxStanzaTitle2->setChecked(mySettings2.showStanzaTitle); ui->checkBoxSongKey2->setChecked(mySettings2.showSongKey); ui->checkBoxSongNumber2->setChecked(mySettings2.showSongNumber); ui->checkBoxSameInfoFont2->setChecked(mySettings2.isNotSameInfoFont); on_checkBoxSameInfoFont2_stateChanged(mySettings2.isNotSameInfoFont); ui->labelInfoFont2->setText(getFontText(mySettings2.infoFont)); ui->checkBoxSameInfoColor2->setChecked(mySettings2.isNotSameInfoColor); on_checkBoxSameInfoColor2_stateChanged(mySettings2.isNotSameInfoColor); p.setColor(QPalette::Base,mySettings2.infoColor); ui->graphicViewInfoColor2->setPalette(p); p.setColor(QPalette::Base,mySettings2.infoShadowColor); ui->graphicViewInfoShadowColor2->setPalette(p); ui->comboBoxInfoAlign2->setCurrentIndex(mySettings2.infoAling); updateInfoButtons2(); // Song Ending ui->groupBoxSongEnding->setChecked(mySettings.showSongEnding); ui->checkBoxSameEndingFont->setChecked(mySettings.isNotSameEndingFont); on_checkBoxSameEndingFont_stateChanged(mySettings.isNotSameEndingFont); ui->labelEndingFont->setText(getFontText(mySettings.endingFont)); ui->checkBoxSameEndingColor->setChecked(mySettings.isNotSameEndingColor); on_checkBoxSameEndingColor_stateChanged(mySettings.isNotSameEndingColor); p.setColor(QPalette::Base,mySettings.endingColor); ui->graphicViewEndingColor->setPalette(p); p.setColor(QPalette::Base,mySettings.endingShadowColor); ui->graphicViewEndingShadowColor->setPalette(p); ui->comboBoxEndingType->setCurrentIndex(mySettings.endingType); ui->comboBoxEndingPosition->setCurrentIndex(mySettings.endingPosition); ui->groupBoxSongEnding2->setChecked(mySettings2.showSongEnding); ui->checkBoxSameEndingFont2->setChecked(mySettings2.isNotSameEndingFont); on_checkBoxSameEndingFont2_stateChanged(mySettings2.isNotSameEndingFont); ui->labelEndingFont2->setText(getFontText(mySettings2.endingFont)); ui->checkBoxSameEndingColor2->setChecked(mySettings2.isNotSameEndingColor); on_checkBoxSameEndingColor2_stateChanged(mySettings2.isNotSameEndingColor); p.setColor(QPalette::Base,mySettings2.endingColor); ui->graphicViewEndingColor2->setPalette(p); p.setColor(QPalette::Base,mySettings2.endingShadowColor); ui->graphicViewEndingShadowColor2->setPalette(p); ui->comboBoxEndingType2->setCurrentIndex(mySettings2.endingType); ui->comboBoxEndingPosition2->setCurrentIndex(mySettings2.endingPosition); // Transition ui->comboBoxTransitionType->setCurrentIndex(mySettings.transitionType + 1); ui->comboBoxTransitionType2->setCurrentIndex(mySettings2.transitionType + 1); // Effects ui->comboBoxTextEffects->setCurrentIndex(mySettings.effectsType + 1); ui->comboBoxTextEffects2->setCurrentIndex(mySettings2.effectsType + 1); // Background ui->comboBoxBackgoundType->setCurrentIndex(mySettings.backgroundType + 1); on_comboBoxBackgoundType_currentIndexChanged(mySettings.backgroundType + 1); p.setColor(QPalette::Base,mySettings.backgroundColor); ui->graphicsViewBackgroundColor->setPalette(p); if(mySettings.backgroundType == 1) ui->lineEditBackPath->setText(mySettings.backgroundName); else if(mySettings.backgroundType == 2) ui->lineEditBackPath->setText(mySettings.backgroundVideoPath); ui->comboBoxBackgoundType2->setCurrentIndex(mySettings2.backgroundType + 1); on_comboBoxBackgoundType2_currentIndexChanged(mySettings2.backgroundType + 1); p.setColor(QPalette::Base,mySettings2.backgroundColor); ui->graphicsViewBackgroundColor2->setPalette(p); if(mySettings2.backgroundType == 1) ui->lineEditBackPath2->setText(mySettings2.backgroundName); else if(mySettings2.backgroundType == 2) ui->lineEditBackPath2->setText(mySettings2.backgroundVideoPath); // Screen Use ui->checkBoxCommonLayout->setChecked(mySettings.isNotCommonLayout); on_checkBoxCommonLayout_stateChanged(mySettings.isNotCommonLayout); ui->spinBoxMaxScreen->setValue(mySettings.screenUse); ui->comboBoxScreenPosition->setCurrentIndex(mySettings.screenPosition); ui->checkBoxCommonLayout2->setChecked(mySettings2.isNotCommonLayout); on_checkBoxCommonLayout2_stateChanged(mySettings2.isNotCommonLayout); ui->spinBoxMaxScreen2->setValue(mySettings2.screenUse); ui->comboBoxScreenPosition2->setCurrentIndex(mySettings2.screenPosition); // Secondary Screen ui->checkBoxDisp2->setChecked(mySettings.useSameForDisp2); on_checkBoxDisp2_stateChanged(mySettings.useSameForDisp2); }