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

Developer

Forums

Forums:

hi,i am new to brewMP.i am trying to get scrollbar in my simulator of BREWMP but anyhow it is not showing .please can anyone correct me or show me the right and proper code to do this:-

the code which i had implemented for scrollbar is:-

result =ISHELL_CreateInstance(pMe->piShell, AEECLSID_ROOTCONTAINER, (void *)(&pMe->picRoot));
IROOTCONTAINER_QueryInterface(pMe->picRoot, AEEIID_WIDGET, (void *)(&pMe->piwRoot));
if(result != 0)
DBGPRINTF("RESULT1 FAILED");

result = ISHELL_CreateInstance(pMe->piShell, AEECLSID_DISPLAYCANVAS, (void**)(&pMe->piCanvas));

IDISPLAYCANVAS_SetDisplay((IDisplayCanvas*)(void *)pMe->piCanvas, pMe->piDisplay);
SETAEERECT(&(pMe->rcRoot), 0, 0,pMe->deviceInfo.cxScreen,pMe->deviceInfo.cyScreen);
IROOTCONTAINER_SetCanvas(pMe->picRoot, pMe->piCanvas, &(pMe->rcRoot));
if(result != 0)
DBGPRINTF("RESULT2 FAILED");

result = ISHELL_CreateInstance(pMe->piShell,AEECLSID_CONSTRAINTCONTAINER, (void**) &pMe->containerWidget);
result = ICONSTRAINTCONTAINER_QueryInterface(pMe->containerWidget, AEEIID_WIDGET, (void**)&pMe->pIConstraintContainerWidget );
if(result != 0)
DBGPRINTF("RESULT3 FAILED");

result= ISHELL_CreateInstance(pMe->piShell, AEECLSID_STATICWIDGET, (void**)&introTextWidget);
result= ISHELL_CreateInstance(pMe->piShell, AEECLSID_STATICWIDGET, (void**)&introTextWidget1);
result= ISHELL_CreateInstance(pMe->piShell, AEECLSID_VIEWPORTWIDGET, (void**)&vpWidget);
result= ISHELL_CreateInstance(pMe->piShell, AEECLSID_SCROLLBARWIDGET, (void**) &piScrollWidget);

if(result != 0)
DBGPRINTF("RESULT4 FAILED");

pMe->introStr = (AECHAR*)MALLOC(200);;
ISHELL_LoadResString(pMe->piShell,APPLICATION3_RES_FILE,szBuf,pMe->introStr,512 * (sizeof( AECHAR )+1));

we.height =10;
we.width = 10;
IWIDGET_SetExtent(vpWidget, &we);

IWIDGET_SetFGColor(introTextWidget,MAKE_RGB(181,207,243));
IWIDGET_SetText(introTextWidget,pMe->introStr,FALSE);
IWIDGET_SetFlags(introTextWidget, IDF_ALIGN_RIGHT | SWF_WRAPTEXT );
IWIDGET_SetRightPadding(introTextWidget,10);
IWIDGET_SetLeftPadding(introTextWidget,10);
IWIDGET_SetTopPadding(introTextWidget,5);

IWidget_SetBGColor(pMe->picRoot, MAKE_RGBA(224, 224, 224, 255));
ISHELL_LoadResString(pMe->piShell,APPLICATION3_RES_FILE,pMe->introStr,szBuf,1024 * (sizeof( AECHAR )+1));
we.height =30;
we.width =20;
IWIDGET_SetExtent(vpWidget, &we);
IWIDGET_SetFGColor(introTextWidget1,MAKE_RGB(82,137,213));
IWIDGET_SetText(introTextWidget1,pMe->introStr,FALSE);
IWIDGET_SetFlags(introTextWidget1, IDF_ALIGN_RIGHT | SWF_WRAPTEXT );
IWIDGET_SetRightPadding(introTextWidget1,10);
IWIDGET_SetLeftPadding(introTextWidget1,10);
IWIDGET_SetTopPadding(introTextWidget1,5);

we.height = 230;
IWIDGET_SetExtent(introTextWidget, &we);

//IWIDGET_SetProperty(piScrollWidget, PROP_SCROLLPAD, 0);
IWIDGET_SetProperty(piScrollWidget,PROP_SCROLLPAD ,0);

IWIDGET_SetProperty(piScrollWidget,PROP_SCROLLCOLOR ,MAKE_RGB(82,137,213));
IWIDGET_SetProperty(piScrollWidget,PROP_SCROLLFILLCOLOR,MAKE_RGB(82,137,213));
IWIDGET_SetProperty(piScrollWidget,PROP_SCROLLHANDLECOLOR,MAKE_RGB(181,207,243));
IWIDGET_SetFlags(piScrollWidget, SCROLL_VERT );

//IDECORATOR_SetWidget((IDecorator*)vpWidget , introTextWidget);

IDecorator_SetWidget((IDecorator*)vpWidget , introTextWidget);
IDecorator_SetWidget((IDecorator*)vpWidget , introTextWidget1);
IDecorator_SetWidget((IDecorator*)piScrollWidget, vpWidget);

wpos.x =(pMe->deviceInfo.cxScreen - we.width)/2;
wpos.y = 5;
wpos.bVisible = TRUE;
(void)IROOTCONTAINER_Insert(pMe->picRoot,piScrollWidget, WIDGET_ZNORMAL,&wpos);
ICONSTRAINTCONTAINER_Insert(pMe->containerWidget , piScrollWidget, WIDGET_ZNORMAL, &wpos);

In KEY_EVT i am using this code:-
case AVK_UP:
(void)IWIDGET_MoveFocus(pMe->piwRoot, (IWidget *)WIDGET_FOCUS_PREV);
return (TRUE);
// Down arrow key was pressed:
case AVK_DOWN:
(void)IWIDGET_MoveFocus(pMe->piwRoot, (IWidget *)WIDGET_FOCUS_NEXT);
return (TRUE);

plz use https://brewmobileplatform.qualcomm.com/devnet/forum.jsp for BREW MP related discussions.
you would get more Brew MP appropriate stuff here.

plz use https://brewmobileplatform.qualcomm.com/devnet/forum.jsp for BREW MP related discussions.
you would get more Brew MP appropriate stuff here.