Symbian中数组的使用

来源:互联网 发布:触不可及知乎 编辑:程序博客网 时间:2024/04/29 21:48

字符串数组的使用

1.      定义

rss

RESOURCE ARRAY r_goldenminer_help_array

{

       items=

       {

              LBUF

               {txt = qtn_goldenminer_help1;},

              LBUF

               {txt = qtn_goldenminer_help2;},

              LBUF

               {txt = qtn_goldenminer_help3;},

              LBUF

               {txt = qtn_goldenminer_help4;},

              LBUF

               {txt = qtn_goldenminer_help5;},

              LBUF

               {txt = qtn_goldenminer_help6;}, 

              LBUF

               {txt = qtn_goldenminer_help7;},

              LBUF

               {txt = qtn_goldenminer_help8;},

              LBUF

               {txt = qtn_goldenminer_help9;}        

       };

注:只能用LBUF,使用TBUF不能运行

2.      使用

gc.UseFont(AknLayoutUtils::FontFromId(EAknHighestLogicalFont ));

TInt fontHeight =AknLayoutUtils::FontFromId( EAknHighestLogicalFont )->HeightInPixels();

                     fontHeight+= 2;

                     gc.SetPenColor(KRgbWhite);

CDesCArray*textArray=CoeEnv->ReadDesCArrayResourceL(R_GOLDENMINER_HELP_ARRAY );

                     CleanupStack::PushL(textArray);

 

                     for(TInti = 0; i < textArray->Count(); i++)

                     {

                            gc.DrawText((*textArray)[i],TPoint(0, (i + 1)*fontHeight));

                     }

 

                     CleanupStack::PopAndDestroy();

                     gc.DiscardFont();

 

 

原创粉丝点击