This page was last modified 09:16, 24 August 2007.
TSS000033 - Defining customized buttons for queries
From Forum Nokia Wiki
Subject:
| Defining customized buttons for queries
| TSS000033
|
| Platform(s):
| Device(s), SW version(s):
|
S60 1st Edition S60 2nd Edition
| N/A
|
Category:
| Symbian C++
|
Subcategory:
| General
|
Description:
| Customized buttons can be defined in resource files. For example: RESOURCE CBA r_my_softkey { buttons = { CBA_BUTTON { id = EAknSoftkeyMaybe; txt = "Maybe"; // Texts can be defined in .loc file(s) // to support language localization }, CBA_BUTTON { id = EAknSoftkeyWhy; txt = "Why?"; } }; } Customized softkeys are not translated to the device’s current language automatically by the framework, but they can be used instead of the built-in buttons anywhere. In case of a Query dialog: RESOURCE DIALOG r_myconfirmation_query { flags = EGeneralQueryFlags; buttons = r_my_softkey; // note that own softkey is // used as lowercase items = { DLG_LINE { type = EAknCtQuery; id = EGeneralQuery; control = AVKON_CONFIRMATION_QUERY; }, ... } The Query dialog behaves like any other dialogs and handles the softkeys with the OkToExitL() method: // class CMyAknQueryDialog: public CAknQueryDialog, ... #include <eikenv.h> TBool CMyAknQueryDialog::OkToExitL(TInt aButtonId) { if (aButtonId == EAknSoftkeyMaybe) // Handle "Maybe" key press else if (aButtonId == EAknSoftkeyWhy) // Handle "Why" key press return ETrue; } Code for launching the query dialog remains the same.
|
Creation date:
| May 5, 2003
|
Last modified:
|
|