📄 如何改变ceiklabel的颜色 - newlc - symbian os系统[s60,uiq]开发中文翻译论坛.mht
字号:
rL( EColorLabelTextEmphasis,=20
KRgbWhite );<BR>myLabel->OverrideColorL(=20
EColorLabelHighlightFullEmphasis, KRgbRed=20
);<BR>myLabel->SetEmphasis( CEikLabel::EFullEmphasis=20
); </DIV><BR></DIV></TD></TR>
<TR>
<TD vAlign=3Dbottom><BR><BR><BR><IMG alt=3D""=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/common/sigl=
ine.gif"><BR>
<DIV class=3Dsignature=20
style=3D"OVERFLOW: hidden; MAX-HEIGHT: 20em; maxHeightIE: =
245px"><FONT=20
=
color=3Dred>=E6=9C=89=E5=85=B6=E4=BB=96=E9=97=AE=E9=A2=98=E8=AF=B7=E5=8A=A0=
=E5=85=A5Symbian=E5=BC=80=E5=8F=91=E7=BE=A4=E5=8F=82=E4=B8=8E=E8=AE=A8=E8=
=AE=BA=EF=BC=9A=E7=BE=A4=20
=
=E2=91=A0:623041=E5=B7=B2=E6=BB=A1=EF=BC=8C=E8=AF=B7=E5=8A=A0=E7=BE=A4=E2=
=91=A1=EF=BC=9A36865776</FONT></DIV></TD></TR>
<TR>
<TD align=3Dright><A onclick=3Dscroll(0,0)=20
=
href=3D"http://www.symbianx.cn/redirect.php?fid=3D5&tid=3D51&goto=
=3Dnextnewset###"><IMG=20
alt=3DTop=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/top=
.gif"=20
border=3D0></A> =
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
<DIV class=3Dspaceborder style=3D"MARGIN-BOTTOM: 4px; WIDTH: 98%">
<TABLE class=3Dt_row cellSpacing=3D0 cellPadding=3D4 width=3D"100%" =
align=3Dcenter>
<TBODY>
<TR style=3D"HEIGHT: 100%">
<TD class=3Dt_user vAlign=3Dtop width=3D"18%"><A =
name=3Dlastpost></A><A class=3Dbold=20
href=3D"http://www.symbianx.cn/viewpro.php?uid=3D2" =
target=3D_blank>Lee</A> <BR>
<DIV class=3Dsmalltxt>Administrator<BR><IMG alt=3D"Rank: 9"=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/sta=
r_level3.gif"><IMG=20
alt=3D"Rank: 9"=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/sta=
r_level3.gif"><IMG=20
alt=3D"Rank: 9"=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/sta=
r_level1.gif"><BR><BR><BR><BR>UID=20
2<BR>Digest Posts 0<BR>Credits 18447<BR>Posts 133<BR>Money 189 =
<BR>Reading=20
Access 200<BR>Registered 13-3-2007<BR>Status Offline </DIV></TD>
<TD=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; =
PADDING-TOP: 0px"=20
vAlign=3Dtop width=3D"82%">
<TABLE class=3Dt_msg cellSpacing=3D0 cellPadding=3D4 border=3D0>
<TBODY>
<TR>
<TD>
<DIV>
<DIV class=3D"right t_number"><A class=3Dbold=20
=
onclick=3D"window.clipboardData.setData('text','http://www.symbianx.cn/vi=
ewthread.php?tid=3D52&page=3D1#pid67')"=20
=
href=3D"http://www.symbianx.cn/redirect.php?fid=3D5&tid=3D51&goto=
=3Dnextnewset###">#2</A></DIV>
<DIV style=3D"PADDING-TOP: 4px">Post at 18-3-2007 =
14:22 <A=20
=
href=3D"http://www.symbianx.cn/viewpro.php?uid=3D2">Profile</A> | <A=20
href=3D"http://www.symbianx.cn/blog.php?uid=3D2" =
target=3D_blank>Blog</A>=20
| <A =
href=3D"http://www.symbianx.cn/pm.php?action=3Dsend&uid=3D2"=20
target=3D_blank>P.M.</A> </DIV></DIV></TD></TR>
<TR>
<TD class=3Dline style=3D"PADDING-TOP: 10px" vAlign=3Dtop =
height=3D"100%"><A=20
title=3D"[Rating] 0"=20
=
href=3D"http://www.symbianx.cn/misc.php?action=3Dviewratings&tid=3D52=
&pid=3D67"=20
name=3Dpid67></A><SPAN class=3Dbold>How to change the color =
of a=20
CEikLabel</SPAN><BR><BR>
<DIV style=3D"FONT-SIZE: 12px">A CEikLabel is a basic =
component use to=20
display static text in a control. It is fairly easy and=20
straightforward to use as soon as you don=E2=80=99t have to =
change its=20
color: there is no SetColor() primitive.<BR><BR>If you are =
reading=20
this page, you are probably looking for the answer. And as =
usual in=20
the Symbian world, it is pretty trivial once you know how to =
do it.=20
As a matter of fact, you have to override the=20
EColorLabelTextEmphasis setting of your label using the=20
OverrideColorL() primitive and then to activate the setting, =
using=20
SetEmphasis(). The code below shows how to do this:<BR><BR>
<DIV class=3Dmsgheader>
<DIV class=3Dright><A class=3Dsmalltxt =
onclick=3D"copycode($('code2'));"=20
=
href=3D"http://www.symbianx.cn/redirect.php?fid=3D5&tid=3D51&goto=
=3Dnextnewset###">[Copy=20
to clipboard]</A></DIV>CODE:</DIV>
<DIV class=3Dmsgborder id=3Dcode2>#include=20
<gulcolor.h><BR>...<BR>// Basic Label=20
Construction<BR>CEikLabel* myLabel;<BR>myLabel=3D new =
(ELeave)=20
CEikLabel;<BR>myLabel->SetContainerWindowL( *this=20
);<BR>myLabel->SetTextL( _L("NewLC rulez!") );<BR><BR>// =
Now Set=20
the foreground color to Red<BR>myLabel->OverrideColorL(=20
EColorLabelTextEmphasis, KRgbRed =
);<BR>myLabel->SetEmphasis(=20
CEikLabel::EPartialEmphasis =
); </DIV><BR>Alternatively=20
you may want to specify a foreground AND a background color. =
In this=20
case, you also have to override and activate the=20
EColorLabelHighlightFullEmphasis setting:<BR><BR>
<DIV class=3Dmsgheader>
<DIV class=3Dright><A class=3Dsmalltxt =
onclick=3D"copycode($('code3'));"=20
=
href=3D"http://www.symbianx.cn/redirect.php?fid=3D5&tid=3D51&goto=
=3Dnextnewset###">[Copy=20
to clipboard]</A></DIV>CODE:</DIV>
<DIV class=3Dmsgborder id=3Dcode3>// Now Set the foreground =
Color to=20
White<BR>// and the background color to=20
Red<BR>myLabel->OverrideColorL( EColorLabelTextEmphasis,=20
KRgbWhite );<BR>myLabel->OverrideColorL(=20
EColorLabelHighlightFullEmphasis, KRgbRed=20
);<BR>myLabel->SetEmphasis( CEikLabel::EFullEmphasis=20
); </DIV><BR></DIV></TD></TR>
<TR>
<TD vAlign=3Dbottom><BR><BR><BR><IMG alt=3D""=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/common/sigl=
ine.gif"><BR>
<DIV class=3Dsignature=20
style=3D"OVERFLOW: hidden; MAX-HEIGHT: 20em; maxHeightIE: =
245px"><FONT=20
=
color=3Dred>=E6=9C=89=E5=85=B6=E4=BB=96=E9=97=AE=E9=A2=98=E8=AF=B7=E5=8A=A0=
=E5=85=A5Symbian=E5=BC=80=E5=8F=91=E7=BE=A4=E5=8F=82=E4=B8=8E=E8=AE=A8=E8=
=AE=BA=EF=BC=9A=E7=BE=A4=20
=
=E2=91=A0:623041=E5=B7=B2=E6=BB=A1=EF=BC=8C=E8=AF=B7=E5=8A=A0=E7=BE=A4=E2=
=91=A1=EF=BC=9A36865776</FONT></DIV></TD></TR>
<TR>
<TD align=3Dright><A onclick=3Dscroll(0,0)=20
=
href=3D"http://www.symbianx.cn/redirect.php?fid=3D5&tid=3D51&goto=
=3Dnextnewset###"><IMG=20
alt=3DTop=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/top=
.gif"=20
border=3D0></A>=20
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></FORM></DIV>
<SCRIPT type=3Dtext/javascript>
function setanswer(pid){
if(confirm("Are you sure to set this answer as \"The Best Answer\"")){
document.delpost.action=3D'misc.php?action=3Dbestanswer&tid=3D52&pid=3D' =
+ pid + '&bestanswersubmit=3Dyes';
document.delpost.submit();
}
}
</SCRIPT>
<DIV class=3Dmaintable style=3D"CLEAR: both">
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"98%" align=3Dcenter>
<TBODY>
<TR>
<TD vAlign=3Dtop></TD>
<TD align=3Dright width=3D"40%">
<DIV class=3Dright> <A=20
=
href=3D"http://www.symbianx.cn/post.php?action=3Dreply&fid=3D5&ti=
d=3D52&extra=3D"><IMG=20
alt=3D""=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/rep=
ly.gif"=20
border=3D0></A></DIV>
<DIV class=3Dright id=3Dnewspecialfooter><A=20
=
href=3D"http://www.symbianx.cn/post.php?action=3Dnewthread&fid=3D5&am=
p;extra=3D"><IMG=20
alt=3D""=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/new=
topic.gif"=20
border=3D0></A><A=20
=
href=3D"http://www.symbianx.cn/redirect.php?fid=3D5&tid=3D51&goto=
=3Dnextnewset###"><IMG=20
alt=3D""=20
src=3D"mhtml:file://C:\Documents and =
Settings\Administrator\=E6=A1=8C=E9=9D=A2\=E5=A6=82=E4=BD=95=E6=94=B9=E5=8F=
=98CEikLabel=E7=9A=84=E9=A2=9C=E8=89=B2 - NewLC - Symbian =
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B.mht!http://www.symbianx.cn/images/default/new=
special.gif"=20
border=3D0></A>
<SCRIPT=20
type=3Dtext/javascript>menuregister(false, "newspecialfooter", =
true)</SCRIPT>
</DIV>
<DIV class=3D"popupmenu_popup newspecialmenu" =
id=3Dnewspecialfooter_menu=20
style=3D"DISPLAY: none">
<TABLE cellSpacing=3D0 cellPadding=3D4 width=3D"100%" border=3D0>
<TBODY>
<TR>
<TD class=3Dpopupmenu_option>
<DIV class=3Dnewspecial><A=20
=
href=3D"http://www.symbianx.cn/post.php?action=3Dnewthread&fid=3D5&am=
p;extra=3D&poll=3Dyes">Poll</A></DIV></TD></TR>
<TR>
<TD class=3Dpopupmenu_option>
<DIV class=3Dnewspecial><A=20
=
href=3D"http://www.symbianx.cn/post.php?action=3Dnewthread&fid=3D5&am=
p;extra=3D&trade=3Dyes">Trade</A></DIV></TD></TR>
<TR>
<TD class=3Dpopupmenu_option>
<DIV class=3Dnewspecial><A=20
=
href=3D"http://www.symbianx.cn/post.php?action=3Dnewthread&fid=3D5&am=
p;extra=3D&reward=3Dyes">Reward</A></DIV></TD></TR>
<TR>
<TD class=3Dpopupmenu_option>
<DIV class=3Dnewspecial><A=20
=
href=3D"http://www.symbianx.cn/post.php?action=3Dnewthread&fid=3D5&am=
p;extra=3D&activity=3Dyes">Activity</A></DIV></TD></TR></TBODY></TABL=
E></DIV></TD></TR></TBODY></TABLE><BR></DIV>
<DIV class=3Dpopupmenu_popup id=3Dforumlist_menu style=3D"DISPLAY: =
none">
<TABLE cellSpacing=3D0 cellPadding=3D4 border=3D0>
<TBODY>
<TR>
<TD class=3Dpopupmenu_option><A class=3Dnav=20
href=3D"http://www.symbianx.cn/index.php">Symbian=20
=
OS=E7=B3=BB=E7=BB=9F[S60,UIQ]=E5=BC=80=E5=8F=91=E4=B8=AD=E6=96=87=E7=BF=BB=
=E8=AF=91=E8=AE=BA=E5=9D=9B</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
=
href=3D"http://www.symbianx.cn/index.php?gid=3D3">=E8=B5=84=E6=96=99=E7=BF=
=BB=E8=AF=91</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
href=3D"http://www.symbianx.cn/forumdisplay.php?fid=3D4"> =
> Forum=20
Nokia</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A class=3Dbold=20
href=3D"http://www.symbianx.cn/forumdisplay.php?fid=3D5"> =
>=20
NewLC</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
href=3D"http://www.symbianx.cn/forumdisplay.php?fid=3D6"> =
>=20
Symbian=E5=AE=98=E6=96=B9</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
href=3D"http://www.symbianx.cn/forumdisplay.php?fid=3D10"> =
>=20
Others</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
href=3D"http://www.symbianx.cn/forumdisplay.php?fid=3D17"> =
>=20
=E6=88=91=E6=9D=A5=E4=BE=9B=E7=A8=BF</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
=
href=3D"http://www.symbianx.cn/index.php?gid=3D18">=E5=BC=80=E6=BA=90=E9=A1=
=B9=E7=9B=AE=E7=A0=94=E7=A9=B6</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
href=3D"http://www.symbianx.cn/forumdisplay.php?fid=3D16"> =
>=20
ScreenShot</A></TD></TR>
<TR>
<TD class=3Dpopupmenu_option><A=20
=
href=3D"http://www.symbianx.cn/index.php?gid=3D13">=E8=AE=A8=E8=AE=BA=E5=8C=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -