Namespaces
Variants
Actions
Revision as of 10:41, 20 July 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Change softkeys dynamically (either right or left or both)

Jump to: navigation, search
Article Metadata

Article
Created: rathodavinash (19 May 2007)
Last edited: hamishwillee (20 Jul 2012)

The article shows how Softkeys (not CBA) can be changed dynamically. Either left or right or both can be changed.

Changing right softkey

Cba()->RemoveCommandFromStack(2, EBack);
Cba()->AddCommandToStackL(2,ECancel,_L("Cancel"));
Cba()->DrawDeferred();

So instead of handling EBack in HandleCommandL ECancel will be handled.

Similarly the left softkey can be changed by

Cba()->RemoveCommandFromStack(0, ESave);
Cba()->AddCommandToStackL(0,EOk,_L("Ok"));
Cba()->DrawDeferred();

Just remember

  • 0 - Left softkey
  • 2 - Right softkey
  • Header File - #include <eikbtgpc.h>
  • Link against - eikcoctl.lib


And you can also try this code for changing softkeys

Cba()->SetCommandL(0, EAknSoftkeyOk, _L("Ok"));
Cba()->DrawDeferred();
114 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved