我尝试将等待对话框的图像(图标)从“Gear”图标更改为另一个图标(图标),但我失败了,尽管我在书中关注了很多文章和示例:
RESOURCE DIALOG r_progressdlg_container_wait_dialog1
{
flags = EAknWaitNoteFlags;
buttons = R_AVKON_SOFTKEYS_CANCEL;
items =
{
DLG_LINE
{
id = EProgressdlgContainerViewWaitDialog1;
type = EAknCtNote;
control = AVKON_NOTE
{
layout = EWaitLayout;
singular_label = STR_progressdlgContainerView_10;
animation = R_QGN_GRAF_WAIT_BAR_ANIM;
};
},
DLG_LINE
{
id = EProgressdlgContainerViewWaitDialog1;
type=EEikCtImage;
control = IMAGE
{
horiz_align=EEikLabelAlignHRight;
vert_align=EEikLabelAlignVTop;
bmpfile = "\\resource\\apps\\progressdlg.mbm";
bmpid = EMbmProgressdlgList_icon;
bmpmask = EMbmProgressdlgList_icon_mask;
extension=0;
};
}
};
}
这是我根据您支持的信息更新的代码,但是, 对话框仍然显示默认图标“Gear”,那么代码有什么问题?
我正在使用Carbide.C ++ 2.7,S60 5th Ed SDK,在诺基亚E7上测试(Symbian ^ 3)
答案 0 :(得分:1)
在我看来,您发布的代码适用于进度条动画,而不是图标。我猜你需要像
这样的东西DLG_LINE {
id=EDlgListBoxViewWaitDialog1;
type=EEikCtImage;
control = IMAGE
{
bmpfile = "example.mbm"; // Replace with your .mbm file
bmpid = mbmID; // // The id of the image
};
}
或者只是在代码中设置它?
答案 1 :(得分:1)
你可以像这样替换图像:
// CONSTANTS
#define AVKON_BMPFILE_NAME "\\resource\\apps\\avkon2.mbm"
...
RESOURCE DIALOG r_my_progress_note
{
flags = EAknProgressNoteFlags;
buttons = r_my_softkeys_cancel;
items =
{
DLG_LINE
{
type = EAknCtNote;
id = EMyCtrlIdProgressNote;
control = AVKON_NOTE
{
layout = EProgressLayout;
singular_label = STRING_r_exnt_progress_singular;
plural_label = STRING_r_exnt_progress_plural;
imagefile = AVKON_BMPFILE_NAME;
imageid = EMbmAvkonQgn_note_progress;
imagemask = EMbmAvkonQgn_note_progress_mask;
};
}
};
}
Note示例应用程序在不同对话框中有大量替换图像的示例。在S60第5版SDK上,您可以在以下位置找到它:
C:\S60\devices\S60_5th_Edition_SDK_v1.0\S60CppExamples\Note
您的.mbm或索引也可能存在问题,请先尝试使用avkon2.mbm。