Categories: Symbian C++ | How To | UI | Code Examples
This page was last modified 10:43, 9 April 2008.
Changing softkeys dynamically and disabling them in S60
From Forum Nokia Wiki
Softkeys can be changed dynamically in the following way:
Define a new CBA resource (or resources) in the .rss file:
RESOURCE CBA r_custom_cba1
{
buttons =
{
CBA_BUTTON { id = ECba1Button1; txt = "Button1"; },
CBA_BUTTON { id = ECba1Button2; txt = "Button2"; }
};
}
Add definitions for new command IDs to the .hrh file:
enum TMyMenuCmdIDs
{
ECba1Button1,
ECba1Button2
};
And call SetCommandSetL() from the code:
#include <eikbtgpc.h> CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); cba->SetCommandSetL(R_CUSTOM_CBA1); cba->DrawNow();
See also predefined resources in avkon.rsg. For example, to change CBA buttons to Options/Cancel:
cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_CANCEL);
To disable softkeys, use the predefined resource R_AVKON_SOFTKEYS_EMPTY.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do i specify a default value for a number editor? | advocatee | Symbian User Interface | 5 | 2007-05-11 08:26 |
| Changing Application Title and Icon on Top of the Phone Screen | srigans1 | Symbian User Interface | 2 | 2006-08-08 03:59 |
| Adding Views Dynamically | sinhashivam | General Symbian C++ | 2 | 2006-04-13 10:14 |
| buttons? | kurtrips | General Symbian C++ | 1 | 2004-07-28 14:49 |
| Dynamically change image color, is it possibile? | Cinghius | Mobile Java Media (Graphics & Sounds) | 3 | 2004-06-16 13:07 |
