📄 helloworldbasicappview_8cpp-source.html
字号:
<a name="l00075"></a><a class="code" href="class_c_hello_world_basic_app_view.html#5e4d6585c0318638ef415fa23ee6a14d">00075</a> <a class="code" href="class_c_hello_world_basic_app_view.html#5e4d6585c0318638ef415fa23ee6a14d">CHelloWorldBasicAppView::CHelloWorldBasicAppView</a>()<a name="l00076"></a>00076 {<a name="l00077"></a>00077 <span class="comment">// No implementation required</span><a name="l00078"></a>00078 }<a name="l00079"></a>00079 <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00082"></a>00082 <span class="comment">// CHelloWorldBasicAppView::~CHelloWorldBasicAppView()</span><a name="l00083"></a>00083 <span class="comment">// Destructor.</span><a name="l00084"></a>00084 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00085"></a>00085 <span class="comment">//</span><a name="l00086"></a><a class="code" href="class_c_hello_world_basic_app_view.html#86b9b8317b30af7e92818502b4bfdb34">00086</a> <a class="code" href="class_c_hello_world_basic_app_view.html#86b9b8317b30af7e92818502b4bfdb34">CHelloWorldBasicAppView::~CHelloWorldBasicAppView</a>()<a name="l00087"></a>00087 {<a name="l00088"></a>00088 <span class="comment">// No implementation required</span><a name="l00089"></a>00089 }<a name="l00090"></a>00090 <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00093"></a>00093 <span class="comment">// CHelloWorldBasicAppView::Draw()</span><a name="l00094"></a>00094 <span class="comment">// Draws the display.</span><a name="l00095"></a>00095 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00096"></a>00096 <span class="comment">//</span><a name="l00097"></a><a class="code" href="class_c_hello_world_basic_app_view.html#67f946ca7848ec78de4961c5bcefdb72">00097</a> <span class="keywordtype">void</span> <a class="code" href="class_c_hello_world_basic_app_view.html#67f946ca7848ec78de4961c5bcefdb72">CHelloWorldBasicAppView::Draw</a>( <span class="keyword">const</span> TRect& <span class="comment">/*aRect*/</span> )<span class="keyword"> const</span><a name="l00098"></a>00098 <span class="keyword"> </span>{<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 }<a name="l00123"></a>00123 <a name="l00124"></a>00124 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00125"></a>00125 <span class="comment">// CHelloWorldBasicAppView::SizeChanged()</span><a name="l00126"></a>00126 <span class="comment">// Called by framework when the view size is changed.</span><a name="l00127"></a>00127 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00128"></a>00128 <span class="comment">//</span><a name="l00129"></a><a class="code" href="class_c_hello_world_basic_app_view.html#9f9bb5a2110532e2f2909eaefb44d36a">00129</a> <span class="keywordtype">void</span> <a class="code" href="class_c_hello_world_basic_app_view.html#9f9bb5a2110532e2f2909eaefb44d36a">CHelloWorldBasicAppView::SizeChanged</a>()<a name="l00130"></a>00130 {<a name="l00131"></a>00131 }<a name="l00132"></a>00132 <a name="l00133"></a>00133 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00134"></a>00134 <span class="comment">// CHelloWorldBasicAppView::GetText()</span><a name="l00135"></a>00135 <span class="comment">// Called by AppUi to either set the text (via dialog) or zero the contents.</span><a name="l00136"></a>00136 <span class="comment">// -----------------------------------------------------------------------------</span><a name="l00137"></a>00137 <span class="comment">//</span><a name="l00138"></a><a class="code" href="class_c_hello_world_basic_app_view.html#59cee462c5e06d883260d21037a3ebd7">00138</a> TDes & <a class="code" href="class_c_hello_world_basic_app_view.html#59cee462c5e06d883260d21037a3ebd7">CHelloWorldBasicAppView::GetText</a>()<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 }<a name="l00142"></a>00142 <a name="l00143"></a>00143 <span class="comment">// End of File</span><a name="l00144"></a>00144 </pre></div><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 + -