tsrc/mustestapp/src/AiwTestAppContainer.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "aiwtestappcontainer.h"
       
    21 #include <eikenv.h>
       
    22 #include <eiklabel.h>  // for example label control
       
    23 
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 
       
    26 // ---------------------------------------------------------
       
    27 // CAiwTestContainer::ConstructL(const TRect& aRect)
       
    28 // Symbian 2nd phase constructor can leave.
       
    29 // ---------------------------------------------------------
       
    30 //
       
    31 void CAiwTestContainer::ConstructL(const TRect& aRect)
       
    32     {
       
    33     CreateWindowL();
       
    34 
       
    35     iLabel = new (ELeave) CEikLabel;
       
    36     iLabel->SetContainerWindowL( *this );
       
    37     iLabel->SetTextL( _L("Label") );
       
    38 
       
    39     iToDoLabel = new (ELeave) CEikLabel;
       
    40     iToDoLabel->SetContainerWindowL( *this );
       
    41     iToDoLabel->SetTextL( _L("TodoLabel") );
       
    42 
       
    43     SetRect(aRect);
       
    44     ActivateL();
       
    45     }
       
    46 
       
    47 // ---------------------------------------------------------
       
    48 // CAiwTestContainer::~CAiwTestContainer()
       
    49 // Destructor
       
    50 // ---------------------------------------------------------
       
    51 //
       
    52 CAiwTestContainer::~CAiwTestContainer()
       
    53     {
       
    54     delete iLabel;
       
    55     delete iToDoLabel;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // CAiwTestContainer::SetLabelL(TDesC& aText)
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 void CAiwTestContainer::SetLabelL(TDesC& /*aText*/)
       
    63     {
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // CAiwTestContainer::SizeChanged()
       
    68 // Called by framework when the view size is changed
       
    69 // ---------------------------------------------------------
       
    70 //
       
    71 void CAiwTestContainer::SizeChanged()
       
    72     {
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------
       
    76 // CAiwTestContainer::CountComponentControls() const
       
    77 // ---------------------------------------------------------
       
    78 //
       
    79 TInt CAiwTestContainer::CountComponentControls() const
       
    80     {
       
    81     return 2; // return nbr of controls inside this container
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------
       
    85 // CAiwTestContainer::ComponentControl(TInt aIndex) const
       
    86 // ---------------------------------------------------------
       
    87 //
       
    88 CCoeControl* CAiwTestContainer::ComponentControl(TInt aIndex) const
       
    89     {
       
    90     switch ( aIndex )
       
    91         {
       
    92         case 0:
       
    93             return iLabel;
       
    94         case 1:
       
    95             return iToDoLabel;
       
    96         default: 
       
    97             return NULL;
       
    98         }
       
    99     }
       
   100 
       
   101 // ---------------------------------------------------------
       
   102 // CAiwTestContainer::Draw(const TRect& aRect) const
       
   103 // ---------------------------------------------------------
       
   104 //
       
   105 void CAiwTestContainer::Draw(const TRect& aRect) const
       
   106     {
       
   107     CWindowGc& gc = SystemGc();
       
   108     
       
   109     gc.SetPenStyle( CGraphicsContext::ENullPen ); 
       
   110     gc.SetBrushColor( KRgbGray );
       
   111     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   112     
       
   113     gc.DrawRect( aRect );      
       
   114     }
       
   115 
       
   116 // ---------------------------------------------------------
       
   117 // CAiwTestContainer::HandleControlEventL(CCoeControl* aControl, 
       
   118 //    TCoeEvent aEventType)
       
   119 // ---------------------------------------------------------
       
   120 //
       
   121 void CAiwTestContainer::HandleControlEventL(CCoeControl* /*aControl*/, 
       
   122     TCoeEvent /*aEventType*/)
       
   123     {
       
   124     // TODO: Add your control event handler code here
       
   125     }
       
   126     
       
   127 // End of File