⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class_c_r_t_e_container.html

📁 symbian OS中关于文本编辑功能的实现
💻 HTML
📖 第 1 页 / 共 3 页
字号:
    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CRTEContainer::SetAlignment           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">CParaFormat::TAlignment&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Toggle -left-center-right- alignment within the actual paragraph <p>Definition at line <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00338">338</a> of file <a class="el" href="_rich_text_editor_container_8cpp-source.html">RichTextEditorContainer.cpp</a>.<p>References <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00473">Echo()</a>, and <a class="el" href="_rich_text_editor_container_8h-source.html#l00132">iRtEd</a>.<p>Referenced by <a class="el" href="_rich_text_editor_app_ui_8cpp-source.html#l00069">CRTEAppUi::HandleCommandL()</a>, and <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00484">IntroL()</a>.<div class="fragment"><pre class="fragment"><a name="l00339"></a>00339         {<a name="l00340"></a>00340         CParaFormat     paraFormat;<a name="l00341"></a>00341         TParaFormatMask paraFormatMask;<a name="l00342"></a>00342 <a name="l00343"></a>00343         paraFormatMask.SetAttrib(EAttAlignment);    <span class="comment">// set the mask</span><a name="l00344"></a>00344         paraFormat.iHorizontalAlignment = aAlignment;<a name="l00345"></a>00345 <a name="l00346"></a>00346         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;ApplyParaFormatL(&amp;paraFormat, paraFormatMask);<a name="l00347"></a>00347         <a name="l00348"></a>00348         <a class="code" href="class_c_r_t_e_container.html#38bc46ca50d704160d45a75119a95774">Echo</a>(R_TYPE_DIALOG_TBUF_INDICATOR_ALIGNMENT);<a name="l00349"></a>00349         }</pre></div><p>    </td>  </tr></table><a class="anchor" name="10f4269acf9d1c486ce5706181f08f38"></a><!-- doxytag: member="CRTEContainer::Strike" ref="10f4269acf9d1c486ce5706181f08f38" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CRTEContainer::Strike           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Toggle between strikethrough or not strikethrough text <p>Definition at line <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00430">430</a> of file <a class="el" href="_rich_text_editor_container_8cpp-source.html">RichTextEditorContainer.cpp</a>.<p>References <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00473">Echo()</a>, <a class="el" href="_rich_text_editor_container_8h-source.html#l00132">iRtEd</a>, and <a class="el" href="_rich_text_editor_container_8h-source.html#l00135">iStrike</a>.<p>Referenced by <a class="el" href="_rich_text_editor_app_ui_8cpp-source.html#l00069">CRTEAppUi::HandleCommandL()</a>.<div class="fragment"><pre class="fragment"><a name="l00431"></a>00431         {<a name="l00432"></a>00432     TCharFormat charFormat;<a name="l00433"></a>00433         TCharFormatMask charFormatMask;<a name="l00434"></a>00434 <a name="l00435"></a>00435         <a class="code" href="class_c_r_t_e_container.html#6000af4decfcfe07e4d797956b4601ec">iStrike</a>=!<a class="code" href="class_c_r_t_e_container.html#6000af4decfcfe07e4d797956b4601ec">iStrike</a>;<a name="l00436"></a>00436         charFormat.iFontPresentation.iStrikethrough=<a class="code" href="class_c_r_t_e_container.html#6000af4decfcfe07e4d797956b4601ec">iStrike</a>?EStrikethroughOn:EStrikethroughOff;<a name="l00437"></a>00437     charFormatMask.SetAttrib(EAttFontStrikethrough);<a name="l00438"></a>00438         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;ApplyCharFormatL(charFormat, charFormatMask);<a name="l00439"></a>00439 <a name="l00440"></a>00440         <span class="keywordflow">if</span>(<a class="code" href="class_c_r_t_e_container.html#6000af4decfcfe07e4d797956b4601ec">iStrike</a>)<a name="l00441"></a>00441                 {<a name="l00442"></a>00442                 <a class="code" href="class_c_r_t_e_container.html#38bc46ca50d704160d45a75119a95774">Echo</a>(R_TYPE_DIALOG_TBUF_INDICATOR_STRIKE_ON);<a name="l00443"></a>00443                 }<a name="l00444"></a>00444         <span class="keywordflow">else</span><a name="l00445"></a>00445                 {<a name="l00446"></a>00446                 <a class="code" href="class_c_r_t_e_container.html#38bc46ca50d704160d45a75119a95774">Echo</a>(R_TYPE_DIALOG_TBUF_INDICATOR_STRIKE_OFF);<a name="l00447"></a>00447                 }<a name="l00448"></a>00448         }</pre></div><p>    </td>  </tr></table><a class="anchor" name="1c8ce06002012052d2e246a981f4654f"></a><!-- doxytag: member="CRTEContainer::SetColor" ref="1c8ce06002012052d2e246a981f4654f" args="(TRgb)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CRTEContainer::SetColor           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">TRgb&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Change the text's color <p>Definition at line <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00455">455</a> of file <a class="el" href="_rich_text_editor_container_8cpp-source.html">RichTextEditorContainer.cpp</a>.<p>References <a class="el" href="_rich_text_editor_container_8h-source.html#l00132">iRtEd</a>.<p>Referenced by <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00145">DemoL()</a>, and <a class="el" href="_rich_text_editor_app_ui_8cpp-source.html#l00069">CRTEAppUi::HandleCommandL()</a>.<div class="fragment"><pre class="fragment"><a name="l00456"></a>00456         {<a name="l00457"></a>00457         TCharFormat charFormat;<a name="l00458"></a>00458         TCharFormatMask charFormatMask;<a name="l00459"></a>00459 <a name="l00460"></a>00460         charFormat.iFontPresentation.iTextColor = aColor;<a name="l00461"></a>00461         charFormatMask.SetAttrib(EAttColor);<a name="l00462"></a>00462         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;ApplyCharFormatL(charFormat, charFormatMask);<a name="l00463"></a>00463         <a name="l00464"></a>00464 <span class="comment">//      iRtEd-&gt;SetBackgroundColorL(aColor); </span><a name="l00465"></a>00465 <span class="comment">//  It is possible to change the background color - if foreground and background </span><a name="l00466"></a>00466 <span class="comment">//  color is same, the text became invisible.</span><a name="l00467"></a>00467         }</pre></div><p>    </td>  </tr></table><a class="anchor" name="f4477c67c39e9068cf4faf48987050fe"></a><!-- doxytag: member="CRTEContainer::DemoL" ref="f4477c67c39e9068cf4faf48987050fe" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CRTEContainer::DemoL           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Create Demo Content <p>Definition at line <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00145">145</a> of file <a class="el" href="_rich_text_editor_container_8cpp-source.html">RichTextEditorContainer.cpp</a>.<p>References <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00120">InsertMyPictureL()</a>, <a class="el" href="_rich_text_editor_container_8h-source.html#l00132">iRtEd</a>, <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00455">SetColor()</a>, and <a class="el" href="_rich_text_editor_container_8cpp-source.html#l00355">SetSelectionL()</a>.<p>Referenced by <a class="el" href="_rich_text_editor_app_ui_8cpp-source.html#l00069">CRTEAppUi::HandleCommandL()</a>.<div class="fragment"><pre class="fragment"><a name="l00146"></a>00146         {<a name="l00147"></a>00147         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;SetCursorPosL(0,EFalse);<a name="l00148"></a>00148         <span class="comment">// Set the Demo text to Richtext Editor</span><a name="l00149"></a>00149         TBuf&lt;KBufSize&gt; Demobuf;<a name="l00150"></a>00150         CEikonEnv::Static()-&gt;ReadResource(Demobuf, R_TYPE_II_DIALOG_TBUF_DEMO_TEXT);<a name="l00151"></a>00151         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;SetTextL(&amp;Demobuf);<a name="l00152"></a>00152         <a name="l00153"></a>00153         <span class="comment">// Insert a Bipmaps to Richtext </span><a name="l00154"></a>00154         <a class="code" href="class_c_r_t_e_container.html#7e4b210385d0ef02d8bdb290fc0d5679">InsertMyPictureL</a>(KLeftImagePositionInTheText);<a name="l00155"></a>00155         <a class="code" href="class_c_r_t_e_container.html#7e4b210385d0ef02d8bdb290fc0d5679">InsertMyPictureL</a>(KRightImagePositionInTheText);<a name="l00156"></a>00156         <span class="comment"></span><a name="l00157"></a>00157 <span class="comment">        //// To Compare the '\f' to EParagraphDelimiter change the comment status of the two following lines</span><a name="l00158"></a>00158 <span class="comment"></span>        <span class="comment">//iRtEd-&gt;RichText()-&gt;InsertL( KEndofCenterFormat , CEditableText::EParagraphDelimiter);</span><a name="l00159"></a>00159         _LIT(KFormat, <span class="stringliteral">"\f"</span>);<a name="l00160"></a>00160         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;RichText()-&gt;InsertL( KEndofCenterFormat , KFormat);<a name="l00161"></a>00161 <a name="l00162"></a>00162         <span class="comment">// Basic Text Formatting border by EParagraphDelimiter, same as in Forum Nokia's Type - Example</span><a name="l00163"></a>00163         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;RichText()-&gt;InsertL( KLeftImagePositionInTheText , CEditableText::EParagraphDelimiter);<a name="l00164"></a>00164         <a name="l00165"></a>00165         <span class="comment">// Do some color change</span><a name="l00166"></a>00166         <a class="code" href="class_c_r_t_e_container.html#b672064cc9e9f157b51250c102d3e07b">SetSelectionL</a>(KLeftImagePositionInTheText, KRightImagePositionInTheText);<a name="l00167"></a>00167         <a class="code" href="class_c_r_t_e_container.html#1c8ce06002012052d2e246a981f4654f">SetColor</a>(KRgbRed);<a name="l00168"></a>00168         <a class="code" href="class_c_r_t_e_container.html#b672064cc9e9f157b51250c102d3e07b">SetSelectionL</a>(KLeftNokia, KRightNokia);<a name="l00169"></a>00169         <a class="code" href="class_c_r_t_e_container.html#1c8ce06002012052d2e246a981f4654f">SetColor</a>(KRgbBlue);<a name="l00170"></a>00170         <a name="l00171"></a>00171         <span class="comment">//set newline end of document</span><a name="l00172"></a>00172         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;RichText()-&gt;InsertL(<a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;Text()-&gt;DocumentLength() , CEditableText::ELineBreak);<a name="l00173"></a>00173         <a name="l00174"></a>00174         <span class="comment">// Set the cursor end of the document</span><a name="l00175"></a>00175         <a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;SetCursorPosL(<a class="code" href="class_c_r_t_e_container.html#714a273f76116be110f7a0bf8e2e6236">iRtEd</a>-&gt;Text()-&gt;DocumentLength(), EFalse);<a name="l00176"></a>00176         }</pre></div><p>    </td>  </tr></table><a class="anchor" name="9f9bb5a2110532e2f2909eaefb44d36a"></a><!-- doxytag: member="CRTEContainer::SizeChanged" ref="9f9bb5a2110532e2f2909eaefb44d36a" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CRTEContainer::SizeChanged           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [private]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -