int flag  = 0;
void PaintBox99OnPaint(tWidget *pWidget, tContext *pContext)
{
    switch(flag)
     {
     case 0 :   hmi_SetForeground(pContext , 0xFFFFFF );
                hmi_FillRect(pContext, 0, 0, 240, 197);
                break ;

     case 1 :   hmi_DrawRect( pContext , WidgetLeft(pWidget), WidgetTop(pWidget), WidgetRight(pWidget), WidgetBottom(pWidget) );
                break ;

     case 2 :   hmi_SetForeground(pContext , 0xFFFFFF);
                hmi_FillRect(pContext , 0 , 0 ,240 , 320);
                break ;

     case 3 :   hmi_DrawCircle(pContext , 120 , 187 , 50 );
                break;

     case 4 :   hmi_SetForeground(pContext , 0xFFFFFF);
                hmi_FillRect(pContext , 0 , 0 , 240 , 320);
                break ;

     case 5 :   hmi_DrawEllipse(pContext ,  WidgetLeft(pWidget), WidgetTop(pWidget), WidgetRight(pWidget), WidgetBottom(pWidget));
                break ;

     case 6 :   hmi_SetForeground(pContext , 0xFFFFFF);
                hmi_FillRect(pContext , 0 , 0 , 240 , 320);
                break ;

     case 7 :   hmi_SetForeground(pContext , 0xFFCC33);
                hmi_FillRect(pContext , WidgetLeft(pWidget), WidgetTop(pWidget), WidgetRight(pWidget), WidgetBottom(pWidget));
                break ;

     case 8 :   hmi_SetForeground(pContext , 0xFFFFFF);
                hmi_FillRect(pContext , 0 , 0 , 240 , 320);
                break ;

     case 9 :   hmi_SetForeground(pContext , 0x6666FF);
                hmi_FillCircle(pContext , 120 , 187,50 );
                break;

     case 10 :  hmi_SetForeground(pContext , 0xFFFFFF);
                hmi_FillRect(pContext , 0 , 0 , 240 , 320);
                break ;

     case 11 :  hmi_SetForeground(pContext , 0x888888);
                hmi_FillEllipse(pContext ,WidgetLeft(pWidget), WidgetTop(pWidget), WidgetRight(pWidget), WidgetBottom(pWidget));
                break ;

     default:   hmi_SetForeground(pContext , 0xFFFFFF );
                hmi_FillRect(pContext, 0, 0, 240, 320);
     }
}



void BitButton100OnClick(tWidget *pWidget)
{
       if(flag > 11)
     {
      flag = 0 ;
     }

     WidgetPaint((tWidget*)&PaintBox103);
     flag++;
}
