uifw/ganes/src/HgVgLabel.cpp
branchRCL_3
changeset 5 aabf2c525e0f
parent 0 2f259fa3e83a
child 6 9f56a4e1b8ab
equal deleted inserted replaced
3:8ca85d2f0db7 5:aabf2c525e0f
    41 // -----------------------------------------------------------------------------
    41 // -----------------------------------------------------------------------------
    42 // CHgVgTitleRenderer::NewL()
    42 // CHgVgTitleRenderer::NewL()
    43 // Two-phased constructor.
    43 // Two-phased constructor.
    44 // -----------------------------------------------------------------------------
    44 // -----------------------------------------------------------------------------
    45 //
    45 //
    46 CHgVgLabel* CHgVgLabel::NewL(const TRect& aRect, const CFont* aFont, const TDesC& aText)
    46 CHgVgLabel* CHgVgLabel::NewL(const TRect& aRect, const TDesC& aText)
    47     {
    47     {
    48     CHgVgLabel* self = new ( ELeave ) CHgVgLabel(aRect, aFont);
    48     CHgVgLabel* self = new ( ELeave ) CHgVgLabel(aRect);
    49     CleanupStack::PushL (self );
    49     CleanupStack::PushL (self );
    50     self->ConstructL(aText);
    50     self->ConstructL(aText);
    51     CleanupStack::Pop ( self );
    51     CleanupStack::Pop ( self );
    52     return self;
    52     return self;
    53     }
    53     }
    98 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
    99 // CHgVgTitleRenderer::CHgVgTitleRenderer()
    99 // CHgVgTitleRenderer::CHgVgTitleRenderer()
   100 // C++ default constructor can NOT contain any code, that might leave.
   100 // C++ default constructor can NOT contain any code, that might leave.
   101 // -----------------------------------------------------------------------------
   101 // -----------------------------------------------------------------------------
   102 //
   102 //
   103 CHgVgLabel::CHgVgLabel(const TRect& aRect, const CFont* aFont) : 
   103 CHgVgLabel::CHgVgLabel(const TRect& aRect) : 
   104 iRect(aRect),
   104 iRect(aRect),
   105 iFont(aFont),
       
   106 iTextColor(KRgbDarkGray),
   105 iTextColor(KRgbDarkGray),
   107 iShadowColor(KRgbBlack),
   106 iShadowColor(KRgbBlack),
   108 iDirty(ETrue)
   107 iDirty(ETrue)
   109     {
   108     {
   110     
   109     
   134         delete iText;
   133         delete iText;
   135         iText = 0;
   134         iText = 0;
   136         iText = aText.AllocL();
   135         iText = aText.AllocL();
   137         iDirty = ETrue;
   136         iDirty = ETrue;
   138         }
   137         }
   139     }
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // CHgVgLabel::SetFont()
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 void CHgVgLabel::SetFont(const CFont* aFont)
       
   146     {
       
   147     if (aFont != iFont)
       
   148         {
       
   149         iFont = aFont;
       
   150         iDirty = ETrue;
       
   151         }
       
   152     }
       
   153 
       
   154 // -----------------------------------------------------------------------------
       
   155 // CHgVgLabel::SetColor()
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158 void CHgVgLabel::SetColor(const TRgb& aColor)
       
   159     {
       
   160     iTextColor = aColor;
       
   161     }
       
   162 
       
   163 // -----------------------------------------------------------------------------
       
   164 // CHgVgLabel::SetColor()
       
   165 // -----------------------------------------------------------------------------
       
   166 //
       
   167 void CHgVgLabel::SetShadowColor(const TRgb& aColor)
       
   168     {
       
   169     iShadowColor = aColor;
       
   170     }
   138     }
   171 
   139 
   172 // -----------------------------------------------------------------------------
   140 // -----------------------------------------------------------------------------
   173 // CHgVgLabel::Draw()
   141 // CHgVgLabel::Draw()
   174 // -----------------------------------------------------------------------------
   142 // -----------------------------------------------------------------------------