Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hi,
I have created a root container and a text widget i have added to that container.
Now i want to add softkey to that container.

How can i do that?
If anybody knows the solution please help me by giving sample code.

Thanks in advance.

BR,
Shahid

IWidget *piwSoftKey;
IWidget *piwSoft1, *piwSoft2;
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_SoftkeyWidget, (void**)&pMe->piwSoftKey);
IWidget_GetSoftkey(pMe->piwSoftKey, PROP_SOFTKEY1, &piwSoft1);
IWidget_GetSoftkey(pMe->piwSoftKey, PROP_SOFTKEY2, &piwSoft2);
IWIDGET_SetText(piwSoft1, L"Test", 0);
IWIDGET_SetText(piwSoft2, L"Back", 0);
IWidget_SetBGColor(pMe->piwSoftKey, MAKE_RGBA(198,198,198,255));
IWidget_SetFGColor(pMe->piwSoftKey, MAKE_RGBA(255,0,0,255));
IWidget_GetPreferredExtent(pMe->piwSoftKey, &pWExtent);
pWExtent.width = pMe->deviceInfo.cxScreen;
pWExtent.height = 15;
IWidget_SetExtent(pMe->piwSoftKey,&pWExtent);
// insert widget into root container
ppos.bVisible = TRUE;
ppos.x = 0;
ppos.y = pMe->deviceInfo.cyScreen - pWExtent.height;
IRootContainer_Insert(pMe->picRootText, pMe->piwSoftKey, WIDGET_ZNORMAL, &ppos);
RELEASEIF(piwSoft1); RELEASEIF(piwSoft2);
Event handling isn't part of this code snippet.

IWidget *piwSoftKey;
IWidget *piwSoft1, *piwSoft2;
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_SoftkeyWidget, (void**)&pMe->piwSoftKey);
IWidget_GetSoftkey(pMe->piwSoftKey, PROP_SOFTKEY1, &piwSoft1);
IWidget_GetSoftkey(pMe->piwSoftKey, PROP_SOFTKEY2, &piwSoft2);
IWIDGET_SetText(piwSoft1, L"Test", 0);
IWIDGET_SetText(piwSoft2, L"Back", 0);
IWidget_SetBGColor(pMe->piwSoftKey, MAKE_RGBA(198,198,198,255));
IWidget_SetFGColor(pMe->piwSoftKey, MAKE_RGBA(255,0,0,255));
IWidget_GetPreferredExtent(pMe->piwSoftKey, &pWExtent);
pWExtent.width = pMe->deviceInfo.cxScreen;
pWExtent.height = 15;
IWidget_SetExtent(pMe->piwSoftKey,&pWExtent);
// insert widget into root container
ppos.bVisible = TRUE;
ppos.x = 0;
ppos.y = pMe->deviceInfo.cyScreen - pWExtent.height;
IRootContainer_Insert(pMe->picRootText, pMe->piwSoftKey, WIDGET_ZNORMAL, &ppos);
RELEASEIF(piwSoft1); RELEASEIF(piwSoft2);
Event handling isn't part of this code snippet.

Hi Atul,
Thanks a lot it is working perfectly.
BR,
Shahid

Hi Atul,
Thanks a lot it is working perfectly.
BR,
Shahid

Hi,
Now i am facing another problem.
I have an application having one root container and a soft key widget with two soft key. Left soft key and right soft key.
Now i want that when i click to the right soft key then the application will exit.
How can i do that?
Is there anyone please help me?
BR,
Shahid

Hi,
Now i am facing another problem.
I have an application having one root container and a soft key widget with two soft key. Left soft key and right soft key.
Now i want that when i click to the right soft key then the application will exit.
How can i do that?
Is there anyone please help me?
BR,
Shahid

It is very important to note that the softkey widget only creates the softkeys. It does not handle EVT_KEY events.
Handle AVK_SOFT1/AVK_SOFT2 keys EVT_KEY event. For closing the app, call ISHELL_CloseApplet on AVK_SOFT2. Make sure to release all resources before closing app.

It is very important to note that the softkey widget only creates the softkeys. It does not handle EVT_KEY events.
Handle AVK_SOFT1/AVK_SOFT2 keys EVT_KEY event. For closing the app, call ISHELL_CloseApplet on AVK_SOFT2. Make sure to release all resources before closing app.

Hi Atul,
I have got the AVK_SOFT2 click event. I can show a message by clicking the soft key.
But using ISHELL_CloseApplet i am unable to exit the application.
Please give me the sample code to exit the application.
Here in my application there are a display canvas and a root container and on the container a text widget and the soft key widget.
so please help me if any one knows the solution.
BR,
Shahid

Hi Atul,
I have got the AVK_SOFT2 click event. I can show a message by clicking the soft key.
But using ISHELL_CloseApplet i am unable to exit the application.
Please give me the sample code to exit the application.
Here in my application there are a display canvas and a root container and on the container a text widget and the soft key widget.
so please help me if any one knows the solution.
BR,
Shahid

Please try to debug the code.
if(wParam == AVK_SOFT2)
{
ISHELL_CloseApplet(pMe->piShell, FALSE);
return TRUE;

Please try to debug the code.
if(wParam == AVK_SOFT2)
{
ISHELL_CloseApplet(pMe->piShell, FALSE);
return TRUE;

Hi Atul,
Thanks for your reply.
The code is working well.
BR,
Shahid

Hi Atul,
Thanks for your reply.
The code is working well.
BR,
Shahid