lafagnosticuifoundation/cone/tef/TCone7Containee.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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 // Child
       
    25 
       
    26 /** Assume container has no background and will supply the  environment's text drawer. */
       
    27 	
       
    28 TBool CCtlContainee641::TestContainerTextDrawer()
       
    29 	{
       
    30 	// The Inherited text drawer
       
    31 	XCoeTextDrawer xTextDrawer(TextDrawer());
       
    32 	// Assume reusable.
       
    33 	
       
    34 	TRect rect = Rect();
       
    35 	CCoeEnv* env = ControlEnv();
       
    36 	
       
    37 	ActivateGc();
       
    38 	
       
    39 	xTextDrawer.SetClipRect( rect );
       
    40 	xTextDrawer.SetAlignment( EHRightVBottom );
       
    41 	xTextDrawer.DrawDisplayOrderedText( SystemGc(), KInheritedTextDrawerText, rect, *env->NormalFont() );
       
    42 
       
    43 	DeactivateGc();
       
    44 	iCoeEnv->Flush();
       
    45 	
       
    46 	return (KRgbInherited == xTextDrawer->TextColor());
       
    47 	}
       
    48 
       
    49 void CCtlContainee641::ApplyText() const
       
    50 	{	
       
    51 	TInt key = 0;
       
    52 	// The Inherited text drawer
       
    53 	XCoeTextDrawer xTextDrawer(TextDrawer( key ));
       
    54 	
       
    55 	TRect rect = Rect();
       
    56 	CCoeEnv* env = ControlEnv();
       
    57 	
       
    58 	xTextDrawer.SetClipRect( rect );
       
    59 	xTextDrawer.SetAlignment( EHLeftVTop );
       
    60 	xTextDrawer.DrawDisplayOrderedText( SystemGc(), KInheritedTextDrawerText, rect, *env->NormalFont() );
       
    61 
       
    62 	// Our local text drawer
       
    63 	XCoeTextDrawer textDrawer(*CCoePlainTextDrawer::New( KRgbBlue ));
       
    64 	
       
    65 	textDrawer.SetClipRect( rect );
       
    66 	textDrawer.SetAlignment( EHLeftVBottom );
       
    67 	textDrawer.DrawDisplayOrderedText( SystemGc(), KLocalTextDrawerText, rect, *env->NormalFont() );
       
    68 	}
       
    69 
       
    70 CCtlContainee641::CCtlContainee641()
       
    71 	{
       
    72 	}
       
    73 	
       
    74 CCtlContainee641::~CCtlContainee641()
       
    75 	{
       
    76 	delete iName;
       
    77 	}
       
    78 	
       
    79 void CCtlContainee641::ConstructL( const TDesC& aName )
       
    80 	{
       
    81 	CCtlBase641::ConstructL();
       
    82 	iName = aName.AllocL();
       
    83 	}
       
    84 
       
    85 void CCtlContainee641::Draw(const TRect& /*aRect*/) const
       
    86 	{
       
    87 	CWindowGc& gc=SystemGc();
       
    88 	TRect rect=Rect();
       
    89 	gc.SetBrushColor( KRgbYellow );
       
    90 		
       
    91 	DoDraw( gc, rect );
       
    92 	
       
    93 	//ApplyText();
       
    94 	}	
       
    95 
       
    96 const TDesC& CCtlContainee641::WhoAmI() const
       
    97 	{
       
    98 	return *iName;
       
    99 	}