|
|
User login
Feeds |
How to change text of CBA buttons
|
|||||
| Thu, 2006-02-16 12:12 | |
Forum posts: 732
{
buttons =
{
CBA_BUTTON { id=EAknSoftkeyOptions; txt = "Options"; },
CBA_BUTTON { id=EYourAppCmdOpenApp; txt = "Open"; }
};
}
RESOURCE CBA r_yourapp_softkeys_options_stop
{
buttons =
{
CBA_BUTTON { id=EAknSoftkeyOptions; txt = "Options"; },
CBA_BUTTON { id=EYourAppCmdStopApp; txt = "Stop"; }
};
}
In the HRH file:
  {
// ...
id=EYourAppCmdOpenApp,
id=EYourAppCmdStopApp,
// ...
};
In your application's AppUi class:
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
cba->SetCommandSetL( aResourceId );
}
Now you can call:
SetCommandSetL( R_YOURAPP_SOFTKEYS_OPTIONS_OPEN );
OR
SetCommandSetL( R_YOURAPP_SOFTKEYS_OPTIONS_STOP );
where ever you want.Â
Forum posts: 13
Ur code works.
Regards,
Meghana
Forum posts: 137
I followed the link
http://wiki.forum.nokia.com/index.ph...n_button_group
and made modification to the code.
Still.. I get panic user 23
MODIFIED CODE
---------------
.rss file
-----------
RESOURCE CBA r_hello_bye
{
buttons ={
CBA_BUTTON {id = EHello;txt = "hello";},
CBA_BUTTON {id = EBye;txt = "Bye"; }
};
}
RESOURCE EIK_APP_INFO
{
menubar = r_menubar;
cba =R_AVKON_SOFTKEYS_OPTIONS_EXIT;
}
APPui.cpp file
----------------
#include
void CTRM_SymbAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
-------------------------
-------------------------
case EGpsMap:
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
if(cba)
{
cba->SetCommandSetL(R_HELLO_BYE);
cba->DrawNow();
}
iAppView->GetGpsInfoL();
}
break;
----------------------------
----------------------------
}}
in mmp file
-------------
eikcoctl.lib avkon.lib
now what to do.......
Forum posts: 137
I followed ur posts. It works now.
I dont know why it was not working earlier.
But, there is still another problem.......
I need to add a menu_bar to the open button in the softkey----- r_yourapp_softkeys_options_open
Regards!
Forum posts: 137
solved using
iEikonEnv->AppUiFactory()->MenuBar()->TryDisplayMenuBarL();
your posts were usefull
Thanks
Forum posts: 137
I guess the error in the previous try to change CBA was because it was defined above
RESOURCE EIK_APP_INFO
{
menubar = r_menubar;
cba =R_AVKON_SOFTKEYS_OPTIONS_EXIT;
}
Still now if I define my code above RESOURCE EIK_APP_INFO, it gives some panic
it works if the code is defined below.
This is just my guess.
This data may be helpfull to someone else
Regards to all!