This page was last modified 11:04, 4 August 2008.
Confirmation Query
From Forum Nokia Wiki
CAknQueryDialog API can also be used as a confirmation query, following function illustrates how you could use it for this purpose:
TInt ShowQueryDialogL(const TDesC& aMessage)
{
CAknQueryDialog* dlg = CAknQueryDialog::NewL();
return dlg->ExecuteLD(R_QUERY,aMessage);
}
another usage...
TBool ShowQueryDialogL(const TDesC& aMessage)
{
CAknQueryDialog* dlg = CAknQueryDialog::NewL();
TBool answer( dlg->ExecuteLD( R_QUERY,aMessage ) );
return answer;// True=YES, False=NO
}
As all dialogs CAknQueryDialog also requires resource definition, with this example function you could use following resource definition:
RESOURCE DIALOG R_QUERY
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_YES_NO;
items =
{
DLG_LINE
{
type = EAknCtQuery;
id = EGeneralQuery;
control = AVKON_CONFIRMATION_QUERY
{
layout = EConfirmationQueryLayout;
animation = R_QGN_NOTE_INFO_ANIM;
};
}
};
}
If you want to use confirmation queries without resource definitions, you could also utilize CAknGlobalConfirmationQuery API for example like this:
TBool ShowQueryDialogL(const TDesC& aMessage)
{
CAknGlobalConfirmationQuery* QlobalQ = CAknGlobalConfirmationQuery::NewL();
CleanupStack::PushL(QlobalQ);
TRequestStatus theStat = KRequestPending;
QlobalQ->ShowConfirmationQueryL(theStat, aMessage, R_AVKON_SOFTKEYS_YES_NO);
User::WaitForRequest(theStat);
CleanupStack::PopAndDestroy(QlobalQ);
if(theStat.Int() == EAknSoftkeyYes)
{
return ETrue;
}
else
{
return EFalse;
}
}
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to set field length of appuifw.query(,"number")? | jfml | Python | 14 | 2007-05-21 20:14 |
| Help: convert to star '*'? | llapplecn | Python | 3 | 2005-05-05 13:26 |
| CAknMarkableListDialog panics with USER 0 | grapentin | Symbian User Interface | 8 | 2007-03-01 13:31 |
| How to query Application ID | ericyklee | General Symbian C++ | 2 | 2003-11-04 05:49 |
| How to disable confirmation dialog when making connection?? | kensiu_fp | Mobile Java General | 1 | 2005-09-15 21:09 |
