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

Developer

Forums

Forums:

Hi all,

 

i am unable to display the menu items using list container, here is the snippet, please help me..

IDecorator *pList = NULL;

IWidget *pIMenuWidget=NULL;

IWidget        *pStatic;

WidgetPos dwpos;

    WidgetExtent we;

ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_MenuModel, (void **)&pMe->piMenuModel);

ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_ListWidget, (void **)&pStatic);

bErr = ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_ListWidget, (void **)&pList);

    bErr = IDecorator_QueryInterface(pList, AEEIID_IWidget,(void **)&pIMenuWidget );

(void)IMenuModel_SetItemFlags(pMe->piMenuModel, MENUITEM_ALL, MMF_ENABLED | MMF_SEPARATOR, TRUE);

   IMenuModel_Add(pMe->piMenuModel, (void *)L"Item1", 0, MMF_ENABLED );

    (void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item2", 1, MMF_ENABLED);

    (void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item3", 2, MMF_ENABLED);

    (void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item4", 3, MMF_ENABLED);

IWidget_SetItemHeight(pIMenuWidget,30);

    IWIDGET_SetSelectedFGColor( pStatic, MAKE_RGBA(255, 0, 0, 255) );

    IWIDGET_SetSelectedBGColor( pStatic, RGB_BLACK );

    IWIDGET_SetSelectedBGColor( pStatic, MAKE_RGB(0,0,255));

    IWIDGET_SetFontClass(pStatic, AEECLSID_FONTSYSBOLD);

    IWIDGET_SetBorderRadius(pStatic, 7);

    IWIDGET_SetBorderStyle(pStatic, BORDERSTYLE_BEVELED);

    IWIDGET_SetFlags(pStatic, SWF_WRAPTEXT | SWF_NOSHORTENTEXT | IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);

    //scrolling of long menu items

    IWidget_SetProperty(pStatic, PROP_ANIMATE, 1);

    IWIDGET_SetGradientStyle(pStatic,1);

IWidget_SetModel(pIMenuWidget, IMenuModel_to_IModel(pMe->piMenuModel));

IDecorator_SetWidget(pList, pStatic);

we.height = pMe->m_deviceInfo.cyScreen-10;

    we.width = pMe->m_deviceInfo.cxScreen;

    IWidget_SetExtent(pIMenuWidget,&we);

dwpos.x = 0;

    dwpos.y = 25;

    dwpos.bVisible = TRUE;

    j = IRootContainer_Insert(pMe->m_pRootCont, pIMenuWidget, WIDGET_ZNORMAL,&dwpos);

    IWidget_MoveFocus(pMe->m_pRootContWgt,pIMenuWidget);

 

I think by mistake you created instance of list widget twice and forgot to create static widget (which in your case is the list item widget).
ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_ListWidget, (void **)&pStatic); should be ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_StaticWidget, (void **)&pStatic);

I think by mistake you created instance of list widget twice and forgot to create static widget (which in your case is the list item widget).
ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_ListWidget, (void **)&pStatic); should be ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_StaticWidget, (void **)&pStatic);

Thanks a lot, by mistake i did that,, once again thanks .
 
-Hanmanth

Thanks a lot, by mistake i did that,, once again thanks .
 
-Hanmanth

hey i used above code n trying to build a menu on Root container. Its displaying menu bar n 4 items one bellow other . But i want to make it as touch support so that if i click on menu it should give items.. how it can be done???
Please help
 
RAj

hey i used above code n trying to build a menu on Root container. Its displaying menu bar n 4 items one bellow other . But i want to make it as touch support so that if i click on menu it should give items.. how it can be done???
Please help
 
RAj

Add touch support to your root container using IWidget_EnableTouch.
Pass all the unhandled events to Root container using IWidget_HandleEvent.
Add view model listener to list widget and do the required action on select event:
IWidget_GetViewModel(pMe->piwlist, &piViewModel);
LISTENER_Init(&pMe->mlList, listwidgetapp_listviewlistener, (void*)pMe);
(void)IModel_AddListener(piViewModel, &pMe->mlList);

