1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
void CTibEditCtrl::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CHARFORMAT2 cf;
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwMask = CFM_FACE | CFM_SIZE | CFM_COLOR | CFM_WEIGHT;
cf.crTextColor = RGB(0,0,255);
if(m_nMode == CCE_TIBETAN)
{
lstrcpy(cf.szFaceName, "TibetanMachine");
cf.yHeight = 700;
cf.dwEffects = CFE_DISABLED;
cf.wWeight = FW_NORMAL;
} else {
lstrcpy(cf.szFaceName, "Arial");
cf.yHeight = 200;
cf.dwEffects = CFE_DISABLED;
cf.wWeight = FW_NORMAL;
}
SetWordCharFormat(cf);
nChar = TranslateKey(nChar); // traitement du caractère
CRichEditCtrl::OnChar(nChar, nRepCnt, nFlags);
} |
Partager