Chinaunix首页 | 论坛 | 博客
  • 博客访问: 22182
  • 博文数量: 28
  • 博客积分: 670
  • 博客等级: 上士
  • 技术积分: 285
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-09 11:27
文章分类

全部博文(28)

文章存档

2011年(28)

我的朋友
最近访客

分类: 嵌入式

2011-01-29 12:32:42

这个跟我们在新建HELLOWORLD的UI程序不一样,我们需要在Container中声明个CEikLabel *iLabel成员变量,并把它显示在UI中 。

CEikLabel没有SetColor来设置颜色,它是通过void OverrideColorL(TInt aLogicalColor,TRgb aColor);来设置颜色see:

OverrideColorL()

void OverrideColorL(TInt aLogicalColor,TRgb aColor);

Description

Overrides the control's colour setting, as specified in the application's colour scheme.

This function does not change the application's colour scheme — it changes the colour mapping used in this control only.

Parameters
TInt aLogicalColor

The logical colour. Indicates which part of a control the physical colour maps to. The set of logical colours for a standard application are defined in TLogicalColor.

TRgb aColor

The new physical colour to which the logical colour should be mapped.




void CFirstFuckContainer::ConstructL( const TRect &aRect )
    {
    CreateWindowL();
    InitComponentArrayL();
    iLabel = new (ELeave) CEikLabel;
    iLabel->SetContainerWindowL(*this);
    iLabel->SetRect( aRect );           //一定要加这句,这个用来指定控件所占的区域
    iLabel->OverrideColorL( EColorLabelText, KRgbRed );//设置CEikLabel颜色
    iLabel->SetEmphasis( CEikLabel::ENoEmphasis )
    //iLabel->SetPosition(AKNEXQUERY_LABEL2_POSITION);
    iLabel->SetAlignment( EHCenterVTop );
    iLabel->SetTextL( _L("Billpig"));
    //iLabel->DrawNow();
    
    //Components().AppendLC( iLabel );
    //CleanupStack::Pop( iLabel );
    SetRect( aRect );
    //SetBlank();
    ActivateL();
    }

阅读(323) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~