void listwidgetapp_listviewlistener(listwidgetapp* pme, ModelEvent *pEvt)
{
if (pEvt->evCode == EVT_MDL_FOCUS_SELECT) {
DBGPRINTF("selected item to %d", pEvt->dwParam);
switch(pEvt->dwParam)
{
case 0://All widget usage
break;
case 1://dummy list
case 2:
case 3:
break;
}
}

Add touch support to your root container using IWidget_EnableTouch.
Pass all the unhandled events to Root container using IWidget_HandleEvent.
Add view model listener to list widget and do the required action on select event:
IWidget_GetViewModel(pMe->piwlist, &piViewModel);
LISTENER_Init(&pMe->mlList, listwidgetapp_listviewlistener, (void*)pMe);
(void)IModel_AddListener(piViewModel, &pMe->mlList);

void listwidgetapp_listviewlistener(listwidgetapp* pme, ModelEvent *pEvt)
{
if (pEvt->evCode == EVT_MDL_FOCUS_SELECT) {
DBGPRINTF("selected item to %d", pEvt->dwParam);
switch(pEvt->dwParam)
{
case 0://All widget usage
break;
case 1://dummy list
case 2:
case 3:
break;
}
}

Thanks for the reply but ,
what is piwlist?mlList ?
in &pMe->mlList??&pMe->mlList???
 
 
Thanks
RAJ

Thanks for the reply but ,
what is piwlist?mlList ?
in &pMe->mlList??&pMe->mlList???
 
 
Thanks
RAJ

IWidget *piwlist; // list widget...same pIMenuWidget in code above.
ModelListener mlList; //view model listener
These were part of my applet structure.

IWidget *piwlist; // list widget...same pIMenuWidget in code above.
ModelListener mlList; //view model listener
These were part of my applet structure.

Thanks  ADHUDASE,
there are no errors at present but how to send  unhandled events to Root container using IWidget_HandleEvent.??? I really dnt have any idea thats why i am asking.. i'll attach ma file if u have time to check it??
 
Thanks
Raj

Thanks  ADHUDASE,
there are no errors at present but how to send  unhandled events to Root container using IWidget_HandleEvent.??? I really dnt have any idea thats why i am asking.. i'll attach ma file if u have time to check it??
 
Thanks
Raj

At the end of main handleevent function, there is "return FALSE"...right? That means, we pass all the unhandled events to Brew. In this case, replace "return FALSE" with
if(pMe->piwRootMenu)//root container widget        return SUCCESS == IWidget_HandleEvent(pMe->piwRootMenu, eCode, wParam, dwParam);else            return FALSE;
 
Here, we are passing all the unhandled events root container widget if it exists.
 
Please refer sample widgets apps posted on developer site (resources tab). I guess there is one for list widget as well.

At the end of main handleevent function, there is "return FALSE"...right? That means, we pass all the unhandled events to Brew. In this case, replace "return FALSE" with
if(pMe->piwRootMenu)//root container widget        return SUCCESS == IWidget_HandleEvent(pMe->piwRootMenu, eCode, wParam, dwParam);else            return FALSE;
 
Here, we are passing all the unhandled events root container widget if it exists.
 
Please refer sample widgets apps posted on developer site (resources tab). I guess there is one for list widget as well.

Hey thanks ADHUDASE,
         That was really help ful now i have added listner n now i am able to get
EVT_MDL_FOCUS_CHANGE,
EVT_MDL_FOCUS_SELECT
events but how to create dynamic MENU ? so that if i click on menu it should give items but in above program its already displaying menu items and menu bar itself is moving if i select any item????
 
Thanks
RAJ

Hey thanks ADHUDASE,
         That was really help ful now i have added listner n now i am able to get
EVT_MDL_FOCUS_CHANGE,
EVT_MDL_FOCUS_SELECT
events but how to create dynamic MENU ? so that if i click on menu it should give items but in above program its already displaying menu items and menu bar itself is moving if i select any item????
 
Thanks
RAJ

Sorry, I couldn't get you. Do you mean displaying something (different screen) on menu item click? If yes, you can add that code in listwidgetapp_listviewlistener above for each item.

Sorry, I couldn't get you. Do you mean displaying something (different screen) on menu item click? If yes, you can add that code in listwidgetapp_listviewlistener above for each item.

No i maen Menu should be like if we click on menu bar like FILE den only it should display sub menus n in dat if we click some item den some operation  shoulb be performed but in ma menu bar items are already available if i click on some item menu bar itself wil move...
 

No i maen Menu should be like if we click on menu bar like FILE den only it should display sub menus n in dat if we click some item den some operation  shoulb be performed but in ma menu bar items are already available if i click on some item menu bar itself wil move...
 

Sorry, I couldn't get you again. Please break the sentences so that it will be easy to understand. Are you looking for multi-level menu (menu->sub-menu->sub-submenu)? Or something like button->click to open menu->select item to do some operation? It iwll be great if you can share some example?

Sorry, I couldn't get you again. Please break the sentences so that it will be easy to understand. Are you looking for multi-level menu (menu->sub-menu->sub-submenu)? Or something like button->click to open menu->select item to do some operation? It iwll be great if you can share some example?

actually i am building simple menu with main items like FILE EDIT HELP  n if i press menu  it should give sub menu
EX: if press on FILE it sholud open sub menu with list like
SAVE
SAVE AS
EXIT
      and if i press on these items respective operations shold be performed.
Thanks
RAJ

actually i am building simple menu with main items like FILE EDIT HELP  n if i press menu  it should give sub menu
EX: if press on FILE it sholud open sub menu with list like
SAVE
SAVE AS
EXIT
      and if i press on these items respective operations shold be performed.
Thanks
RAJ

Thanks for the info.
1. Use Pick widget for FILE EDIT HELP, it will layout items in horizontal direction. Usage is same as above; just need to use classid of pick widget instead of list widget. See list widget API ref.
2. To display submenu, add submenu code in view listener (code as above) of pick widget. E.g. if you want to display submenu 1 on lciking first item, then add code in case 0 in view listener code above. For submenu (save, save as etc..) use list widget as above. Set position properly so that it comes just below main menu like FILE.
3. To do operations on clicking sub-menu items, code accordingly in view listener of that submenu.
 
hope this helps.

Thanks for the info.
1. Use Pick widget for FILE EDIT HELP, it will layout items in horizontal direction. Usage is same as above; just need to use classid of pick widget instead of list widget. See list widget API ref.
2. To display submenu, add submenu code in view listener (code as above) of pick widget. E.g. if you want to display submenu 1 on lciking first item, then add code in case 0 in view listener code above. For submenu (save, save as etc..) use list widget as above. Set position properly so that it comes just below main menu like FILE.
3. To do operations on clicking sub-menu items, code accordingly in view listener of that submenu.
 
hope this helps.

Thank u very much ADHUDASE,
    I am able to get MENU bar and sub menu bar and if i press menu item its giving sub menus its working fine.
But it works if i dnt use

 
case  EVT_POINTER_DOWN :
{
   \\Something
}
event but if i use this event then menu is not getting selected.??? 

Thank u very much ADHUDASE,
    I am able to get MENU bar and sub menu bar and if i press menu item its giving sub menus its working fine.
But it works if i dnt use

 
case  EVT_POINTER_DOWN :
{
   \\Something
}
event but if i use this event then menu is not getting selected.??? 

Thank u very much ADHUDASE,
    I am able to get MENU bar and sub menu bar and if i press menu item its giving sub menus its working fine.
But it works if i dnt use

 
case  EVT_POINTER_DOWN :
{
   \\Something
}
event but if i use this event then menu is not getting selected.??? 

Thank u very much ADHUDASE,
    I am able to get MENU bar and sub menu bar and if i press menu item its giving sub menus its working fine.
But it works if i dnt use

 
case  EVT_POINTER_DOWN :
{
   \\Something
}
event but if i use this event then menu is not getting selected.??? 

I think you returned TRUE from EVT_POINTER_DOWN...right? that means pointer events aren't getting passed to root container. If you want to use EVT_POINTER_DOWN for any other purpose then break from the loop instead of return. That way, events will get passed to your root container.

I think you returned TRUE from EVT_POINTER_DOWN...right? that means pointer events aren't getting passed to root container. If you want to use EVT_POINTER_DOWN for any other purpose then break from the loop instead of return. That way, events will get passed to your root container.

you are a saviour ADHUDASE,
   ya you wer rite pointer events arent getting passed... but as i have pasted in some other forum i need to use IDipsplay_ClearScreen() to clear screen that time even menu will erase ???  how to handle this????
Thank u
RAJ
 

you are a saviour ADHUDASE,
   ya you wer rite pointer events arent getting passed... but as i have pasted in some other forum i need to use IDipsplay_ClearScreen() to clear screen that time even menu will erase ???  how to handle this????
Thank u
RAJ
 

Hi,
how to use AEECLSID_PickWidget for the above code, i.e is it possible to use for menumodel, if yes please provide any snippet
 
-Hanu

Hi,
how to use AEECLSID_PickWidget for the above code, i.e is it possible to use for menumodel, if yes please provide any snippet
 
-Hanu

Raj, I think you shouldn't use clearscreen as it clears the entire display buffer. Better try to use widget functions to draw the screen (_Invalidate methods).
 
Hanu, your above code should work by changing few things as below.
- Use AEECLSID_PickWidget instead of AEECLSID_ListWidget (needs to include AEEPickWidget.bid)
- As pick widget lays out items in horz direction, need to set width of the item instead of height. Set extent of list item accordingly. Use IWidget_SetItemWidth.

Raj, I think you shouldn't use clearscreen as it clears the entire display buffer. Better try to use widget functions to draw the screen (_Invalidate methods).
 
Hanu, your above code should work by changing few things as below.
- Use AEECLSID_PickWidget instead of AEECLSID_ListWidget (needs to include AEEPickWidget.bid)
- As pick widget lays out items in horz direction, need to set width of the item instead of height. Set extent of list item accordingly. Use IWidget_SetItemWidth.

Thanks  ADHUDASE,,
             If i press on submenu and select some item that submenu should disappear after selection??? how to make it invisible after selection???
 
 
Thanks
RAJ

Thanks  ADHUDASE,,
             If i press on submenu and select some item that submenu should disappear after selection??? how to make it invisible after selection???
 
 
Thanks
RAJ

Thanks  ADHUDASE,,
             If i press on submenu and select some item that submenu should disappear after selection??? how to make it invisible after selection???
 
 
Thanks
RAJ

Thanks  ADHUDASE,,
             If i press on submenu and select some item that submenu should disappear after selection??? how to make it invisible after selection???
 
 
Thanks
RAJ

You can control visiblity using container's _SetPos() or _SetProp() APIs or IWidget_SetChildVisibility().

You can control visiblity using container's _SetPos() or _SetProp() APIs or IWidget_SetChildVisibility().

how to do menu-sub menu because for the initial code i made some change and its displaying all the menu items, how to acheive sub menu, please provide any snippet, it will helpful. here is the snippet
 
i = IMenuModel_Add(pMe->piMenuModel, (void *)L"Item1", 0, MMF_ENABLED|MMF_SEPARATOR );
(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item2", 1, MMF_ENABLED | MMF_SEPARATOR|MMF_SUBMENU);
(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Grid wdgt", 2, MMF_ENABLED |MMF_SEPARATOR|MMF_SUBMENU);
(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"popup", 3, MMF_ENABLED |MMF_SEPARATOR|MMF_SUBMENU);
 

how to do menu-sub menu because for the initial code i made some change and its displaying all the menu items, how to acheive sub menu, please provide any snippet, it will helpful. here is the snippet
 
i = IMenuModel_Add(pMe->piMenuModel, (void *)L"Item1", 0, MMF_ENABLED|MMF_SEPARATOR );
(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item2", 1, MMF_ENABLED | MMF_SEPARATOR|MMF_SUBMENU);
(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Grid wdgt", 2, MMF_ENABLED |MMF_SEPARATOR|MMF_SUBMENU);
(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"popup", 3, MMF_ENABLED |MMF_SEPARATOR|MMF_SUBMENU);
 

Hi hanamant,
    as ADHUDASE told ,
            To display submenu, add submenu code in view listener (code as above) of pick widget. E.g. if you want to display submenu 1 on lciking first item, then add code in case 0 in view listener code above. For submenu (save, save as etc..) use list widget as above. Set position properly so that it comes just below main menu like FILE.
 
 
void listwidgetapp_listviewlistener(menu* pMe, ModelEvent *pEvt)

{
// DBGPRINTF("selected item to %d", pEvt->dwParam);
if(pEvt->evCode == EVT_MDL_FOCUS_CHANGE)
{
DBGPRINTF("selected item to %d", pEvt->dwParam);

}
else if (pEvt->evCode == EVT_MDL_FOCUS_SELECT)
{

DBGPRINTF("IN FOCUS SELECT %d", pEvt->dwParam);

switch(pEvt->dwParam)

{

case 0:
call_submenu(pMe);

break;

case 1:
call_submenu2(pMe);
break; 
}
 
in  call_submenu() function create one more list widget as in your code and set positions so that submenu comes exactly bellow main menu item....
 

Hi hanamant,
    as ADHUDASE told ,
            To display submenu, add submenu code in view listener (code as above) of pick widget. E.g. if you want to display submenu 1 on lciking first item, then add code in case 0 in view listener code above. For submenu (save, save as etc..) use list widget as above. Set position properly so that it comes just below main menu like FILE.
 
 
void listwidgetapp_listviewlistener(menu* pMe, ModelEvent *pEvt)

{
// DBGPRINTF("selected item to %d", pEvt->dwParam);
if(pEvt->evCode == EVT_MDL_FOCUS_CHANGE)
{
DBGPRINTF("selected item to %d", pEvt->dwParam);

}
else if (pEvt->evCode == EVT_MDL_FOCUS_SELECT)
{

DBGPRINTF("IN FOCUS SELECT %d", pEvt->dwParam);

switch(pEvt->dwParam)

{

case 0:
call_submenu(pMe);

break;

case 1:
call_submenu2(pMe);
break; 
}
 
in  call_submenu() function create one more list widget as in your code and set positions so that submenu comes exactly bellow main menu item....
 

Thanks basavaraj, but what is the use of MMF_SEPARATOR and MMF_SUBMENU in IMenuModel. i thought if we use those flags in menu list it will come as sub-menu. if i'm wrong correct me, and provide any snippet which uses those flags..
 

Thanks basavaraj, but what is the use of MMF_SEPARATOR and MMF_SUBMENU in IMenuModel. i thought if we use those flags in menu list it will come as sub-menu. if i'm wrong correct me, and provide any snippet which uses those flags..
 

These flags are just to filter the menu items - like getting only those items which are submenus or enabled or has seperator.
MMF_SEPARATOR: if ON, draws menu item seperator like line
MMF_SUBMENU: if ON, menu item is a submenu. Adding this flag won't create submenu automatically.

These flags are just to filter the menu items - like getting only those items which are submenus or enabled or has seperator.
MMF_SEPARATOR: if ON, draws menu item seperator like line
MMF_SUBMENU: if ON, menu item is a submenu. Adding this flag won't create submenu automatically.

thanks for the info

thanks for the info

Hi All,
   I am new to BMP side need your help in some points regarding implementation of menu, I tried to build menu using XYcontainer with same code everything goes fine during debug until I try to display it usin IDISPLAY_Update, I am always getting a blank screen during update operation
IDecorator *pList = NULL;

IWidget *pIMenuWidget=NULL,*picontainerwidget;

IWidget *pStatic;

WidgetPos dwpos;

WidgetExtent we;
int bErr;
bErr = ISHELL_CreateInstance(pMe->piShell, AEECLSID_XYContainer, (void **)&pMe->pContainer);
if (SUCCESS != bErr) {}

//IXYContainer_QueryInterface(pMe->pContainer,AEEIID_IWidget,(void**)&pMe->piWindow);

ISHELL_CreateInstance(pMe->piShell, AEECLSID_MenuModel, (void **)&pMe->piMenuModel);

ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget, (void **)&pStatic);

bErr = ISHELL_CreateInstance(pMe->piShell, AEECLSID_ListWidget, (void **)&pList);

bErr = IDecorator_QueryInterface(pList, AEEIID_IWidget,(void **)&pIMenuWidget );

(void)IMenuModel_SetItemFlags(pMe->piMenuModel, MENUITEM_ALL, MMF_ENABLED | MMF_SEPARATOR, TRUE);

IMenuModel_Add(pMe->piMenuModel, (void *)L"Item1", 0, MMF_ENABLED );

(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item2", 1, MMF_ENABLED);

(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item3", 2, MMF_ENABLED);

(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item4", 3, MMF_ENABLED);

IWidget_SetItemHeight(pIMenuWidget,30);

IWidget_SetSelectedFGColor( pStatic, MAKE_RGBA(255, 0, 0, 255) );

IWidget_SetSelectedBGColor( pStatic, RGB_BLACK );

IWidget_SetSelectedBGColor( pStatic, MAKE_RGB(0,0,255));

IWidget_SetFontClass(pStatic, AEECLSID_FONTSYSBOLD);

IWidget_SetBorderRadius(pStatic, 7);

IWidget_SetBorderStyle(pStatic, BORDERSTYLE_BEVELED);

IWidget_SetFlags(pStatic, SWF_WRAPTEXT | SWF_NOSHORTENTEXT | IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);

//scrolling of long menu items

IWidget_SetProperty(pStatic, PROP_ANIMATE, 1);

IWidget_SetGradientStyle(pStatic,1);

IWidget_SetModel(pIMenuWidget, IMenuModel_to_IModel(pMe->piMenuModel));

IDecorator_SetWidget(pList, pStatic);

we.height = pMe->deviceInfo.cyScreen-10;

we.width = pMe->deviceInfo.cxScreen;

IWidget_SetExtent(pIMenuWidget,&we);

dwpos.x = 0;

dwpos.y = 25;

dwpos.bVisible = TRUE;

IXYContainer_Insert(pMe->pContainer, pIMenuWidget, WIDGET_ZNORMAL,&dwpos);
IXYContainer_QueryInterface(pMe->pContainer, AEEIID_WIDGET, (void**)&picontainerwidget);
IWidget_SetBGColor(picontainerwidget,MAKE_RGB(0,255,0) );
//IWidget_MoveFocus(pMe->pContainer,pIMenuWidget);
IDisplay_Update (pMe->piDisplay);
Am I doing anything wrong here ??
 

Hi All,
   I am new to BMP side need your help in some points regarding implementation of menu, I tried to build menu using XYcontainer with same code everything goes fine during debug until I try to display it usin IDISPLAY_Update, I am always getting a blank screen during update operation
IDecorator *pList = NULL;

IWidget *pIMenuWidget=NULL,*picontainerwidget;

IWidget *pStatic;

WidgetPos dwpos;

WidgetExtent we;
int bErr;
bErr = ISHELL_CreateInstance(pMe->piShell, AEECLSID_XYContainer, (void **)&pMe->pContainer);
if (SUCCESS != bErr) {}

//IXYContainer_QueryInterface(pMe->pContainer,AEEIID_IWidget,(void**)&pMe->piWindow);

ISHELL_CreateInstance(pMe->piShell, AEECLSID_MenuModel, (void **)&pMe->piMenuModel);

ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget, (void **)&pStatic);

bErr = ISHELL_CreateInstance(pMe->piShell, AEECLSID_ListWidget, (void **)&pList);

bErr = IDecorator_QueryInterface(pList, AEEIID_IWidget,(void **)&pIMenuWidget );

(void)IMenuModel_SetItemFlags(pMe->piMenuModel, MENUITEM_ALL, MMF_ENABLED | MMF_SEPARATOR, TRUE);

IMenuModel_Add(pMe->piMenuModel, (void *)L"Item1", 0, MMF_ENABLED );

(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item2", 1, MMF_ENABLED);

(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item3", 2, MMF_ENABLED);

(void)IMenuModel_Add(pMe->piMenuModel, (void *)L"Item4", 3, MMF_ENABLED);

IWidget_SetItemHeight(pIMenuWidget,30);

IWidget_SetSelectedFGColor( pStatic, MAKE_RGBA(255, 0, 0, 255) );

IWidget_SetSelectedBGColor( pStatic, RGB_BLACK );

IWidget_SetSelectedBGColor( pStatic, MAKE_RGB(0,0,255));

IWidget_SetFontClass(pStatic, AEECLSID_FONTSYSBOLD);

IWidget_SetBorderRadius(pStatic, 7);

IWidget_SetBorderStyle(pStatic, BORDERSTYLE_BEVELED);

IWidget_SetFlags(pStatic, SWF_WRAPTEXT | SWF_NOSHORTENTEXT | IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);

//scrolling of long menu items

IWidget_SetProperty(pStatic, PROP_ANIMATE, 1);

IWidget_SetGradientStyle(pStatic,1);

IWidget_SetModel(pIMenuWidget, IMenuModel_to_IModel(pMe->piMenuModel));

IDecorator_SetWidget(pList, pStatic);

we.height = pMe->deviceInfo.cyScreen-10;

we.width = pMe->deviceInfo.cxScreen;

IWidget_SetExtent(pIMenuWidget,&we);

dwpos.x = 0;

dwpos.y = 25;

dwpos.bVisible = TRUE;

IXYContainer_Insert(pMe->pContainer, pIMenuWidget, WIDGET_ZNORMAL,&dwpos);
IXYContainer_QueryInterface(pMe->pContainer, AEEIID_WIDGET, (void**)&picontainerwidget);
IWidget_SetBGColor(picontainerwidget,MAKE_RGB(0,255,0) );
//IWidget_MoveFocus(pMe->pContainer,pIMenuWidget);
IDisplay_Update (pMe->piDisplay);
Am I doing anything wrong here ??
 

Please see widgets technology guide available on Brew MP site to get an idea about using widgets.
 
IDISPLAY_Update is not required to draw the widgets on screen. IDISPLAY_Update is for drawing on screen using IDisplay, IGraphics and other legacy controls.
 
To display any widget on screen:
1. Create root container (it is top level container)
2. Create display canvas, attach display to it
3. Set displaycanvas to root container
4. Set properties to root container if any
5. Create widgets and insert them into root container.

Please see widgets technology guide available on Brew MP site to get an idea about using widgets.
 
IDISPLAY_Update is not required to draw the widgets on screen. IDISPLAY_Update is for drawing on screen using IDisplay, IGraphics and other legacy controls.
 
To display any widget on screen:
1. Create root container (it is top level container)
2. Create display canvas, attach display to it
3. Set displaycanvas to root container
4. Set properties to root container if any
5. Create widgets and insert them into root container.

Thanks Adhudase Will try to follow that way.

Thanks Adhudase Will try to follow that way.