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

Developer

Forums

Hi All,

I am trying to access the next item in a container dynamically. I am unable to find any API for that .
Could you please tell me any round about way to find it out ?

Thanks
payal

give some more datails( which widget ur adding to the container, what is the previous widegt......)

give some more datails( which widget ur adding to the container, what is the previous widegt......)

Hi ,
I have used prop Container and static & image widget.
I have put one image & one static widget in a widget and that widget is attached with the main form .
Trying to access each of the widget from the main one.
Hope this will give u a picture .
The code follows as:
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
//creating the datecontrol object
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_DATECTL,(void*)&(pMe->datectl));
IDATECTL_SetActive(pMe->datectl, TRUE);
// Create the root form
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_ROOTFORM,(void *) &pMe->pRootForm);
// create the form :
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FORM,(void *) &pMe->pMainForm);
// create the widget :for pCon
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid );
//ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid2 );
// Widget to hold the Container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid1 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid5 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid6 );
// create the widget :for pCon1
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid3 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid4 );
//Create the container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon1);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon2);
//Creating the img object
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_IMAGEWIDGET,(void*)&pMe->pWid2);
//IFORM_SetWidget(pMe->pMainForm, WID_TITLE , pMe->pWid);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY1, sk3);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY2 , sk4);
// Fill up form with data
//IFORM_SetTitle(pMe->pMainForm, sk1);
IFORM_SetText(pMe->pMainForm, FID_TITLE, sk1);
//Date
//set the date
result = IDATECTL_SetDate(pMe->datectl,2000,10,12);
//get the date
result = IDATECTL_GetDateString(pMe->datectl, pMe->pBuffer, nMaxSize*sizeof(AECHAR), &pMe->pnChars, DFMT_DD_MON_YYYY);
//Image Loading in Widget
pMe->pImg = ISHELL_LoadResImage(pMe->a.m_pIShell,EVT_SCREEN_RES_FILE ,IDI_OBJECT_5001);
i = IWIDGET_SetImage(pMe->pWid2, pMe->pImg);
// i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//IPROPCONTAINER_SetProp(pMe->pCon, pMe->pWid, pMe->pWid2, &pProp2);
// Inserting widgets into container
//ICONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL, NULL);
//ICONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL, NULL);
// Inserting widgets into PropContainer- pCon
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL,&pProp);
// Inserting widgets into PropContainer- pCon1
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid3, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid4, WIDGET_ZNORMAL,&pProp);
//set the text in widget pWid--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid, 2);
i = IWIDGET_SetBorderColor(pMe->pWid, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid, pMe->pBuffer,TRUE);
//set the text in widget pWid2--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid2, 2);
i = IWIDGET_SetBorderColor(pMe->pWid2, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid2, MAKE_RGB(255,0,0));
//i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//set the text in widget pWid3--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid3, 2);
i = IWIDGET_SetBorderColor(pMe->pWid3, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid3, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid3, sk3,TRUE);
//set the text in widget pWid4--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid4, 2);
i = IWIDGET_SetBorderColor(pMe->pWid4, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid4, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid4, sk4,TRUE);
// IWIDGET_SetExtent(pMe->pWid, &pWExtent);
//Getting the widget from the container
//i = ICONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET, &pMe->pWid1);
//Getting the widget from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET,&pMe->pWid1);
i = IPROPCONTAINER_QueryInterface(pMe->pCon1, AEEIID_WIDGET,&pMe->pWid5);
//cHANGING THE bg COLOR OF THE WIDGETS
//i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
//i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
//setting the focus
//IWIDGET_SetFocus(pMe->pWid6, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid6, &pbFocus);
// Inserting widgets into PropContainer- pCon2
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid1, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid5, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon1, WIDGET_ZNORMAL,&pProp);
//Getting the widget(final) from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon2, AEEIID_WIDGET,&pMe->pWid6);
// To set widgets as horizontal
IWIDGET_SetProperty(pMe->pWid1, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
IWIDGET_SetProperty(pMe->pWid5, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
i = IFORM_SetProperty(pMe->pMainForm, WID_FORM, (uint32)pMe->pWid6);
//IFORM_SetTitle(pMe->pForm, pTitle);
i = IROOTFORM_PushForm(pMe->pRootForm, pMe->pMainForm);
//i = IROOTFORM_PopForm(pMe->pRootForm);
IDISPLAY_Update(pMe->a.m_pIDisplay);
return(TRUE);
---------------------------------------------------------------------------------
switch (wParam)
{
case AVK_UP:
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid5;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid1, TRUE);
i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
pMe->pTemp=pMe->pWid1;
//FREEOBJ(pMe->pWid1);
//pMe->pWid5=NULL;
return (TRUE);
case AVK_DOWN:
//Get the current widget selected
// point to the next wid
// set the focus of that one .
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid1;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid5, TRUE);
pMe->pTemp=pMe->pWid5;
//FREEOBJ(pMe->pWid5);
//pMe->pWid5=NULL;
/* //i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
//IWIDGET_SetFocus(pMe->pWid5, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid5, &pbFocus);
//IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_GetFocus(pMe->pWid6, &pMe->pWid1);
IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_SetFocus(pMe->pWid5, TRUE); // This line segfault even if pIWidget is not NULL
*/
return (TRUE);
}
return(TRUE);
--------------------------------------------------------------------------
i AM TRYING THIS WAY AS THE MOVE FOCUS IS NOT WORKING SOME HOW.
WAITING FOR YOUR HELP.
Paya.

