×
Namespaces

Variants
Actions

How to change wait note text at runtime

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: rathodavinash (28 Jun 2007)
Last edited: hamishwillee (20 Oct 2011)
Many a times it is needed to show updates on wait notes. This can be achieved with the following:


The resource file

RESOURCE DIALOG r_waitnote
{
flags = EAknWaitNoteFlags;
buttons = R_AVKON_SOFTKEYS_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtNote;
id = EGeneralNote;
control = AVKON_NOTE
{
layout = EWaitLayout;
singular_label = "Receiving File  : %d Bytes";
plural_label ="%d %% Recieved";
imagefile = "z:\\system\data\avkon.mbm";
imageid = EMbmAvkonQgn_note_progress;
imagemask = EMbmAvkonQgn_note_progress_mask;
animation = R_QGN_GRAF_WAIT_BAR_ANIM;
};
}
};
}

Here singular_label is what will be shown as soon as the dialog is executed. To change the label CAknWaitNotes SetTextL function is used.

C++ Code

  • Create and Execute the dialog
iDlg = new(ELeave)CAknWaitDialog( (REINTERPRET_CAST(CEikDialog**,&iDlg))); 
iDlg->SetTone( CAknNoteDialog::EConfirmationTone );
iDlg->SetCallback( this );
iDlg->SetTextL(_L("Please Wait..."));
iDlg->ExecuteLD(R_WAITNOTE);
  • Change label as and when required
_LIT(KFormat,"%d %% Recieved");
str.Format(KFormat,kb);
iDlg->SetTextL(str);
  • Dismiss the dialog
if(iDlg)
{
iDlg->ProcessFinishedL();
iDlg = NULL;
}
This page was last modified on 20 October 2011, at 04:15.
45 page views in the last 30 days.
×