#define WHITE 0xFFFFFF
#define RED 0xFF0000
#define YELLOW 0xFFFF00
tCanvasWidget *lb[10];

void Timer6OnExecute(tWidget *pWidget)
{
   static char RotarySwitchNum[6];
   static int i ;

   i = GetRotaryID();

  usprintf(RotarySwitchNum, "%d", i);

  if( i == 0 )
  {
     CanvasTextColorSet(lb[9], WHITE);
     CanvasTextColorSet(lb[i+1], WHITE);
     CanvasTextColorSet(lb[i], YELLOW);
     CanvasTextColorSet(&LabelWidget29, RED);
     CanvasTextSet(&LabelWidget29 , RotarySwitchNum);
     WidgetPaint((tWidget*)lb[9]);
     WidgetPaint((tWidget*)lb[i+1]);
     WidgetPaint((tWidget*)lb[i]);
     WidgetPaint((tWidget*)&LabelWidget29);
  }else if ( i == 9)
  {
     CanvasTextColorSet(lb[i-1], WHITE);
     CanvasTextColorSet(lb[0], WHITE);
     CanvasTextColorSet(lb[i], YELLOW);
     CanvasTextColorSet(&LabelWidget29, RED);
     CanvasTextSet(&LabelWidget29 , RotarySwitchNum);
     WidgetPaint((tWidget*)lb[i-1]);
     WidgetPaint((tWidget*)lb[0]);
     WidgetPaint((tWidget*)lb[i]);
     WidgetPaint((tWidget*)&LabelWidget29);
  }else
  {
     CanvasTextColorSet(lb[i-1], WHITE);
     CanvasTextColorSet(lb[i+1], WHITE);
     CanvasTextColorSet(lb[i], YELLOW);
     CanvasTextColorSet(&LabelWidget29, RED);
     CanvasTextSet(&LabelWidget29 , RotarySwitchNum);
     WidgetPaint((tWidget*)lb[i-1]);
     WidgetPaint((tWidget*)lb[i+1]);
     WidgetPaint((tWidget*)lb[i]);
     WidgetPaint((tWidget*)&LabelWidget29);
  }

}

void Frame12OnCreate()
{
      lb[0] = &LabelWidget5 ; //0
      lb[1] = &LabelWidget20 ; //1
      lb[2] = &LabelWidget21; //2
      lb[3] = &LabelWidget22; //3
      lb[4] = &LabelWidget28; //4
      lb[5] = &LabelWidget23; //5
      lb[6] = &LabelWidget27; //6
      lb[7] = &LabelWidget24; //7
      lb[8] = &LabelWidget25; //8
      lb[9] = &LabelWidget26; //9
}