Hi ,
I have used prop Container and static & image widget.
I have put one image & one static widget in a widget and that widget is attached with the main form .
Trying to access each of the widget from the main one.
Hope this will give u a picture .
The code follows as:
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
//creating the datecontrol object
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_DATECTL,(void*)&(pMe->datectl));
IDATECTL_SetActive(pMe->datectl, TRUE);
// Create the root form
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_ROOTFORM,(void *) &pMe->pRootForm);
// create the form :
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FORM,(void *) &pMe->pMainForm);
// create the widget :for pCon
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid );
//ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid2 );
// Widget to hold the Container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid1 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid5 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid6 );
// create the widget :for pCon1
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid3 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid4 );
//Create the container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon1);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon2);
//Creating the img object
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_IMAGEWIDGET,(void*)&pMe->pWid2);
//IFORM_SetWidget(pMe->pMainForm, WID_TITLE , pMe->pWid);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY1, sk3);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY2 , sk4);
// Fill up form with data
//IFORM_SetTitle(pMe->pMainForm, sk1);
IFORM_SetText(pMe->pMainForm, FID_TITLE, sk1);
//Date
//set the date
result = IDATECTL_SetDate(pMe->datectl,2000,10,12);
//get the date
result = IDATECTL_GetDateString(pMe->datectl, pMe->pBuffer, nMaxSize*sizeof(AECHAR), &pMe->pnChars, DFMT_DD_MON_YYYY);
//Image Loading in Widget
pMe->pImg = ISHELL_LoadResImage(pMe->a.m_pIShell,EVT_SCREEN_RES_FILE ,IDI_OBJECT_5001);
i = IWIDGET_SetImage(pMe->pWid2, pMe->pImg);
// i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//IPROPCONTAINER_SetProp(pMe->pCon, pMe->pWid, pMe->pWid2, &pProp2);
// Inserting widgets into container
//ICONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL, NULL);
//ICONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL, NULL);
// Inserting widgets into PropContainer- pCon
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL,&pProp);
// Inserting widgets into PropContainer- pCon1
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid3, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid4, WIDGET_ZNORMAL,&pProp);
//set the text in widget pWid--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid, 2);
i = IWIDGET_SetBorderColor(pMe->pWid, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid, pMe->pBuffer,TRUE);
//set the text in widget pWid2--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid2, 2);
i = IWIDGET_SetBorderColor(pMe->pWid2, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid2, MAKE_RGB(255,0,0));
//i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//set the text in widget pWid3--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid3, 2);
i = IWIDGET_SetBorderColor(pMe->pWid3, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid3, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid3, sk3,TRUE);
//set the text in widget pWid4--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid4, 2);
i = IWIDGET_SetBorderColor(pMe->pWid4, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid4, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid4, sk4,TRUE);
// IWIDGET_SetExtent(pMe->pWid, &pWExtent);
//Getting the widget from the container
//i = ICONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET, &pMe->pWid1);
//Getting the widget from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET,&pMe->pWid1);
i = IPROPCONTAINER_QueryInterface(pMe->pCon1, AEEIID_WIDGET,&pMe->pWid5);
//cHANGING THE bg COLOR OF THE WIDGETS
//i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
//i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
//setting the focus
//IWIDGET_SetFocus(pMe->pWid6, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid6, &pbFocus);
// Inserting widgets into PropContainer- pCon2
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid1, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid5, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon1, WIDGET_ZNORMAL,&pProp);
//Getting the widget(final) from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon2, AEEIID_WIDGET,&pMe->pWid6);
// To set widgets as horizontal
IWIDGET_SetProperty(pMe->pWid1, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
IWIDGET_SetProperty(pMe->pWid5, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
i = IFORM_SetProperty(pMe->pMainForm, WID_FORM, (uint32)pMe->pWid6);
//IFORM_SetTitle(pMe->pForm, pTitle);
i = IROOTFORM_PushForm(pMe->pRootForm, pMe->pMainForm);
//i = IROOTFORM_PopForm(pMe->pRootForm);
IDISPLAY_Update(pMe->a.m_pIDisplay);
return(TRUE);
---------------------------------------------------------------------------------
switch (wParam)
{
case AVK_UP:
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid5;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid1, TRUE);
i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
pMe->pTemp=pMe->pWid1;
//FREEOBJ(pMe->pWid1);
//pMe->pWid5=NULL;
return (TRUE);
case AVK_DOWN:
//Get the current widget selected
// point to the next wid
// set the focus of that one .
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid1;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid5, TRUE);
pMe->pTemp=pMe->pWid5;
//FREEOBJ(pMe->pWid5);
//pMe->pWid5=NULL;
/* //i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
//IWIDGET_SetFocus(pMe->pWid5, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid5, &pbFocus);
//IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_GetFocus(pMe->pWid6, &pMe->pWid1);
IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_SetFocus(pMe->pWid5, TRUE); // This line segfault even if pIWidget is not NULL
*/
return (TRUE);
}
return(TRUE);
--------------------------------------------------------------------------
i AM TRYING THIS WAY AS THE MOVE FOCUS IS NOT WORKING SOME HOW.
WAITING FOR YOUR HELP.
Paya.

