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

Developer

Forums

Forums:

HI All

 

I want to put a vertical bar whenever a progress bar moves at the end of the filling color of the progress widget.

is there any way i can do tat???

below is the code

 

if(!pme->pProgressInfo)

{

    result=ISHELL_CreateInstance(pme->piShell,AEECLSID_ValueModel,((void**)&pme->pProgressInfo));

if(result!=AEE_SUCCESS)

return result;

}

if(!pme->process)

{

result=ISHELL_CreateInstance(pme->piShell,AEECLSID_ProgressWidget,((void**)&pme->process));

if(result!=AEE_SUCCESS)

return result;

}

IWidget_SetBGColor(pme->process,MAKE_RGB(0,255,0));

IWidget_SetFGColor(pme->process,MAKE_RGB(255,0,0));

IWidget_SetProperty(pme->process,PROP_FGCOLOR, MAKE_RGB(160,0,34));

//IWidget_SetProperty(pme->process,PROP_ACTIVE_BORDERWIDTH, 10);

we.height=15;

we.width=225;

IWidget_SetExtent(pme->process,&we);

IWidget_SetModel(pme->process, (IModel*)pme->pProgressInfo);

 

result=IWidget_GetModel(pme->process,AEEIID_IValueModel,(IModel**)&pme->pProgressInfo);

if(result==AEE_SUCCESS)

{  

//IValueModel_AdaptSet(pme->pProgressInfo, (PFNADAPTSET)ListItemValueAdaptSet, pme);

IValueModel_SetValue(pme->pProgressInfo,(void*)pme->m_wPct,0,NULL);

IValueModel_Release(pme->pProgressInfo);

flag=TRUE;

}

   dwpos.x=10;

    dwpos.y=260;

    dwpos.bVisible=TRUE;

     result=IRootContainer_Insert(pme->picRoot,pme->process,WIDGET_ZNORMAL,&dwpos);

   Please help as i m using this progress widget for media player  when song is playing to show the progress timer.

 

Regards

Gautam

Something like "slider handle" in slider widget? Not by default but you can use draw handler to draw the vertical bar on progress widget. Using draw handler code snippet (drawing horz lines though):
//Query for the draw handler from progress widget
IWidget_QueryInterface(pMe->piwProgress, AEEIID_IDrawHandler, (void **)&piDrawHandler);
DRAWHANDLERDESC_Init(&pMe->drawdesc, c_widgetsapp_Draw, pMe,c_widgetsapp_DrawHandlerFree);
IDrawHandler_SetDraw(piDrawHandler, &pMe->drawdesc);

void c_widgetsapp_Draw(c_widgetsapp *pMe, ICanvas *piCanvas, int x, int y)
{
/* Pre-widget draw buffer modifications
We will draw two lines that will be be under the widget. Since we're using
a partially-transparent background color, we will still see these lines */
IDISPLAY_DrawHLine(pMe->piDisplay, x, y+4, 75);
IDISPLAY_DrawHLine(pMe->piDisplay, x, y+20, 75);

// Call the widget's default draw
DRAWHANDLERDESC_Call(&pMe->drawdesc, piCanvas, x, y);

/* Post-widget draw buffer modifications
We will draw two more lines that will be drawn over the widget. */
IDISPLAY_DrawHLine(pMe->piDisplay, x+25, y+9, 75);
IDISPLAY_DrawHLine(pMe->piDisplay, x+25, y+15, 75);

void c_widgetsapp_DrawHandlerFree(c_widgetsapp *pMe)
{
DRAWHANDLERDESC_Free(&pMe->drawdesc);

Something like "slider handle" in slider widget? Not by default but you can use draw handler to draw the vertical bar on progress widget. Using draw handler code snippet (drawing horz lines though):
//Query for the draw handler from progress widget
IWidget_QueryInterface(pMe->piwProgress, AEEIID_IDrawHandler, (void **)&piDrawHandler);
DRAWHANDLERDESC_Init(&pMe->drawdesc, c_widgetsapp_Draw, pMe,c_widgetsapp_DrawHandlerFree);
IDrawHandler_SetDraw(piDrawHandler, &pMe->drawdesc);

void c_widgetsapp_Draw(c_widgetsapp *pMe, ICanvas *piCanvas, int x, int y)
{
/* Pre-widget draw buffer modifications
We will draw two lines that will be be under the widget. Since we're using
a partially-transparent background color, we will still see these lines */
IDISPLAY_DrawHLine(pMe->piDisplay, x, y+4, 75);
IDISPLAY_DrawHLine(pMe->piDisplay, x, y+20, 75);

// Call the widget's default draw
DRAWHANDLERDESC_Call(&pMe->drawdesc, piCanvas, x, y);

/* Post-widget draw buffer modifications
We will draw two more lines that will be drawn over the widget. */
IDISPLAY_DrawHLine(pMe->piDisplay, x+25, y+9, 75);
IDISPLAY_DrawHLine(pMe->piDisplay, x+25, y+15, 75);

void c_widgetsapp_DrawHandlerFree(c_widgetsapp *pMe)
{
DRAWHANDLERDESC_Free(&pMe->drawdesc);

hi adhudase
Thanks for ur reply i achieved it using slider widget.
 
Regards
Gautam

hi adhudase
Thanks for ur reply i achieved it using slider widget.
 
Regards
Gautam