COLORREF LSUtils::PrefixedGetRCColor(LPCTSTR prefix, LPCTSTR setting, COLORREF colDef) { LPTSTR szTemp; AppendSetting(prefix, setting, szTemp); COLORREF retValue = GetRCColor(szTemp, colDef); #ifdef _DEBUG _LSLogPrintf(LOG_DEBUG, szLogName, "looking for setting: %s, got: %d,%d,%d", szTemp, GetRValue(retValue), GetGValue(retValue), GetBValue(retValue) ); #endif delete [] szTemp; return retValue; }
void Label::ReadConfig() { // Background and Borders TCHAR backgroundImageFile[MAX_PATH]; mBackgroundColor = GetRCColor(mName, "BackgroundColor", RGB(255, 255, 255)); GetRCString(mName, "BackgroundImage", backgroundImageFile, NULL, MAX_PATH); mBackgroundImage = LoadLSImage(backgroundImageFile, NULL); mBackgroundImageBorderTop = GetRCInt(mName, "BackgroundImageBorderTop", 0); mBackgroundImageBorderRight = GetRCInt(mName, "BackgroundImageBorderRight", 0); mBackgroundImageBorderBottom = GetRCInt(mName, "BackgroundImageBorderBottom", 0); mBackgroundImageBorderLeft = GetRCInt(mName, "BackgroundImageBorderLeft", 0); mBackgroundImageTile = GetRCEnum(mName, "BackgroundImageTile", gBackgroundImageTileEnum); mBorderColorTop = GetRCColor(mName, "BorderColorTop", RGB(0, 0, 0)); mBorderColorRight = GetRCColor(mName, "BorderColorRight", RGB(0, 0, 0)); mBorderColorBottom = GetRCColor(mName, "BorderColorBottom", RGB(0, 0, 0)); mBorderColorLeft = GetRCColor(mName, "BorderColorLeft", RGB(0, 0, 0)); mBorderTop = GetRCInt(mName, "BorderTop", 0); mBorderRight = GetRCInt(mName, "BorderRight", 0); mBorderBottom = GetRCInt(mName, "BorderBottom", 0); mBorderLeft = GetRCInt(mName, "BorderLeft", 0); // Font TCHAR fontName[LF_FACESIZE]; int fontHeight; bool fontBold; bool fontItalic; bool fontUnderline; GetRCString(mName, "Font", fontName, "Arial", LF_FACESIZE); fontHeight = GetRCInt(mName, "FontHeight", 15); fontBold = GetRCBoolDef(mName, "FontBold", FALSE); fontItalic = GetRCBoolDef(mName, "FontItalic", FALSE); fontUnderline = GetRCBoolDef(mName, "FontUnderline", FALSE); mFont = CreateSimpleFont(fontName, fontHeight, fontBold, fontItalic, fontUnderline); mFontColor = GetRCColor(mName, "FontColor", RGB(0, 0, 0)); mFontShadow = GetRCBoolDef(mName, "FontShadow", FALSE); mFontShadowColor = GetRCColor(mName, "FontShadowColor", RGB(128, 128, 128)); mFontShadowOffsetX = GetRCInt(mName, "FontShadowOffsetX", 1); mFontShadowOffsetY = GetRCInt(mName, "FontShadowOffsetY", 1); // Layout mAlign = GetRCEnum(mName, "Align", gAlignEnum); mImagePosition = GetRCEnum(mName, "ImagePosition", gImagePositionEnum); mImageTextGap = GetRCInt(mName, "ImageTextGap", 4); mPaddingLeft = GetRCInt(mName, "PaddingLeft", 0); mPaddingTop = GetRCInt(mName, "PaddingTop", 0); mPaddingRight = GetRCInt(mName, "PaddingRight", 0); mPaddingBottom = GetRCInt(mName, "PaddingBottom", 0); mVerticalAlign = GetRCEnum(mName, "VerticalAlign", gVerticalAlignEnum); // Content TCHAR imageFile[MAX_PATH]; GetRCString(mName, "Image", imageFile, NULL, MAX_PATH); mImage = LoadLSImage(imageFile, NULL); GetRCString(mName, "Text", mText, NULL, MAX_TEXT); // Position and Size mAlwaysOnTop = GetRCBoolDef(mName, "AlwaysOnTop", FALSE); mVisible = !GetRCBoolDef(mName, "StartHidden", FALSE); mX = GetRCInt(mName, "X", 0); mY = GetRCInt(mName, "Y", 0); mWidth = GetRCInt(mName, "Width", 64); mHeight = GetRCInt(mName, "Height", 64); }