Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/transparent__util_8cpp_source.html
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 6 43e37759235e
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>TB9.2 Example Applications: examples/Graphics/WS/transparent/transparent_util.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2 -->
<h1>examples/Graphics/WS/transparent/transparent_util.cpp</h1><a href="transparent__util_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
<a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
<a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
<a name="l00004"></a>00004 <span class="comment">// under the terms of &quot;Eclipse Public License v1.0&quot;</span>
<a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
<a name="l00006"></a>00006 <span class="comment">// at the URL &quot;http://www.eclipse.org/legal/epl-v10.html&quot;.</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
<a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Description:</span>
<a name="l00014"></a>00014 <span class="comment">// This provides various functions for window event handling, control and access.</span>
<a name="l00015"></a>00015 <span class="comment">//</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="transparent_8h.html">transparent.h</a>&quot;</span>
<a name="l00028"></a>00028 <span class="keyword">static</span> TInt CallDoChangeTransparencyL(TAny *aPtr)
<a name="l00029"></a>00029         {
<a name="l00030"></a>00030         <span class="keywordflow">return</span> (static_cast&lt;CTransparentUtil *&gt; (aPtr)-&gt;DoChangeTransparencyL());
<a name="l00031"></a>00031         }
<a name="l00032"></a>00032 
<a name="l00037"></a>00037 <span class="keyword">static</span> TInt CallDoSetTransparentRegion(TAny *aPtr)
<a name="l00038"></a>00038         {
<a name="l00039"></a>00039         <span class="keywordflow">return</span> (static_cast&lt;CTransparentUtil *&gt; (aPtr)-&gt;DoSetTransparentRegion());
<a name="l00040"></a>00040         }
<a name="l00041"></a>00041 
<a name="l00045"></a><a class="code" href="class_c_transparent_util.html#a5ac75e00750e9cd60fdf575bf3e400e4">00045</a> <a class="code" href="class_c_transparent_util.html#a5ac75e00750e9cd60fdf575bf3e400e4">CTransparentUtil::CTransparentUtil</a>()
<a name="l00046"></a>00046         {
<a name="l00047"></a>00047         }
<a name="l00048"></a>00048 
<a name="l00053"></a><a class="code" href="class_c_transparent_util.html#a9d8db23cebc357a94cfa21213db8a2ab">00053</a> <a class="code" href="class_c_transparent_util.html">CTransparentUtil</a>* <a class="code" href="class_c_transparent_util.html#a9d8db23cebc357a94cfa21213db8a2ab">CTransparentUtil::NewL</a>()
<a name="l00054"></a>00054         {
<a name="l00055"></a>00055         <a class="code" href="class_c_transparent_util.html">CTransparentUtil</a>* <span class="keyword">self</span> = <span class="keyword">new</span>(ELeave) <a class="code" href="class_c_transparent_util.html#a5ac75e00750e9cd60fdf575bf3e400e4">CTransparentUtil</a>();
<a name="l00056"></a>00056         CleanupStack::PushL(<span class="keyword">self</span>);
<a name="l00057"></a>00057         <span class="keyword">self</span>-&gt;ConstructL();
<a name="l00058"></a>00058         CleanupStack::Pop(<span class="keyword">self</span>);
<a name="l00059"></a>00059         <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00060"></a>00060         }
<a name="l00061"></a>00061 
<a name="l00065"></a><a class="code" href="class_c_transparent_util.html#acc7952414bc448ede845d4ee1a6306ab">00065</a> <a class="code" href="class_c_transparent_util.html#acc7952414bc448ede845d4ee1a6306ab">CTransparentUtil::~CTransparentUtil</a>()
<a name="l00066"></a>00066         {
<a name="l00067"></a>00067         <span class="keywordflow">if</span>(iPeriodicObject-&gt;IsActive())
<a name="l00068"></a>00068             {
<a name="l00069"></a>00069             iPeriodicObject-&gt;Cancel();
<a name="l00070"></a>00070             }
<a name="l00071"></a>00071         <span class="keyword">delete</span> iPeriodicObject;
<a name="l00072"></a>00072         <span class="keyword">delete</span> iBitmapGc;
<a name="l00073"></a>00073         <span class="keyword">delete</span> iBitmapDevice;
<a name="l00074"></a>00074         <span class="keyword">delete</span> iEventHandler;
<a name="l00075"></a>00075         
<a name="l00076"></a>00076         iForegndWindowTrans.Close();
<a name="l00077"></a>00077         iFgndWinTransRegion.Close();    
<a name="l00078"></a>00078         iBackgndWindow.Close();
<a name="l00079"></a>00079         iGroup.Close();
<a name="l00080"></a>00080 
<a name="l00081"></a>00081         <span class="keyword">delete</span> iGc;
<a name="l00082"></a>00082         <span class="keyword">delete</span> iScr;
<a name="l00083"></a>00083         iWs.Close();
<a name="l00084"></a>00084         }
<a name="l00085"></a>00085 
<a name="l00093"></a><a class="code" href="class_c_transparent_util.html#a913184d6e06574a7b843e17c021caad6">00093</a> <span class="keywordtype">void</span> <a class="code" href="class_c_transparent_util.html#a913184d6e06574a7b843e17c021caad6">CTransparentUtil::ConstructL</a>()
<a name="l00094"></a>00094         {
<a name="l00095"></a>00095         <span class="comment">// Connect the client session to the window server.</span>
<a name="l00096"></a>00096         User::LeaveIfError(iWs.Connect());
<a name="l00097"></a>00097 
<a name="l00098"></a>00098         <span class="comment">// Construct a new screen device attached to the window server session.</span>
<a name="l00099"></a>00099         iScr = <span class="keyword">new</span>(ELeave) CWsScreenDevice(iWs);
<a name="l00100"></a>00100         User::LeaveIfError(iScr-&gt;Construct(0)); <span class="comment">// screen number (0 is first screen)</span>
<a name="l00101"></a>00101 
<a name="l00102"></a>00102         <span class="comment">// Create the graphics context  but do not initialise</span>
<a name="l00103"></a>00103         iGc = <span class="keyword">new</span>(ELeave) CWindowGc(iScr);
<a name="l00104"></a>00104 
<a name="l00105"></a>00105         <span class="comment">// Complete construction</span>
<a name="l00106"></a>00106         User::LeaveIfError(iGc-&gt;Construct());
<a name="l00107"></a>00107 
<a name="l00108"></a>00108         <span class="comment">// Create an initialised window group handle within the session.</span>
<a name="l00109"></a>00109         iGroup  = RWindowGroup(iWs);
<a name="l00110"></a>00110         User::LeaveIfError(iGroup.Construct((TUint)&amp;iGroup, ETrue));
<a name="l00111"></a>00111 
<a name="l00112"></a>00112         <span class="comment">// Initialise the background window handle</span>
<a name="l00113"></a>00113         iBackgndWindow = RWindow(iWs);
<a name="l00114"></a>00114 
<a name="l00115"></a>00115         <span class="comment">// Initialise the foreground window handle to demonstrate TransparencyVariance(). </span>
<a name="l00116"></a>00116         iForegndWindowTrans = RWindow(iWs);
<a name="l00117"></a>00117 
<a name="l00118"></a>00118     <span class="comment">// Initialise the foreground window handle to demonstrate TransparentRegionL()</span>
<a name="l00119"></a>00119         iFgndWinTransRegion = RWindow(iWs);
<a name="l00120"></a>00120         
<a name="l00121"></a>00121         <span class="comment">// Create the CPeriodic object to generate periodic events</span>
<a name="l00122"></a>00122         iPeriodicObject=<a class="code" href="class_c_transparent_util.html#a9d8db23cebc357a94cfa21213db8a2ab">CPeriodic::NewL</a>(CActive::EPriorityUserInput);
<a name="l00123"></a>00123         
<a name="l00124"></a>00124     <span class="comment">// Construct the event handler</span>
<a name="l00125"></a>00125     iEventHandler = <a class="code" href="class_c_transparent_util.html#a9d8db23cebc357a94cfa21213db8a2ab">CEventHandler::NewL</a>(iWs);   
<a name="l00126"></a>00126 
<a name="l00127"></a>00127         <span class="comment">// Construct foreground and background windows</span>
<a name="l00128"></a>00128         User::LeaveIfError(iBackgndWindow.Construct(iGroup, (TUint)&amp;iBackgndWindow));
<a name="l00129"></a>00129         User::LeaveIfError(iForegndWindowTrans.Construct(iGroup, (TUint)&amp;iForegndWindowTrans));
<a name="l00130"></a>00130         User::LeaveIfError(iFgndWinTransRegion.Construct(iGroup, (TUint)&amp;iFgndWinTransRegion));
<a name="l00131"></a>00131 
<a name="l00132"></a>00132         iForegndWindowTrans.SetRequiredDisplayMode(EColor16MA); 
<a name="l00133"></a>00133         iFgndWinTransRegion.SetRequiredDisplayMode(EColor16MA); 
<a name="l00134"></a>00134         
<a name="l00135"></a>00135     <span class="comment">// Set background window size</span>
<a name="l00136"></a>00136     TSize bgRectSize(iScr-&gt;SizeInPixels().iWidth/2,iScr-&gt;SizeInPixels().iHeight);
<a name="l00137"></a>00137     iBackgndWindow.SetExtent(TPoint(),bgRectSize);
<a name="l00138"></a>00138     iBackgndWindow.Activate();
<a name="l00139"></a>00139 
<a name="l00140"></a>00140     <span class="comment">// Set the size of the foreground window to span the upper half of the background window</span>
<a name="l00141"></a>00141     TSize fgRectSize(iScr-&gt;SizeInPixels().iWidth/2,iScr-&gt;SizeInPixels().iHeight/2);
<a name="l00142"></a>00142     iForegndWindowTrans.SetExtent(TPoint(),fgRectSize);
<a name="l00143"></a>00143     <span class="comment">//Enable the use of alpha channel to vary foreground window&#39;s transparency</span>
<a name="l00144"></a>00144     User::LeaveIfError(iForegndWindowTrans.SetTransparencyAlphaChannel());
<a name="l00145"></a>00145     iForegndWindowTrans.Activate();
<a name="l00146"></a>00146     
<a name="l00147"></a>00147     <span class="comment">// Set the size of the foreground window to overlap the bottom half of the background window</span>
<a name="l00148"></a>00148     iFgndWinTransRegion.SetExtent(TPoint(0, iScr-&gt;SizeInPixels().iHeight/2),fgRectSize);
<a name="l00149"></a>00149 
<a name="l00150"></a>00150     <span class="comment">//Enable the use of alpha channel to vary foreground window&#39;s transparency</span>
<a name="l00151"></a>00151     User::LeaveIfError(iFgndWinTransRegion.SetTransparencyAlphaChannel()); 
<a name="l00152"></a>00152     iFgndWinTransRegion.Activate();
<a name="l00153"></a>00153     
<a name="l00154"></a>00154     TRect circleRect(TPoint(80,50), TSize(170, 170));   
<a name="l00155"></a>00155     <span class="comment">//Draw the background window using the colour specified by the second parameter </span>
<a name="l00156"></a>00156     <span class="comment">//and draw a circle on top of it with the colour specified by the third parameter. </span>
<a name="l00157"></a>00157     <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KBackGrndWindow, <span class="stringliteral">&quot;Background window&quot;</span>);
<a name="l00158"></a>00158     <a class="code" href="class_c_transparent_util.html#a253c26d5668451d3186cabe1744e364a">DrawWindow</a>(iBackgndWindow, TRgb(234,234,236), TRgb(0,255,0), circleRect , KBackGrndWindow);
<a name="l00159"></a>00159     
<a name="l00160"></a>00160     <span class="comment">//issue request to the event handler. </span>
<a name="l00161"></a>00161     iEventHandler-&gt;<a class="code" href="class_c_event_handler.html#aac65df544e26e3ef06cc087b514c030a">IssueRequest</a>();
<a name="l00162"></a>00162         }
<a name="l00163"></a>00163 
<a name="l00171"></a><a class="code" href="class_c_transparent_util.html#a253c26d5668451d3186cabe1744e364a">00171</a> <span class="keywordtype">void</span> <a class="code" href="class_c_transparent_util.html#a253c26d5668451d3186cabe1744e364a">CTransparentUtil::DrawWindow</a>(RWindow&amp; aWindow, TRgb aColor1, TRgb aColor2, TRect aRect, <span class="keyword">const</span> TDesC&amp; aText)
<a name="l00172"></a>00172         {
<a name="l00173"></a>00173         aWindow.Invalidate();
<a name="l00174"></a>00174         aWindow.BeginRedraw();
<a name="l00175"></a>00175         iGc-&gt;Activate(aWindow);
<a name="l00176"></a>00176 
<a name="l00177"></a>00177         iGc-&gt;SetBrushStyle(CGraphicsContext::ESolidBrush);
<a name="l00178"></a>00178         iGc-&gt;SetPenStyle(CGraphicsContext::ENullPen);
<a name="l00179"></a>00179         iGc-&gt;SetBrushColor(aColor1);
<a name="l00180"></a>00180         iGc-&gt;Clear();
<a name="l00181"></a>00181         iGc-&gt;SetBrushColor(aColor2);
<a name="l00182"></a>00182         iGc-&gt;DrawEllipse(aRect);
<a name="l00183"></a>00183     iGc-&gt;UseFont(iEikonEnv-&gt;NormalFont());
<a name="l00184"></a>00184     iGc-&gt;DrawText(aText, TPoint(10, aWindow.Size().iHeight/2 + 5));
<a name="l00185"></a>00185         iGc-&gt;Deactivate();
<a name="l00186"></a>00186         aWindow.EndRedraw();
<a name="l00187"></a>00187         iWs.Flush();
<a name="l00188"></a>00188         }
<a name="l00189"></a>00189 
<a name="l00197"></a><a class="code" href="class_c_transparent_util.html#a8789a4bf5bdbbd7ee94c91ac91a5c04f">00197</a> <span class="keywordtype">void</span> <a class="code" href="class_c_transparent_util.html#a8789a4bf5bdbbd7ee94c91ac91a5c04f">CTransparentUtil::TransparencyVarianceL</a>()
<a name="l00198"></a>00198         { 
<a name="l00199"></a>00199         <span class="comment">//Clear the foreground windows to the selected colour. </span>
<a name="l00200"></a>00200         <a class="code" href="class_c_transparent_util.html#a1b609f4a41da207c7a42610a42529752">ClearWindow</a>(iWs, iForegndWindowTrans, iGc, TRgb::Gray16(10));
<a name="l00201"></a>00201               
<a name="l00202"></a>00202         <span class="comment">// Issue request to the active scheduler after receiving the event.</span>
<a name="l00203"></a>00203          <span class="keywordflow">if</span>((iPeriodicObject-&gt;IsActive()))
<a name="l00204"></a>00204              {       
<a name="l00205"></a>00205              iPeriodicObject-&gt;Cancel();
<a name="l00206"></a>00206              }
<a name="l00207"></a>00207      iPeriodicObject-&gt;Start(0,KDelay,TCallBack(CallDoChangeTransparencyL,<span class="keyword">this</span>));
<a name="l00208"></a>00208         }
<a name="l00209"></a>00209 
<a name="l00217"></a><a class="code" href="class_c_transparent_util.html#a1b609f4a41da207c7a42610a42529752">00217</a> <span class="keywordtype">void</span> <a class="code" href="class_c_transparent_util.html#a1b609f4a41da207c7a42610a42529752">CTransparentUtil::ClearWindow</a>(RWsSession&amp; aSession, RWindow&amp; aWindow, CWindowGc* aGc, TRgb aColor)
<a name="l00218"></a>00218         {
<a name="l00219"></a>00219         aWindow.Invalidate();
<a name="l00220"></a>00220         aWindow.BeginRedraw();
<a name="l00221"></a>00221         aGc-&gt;Activate(aWindow);
<a name="l00222"></a>00222         aGc-&gt;SetBrushColor(aColor);
<a name="l00223"></a>00223         aGc-&gt;Clear();
<a name="l00224"></a>00224         aGc-&gt;Deactivate();
<a name="l00225"></a>00225         aWindow.EndRedraw();
<a name="l00226"></a>00226         aSession.Flush();
<a name="l00227"></a>00227         }
<a name="l00228"></a>00228 
<a name="l00234"></a><a class="code" href="class_c_transparent_util.html#ae5c53597e173f8e554c7f4fbda81a154">00234</a> TBool <a class="code" href="class_c_transparent_util.html#ae5c53597e173f8e554c7f4fbda81a154">CTransparentUtil::DoChangeTransparencyL</a>()
<a name="l00235"></a>00235         {
<a name="l00236"></a>00236         <span class="comment">//iAlphaValue is the alpha value and the foreground window is redrawn to show </span>
<a name="l00237"></a>00237         <span class="comment">//periodic transparency change. </span>
<a name="l00238"></a>00238         iForegndWindowTrans.SetBackgroundColor( TRgb(255,0, 0, iAlphaValue));
<a name="l00239"></a>00239 
<a name="l00240"></a>00240         TRect drawEllipse(TPoint(170, 45), TSize(65, 45));
<a name="l00241"></a>00241         <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KForeGrndWindowforTrans, <span class="stringliteral">&quot;Foreground window for Vary Tra...&quot;</span>);
<a name="l00242"></a>00242         <a class="code" href="class_c_transparent_util.html#a253c26d5668451d3186cabe1744e364a">DrawWindow</a>(iForegndWindowTrans, TRgb(255,0,0,iAlphaValue), TRgb(100,100,100, iAlphaValue), drawEllipse, KForeGrndWindowforTrans);
<a name="l00243"></a>00243 
<a name="l00244"></a>00244         iAlphaValue += 20;
<a name="l00245"></a>00245         <span class="keywordflow">if</span> (iAlphaValue &lt; 255)
<a name="l00246"></a>00246                 {
<a name="l00247"></a>00247                 <span class="keywordflow">return</span> ETrue;
<a name="l00248"></a>00248                 }
<a name="l00249"></a>00249         <span class="keywordflow">else</span>
<a name="l00250"></a>00250                 {
<a name="l00251"></a>00251                 iAlphaValue=0;
<a name="l00252"></a>00252                 iPeriodicObject-&gt;Cancel();
<a name="l00253"></a>00253                 <span class="keywordflow">return</span> EFalse;
<a name="l00254"></a>00254                 }
<a name="l00255"></a>00255         }
<a name="l00256"></a>00256 
<a name="l00263"></a><a class="code" href="class_c_transparent_util.html#a5177889bde1510d758ef8e84b6416e5f">00263</a> <span class="keywordtype">void</span> <a class="code" href="class_c_transparent_util.html#a5177889bde1510d758ef8e84b6416e5f">CTransparentUtil::TransparentRegionL</a>()
<a name="l00264"></a>00264         {   
<a name="l00265"></a>00265     <span class="comment">//iBoolVisible is a boolean variable used to toggle the visibility of foreground</span>
<a name="l00266"></a>00266     <span class="comment">//window on TransparentRegionL().. button press</span>
<a name="l00267"></a>00267     <span class="keywordflow">if</span>(iBoolVisible)
<a name="l00268"></a>00268         {
<a name="l00269"></a>00269         iFgndWinTransRegion.SetVisible(EFalse);
<a name="l00270"></a>00270         iBoolVisible = EFalse; 
<a name="l00271"></a>00271         iWs.Flush();
<a name="l00272"></a>00272         }
<a name="l00273"></a>00273     <span class="keywordflow">else</span>
<a name="l00274"></a>00274         {  
<a name="l00275"></a>00275         iFgndWinTransRegion.SetVisible(ETrue);       
<a name="l00276"></a>00276         
<a name="l00277"></a>00277         <span class="comment">//set background colour of the foreground window as blue and alpha value as 50. </span>
<a name="l00278"></a>00278         iFgndWinTransRegion.SetBackgroundColor(TRgb(0, 0 , 255 , 50));
<a name="l00279"></a>00279     
<a name="l00280"></a>00280         <span class="comment">//create a rectsize which is half the size of the foreground window. </span>
<a name="l00281"></a>00281         TSize rectsize1(iScr-&gt;SizeInPixels().iWidth/2,iScr-&gt;SizeInPixels().iHeight/4);
<a name="l00282"></a>00282         TRect chopRect1(TPoint(0, iScr-&gt;SizeInPixels().iHeight/4), rectsize1);
<a name="l00283"></a>00283         
<a name="l00284"></a>00284         <span class="comment">//Take a region which is the lower half of the foreground window. </span>
<a name="l00285"></a>00285         iRegion = TRegionFix&lt;2&gt;(chopRect1);
<a name="l00286"></a>00286         <span class="comment">//Use SetTransparentRegion() to keep only the region specified by iRegion as transparent.</span>
<a name="l00287"></a>00287         iFgndWinTransRegion.SetTransparentRegion(iRegion);
<a name="l00288"></a>00288     
<a name="l00289"></a>00289         <span class="comment">//Invalidate and begin redraw on the opaque region of the foreground window. </span>
<a name="l00290"></a>00290         TRect chopRect2(TPoint(0, 0), rectsize1);
<a name="l00291"></a>00291         <span class="comment">//Draw a circle on the opaque region of the foreground window. </span>
<a name="l00292"></a>00292         TRect circleRect2(TPoint(60,20), TSize(40, 40));
<a name="l00293"></a>00293         <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KOpqRegion, <span class="stringliteral">&quot;Opaque region of the transparent window&quot;</span>);
<a name="l00294"></a>00294         <a class="code" href="class_c_transparent_util.html#ab552b1972db4ef4c22a6733e8f48a959">DrawWindowRegion</a>(iFgndWinTransRegion, TRgb(255, 255, 0), TRgb(100, 100, 0), chopRect2, circleRect2, KOpqRegion, TPoint(10, 15)); 
<a name="l00295"></a>00295         
<a name="l00296"></a>00296         <span class="comment">//Invalidate and begin redraw on the transparent region of the foreground window. </span>
<a name="l00297"></a>00297         TRect circleRect3(TPoint(110,80), TSize(40, 40));
<a name="l00298"></a>00298         <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTransRegion, <span class="stringliteral">&quot;Transparent region of the transparent window&quot;</span>);
<a name="l00299"></a>00299         <a class="code" href="class_c_transparent_util.html#ab552b1972db4ef4c22a6733e8f48a959">DrawWindowRegion</a>(iFgndWinTransRegion, TRgb(0, 0 , 255 , 50), TRgb(255,0,0, 100), chopRect1, circleRect3, KTransRegion, TPoint(10, 75)); 
<a name="l00300"></a>00300         iBoolVisible = ETrue; 
<a name="l00301"></a>00301         }
<a name="l00302"></a>00302         }
<a name="l00303"></a>00303 
<a name="l00314"></a><a class="code" href="class_c_transparent_util.html#ab552b1972db4ef4c22a6733e8f48a959">00314</a> <span class="keywordtype">void</span> <a class="code" href="class_c_transparent_util.html#ab552b1972db4ef4c22a6733e8f48a959">CTransparentUtil::DrawWindowRegion</a>(RWindow&amp; aWindow, TRgb aColor1, TRgb aColor2, TRect aChopRect, TRect aRect, <span class="keyword">const</span> TDesC&amp; aText, <span class="keyword">const</span> TPoint&amp; aPoint)
<a name="l00315"></a>00315     {
<a name="l00316"></a>00316     aWindow.Invalidate(aChopRect);
<a name="l00317"></a>00317     aWindow.BeginRedraw(aChopRect);
<a name="l00318"></a>00318     iGc-&gt;Activate(aWindow);
<a name="l00319"></a>00319 
<a name="l00320"></a>00320     iGc-&gt;SetBrushStyle(CGraphicsContext::ESolidBrush);
<a name="l00321"></a>00321     iGc-&gt;SetPenStyle(CGraphicsContext::ENullPen);
<a name="l00322"></a>00322 
<a name="l00323"></a>00323     iGc-&gt;SetBrushColor(aColor1);
<a name="l00324"></a>00324     iGc-&gt;Clear();
<a name="l00325"></a>00325         
<a name="l00326"></a>00326     iGc-&gt;SetBrushColor(aColor2);
<a name="l00327"></a>00327     iGc-&gt;DrawEllipse(aRect);
<a name="l00328"></a>00328     iGc-&gt;SetBrushColor(TRgb(0, 0, 0)); 
<a name="l00329"></a>00329     iGc-&gt;UseFont(iEikonEnv-&gt;NormalFont());
<a name="l00330"></a>00330     iGc-&gt;DrawText(aText, aPoint);
<a name="l00331"></a>00331     iGc-&gt;Deactivate();
<a name="l00332"></a>00332     aWindow.EndRedraw();
<a name="l00333"></a>00333     iWs.Flush();
<a name="l00334"></a>00334     }
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>