本文整理汇总了C++中AppSettings::SetPaletteName方法的典型用法代码示例。如果您正苦于以下问题:C++ AppSettings::SetPaletteName方法的具体用法?C++ AppSettings::SetPaletteName怎么用?C++ AppSettings::SetPaletteName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppSettings
的用法示例。
在下文中一共展示了AppSettings::SetPaletteName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnComboBox
INT_PTR CSetPgApps::OnComboBox(HWND hDlg, WORD nCtrlId, WORD code)
{
if (nCtrlId == lbAppDistinct)
{
if (!mb_SkipSelChange)
{
OnAppSelectionChanged();
}
} // if (CB == lbAppDistinct)
else
{
int iCur = mb_SkipSelChange ? -1 : (int)SendDlgItemMessage(hDlg, lbAppDistinct, LB_GETCURSEL, 0,0);
AppSettings* pApp = (iCur < 0) ? NULL : gpSet->GetAppSettingsPtr(iCur);
_ASSERTE((iCur<0) || (pApp && pApp->AppNames));
if (!pApp)
{
_ASSERTE(pApp);
return 0;
}
switch (nCtrlId)
{
case lbExtendFontBoldIdx:
pApp->nFontBoldColor = GetNumber(mh_Child, nCtrlId);
if (pApp->isExtendFonts)
mb_Redraw = true;
break;
case lbExtendFontItalicIdx:
pApp->nFontItalicColor = GetNumber(mh_Child, nCtrlId);
if (pApp->isExtendFonts)
mb_Redraw = true;
break;
case lbExtendFontNormalIdx:
pApp->nFontNormalColor = GetNumber(mh_Child, nCtrlId);
if (pApp->isExtendFonts)
mb_Redraw = true;
break;
case lbColorsOverride:
{
HWND hList = GetDlgItem(mh_Child, nCtrlId);
INT_PTR nIdx = SendMessage(hList, CB_GETCURSEL, 0, 0);
if (nIdx >= 0)
{
INT_PTR nLen = SendMessage(hList, CB_GETLBTEXTLEN, nIdx, 0);
wchar_t* pszText = (nLen > 0) ? (wchar_t*)calloc((nLen+1),sizeof(wchar_t)) : NULL;
if (pszText)
{
SendMessage(hList, CB_GETLBTEXT, nIdx, (LPARAM)pszText);
int iPal = (nIdx == 0) ? -1 : gpSet->PaletteGetIndex(pszText);
if ((nIdx == 0) || (iPal >= 0))
{
pApp->SetPaletteName((nIdx == 0) ? L"" : pszText);
_ASSERTE(iCur>=0 && iCur<gpSet->AppCount /*&& gpSet->AppColors*/);
const ColorPalette* pPal = gpSet->PaletteGet(iPal);
if (pPal)
{
//memmove(gpSet->AppColors[iCur]->Colors, pPal->Colors, sizeof(pPal->Colors));
//gpSet->AppColors[iCur]->FadeInitialized = false;
BOOL bTextAttr = (pApp->nTextColorIdx != pPal->nTextColorIdx) || (pApp->nBackColorIdx != pPal->nBackColorIdx);
pApp->nTextColorIdx = pPal->nTextColorIdx;
pApp->nBackColorIdx = pPal->nBackColorIdx;
BOOL bPopupAttr = (pApp->nPopTextColorIdx != pPal->nPopTextColorIdx) || (pApp->nPopBackColorIdx != pPal->nPopBackColorIdx);
pApp->nPopTextColorIdx = pPal->nPopTextColorIdx;
pApp->nPopBackColorIdx = pPal->nPopBackColorIdx;
pApp->isExtendColors = pPal->isExtendColors;
pApp->nExtendColorIdx = pPal->nExtendColorIdx;
if (bTextAttr || bPopupAttr)
{
gpSetCls->UpdateTextColorSettings(bTextAttr, bPopupAttr, pApp);
}
mb_Redraw = true;
}
else
{
_ASSERTE(pPal!=NULL);
}
}
}
}
} // lbColorsOverride
break;
case lbCTSEOL:
{
BYTE eol = 0;
CSetDlgLists::GetListBoxItem(mh_Child, lbCTSEOL, CSetDlgLists::eCRLF, eol);
pApp->isCTSEOL = eol;
} // lbCTSEOL
break;
}
}
return 0;
}