Hi ,
I have used prop Container and static & image widget.
I have put one image & one static widget in a widget and that widget is attached with the main form .
Trying to access each of the widget from the main one.
Hope this will give u a picture .
The code follows as:
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
//creating the datecontrol object
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_DATECTL,(void*)&(pMe->datectl));
IDATECTL_SetActive(pMe->datectl, TRUE);
// Create the root form
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_ROOTFORM,(void *) &pMe->pRootForm);
// create the form :
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FORM,(void *) &pMe->pMainForm);
// create the widget :for pCon
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid );
//ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid2 );
// Widget to hold the Container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid1 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid5 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid6 );
// create the widget :for pCon1
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid3 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid4 );
//Create the container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon1);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon2);
//Creating the img object
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_IMAGEWIDGET,(void*)&pMe->pWid2);
//IFORM_SetWidget(pMe->pMainForm, WID_TITLE , pMe->pWid);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY1, sk3);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY2 , sk4);
// Fill up form with data
//IFORM_SetTitle(pMe->pMainForm, sk1);
IFORM_SetText(pMe->pMainForm, FID_TITLE, sk1);
//Date
//set the date
result = IDATECTL_SetDate(pMe->datectl,2000,10,12);
//get the date
result = IDATECTL_GetDateString(pMe->datectl, pMe->pBuffer, nMaxSize*sizeof(AECHAR), &pMe->pnChars, DFMT_DD_MON_YYYY);
//Image Loading in Widget
pMe->pImg = ISHELL_LoadResImage(pMe->a.m_pIShell,EVT_SCREEN_RES_FILE ,IDI_OBJECT_5001);
i = IWIDGET_SetImage(pMe->pWid2, pMe->pImg);
// i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//IPROPCONTAINER_SetProp(pMe->pCon, pMe->pWid, pMe->pWid2, &pProp2);
// Inserting widgets into container
//ICONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL, NULL);
//ICONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL, NULL);
// Inserting widgets into PropContainer- pCon
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL,&pProp);
// Inserting widgets into PropContainer- pCon1
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid3, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid4, WIDGET_ZNORMAL,&pProp);
//set the text in widget pWid--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid, 2);
i = IWIDGET_SetBorderColor(pMe->pWid, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid, pMe->pBuffer,TRUE);
//set the text in widget pWid2--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid2, 2);
i = IWIDGET_SetBorderColor(pMe->pWid2, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid2, MAKE_RGB(255,0,0));
//i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//set the text in widget pWid3--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid3, 2);
i = IWIDGET_SetBorderColor(pMe->pWid3, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid3, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid3, sk3,TRUE);
//set the text in widget pWid4--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid4, 2);
i = IWIDGET_SetBorderColor(pMe->pWid4, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid4, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid4, sk4,TRUE);
// IWIDGET_SetExtent(pMe->pWid, &pWExtent);
//Getting the widget from the container
//i = ICONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET, &pMe->pWid1);
//Getting the widget from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET,&pMe->pWid1);
i = IPROPCONTAINER_QueryInterface(pMe->pCon1, AEEIID_WIDGET,&pMe->pWid5);
//cHANGING THE bg COLOR OF THE WIDGETS
//i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
//i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
//setting the focus
//IWIDGET_SetFocus(pMe->pWid6, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid6, &pbFocus);
// Inserting widgets into PropContainer- pCon2
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid1, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid5, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon1, WIDGET_ZNORMAL,&pProp);
//Getting the widget(final) from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon2, AEEIID_WIDGET,&pMe->pWid6);
// To set widgets as horizontal
IWIDGET_SetProperty(pMe->pWid1, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
IWIDGET_SetProperty(pMe->pWid5, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
i = IFORM_SetProperty(pMe->pMainForm, WID_FORM, (uint32)pMe->pWid6);
//IFORM_SetTitle(pMe->pForm, pTitle);
i = IROOTFORM_PushForm(pMe->pRootForm, pMe->pMainForm);
//i = IROOTFORM_PopForm(pMe->pRootForm);
IDISPLAY_Update(pMe->a.m_pIDisplay);
return(TRUE);
---------------------------------------------------------------------------------
switch (wParam)
{
case AVK_UP:
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid5;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid1, TRUE);
i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
pMe->pTemp=pMe->pWid1;
//FREEOBJ(pMe->pWid1);
//pMe->pWid5=NULL;
return (TRUE);
case AVK_DOWN:
//Get the current widget selected
// point to the next wid
// set the focus of that one .
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid1;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid5, TRUE);
pMe->pTemp=pMe->pWid5;
//FREEOBJ(pMe->pWid5);
//pMe->pWid5=NULL;
/* //i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
//IWIDGET_SetFocus(pMe->pWid5, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid5, &pbFocus);
//IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_GetFocus(pMe->pWid6, &pMe->pWid1);
IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_SetFocus(pMe->pWid5, TRUE); // This line segfault even if pIWidget is not NULL
*/
return (TRUE);
}
return(TRUE);
--------------------------------------------------------------------------
i AM TRYING THIS WAY AS THE MOVE FOCUS IS NOT WORKING SOME HOW.
WAITING FOR YOUR HELP.
Payal.

