|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #include "TCone7Step.h" |
|
23 |
|
24 CCtlBase641::CCtlBase641() |
|
25 { |
|
26 } |
|
27 |
|
28 void CCtlBase641::ConstructL() |
|
29 { |
|
30 TFontSpec spec(_L("Arial"),240); |
|
31 iFont = iCoeEnv->CreateScreenFontL( spec ); |
|
32 } |
|
33 |
|
34 CCtlBase641::~CCtlBase641() |
|
35 { |
|
36 iCoeEnv->ReleaseScreenFont(iFont); |
|
37 } |
|
38 |
|
39 void CCtlBase641::WriteName( CWindowGc& aGc, const TDesC& aText ) const |
|
40 { |
|
41 TRect rect = Rect(); |
|
42 rect.Shrink( 3, 3 ); |
|
43 aGc.UseFont( iFont ); |
|
44 TInt ascent = ( rect.iBr.iY - rect.iTl.iY-iFont->HeightInPixels() ) / 2 + iFont->AscentInPixels(); |
|
45 aGc.SetPenColor( KRgbBlack ); |
|
46 aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
47 aGc.DrawText( aText, rect, ascent, CGraphicsContext::ERight ); |
|
48 } |
|
49 |
|
50 void CCtlBase641::DoDraw( CWindowGc& aGc, TRect aRect ) const |
|
51 { |
|
52 aGc.DrawRect( aRect ); |
|
53 aRect.Shrink( 1, 1 ); |
|
54 aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
55 aGc.DrawRect( aRect ); |
|
56 WriteName( aGc, *iName ); |
|
57 } |
|
58 |