本文整理汇总了C++中CEikEdwin::SetDocumentContentL方法的典型用法代码示例。如果您正苦于以下问题:C++ CEikEdwin::SetDocumentContentL方法的具体用法?C++ CEikEdwin::SetDocumentContentL怎么用?C++ CEikEdwin::SetDocumentContentL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEikEdwin
的用法示例。
在下文中一共展示了CEikEdwin::SetDocumentContentL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UseFontL
void CEikListBoxTextEditor::UseFontL( CEikEdwin& aEditor, const CFont& aFont )
{
_AKNTRACE_FUNC_ENTER;
CGlobalText* globalText;
TCharFormatMask defaultCharFormatMask;
defaultCharFormatMask.SetAttrib(EAttFontTypeface);
defaultCharFormatMask.SetAttrib(EAttFontHeight);
TFontSpec fontspec = aFont.FontSpecInTwips();
TCharFormat defaultCharFormat( fontspec.iTypeface.iName, fontspec.iHeight );
iParaFormatLayer=CParaFormatLayer::NewL();
iCharFormatLayer=CCharFormatLayer::NewL(defaultCharFormat,defaultCharFormatMask);
globalText=CGlobalText::NewL(iParaFormatLayer,iCharFormatLayer,CEditableText::ESegmentedStorage,5);
CleanupStack::PushL(globalText);
TCharFormat charFormat;
TCharFormatMask charMask;
iCharFormatLayer->Sense(charFormat,charMask);
if ( fontspec.iFontStyle.Posture()==EPostureItalic )
{
charMask.SetAttrib(EAttFontPosture);
charFormat.iFontSpec.iFontStyle.SetPosture(EPostureItalic);
}
if ( fontspec.iFontStyle.StrokeWeight()==EStrokeWeightBold )
{
charMask.SetAttrib(EAttFontStrokeWeight );
charFormat.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
}
iCharFormatLayer->SetL(charFormat,charMask);
CPlainText* old=aEditor.Text();
CleanupStack::Pop(); // globalText
CleanupStack::PushL(old); // old is pushed because we're using EUseText in the subsequent call
aEditor.SetDocumentContentL(*globalText,CEikEdwin::EUseText);
CleanupStack::PopAndDestroy(); // old
_AKNTRACE_FUNC_EXIT;
}