Hi ,
I have used prop Container and static & image widget.
I have put one image & one static widget in a widget and that widget is attached with the main form .
Trying to access each of the widget from the main one.
Hope this will give u a picture .
The code follows as:
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
//creating the datecontrol object
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_DATECTL,(void*)&(pMe->datectl));
IDATECTL_SetActive(pMe->datectl, TRUE);
// Create the root form
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_ROOTFORM,(void *) &pMe->pRootForm);
// create the form :
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FORM,(void *) &pMe->pMainForm);
// create the widget :for pCon
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid );
//ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid2 );
// Widget to hold the Container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid1 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid5 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid6 );
// create the widget :for pCon1
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid3 );
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_STATICWIDGET,(void*)&pMe->pWid4 );
//Create the container
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon1);
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_PROPCONTAINER,(void*)&pMe->pCon2);
//Creating the img object
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_IMAGEWIDGET,(void*)&pMe->pWid2);
//IFORM_SetWidget(pMe->pMainForm, WID_TITLE , pMe->pWid);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY1, sk3);
IFORM_SetSoftkey(pMe->pMainForm, FID_SOFTKEY2 , sk4);
// Fill up form with data
//IFORM_SetTitle(pMe->pMainForm, sk1);
IFORM_SetText(pMe->pMainForm, FID_TITLE, sk1);
//Date
//set the date
result = IDATECTL_SetDate(pMe->datectl,2000,10,12);
//get the date
result = IDATECTL_GetDateString(pMe->datectl, pMe->pBuffer, nMaxSize*sizeof(AECHAR), &pMe->pnChars, DFMT_DD_MON_YYYY);
//Image Loading in Widget
pMe->pImg = ISHELL_LoadResImage(pMe->a.m_pIShell,EVT_SCREEN_RES_FILE ,IDI_OBJECT_5001);
i = IWIDGET_SetImage(pMe->pWid2, pMe->pImg);
// i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//IPROPCONTAINER_SetProp(pMe->pCon, pMe->pWid, pMe->pWid2, &pProp2);
// Inserting widgets into container
//ICONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL, NULL);
//ICONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL, NULL);
// Inserting widgets into PropContainer- pCon
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon, pMe->pWid2, WIDGET_ZNORMAL,&pProp);
// Inserting widgets into PropContainer- pCon1
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid3, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon1, pMe->pWid4, WIDGET_ZNORMAL,&pProp);
//set the text in widget pWid--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid, 2);
i = IWIDGET_SetBorderColor(pMe->pWid, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid, pMe->pBuffer,TRUE);
//set the text in widget pWid2--- used with out using Container
i = IWIDGET_SetBorderWidth(pMe->pWid2, 2);
i = IWIDGET_SetBorderColor(pMe->pWid2, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid2, MAKE_RGB(255,0,0));
//i = IWIDGET_SetText(pMe->pWid2, sk2,TRUE);
//set the text in widget pWid3--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid3, 2);
i = IWIDGET_SetBorderColor(pMe->pWid3, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid3, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid3, sk3,TRUE);
//set the text in widget pWid4--- used with PropContainer
i = IWIDGET_SetBorderWidth(pMe->pWid4, 2);
i = IWIDGET_SetBorderColor(pMe->pWid4, MAKE_RGB(255,0,255));
i = IWIDGET_SetSelectedBorderColor(pMe->pWid4, MAKE_RGB(255,0,0));
i = IWIDGET_SetText(pMe->pWid4, sk4,TRUE);
// IWIDGET_SetExtent(pMe->pWid, &pWExtent);
//Getting the widget from the container
//i = ICONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET, &pMe->pWid1);
//Getting the widget from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon, AEEIID_WIDGET,&pMe->pWid1);
i = IPROPCONTAINER_QueryInterface(pMe->pCon1, AEEIID_WIDGET,&pMe->pWid5);
//cHANGING THE bg COLOR OF THE WIDGETS
//i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
//i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
//setting the focus
//IWIDGET_SetFocus(pMe->pWid6, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid6, &pbFocus);
// Inserting widgets into PropContainer- pCon2
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid1, WIDGET_ZNORMAL,&pProp);
IPROPCONTAINER_Insert(pMe->pCon2, pMe->pWid5, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon, WIDGET_ZNORMAL,&pProp);
//IPROPCONTAINER_Insert(pMe->pCon2, pMe->pCon1, WIDGET_ZNORMAL,&pProp);
//Getting the widget(final) from the PropContainer
i = IPROPCONTAINER_QueryInterface(pMe->pCon2, AEEIID_WIDGET,&pMe->pWid6);
// To set widgets as horizontal
IWIDGET_SetProperty(pMe->pWid1, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
IWIDGET_SetProperty(pMe->pWid5, PROP_LAYOUTSTYLE ,LAYOUT_HORZ);
i = IFORM_SetProperty(pMe->pMainForm, WID_FORM, (uint32)pMe->pWid6);
//IFORM_SetTitle(pMe->pForm, pTitle);
i = IROOTFORM_PushForm(pMe->pRootForm, pMe->pMainForm);
//i = IROOTFORM_PopForm(pMe->pRootForm);
IDISPLAY_Update(pMe->a.m_pIDisplay);
return(TRUE);
---------------------------------------------------------------------------------
switch (wParam)
{
case AVK_UP:
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid5;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid1,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid1, TRUE);
i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
pMe->pTemp=pMe->pWid1;
//FREEOBJ(pMe->pWid1);
//pMe->pWid5=NULL;
return (TRUE);
case AVK_DOWN:
//Get the current widget selected
// point to the next wid
// set the focus of that one .
//i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT) ;
//i=IWIDGET_GetFocus(pMe->pWid6, (IWidget **)&pMe->pTemp);
if(pMe->pTemp== NULL)
pMe->pTemp=pMe->pWid1;
i = IWIDGET_SetActiveBGColor(pMe->pTemp,MAKE_RGB(255,255,255));
i = IWIDGET_SetActiveBGColor(pMe->pWid5,MAKE_RGB(255,0,0));
IWIDGET_SetFocus(pMe->pWid5, TRUE);
pMe->pTemp=pMe->pWid5;
//FREEOBJ(pMe->pWid5);
//pMe->pWid5=NULL;
/* //i = IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
//IWIDGET_SetFocus(pMe->pWid5, TRUE);
//i = IWIDGET_HasFocus(pMe->pWid5, &pbFocus);
//IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_GetFocus(pMe->pWid6, &pMe->pWid1);
IWIDGET_MoveFocus(pMe->pWid6, (IWidget*)WIDGET_FOCUS_NEXT);
IWIDGET_SetFocus(pMe->pWid5, TRUE); // This line segfault even if pIWidget is not NULL
*/
return (TRUE);
}
return(TRUE);
--------------------------------------------------------------------------
i AM TRYING THIS WAY AS THE MOVE FOCUS IS NOT WORKING SOME HOW.
WAITING FOR YOUR HELP.
Payal.

