📄 class_c_hello_world_basic_app_view.html
字号:
GetText <dl compact><dt><b>Returns:</b></dt><dd>modifiable reference to the descriptor, which stores user-given text </dd></dl><p>Definition at line <a class="el" href="helloworldbasicappview_8cpp-source.html#l00138">138</a> of file <a class="el" href="helloworldbasicappview_8cpp-source.html">helloworldbasicappview.cpp</a>.<p>References <a class="el" href="helloworldbasicappview_8h-source.html#l00103">iText</a>.<p>Referenced by <a class="el" href="helloworldbasicappui_8cpp-source.html#l00124">CHelloWorldBasicAppUi::HandleCommandL()</a>.<div class="fragment"><pre class="fragment"><a name="l00139"></a>00139 {<a name="l00140"></a>00140 <span class="keywordflow">return</span> <a class="code" href="class_c_hello_world_basic_app_view.html#3acc54dfc6520e11f5c51f4cd887a7d0">iText</a>;<a name="l00141"></a>00141 }</pre></div><p> </td> </tr></table><a class="anchor" name="67f946ca7848ec78de4961c5bcefdb72"></a><!-- doxytag: member="CHelloWorldBasicAppView::Draw" ref="67f946ca7848ec78de4961c5bcefdb72" args="(const TRect &aRect) const " --><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 CHelloWorldBasicAppView::Draw </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const TRect & </td> <td class="mdname1" valign="top" nowrap> <em>aRect</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>From CCoeControl, Draw Draw this CHelloWorldBasicAppView to the screen. If the user has given a text, it is also printed to the center of the screen. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>aRect</em> </td><td>the rectangle of this view that needs updating </td></tr> </table></dl><p>Definition at line <a class="el" href="helloworldbasicappview_8cpp-source.html#l00097">97</a> of file <a class="el" href="helloworldbasicappview_8cpp-source.html">helloworldbasicappview.cpp</a>.<p>References <a class="el" href="helloworldbasicappview_8h-source.html#l00098">iFont</a>, and <a class="el" href="helloworldbasicappview_8h-source.html#l00103">iText</a>.<div class="fragment"><pre class="fragment"><a name="l00098"></a>00098 {<a name="l00099"></a>00099 <span class="comment">// note that the whole screen is drawn everytime, so aRect-parameter</span><a name="l00100"></a>00100 <span class="comment">// is ignored</span><a name="l00101"></a>00101 <a name="l00102"></a>00102 <span class="comment">// Get the standard graphics context</span><a name="l00103"></a>00103 CWindowGc& gc = SystemGc();<a name="l00104"></a>00104 gc.SetPenStyle( CGraphicsContext::ENullPen );<a name="l00105"></a>00105 gc.SetBrushColor( KRgbWhite);<a name="l00106"></a>00106 gc.SetBrushStyle( CGraphicsContext::ESolidBrush );<a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="comment">// Gets the control's extent</span><a name="l00109"></a>00109 TRect rect( Rect());<a name="l00110"></a>00110 <a name="l00111"></a>00111 <span class="comment">// draw also text, if user has given it via dialog</span><a name="l00112"></a>00112 <span class="keywordflow">if</span> (<a class="code" href="class_c_hello_world_basic_app_view.html#3acc54dfc6520e11f5c51f4cd887a7d0">iText</a>.Length() > 0)<a name="l00113"></a>00113 {<a name="l00114"></a>00114 gc.UseFont(<a class="code" href="class_c_hello_world_basic_app_view.html#4faf9e48cb813e0be080fe4270d15573">iFont</a>);<a name="l00115"></a>00115 gc.DrawText(<a class="code" href="class_c_hello_world_basic_app_view.html#3acc54dfc6520e11f5c51f4cd887a7d0">iText</a>, rect, Rect().Height()/3, CGraphicsContext::ECenter );<a name="l00116"></a>00116 gc.DiscardFont();<a name="l00117"></a>00117 }<a name="l00118"></a>00118 <span class="keywordflow">else</span><a name="l00119"></a>00119 {<a name="l00120"></a>00120 gc.Clear( rect );<a name="l00121"></a>00121 }<a name="l00122"></a>00122 }</pre></div><p> </td> </tr></table><a class="anchor" name="9f9bb5a2110532e2f2909eaefb44d36a"></a><!-- doxytag: member="CHelloWorldBasicAppView::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 CHelloWorldBasicAppView::SizeChanged </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>From CoeControl, SizeChanged. Called by framework when the view size is changed. <p>Definition at line <a class="el" href="helloworldbasicappview_8cpp-source.html#l00129">129</a> of file <a class="el" href="helloworldbasicappview_8cpp-source.html">helloworldbasicappview.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00130"></a>00130 {<a name="l00131"></a>00131 }</pre></div><p> </td> </tr></table><a class="anchor" name="bf31593b337cbf3fb671382cf773281c"></a><!-- doxytag: member="CHelloWorldBasicAppView::ConstructL" ref="bf31593b337cbf3fb671382cf773281c" args="(const TRect &aRect)" --><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 CHelloWorldBasicAppView::ConstructL </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const TRect & </td> <td class="mdname1" valign="top" nowrap> <em>aRect</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [private]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>ConstructL 2nd phase constructor. Perform the second phase construction of a CHelloWorldBasicAppView object. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>aRect</em> </td><td>The rectangle this view will be drawn to. </td></tr> </table></dl><p>Definition at line <a class="el" href="helloworldbasicappview_8cpp-source.html#l00053">53</a> of file <a class="el" href="helloworldbasicappview_8cpp-source.html">helloworldbasicappview.cpp</a>.<p>References <a class="el" href="helloworldbasicappview_8h-source.html#l00098">iFont</a>, and <a class="el" href="helloworldbasicappview_8h-source.html#l00103">iText</a>.<p>Referenced by <a class="el" href="helloworldbasicappview_8cpp-source.html#l00040">NewLC()</a>.<div class="fragment"><pre class="fragment"><a name="l00054"></a>00054 {<a name="l00055"></a>00055 <span class="comment">// Create a window for this application view</span><a name="l00056"></a>00056 CreateWindowL();<a name="l00057"></a>00057 <a name="l00058"></a>00058 <span class="comment">// set the font</span><a name="l00059"></a>00059 <a class="code" href="class_c_hello_world_basic_app_view.html#4faf9e48cb813e0be080fe4270d15573">iFont</a> = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);<a name="l00060"></a>00060 <a name="l00061"></a>00061 <a class="code" href="class_c_hello_world_basic_app_view.html#3acc54dfc6520e11f5c51f4cd887a7d0">iText</a>.Zero();<a name="l00062"></a>00062 <a name="l00063"></a>00063 <span class="comment">// Set the windows size</span><a name="l00064"></a>00064 SetRect( aRect );<a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="comment">// Activate the window, which makes it ready to be drawn</span><a name="l00067"></a>00067 ActivateL();<a name="l00068"></a>00068 }</pre></div><p> </td> </tr></table><hr><h2>Member Data Documentation</h2><a class="anchor" name="4faf9e48cb813e0be080fe4270d15573"></a><!-- doxytag: member="CHelloWorldBasicAppView::iFont" ref="4faf9e48cb813e0be080fe4270d15573" 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">const CFont* <a class="el" href="class_c_hello_world_basic_app_view.html#4faf9e48cb813e0be080fe4270d15573">CHelloWorldBasicAppView::iFont</a><code> [private]</code> </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>font used, when printing user-given text to the screen <p>Definition at line <a class="el" href="helloworldbasicappview_8h-source.html#l00098">98</a> of file <a class="el" href="helloworldbasicappview_8h-source.html">helloworldbasicappview.h</a>.<p>Referenced by <a class="el" href="helloworldbasicappview_8cpp-source.html#l00053">ConstructL()</a>, and <a class="el" href="helloworldbasicappview_8cpp-source.html#l00097">Draw()</a>. </td> </tr></table><a class="anchor" name="3acc54dfc6520e11f5c51f4cd887a7d0"></a><!-- doxytag: member="CHelloWorldBasicAppView::iText" ref="3acc54dfc6520e11f5c51f4cd887a7d0" 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">TBuf<24> <a class="el" href="class_c_hello_world_basic_app_view.html#3acc54dfc6520e11f5c51f4cd887a7d0">CHelloWorldBasicAppView::iText</a><code> [private]</code> </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>descriptor storing the user-given text <p>Definition at line <a class="el" href="helloworldbasicappview_8h-source.html#l00103">103</a> of file <a class="el" href="helloworldbasicappview_8h-source.html">helloworldbasicappview.h</a>.<p>Referenced by <a class="el" href="helloworldbasicappview_8cpp-source.html#l00053">ConstructL()</a>, <a class="el" href="helloworldbasicappview_8cpp-source.html#l00097">Draw()</a>, and <a class="el" href="helloworldbasicappview_8cpp-source.html#l00138">GetText()</a>. </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="helloworldbasicappview_8h-source.html">helloworldbasicappview.h</a><li><a class="el" href="helloworldbasicappview_8cpp-source.html">helloworldbasicappview.cpp</a></ul><hr><table x-use-null-cells style="x-cell-content-align: top; width: 100%; border-spacing: 0px; border-spacing: 0px;" cellspacing=0 width=100%> <col style="width: 50%;"> <col style="width: 50%;"> <tr style="x-cell-content-align: top;" valign=top> <td style="width: 50%; padding-right: 10px; padding-left: 10px; border-right-style: None; border-left-style: None; border-top-style: None; border-bottom-style: None;" width=50%> <p style="font-family: Arial;"><small style="font-size: smaller;">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -