Esempio n. 1
0
String HelpTopicInfo::GetText() const
{
	String t = GetText(GetCurrentLanguage());
	if(IsNull(t))
		t = GetDefaultText();
	return t;
}
Esempio n. 2
0
BOOL CDreamSkinStatic::GetDefaultSkin(SKINSTATIC *pSkinStatic)
{
	if (pSkinStatic)
	{
		GetDefaultBackground(&pSkinStatic->skinBkNormal, ::GetSysColor(COLOR_BTNFACE));
		GetDefaultText(&pSkinStatic->skinTxtNormal, ::GetSysColor(COLOR_BTNTEXT));
	}

	return TRUE;
}
Esempio n. 3
0
void CDreamSkinTab::GetDefaultButton(SKINBUTTON *pSkinButton)
{
	pSkinButton->nRgnType = RGN_RECT;
	pSkinButton->clrTansparent = RGB(255, 255, 255);

	GetDefaultBackground(&pSkinButton->skinBkNormal, ::GetSysColor(COLOR_BTNFACE));
	GetDefaultBackground(&pSkinButton->skinBkDisable, ::GetSysColor(COLOR_BTNFACE));
	GetDefaultBackground(&pSkinButton->skinBkHover, ::GetSysColor(COLOR_BTNFACE));
	GetDefaultBackground(&pSkinButton->skinBkPress, ::GetSysColor(COLOR_BTNFACE));
	GetDefaultBackground(&pSkinButton->skinBkDefault, ::GetSysColor(COLOR_BTNFACE));

	GetDefaultText(&pSkinButton->skinTxtNormal, ::GetSysColor(COLOR_BTNTEXT));
	GetDefaultText(&pSkinButton->skinTxtDisable, ::GetSysColor(COLOR_GRAYTEXT));
	GetDefaultText(&pSkinButton->skinTxtHover, ::GetSysColor(COLOR_BTNTEXT));
	GetDefaultText(&pSkinButton->skinTxtPress, ::GetSysColor(COLOR_BTNTEXT));
	GetDefaultText(&pSkinButton->skinTxtDefault, ::GetSysColor(COLOR_BTNTEXT));

	GetDefaultBorder(&pSkinButton->skinLBorderNormal, ::GetSysColor(COLOR_GRAYTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinRBorderNormal, ::GetSysColor(COLOR_GRAYTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinTBorderNormal, ::GetSysColor(COLOR_GRAYTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinBBorderNormal, ::GetSysColor(COLOR_GRAYTEXT), 1, DRAWTYPE_TRANSPARENT);

	GetDefaultBorder(&pSkinButton->skinLBorderDisable, ::GetSysColor(COLOR_GRAYTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinRBorderDisable, ::GetSysColor(COLOR_GRAYTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinTBorderDisable, ::GetSysColor(COLOR_GRAYTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinBBorderDisable, ::GetSysColor(COLOR_GRAYTEXT), 1, DRAWTYPE_TRANSPARENT);

	GetDefaultBorder(&pSkinButton->skinLBorderHover, ::GetSysColor(COLOR_3DHILIGHT), 1);
	GetDefaultBorder(&pSkinButton->skinRBorderHover, ::GetSysColor(COLOR_3DDKSHADOW), 1);
	GetDefaultBorder(&pSkinButton->skinTBorderHover, ::GetSysColor(COLOR_3DHILIGHT), 1);
	GetDefaultBorder(&pSkinButton->skinBBorderHover, ::GetSysColor(COLOR_3DLIGHT), 1, DRAWTYPE_TRANSPARENT);

	GetDefaultBorder(&pSkinButton->skinLBorderPress, ::GetSysColor(COLOR_3DDKSHADOW), 1);
	GetDefaultBorder(&pSkinButton->skinRBorderPress, ::GetSysColor(COLOR_3DHILIGHT), 1);
	GetDefaultBorder(&pSkinButton->skinTBorderPress, ::GetSysColor(COLOR_3DDKSHADOW), 1);
	GetDefaultBorder(&pSkinButton->skinBBorderPress, ::GetSysColor(COLOR_BTNFACE), 1);

	GetDefaultBorder(&pSkinButton->skinLBorderDefault, ::GetSysColor(COLOR_BTNTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinRBorderDefault, ::GetSysColor(COLOR_BTNTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinTBorderDefault, ::GetSysColor(COLOR_BTNTEXT), 1);
	GetDefaultBorder(&pSkinButton->skinBBorderDefault, ::GetSysColor(COLOR_BTNTEXT), 1, DRAWTYPE_TRANSPARENT);
}
Esempio n. 4
0
void MythUIText::SetTextFromMap(QHash<QString, QString> &map)
{
    if (!IsVisible())
        return;

    if (map.contains(objectName()))
    {
        QString newText = GetTemplateText();

        if (newText.isEmpty())
            newText = GetDefaultText();

        QRegExp regexp("%(([^\\|%]+)?\\||\\|(.))?(\\w+)(\\|(.+))?%");
        regexp.setMinimal(true);

        if (!newText.isEmpty() && newText.contains(regexp))
        {
            int pos = 0;

            QString translatedTemplate = qApp->translate("ThemeUI",
                                         newText.toUtf8(),
                                         NULL,
                                         QCoreApplication::UnicodeUTF8);

            QString tempString = translatedTemplate;

            while ((pos = regexp.indexIn(translatedTemplate, pos)) != -1)
            {
                QString key = regexp.cap(4).toLower().trimmed();
                QString replacement;

                if (!map.value(key).isEmpty())
                {
                    replacement = QString("%1%2%3%4")
                                  .arg(regexp.cap(2))
                                  .arg(regexp.cap(3))
                                  .arg(map.value(key))
                                  .arg(regexp.cap(6));
                }

                tempString.replace(regexp.cap(0), replacement);
                pos += regexp.matchedLength();
            }

            newText = tempString;
        }
        else
            newText = map.value(objectName());

        SetText(newText);
    }
}
Esempio n. 5
0
void CDreamSkinWindow::GetDefaultItem(SKINITEM *pItem, COLORREF clrBk, COLORREF clrTxt, COLORREF clrBd, int nWidthBd)
{
	pItem->nDefault = 1;
	GetDefaultBackground(&pItem->skinBk, clrBk);

	GetDefaultBorder(&pItem->skinLBorder, clrBd, nWidthBd);
	GetDefaultBorder(&pItem->skinRBorder, clrBd, nWidthBd);
	GetDefaultBorder(&pItem->skinTBorder, clrBd, nWidthBd);
	GetDefaultBorder(&pItem->skinBBorder, clrBd, nWidthBd);

	GetDefaultText(&pItem->skinTxt, clrTxt);
	GetDefaultIcon(&pItem->skinIcon, clrTxt);
}
Esempio n. 6
0
void MythUIText::SetTextFromMap(const InfoMap &map)
{
    QString newText = GetTemplateText();

    if (newText.isEmpty())
        newText = GetDefaultText();

    QRegExp regexp("%(([^\\|%]+)?\\||\\|(.))?([\\w#]+)(\\|(.+))?%");
    regexp.setMinimal(true);

    if (!newText.isEmpty() && newText.contains(regexp))
    {
        int pos = 0;

        QString translatedTemplate = qApp->translate("ThemeUI",
                                                     newText.toUtf8());

        QString tempString = translatedTemplate;
        bool replaced = map.contains(objectName());

        while ((pos = regexp.indexIn(translatedTemplate, pos)) != -1)
        {
            QString key = regexp.cap(4).toLower().trimmed();
            QString replacement;

            if (map.contains(key))
            {
                replaced = true;
            }
            if (!map.value(key).isEmpty())
            {
                replacement = QString("%1%2%3%4")
                .arg(regexp.cap(2))
                .arg(regexp.cap(3))
                .arg(map.value(key))
                .arg(regexp.cap(6));
            }

            tempString.replace(regexp.cap(0), replacement);
            pos += regexp.matchedLength();
        }
        if (replaced)
        {
            SetText(tempString);
        }
    }
    else if (map.contains(objectName()))
    {
        SetText(map.value(objectName()));
    }
}
Esempio n. 7
0
void MythUIText::ResetMap(const InfoMap &map)
{
    QString newText = GetTemplateText();

    if (newText.isEmpty())
        newText = GetDefaultText();

    QRegExp regexp("%(([^\\|%]+)?\\||\\|(.))?([\\w#]+)(\\|(.+))?%");
    regexp.setMinimal(true);

    bool replaced = map.contains(objectName());

    if (!replaced && !newText.isEmpty() && newText.contains(regexp))
    {
        int pos = 0;

        QString translatedTemplate = qApp->translate("ThemeUI",
                                                     newText.toUtf8());

        while ((pos = regexp.indexIn(translatedTemplate, pos)) != -1)
        {
            QString key = regexp.cap(4).toLower().trimmed();

            if (map.contains(key))
            {
                replaced = true;
                break;
            }
            pos += regexp.matchedLength();
        }
    }

    if (replaced)
    {
        Reset();
    }
}