Hi
i saw ur post....
In that u hav set the focus for static in the handle event........
Static widget by default not having the focus.u set the focus where u created the widget(static).in the handle event ,on event Up & Down u u set the focus on previous and next....
i think it will work.

Hi
i saw ur post....
In that u hav set the focus for static in the handle event........
Static widget by default not having the focus.u set the focus where u created the widget(static).in the handle event ,on event Up & Down u u set the focus on previous and next....
i think it will work.

Thanks vasuki. Could you please tell me what are the widgets can take focus ??
One more query,
Can we push a widget in a ListWidget as an item? If so, what are the types of widget we can push .
Regards,
Payal

Thanks vasuki. Could you please tell me what are the widgets can take focus ??
One more query,
Can we push a widget in a ListWidget as an item? If so, what are the types of widget we can push .
Regards,
Payal

Hi
Almost all the widget can take focus by default. Ex: text,checkbox, radio,progress widgets....(except static)
U can add static, ImageStatic, only image(grid) as a member(item ) of the list widget.
Regards
vasuki

Hi
Almost all the widget can take focus by default. Ex: text,checkbox, radio,progress widgets....(except static)
U can add static, ImageStatic, only image(grid) as a member(item ) of the list widget.
Regards
vasuki

Thanks vasuki. But i am just a beginner in brew coding.
Could you please give a sample code ( if you have) for adding widgets to listwidgets as items and for changing the focus.
Waiting for your reply .
Regards,
Payal

Thanks vasuki. But i am just a beginner in brew coding.
Could you please give a sample code ( if you have) for adding widgets to listwidgets as items and for changing the focus.
Waiting for your reply .
Regards,
Payal

hi
Try this
if ( ISHELL_CreateInstance( m_pIShell, AEECLSID_LISTWIDGET, (void **)&pListWidget ) != SUCCESS ) return ;
if ( ISHELL_CreateInstance( m_pIShell, AEECLSID_MENUMODEL, (void **)&pMenuModel ) != SUCCESS ) return ;
if( ISHELL_CreateInstance( m_pIShell, AEECLSID_STATICWIDGET , (void **)&pStaticListWidget ) != SUCCESS ) return ;
STRTOWSTR("chat", pStaticInfo[0], sizeof(pStaticInfo[0]));
STRTOWSTR("Inbox", pStaticInfo[1], sizeof(pStaticInfo[1]));
STRTOWSTR("Outbox", pStaticInfo[2], sizeof(pStaticInfo[2]));
STRTOWSTR("sent Items", pStaticInfo[3], sizeof(pStaticInfo[4]));
for ( int i=0; i<4; i++ )
IMENUMODEL_Add( pMenuModel, pStaticInfo[i], (uint16)i, MMF_ENABLED );
IWIDGET_SetModel( pListWidget, IMENUMODEL_TO_IMODEL(pMenuModel) );
IModel *tmpViewModel =NULL;
IWIDGET_GetViewModel( pListWidget, &tmpViewModel );
ListModelListener.pfnListener = ListListener ;
ListModelListener.pListenerData = (void *)this ;
IMODEL_AddListener( tmpViewModel, &ListModelListener);
ReleaseIF( tmpViewModel );
IWIDGET_SetBorderWidth( pListWidget , 1 );
IWIDGET_SetSelectedFGColor( pListWidget, MAKE_RGBA(125, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pListWidget, MAKE_RGBA(125, 233, 10, 5) );
IWIDGET_SetSelectedFGColor( pStaticListWidget, MAKE_RGBA(255, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pStaticListWidget, RGB_BLACK );
IWIDGET_SetProperty(pStaticListWidget, PROP_SELECTED_FGCOLOR, MAKE_RGB(0, 255, 0));
IWIDGET_SetProperty( pListWidget, PROP_FLAGS, LWF_WRAP );
IWIDGET_SetTransparency( pListWidget, 255 );
IWIDGET_GetPreferredExtent( pStaticListWidget, &we );
IWIDGET_SetItemHeight( pListWidget, we.height+4 );
pMe->pRootForm->GetClientRect(pRect);
we.height = pRect.dy-2 ;
we.width = pRect.dx-2;
IWIDGET_SetExtent( pListWidget, &we );
wpos.bVisible = TRUE ;
wpos.x = 1 ; wpos.y = 1 ;
IDECORATOR_SetWidget( (IDecorator *) pListWidget, pStaticListWidget );
Add pListwidget to ur container
Regaurds
vasuki

hi
Try this
if ( ISHELL_CreateInstance( m_pIShell, AEECLSID_LISTWIDGET, (void **)&pListWidget ) != SUCCESS ) return ;
if ( ISHELL_CreateInstance( m_pIShell, AEECLSID_MENUMODEL, (void **)&pMenuModel ) != SUCCESS ) return ;
if( ISHELL_CreateInstance( m_pIShell, AEECLSID_STATICWIDGET , (void **)&pStaticListWidget ) != SUCCESS ) return ;
STRTOWSTR("chat", pStaticInfo[0], sizeof(pStaticInfo[0]));
STRTOWSTR("Inbox", pStaticInfo[1], sizeof(pStaticInfo[1]));
STRTOWSTR("Outbox", pStaticInfo[2], sizeof(pStaticInfo[2]));
STRTOWSTR("sent Items", pStaticInfo[3], sizeof(pStaticInfo[4]));
for ( int i=0; i<4; i++ )
IMENUMODEL_Add( pMenuModel, pStaticInfo[i], (uint16)i, MMF_ENABLED );
IWIDGET_SetModel( pListWidget, IMENUMODEL_TO_IMODEL(pMenuModel) );
IModel *tmpViewModel =NULL;
IWIDGET_GetViewModel( pListWidget, &tmpViewModel );
ListModelListener.pfnListener = ListListener ;
ListModelListener.pListenerData = (void *)this ;
IMODEL_AddListener( tmpViewModel, &ListModelListener);
ReleaseIF( tmpViewModel );
IWIDGET_SetBorderWidth( pListWidget , 1 );
IWIDGET_SetSelectedFGColor( pListWidget, MAKE_RGBA(125, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pListWidget, MAKE_RGBA(125, 233, 10, 5) );
IWIDGET_SetSelectedFGColor( pStaticListWidget, MAKE_RGBA(255, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pStaticListWidget, RGB_BLACK );
IWIDGET_SetProperty(pStaticListWidget, PROP_SELECTED_FGCOLOR, MAKE_RGB(0, 255, 0));
IWIDGET_SetProperty( pListWidget, PROP_FLAGS, LWF_WRAP );
IWIDGET_SetTransparency( pListWidget, 255 );
IWIDGET_GetPreferredExtent( pStaticListWidget, &we );
IWIDGET_SetItemHeight( pListWidget, we.height+4 );
pMe->pRootForm->GetClientRect(pRect);
we.height = pRect.dy-2 ;
we.width = pRect.dx-2;
IWIDGET_SetExtent( pListWidget, &we );
wpos.bVisible = TRUE ;
wpos.x = 1 ; wpos.y = 1 ;
IDECORATOR_SetWidget( (IDecorator *) pListWidget, pStaticListWidget );
Add pListwidget to ur container
Regaurds
vasuki

Hi vasuki,
Yeh , I tried that one . It works too.
Actually I need to fill up the data in the list item after reading from the file .
So I cant hardcode the value of the list item .
So could you plaese tell me how to add the ptr of a widget i can set/add to the list widget.
We are using IDECORATOR_SetWidget() to associate the list widget with the static widget. But I am not able to understand why do we need to do it .
Even we are able to display the listwidget only this way .
Is it the only way to display the list widget over the form .
Regards,
payal

Hi vasuki,
Yeh , I tried that one . It works too.
Actually I need to fill up the data in the list item after reading from the file .
So I cant hardcode the value of the list item .
So could you plaese tell me how to add the ptr of a widget i can set/add to the list widget.
We are using IDECORATOR_SetWidget() to associate the list widget with the static widget. But I am not able to understand why do we need to do it .
Even we are able to display the listwidget only this way .
Is it the only way to display the list widget over the form .
Regards,
payal

Hi
see ur private message folders

Hi
see ur private message folders

Hi vasuki ,
Thanks . But i wanted to read the value from the file ( not resource file) .
Now currently i am reading it through a structure .
One more query , I need to edit some blank in front of a string.
Could you please tell me any API that brew support ?
or can i do it using simple c syntax ??
Waiting for your reply.
Regards,
Payal

Hi vasuki ,
Thanks . But i wanted to read the value from the file ( not resource file) .
Now currently i am reading it through a structure .
One more query , I need to edit some blank in front of a string.
Could you please tell me any API that brew support ?
or can i do it using simple c syntax ??
Waiting for your reply.
Regards,
Payal

Hi all,
Iam new Uiwidgets and Forms.
I created a main menu with list widget(AEECLSID_LISTWIDGET).
List is displayed with menu items with IMenuModel.But i don't know how to handle the events in list, means selecting UP and Down keys.Any body please advice me about the event handling in list widget with some source code.
My mainmenu creation code is bellow.
void createSampleMenu(helloformapp* pApp)
{
ISHELL_CreateInstance(pApp->pIShell, AEECLSID_ROOTFORM, (void **)&piRootForm);
ISHELL_CreateInstance(pApp->pIShell, AEECLSID_FORM, (void **)&piForm);
ISHELL_CreateInstance(pApp->pIShell, AEECLSID_XYCONTAINER, (void**)&XYcontainerWidget);
ISHELL_CreateInstance( pApp->pIShell, AEECLSID_LISTWIDGET, (void **)&pListWidget );
ISHELL_CreateInstance( pApp->pIShell, AEECLSID_MENUMODEL, (void **)&pMenuModel );
ISHELL_CreateInstance( pApp->pIShell, AEECLSID_STATICWIDGET , (void **)&pStaticListWidget );
IMENUMODEL_Add( pMenuModel, L"Browser", 0, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Camera", 1, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"BlueBox", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Morph", 3, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Settings", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Help", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"About", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Exit", 2, MMF_ENABLED );
IWIDGET_SetModel( pListWidget, IMENUMODEL_TO_IMODEL(pMenuModel) );
IWIDGET_SetBorderWidth( pListWidget , 3 );
IWIDGET_SetSelectedFGColor( pListWidget, MAKE_RGBA(125, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pListWidget, MAKE_RGBA(125, 233, 10, 5) );
IWIDGET_SetSelectedFGColor( pStaticListWidget, MAKE_RGBA(255, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pStaticListWidget, MAKE_RGB(255, 0 , 255));
IWIDGET_SetProperty(pStaticListWidget, PROP_SELECTED_FGCOLOR, MAKE_RGB(0, 255, 0));
IWIDGET_SetProperty( pListWidget, PROP_FLAGS, LWF_WRAP );
IWIDGET_SetTransparency( pListWidget, 255 );
IWIDGET_GetPreferredExtent( pStaticListWidget, &we );
IWIDGET_SetItemHeight( pListWidget, we.height+4 );
we.height =100 ;
we.width = 75;
IWIDGET_SetExtent( pListWidget, &we );
wpos.bVisible = TRUE ;
wpos.x = 240/3 ; wpos.y = 25 ;
IDECORATOR_SetWidget( (IDecorator *) pListWidget, pStaticListWidget );
IXYCONTAINER_Insert(XYcontainerWidget, pListWidget, WIDGET_ZNORMAL,&wpos);
if(IXYCONTAINER_QueryInterface(XYcontainerWidget, AEEIID_WIDGET, (void**)&menuContainer)== SUCCESS)
{
IWIDGET_SetLayoutStyle(menuContainer, 0);
IWIDGET_SetBGColor(menuContainer,MAKE_RGB(0,255,0));
IWIDGET_SetBorderColor(menuContainer, MAKE_RGB(0,0,0));
IWIDGET_SetBorderWidth(menuContainer, 2);
IWIDGET_SetGradientStyle(menuContainer,1);
IWIDGET_SetTransparency(menuContainer,5);
IFORM_SetWidget(piForm,WID_FORM, menuContainer);
IFORM_SetSoftkey(piForm, FID_SOFTKEY1 ,L"Options");
IFORM_SetSoftkey(piForm, FID_SOFTKEY2 ,L"Back");
IROOTFORM_PushForm(piRootForm,piForm);
}
}
Regars and thanks
Premlal

Hi all,
Iam new Uiwidgets and Forms.
I created a main menu with list widget(AEECLSID_LISTWIDGET).
List is displayed with menu items with IMenuModel.But i don't know how to handle the events in list, means selecting UP and Down keys.Any body please advice me about the event handling in list widget with some source code.
My mainmenu creation code is bellow.
void createSampleMenu(helloformapp* pApp)
{
ISHELL_CreateInstance(pApp->pIShell, AEECLSID_ROOTFORM, (void **)&piRootForm);
ISHELL_CreateInstance(pApp->pIShell, AEECLSID_FORM, (void **)&piForm);
ISHELL_CreateInstance(pApp->pIShell, AEECLSID_XYCONTAINER, (void**)&XYcontainerWidget);
ISHELL_CreateInstance( pApp->pIShell, AEECLSID_LISTWIDGET, (void **)&pListWidget );
ISHELL_CreateInstance( pApp->pIShell, AEECLSID_MENUMODEL, (void **)&pMenuModel );
ISHELL_CreateInstance( pApp->pIShell, AEECLSID_STATICWIDGET , (void **)&pStaticListWidget );
IMENUMODEL_Add( pMenuModel, L"Browser", 0, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Camera", 1, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"BlueBox", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Morph", 3, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Settings", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Help", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"About", 2, MMF_ENABLED );
IMENUMODEL_Add( pMenuModel, L"Exit", 2, MMF_ENABLED );
IWIDGET_SetModel( pListWidget, IMENUMODEL_TO_IMODEL(pMenuModel) );
IWIDGET_SetBorderWidth( pListWidget , 3 );
IWIDGET_SetSelectedFGColor( pListWidget, MAKE_RGBA(125, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pListWidget, MAKE_RGBA(125, 233, 10, 5) );
IWIDGET_SetSelectedFGColor( pStaticListWidget, MAKE_RGBA(255, 255, 255, 255) );
IWIDGET_SetSelectedBGColor( pStaticListWidget, MAKE_RGB(255, 0 , 255));
IWIDGET_SetProperty(pStaticListWidget, PROP_SELECTED_FGCOLOR, MAKE_RGB(0, 255, 0));
IWIDGET_SetProperty( pListWidget, PROP_FLAGS, LWF_WRAP );
IWIDGET_SetTransparency( pListWidget, 255 );
IWIDGET_GetPreferredExtent( pStaticListWidget, &we );
IWIDGET_SetItemHeight( pListWidget, we.height+4 );
we.height =100 ;
we.width = 75;
IWIDGET_SetExtent( pListWidget, &we );
wpos.bVisible = TRUE ;
wpos.x = 240/3 ; wpos.y = 25 ;
IDECORATOR_SetWidget( (IDecorator *) pListWidget, pStaticListWidget );
IXYCONTAINER_Insert(XYcontainerWidget, pListWidget, WIDGET_ZNORMAL,&wpos);
if(IXYCONTAINER_QueryInterface(XYcontainerWidget, AEEIID_WIDGET, (void**)&menuContainer)== SUCCESS)
{
IWIDGET_SetLayoutStyle(menuContainer, 0);
IWIDGET_SetBGColor(menuContainer,MAKE_RGB(0,255,0));
IWIDGET_SetBorderColor(menuContainer, MAKE_RGB(0,0,0));
IWIDGET_SetBorderWidth(menuContainer, 2);
IWIDGET_SetGradientStyle(menuContainer,1);
IWIDGET_SetTransparency(menuContainer,5);
IFORM_SetWidget(piForm,WID_FORM, menuContainer);
IFORM_SetSoftkey(piForm, FID_SOFTKEY1 ,L"Options");
IFORM_SetSoftkey(piForm, FID_SOFTKEY2 ,L"Back");
IROOTFORM_PushForm(piRootForm,piForm);
}
}
Regars and thanks
Premlal