示例#1
0
文件: Splitter.cpp 项目: GetEnvy/Envy
/**
 * @param hdc - drawing context.
 */
void CSplitter::DrawSplitter(HDC hdc) const
{
	_ASSERTE(m_hwnd != NULL);
	DrawSplitterBar(hdc);
	DrawPanel(hdc, 0);
	DrawPanel(hdc, 1);
}
示例#2
0
文件: statusbar.cpp 项目: PyroOS/Pyro
/********************************************************************
* Description: Paints the statusbar
* Author: Andreas Engh-Halstvedt(with modifications by Rick Caudill)
* Date: Thu Mar 18 20:07:11 2004
*********************************************************************/
void StatusBar::Paint(const os::Rect& cUpdateRect)
{
    os::Rect cBounds=GetBounds();
    float vPanel=3;
    os::font_height sHeight;
    GetFont()->GetHeight(&sHeight);


    SetFgColor(GetBgColor());
    FillRect(cUpdateRect);

    SetFgColor(255, 255, 255);
    DrawLine(os::Point(0, 0), os::Point(cBounds.right, 0));



    for(int a=0;a<nPanelCount;++a)
    {
        switch(m_pcPanels[a].mode)
        {
        case RELATIVE:
            {
                if(m_pcPanels[a].vWidth<0)
                    continue;

                float w=(cBounds.right-cBounds.left)*m_pcPanels[a].vWidth;
                DrawPanel(m_pcPanels[a].cText, vPanel, 3, vPanel+w, cBounds.bottom-3, sHeight.ascender+sHeight.line_gap);
                vPanel+=w;
                break;
            }
        case FILL://TODO: handle FILL other places than at the end
            {
                float w=cBounds.right-cBounds.left-3-vPanel;
                if(w<0)
                    continue;

                DrawPanel(m_pcPanels[a].cText, vPanel, 3, vPanel+w, cBounds.bottom-3, sHeight.ascender+sHeight.line_gap);
                vPanel+=w;
                break;
            }
        case CONSTANT:
        default:
            if(m_pcPanels[a].vWidth<0)
                continue;

            DrawPanel(m_pcPanels[a].cText, vPanel, 3, vPanel+m_pcPanels[a].vWidth, cBounds.bottom-3, sHeight.ascender+sHeight.line_gap);
            vPanel+=m_pcPanels[a].vWidth;
            break;
        }
        vPanel+=5;
    }
}
示例#3
0
void AppLocal::DrawDialog( const Matrix4f & mvp )
{
	// draw the pop-up dialog
	const float now = ovr_GetTimeInSeconds();
	if ( now >= dialogStopSeconds )
	{
		return;
	}
	const Matrix4f dialogMvp = mvp * dialogMatrix;

	const float fadeSeconds = 0.5f;
	const float f = now - ( dialogStopSeconds - fadeSeconds );
	const float clampF = f < 0.0f ? 0.0f : f;
	const float alpha = 1.0f - clampF;

	DrawPanel( dialogTexture->textureId, dialogMvp, alpha );
}
示例#4
0
// DJB: This function displays the 2D android activities. By showing
// android dialogs within VrActivity, this code is executed.
//
// Test by way of displaying Android activity UI.
void AppLocal::DrawActivity( const Matrix4f & mvp )
{
	if ( !activityPanel.Visible )
	{
		return;
	}

#if FANCY_FOLLOW || BASIC_FOLLOW
	Matrix4f targetMatrix = lastViewMatrix.Inverted()
			* Matrix4f::Translation( 0.0f, -0.0f, -2.5 /* screenDist */ )
			* Matrix4f::Scaling( (float)activityPanel.Width / 768.0f,
				(float)activityPanel.Height / 768.0f, 1.0f );
#if FANCY_FOLLOW
	activityPanel.Matrix = MatrixInterpolation( activityPanel.Matrix, targetMatrix, 0.20 );
#elif BASIC_FOLLOW
	activityPanel.Matrix = targetMatrix;
#endif // FANCY or BASIC

#endif // FOLLOW

	const Matrix4f dialogMvp = mvp * activityPanel.Matrix;

	DrawPanel( activityPanel.Texture->textureId, dialogMvp, 1.0f );
}
示例#5
0
void save_screenshot()
{
	DrawPanel((ibitmap*)PANELICON_LOAD, "@snapshot_info", NULL, -1);
	PageSnapshot();
}
示例#6
0
//--------------------------------------------------------------------------------------
// Name: NuiMenu::Render()
// Desc: Renders the menu items and the cursor.
//--------------------------------------------------------------------------------------
VOID NuiMenu::Render() const
{
    assert( m_pd3dDevice != NULL );

    // Nothing to render.
    if( m_pMenuItemList == NULL )
    {
        return;
    }

    // Render each item in listed order
    for( DWORD dwItemIndex = 0; dwItemIndex < m_dwItemCount; ++ dwItemIndex )
    {
        // Only render items that aren't hidden
        if( ! m_pMenuItemList[ dwItemIndex ].bHidden )
        {
            switch( m_pMenuItemList[ dwItemIndex ].eItemType )
            {
            // Render a button. Buttons are shown in different colors depending on whether they are disabled,
            // selectable or selected
            case NUI_MENU_ITEM_BUTTON:
            {
                D3DCOLOR color = m_settings.staticColor;
                if( m_pMenuItemList[ dwItemIndex ].dwItemID == m_dwHoveredItemID )
                {
                    color = m_settings.selectedColor;
                }
                else if( m_pMenuItemList[ dwItemIndex ].bEnabled && ! m_bIsDisabled )
                {
                    color = m_settings.selectableColor;
                }

                DrawButton( &m_pMenuItemList[ dwItemIndex ].Location, m_pMenuItemList[ dwItemIndex ].szText, color );
                break;
            }

            // Render a check box. Check boxes are shown in different colors depending on whether they are disabled,
            // selectable or selected
            case NUI_MENU_ITEM_CHECK_BOX:
            {
                D3DCOLOR color = m_settings.staticColor;
                if( m_pMenuItemList[ dwItemIndex ].dwItemID == m_dwHoveredItemID )
                {
                    color = m_settings.selectedColor;
                }
                else if( m_pMenuItemList[ dwItemIndex ].bEnabled && ! m_bIsDisabled )
                {
                    color = m_settings.selectableColor;
                }


                DrawCheckBox( &m_pMenuItemList[ dwItemIndex ].Location, m_pMenuItemList[ dwItemIndex ].szText, color, m_pMenuItemList[ dwItemIndex ].fValue > 0.0f );
                break;
            }

            case NUI_MENU_ITEM_FRAME:
                DrawFrame( &m_pMenuItemList[ dwItemIndex ].Location, m_settings.staticColor );
                break;

            case NUI_MENU_ITEM_PANEL:
                DrawPanel( &m_pMenuItemList[ dwItemIndex ].Location, m_settings.panelColor );
                break;

            case NUI_MENU_ITEM_PROGRESS_BAR:
                DrawProgressBar( &m_pMenuItemList[ dwItemIndex ].Location, m_pMenuItemList[ dwItemIndex ].fValue, m_settings.staticColor );
                break;

            case NUI_MENU_ITEM_SPINNER:
                DrawSpinner( &m_pMenuItemList[ dwItemIndex ].Location, m_pMenuItemList[ dwItemIndex ].fValue, m_settings.staticColor );
                break;

            case NUI_MENU_ITEM_TEXT:
                DrawText( &m_pMenuItemList[ dwItemIndex ].Location, m_pMenuItemList[ dwItemIndex ].szText, m_settings.staticColor, m_pMenuItemList[ dwItemIndex ].dwValue );
                break;

            default:
                assert( false );
                break;
            }
        }
    }

    // Add an alignment grid on top of the menu, if requested.
    if( m_settings.bDrawGuide )
    {
        DrawAlignmentGrid();
    }

    // Draw the cursor last, unless the whole menu is disabled
    if( ! m_bIsDisabled )
    {
        DrawCursor();
    }

}
示例#7
0
void DrawCalendar()
{
 int i, j, k;
 char s[100];

	if (GetOrientation() == 0 || GetOrientation() == 3) {
		months_by_x = 3;
		months_by_y = 4;
		dx = cpar->dx_p;
		dy = cpar->dy_p;
		sx = cpar->sx_p;
		sy = cpar->sy_p;
		aw = cpar->aw;
		lh = cpar->lh;
	} else {
		months_by_x = 4;
		months_by_y = 3;
		dx = cpar->dx_l;
		dy = cpar->dy_l;
		sx = cpar->sx_l;
		sy = cpar->sy_l;
		aw = cpar->aw;
		lh = cpar->lh;
	}

 ClearScreen();
 //FillArea(0, 0, 600, 800, BLACK);
 //FillArea(10, 10, 580, 780, WHITE);
 SetFont(cal_title_font, BLACK);
 sprintf(s, "\x11    %d    \x12", year);
 DrawTextRect(0, 5, ScreenWidth(), 30, s, ALIGN_CENTER);
 HeaderWidth = StringWidth(s);
 SymbolWidth = CharWidth('A');

 for (i=0; i<months_by_y; i++)
 	for (j=0; j<months_by_x; j++)
 		{
		 int mn = i*months_by_x + j;
 		 SetFont(cal_month_font, BLACK);
 		 DrawTextRect(sx+dx*j, sy-(lh*3)/2+dy*i, dx, 1, GetLangText(MonthName[mn]), ALIGN_CENTER);
 		 SetFont(cal_day_font, BLACK);
 		 for (k=0; k<6; k++)
	 		DrawTextRect(sx+4+dx*j-(IsRTL() ? 10 : 0), sy+lh*k+dy*i, 50, 1, GetLangText(WeekName[k]), ALIGN_LEFT | RTLAUTO);
  		 SetFont(cal_day_font, DGRAY);
		 DrawTextRect(sx+4+dx*j-(IsRTL() ? 10 : 0), sy+lh*6+dy*i, 50, 1, GetLangText(WeekName[6]), ALIGN_LEFT | RTLAUTO);
	 	 for (k=1; k<43; k++)
	 	 	 if (calendar[mn][k]>0)
	 	 	 	{
	 	 		 if (k%7!=0) 
	 	 		 	SetFont(cal_date_font, BLACK);
	 	 		 	else
	 	 		 	SetFont(cal_date2_font, DGRAY);
 		 	 	 sprintf(s, "%d", calendar[mn][k]);
				 DrawTextRect(sx+(aw*8)/5+( (int) ((k-1)/7) )*aw+dx*j, sy+lh*((k-1)%7)+dy*i, aw, 1, s, ALIGN_CENTER);
				}
 		}
 if (year==CurDate->tm_year+1900)
 	{
 	 k=1;
 	 while (calendar[CurDate->tm_mon][k]!=CurDate->tm_mday) k++;
 	 InvertArea(sx+(aw*8)/5+1+( (int) ((k-1)/7) )*aw+dx*(CurDate->tm_mon%months_by_x), sy+lh*((k-1)%7)+dy*(CurDate->tm_mon/months_by_x), aw-2, lh-1);
 	 DrawRect(sx+(aw*8)/5+( (int) ((k-1)/7) )*aw+dx*(CurDate->tm_mon%months_by_x), sy+lh*((k-1)%7)+dy*(CurDate->tm_mon/months_by_x)+1, aw, lh-3, BLACK);
 	}
// SetFont(cour32, BLACK);
// sprintf(s, "%d %s %d", CurDate->tm_mday, GetLangText(MonthName[CurDate->tm_mon]), CurDate->tm_year+1900);
// DrawTextRect(50, 720, 500, 30, s, ALIGN_CENTER);
// DitherArea(0, 0, 600, 800, 4, 1);
 DrawPanel(NULL, CurrentDateStr(), NULL, -1);
 FullUpdate();
}
示例#8
0
void mui::VScrollBar::DoScrollBar() {

    int bx1=mui::VScrollBar::x;
    int by1=mui::VScrollBar::y;
    int bx2=mui::VScrollBar::x+mui::VScrollBar::w;
    int by2=mui::VScrollBar::y+mui::VScrollBar::h;

    int lArrowX = x+((mui::VScrollBar::w)/2);
    int lArrowY = by1+3;
    int rArrowX = x+((mui::VScrollBar::w)/2);
    int rArrowY = by2-3;

    status = 0;
    if ((mouseClickPtr != NULL) && (mouseOldClickPtr != NULL) && (mouseXposPtr != NULL) && (mouseYposPtr != NULL)) {

        if (*mouseClickPtr) {
            if (InBox(*mouseXposPtr, *mouseYposPtr, bx1, by1, bx2, by2)) {

                if (*mouseOldClickPtr == false)
                    clickedOn = true;

                if (clickedOn) {
                    if (InBox(*mouseXposPtr, *mouseYposPtr, bx1, by1, bx2, by1+10)) {
                        if (barClicked == false) {
                            if (value > minVal) value -= 1;
                            status = 3;
                        }
                    } else if (InBox(*mouseXposPtr, *mouseYposPtr, bx1, by2-10, bx2, by2)) {
                        if (barClicked == false) {
                            if (value < maxVal) value += 1;
                            status = 4;
                        }
                    } else {
                        status = 1;
                    }
                }

            }
        } else {
            if (*mouseOldClickPtr == true) clickedOn = false;
            barClicked = false;
        }

    } else {

        clickedOn = false;
        barClicked = false;

    }


    // Calculate scrollbar size and position
    int sliderRange = (maxVal-minVal);
    int sliderYsize = ((mui::VScrollBar::h-1)-20)-sliderRange;
    int sliderYpos;


    if (sliderYsize < 16) {
        sliderYsize = 16;
        sliderYpos = (by1+10)+((sliderRange*(((float)mui::VScrollBar::h-36)/sliderRange))*(((float)value-minVal)/sliderRange));
    } else {
        sliderYpos = (by1+10)+((mui::VScrollBar::h-20)-sliderYsize)*(((float)value-minVal)/sliderRange);
    }


    if (barClicked) {
        sliderYpos = (by1+10)+(*mouseYposPtr-clickPos);
        if (sliderYpos < (by1+10)) sliderYpos = by1+10;
        if (sliderYpos > ((by2-10)-sliderYsize)) sliderYpos = (by2-10)-sliderYsize;
        value = minVal + (sliderRange* ( ((float)sliderYpos-(by1+10))/ sliderRange ) );
        if (value < minVal) value = minVal;
        if (value > maxVal) value = maxVal;
    }


    if ((status == 1) && (clickedOn == true)) {
        if (InBox(*mouseXposPtr, *mouseYposPtr, bx1, sliderYpos, bx2, sliderYpos+sliderYsize)) {
            clickPos = (by1+10)+(*mouseYposPtr-sliderYpos);
            barClicked = true;
        }
    }


    if (status == 3) {
        DrawPanel(bx1, by1, bx2, by1+9, mui::VScrollBar::col, mui::PanelStyle::InButton);
    } else {
        DrawPanel(bx1, by1, bx2, by1+9, mui::VScrollBar::col, mui::PanelStyle::OutButton);
    }

    if (status == 4) {
        DrawPanel(bx1, by2-9, bx2, by2, mui::VScrollBar::col, mui::PanelStyle::InButton);
    } else {
        DrawPanel(bx1, by2-9, bx2, by2, mui::VScrollBar::col, mui::PanelStyle::OutButton);
    }


    struct vert {
        int x,y;
        u_int col;
    } verts[8];

    verts[0] = (vert){ lArrowX-2    , lArrowY+2 , 0xffffffff };
    verts[1] = (vert){ lArrowX      , lArrowY   , 0xffffffff };
    verts[2] = (vert){ lArrowX      , lArrowY   , 0xffffffff };
    verts[3] = (vert){ lArrowX+3    , lArrowY+3 , 0xffffffff };

    verts[4] = (vert){ rArrowX-2    , rArrowY-2 , 0xffffffff };
    verts[5] = (vert){ rArrowX      , rArrowY   , 0xffffffff };
    verts[6] = (vert){ rArrowX      , rArrowY   , 0xffffffff };
    verts[7] = (vert){ rArrowX+3    , rArrowY-2 , 0xffffffff };

    if (status == 3) {
        verts[0].x++; verts[0].y++;
        verts[1].x++; verts[1].y++;
        verts[2].x++; verts[2].y++;
        verts[3].x++; verts[3].y++;
    } else if (status == 4) {
        verts[4].x++; verts[4].y++;
        verts[5].x++; verts[5].y++;
        verts[6].x++; verts[6].y++;
        verts[7].x++; verts[7].y++;
    }

    glDisable(GL_TEXTURE_2D);
    glDisable(GL_LIGHTING);

    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);

    glVertexPointer(2, GL_INT, sizeof(vert), &verts[0].x);
    glColorPointer(3, GL_UNSIGNED_BYTE, sizeof(vert), &verts[0].col);

    glDrawArrays(GL_LINES, 0, 8);


    DrawPanel(bx1, by1+10, bx2, by2-10, mui::VScrollBar::col, mui::PanelStyle::TextBox);


    if (barClicked) {
        DrawPanel(bx1, sliderYpos, bx2, sliderYpos+sliderYsize, mui::VScrollBar::col, mui::PanelStyle::InButton);
    } else {
        DrawPanel(bx1, sliderYpos, bx2, sliderYpos+sliderYsize, mui::VScrollBar::col, mui::PanelStyle::OutButton);
    }

}
示例#9
0
void mui::Button::DoButton() {

    // Button click handling
    mui::Button::status = 0;
    mui::Button::clicked = false;

    if (mui::Button::disabled == false) {
        if ((mouseClickPtr != NULL) && (mouseXposPtr != NULL) && (mouseYposPtr != NULL)) {

            if (*mouseClickPtr)  {

                if ((*mouseXposPtr >= mui::Button::x) &&
                    (*mouseXposPtr <= mui::Button::x+(mui::Button::w)) &&
                    (*mouseYposPtr >= mui::Button::y) &&
                    (*mouseYposPtr <= mui::Button::y+(mui::Button::h))
                ) {

                    if (*mouseOldClickPtr == false) mui::Button::clickedOn = true;
                    if (mui::Button::clickedOn) mui::Button::status = 1;

                }

            } else {

                if ((clickedOn) && (*mouseOldClickPtr)) {
                    if ((*mouseXposPtr >= mui::Button::x) &&
                        (*mouseXposPtr <= mui::Button::x+(mui::Button::w)) &&
                        (*mouseYposPtr >= mui::Button::y) &&
                        (*mouseYposPtr <= mui::Button::y+(mui::Button::h))
                    ) {
                        mui::Button::status = 2;
                        mui::Button::clicked = true;
                    }
                }

                mui::Button::clickedOn = false;

            }

        }
    } else {

        mui::Button::clickedOn = false;

    }

    // Draw the button itself
    int cx,cy;
    if (mui::Button::disabled == false) {

        if (mui::Button::status == 0)
            DrawPanel(mui::Button::x, mui::Button::y, mui::Button::x+mui::Button::w, mui::Button::y+mui::Button::h, mui::Button::col, mui::PanelStyle::OutButton);
        else
            DrawPanel(mui::Button::x, mui::Button::y, mui::Button::x+mui::Button::w, mui::Button::y+mui::Button::h, mui::Button::col, mui::PanelStyle::InButton);

        if (currentFont != NULL) {

            cx=(mui::Button::x+(mui::Button::w/2))-(currentFont->CalcStrLen(text)/2);
            cy=(mui::Button::y+(mui::Button::h/2))-(currentFont->GetCharHeight()/2);

            if (mui::Button::status) {
                cx++;
                cy++;
            }

            currentFont->DrawText(text, cx, cy, 1, gdl::Color::White);

        }

    } else {

        cx=(mui::Button::x+(mui::Button::w/2))-(currentFont->CalcStrLen(text)/2);
        cy=(mui::Button::y+(mui::Button::h/2))-(currentFont->GetCharHeight()/2);

        DrawPanel(mui::Button::x, mui::Button::y, mui::Button::x+mui::Button::w, mui::Button::y+mui::Button::h, mui::Button::col, mui::PanelStyle::OutButton);
        currentFont->DrawText(text, cx, cy, 1, 0xff848484);

    }

}
示例#10
0
char Proc_Display(char *NC)
{
  CHECK_BOX Disp_Check[3]                            ;
  char key,Event,temp[1],active_digit,rx_char        ;
  char index,down_id=0xFF,i,flicker = 0              ;
  union
  {
    unsigned int  pos[2]                             ;
    char byte[4]                                     ;
  }TPoint                                            ;
  Color     = Black                                  ;
  Color_BK  = 0xEF9F                                 ;
  Clear_LCD(Color_BK)                                ;
  DrawRectFill(0,0,240,25,Blue)                      ;
  DrawRectFill(0,295,240,25,Blue)                    ;
  ShowIcon24(217,0,24,23,ICON_CLOSE)                 ;
  Color    = 0xFFFF                                  ;
  Color_BK = Blue                                    ;
  PutStringCN16(4,4,"数码管控制")                    ;
  PutStringCN16(200,300,"退出")                      ;
  Color    = Black                                   ;
  Color_BK = WINDOW_BK_COLOR                         ;
  DrawFrame(3,80,232,48)                             ;
  DrawRectFill(4,81,232,46,Black)                    ;
  DrawPanel(6,160,228,72,"")                         ;
  CreateButton(1,"<",15, 175,45,20)                 ;
  CreateButton(2,">",70, 175,45,20)                 ;
  CreateButton(3,"+",125,175,45,20)                 ;
  CreateButton(4,"-",180,175,45,20)                 ;  
  for(active_digit=1;active_digit<9;active_digit++)
  {
    temp[0] = Find_Data(LED[active_digit-1].data)    ;
    if(!(LED[active_digit-1].mode&DIGIT_OFF))
      Draw7Seg2436(temp[0],(active_digit-1)*29+5,
                   87,Red,Black                  )   ; 
    if(!(LED[active_digit-1].data&SEGDP))
      DrawRectFill((active_digit-1)*29+30,120,
                  3,3,Red)                           ;
  }
  for(active_digit=1;active_digit<9;active_digit++)
  {
    DrawFrame((active_digit-1)*29+14,139,11,11)      ;    
    DrawRectFill((active_digit-1)*29+15,140,10,10,Dark_Grey); 
  }
  DrawRectFill(15,140,10,10,Green)                   ; 
  active_digit = 1                                   ;
  CreateCheck(&Disp_Check[0],25 ,210,12,12,"闪烁")   ;
  CreateCheck(&Disp_Check[1],90 ,210,12,12,"消隐")   ;
  CreateCheck(&Disp_Check[2],150,210,12,12,"小数点") ;
  if(LED[active_digit-1].mode&DIGIT_FLICKER)
    CheckCheck(&Disp_Check[0])                       ;
  if(LED[active_digit-1].mode&DIGIT_OFF)
    CheckCheck(&Disp_Check[1])                       ;
  if(!(LED[active_digit-1].data&SEGDP))
    CheckCheck(&Disp_Check[2])                       ;   
  temp[0]      = 0x00                                ;
  for(;;)
  {
    OS_WaitMail(&MBKeyTP)                            ;
    OS_GetMail1(&MBKeyTP, &Event)                    ;
    OS_GetMail1(&MBKeyTP, &key)                      ; 
    OS_GetMail1(&MBKeyTP, &rx_char)                  ; 
    OS_GetMail1(&MBKeyTP, &TPoint.byte[0])           ; 
    OS_GetMail1(&MBKeyTP, &TPoint.byte[1])           ; 
    OS_GetMail1(&MBKeyTP, &TPoint.byte[2])           ; 
    OS_GetMail1(&MBKeyTP, &TPoint.byte[3])           ;     
    if(Event&EVENT_TP_TOUCHED)
    {
      index = InScopeButton(TPoint.pos[0],
                            TPoint.pos[1] )          ;
      if(index==0xFF)
      {
        OS_Use(&SemaLCD)                             ; 
        SetButtonUp(down_id)                         ;
        down_id = index                              ;
        OS_Unuse(&SemaLCD)                           ;            
      }
      else if(index!=down_id)
      {
        OS_Use(&SemaLCD)                             ; 
        SetButtonUp(down_id)                         ;
        down_id = index                              ;
        SetButtonDown(down_id)                       ;
        OS_Unuse(&SemaLCD)                           ;            
      }
    }
    else if(Event&EVENT_TP_PRESSED)  
    {  
      index = InScopeButton(TPoint.pos[0],
                            TPoint.pos[1] )          ;
      OS_Use(&SemaLCD)                               ; 
      SetButtonUp(index)                             ;
      down_id  = 0xFF                                ;
      OS_Unuse(&SemaLCD)                             ; 
      switch(index)
      {
      case 1:
        if(active_digit>1)
        {
          active_digit--                              ;
          DrawRectFill((active_digit)*29+15,140,10,10,Dark_Grey); 
          DrawRectFill((active_digit-1)*29+15,140,10,10,Green); 
          if(LED[active_digit-1].mode&DIGIT_FLICKER)
            CheckCheck(&Disp_Check[0])               ;
          else
            unCheckCheck(&Disp_Check[0])             ;
          if(LED[active_digit-1].mode&DIGIT_OFF)
            CheckCheck(&Disp_Check[1])               ;
          else
            unCheckCheck(&Disp_Check[1])             ;
          if(!(LED[active_digit-1].data&SEGDP))
            CheckCheck(&Disp_Check[2])               ;
          else
            unCheckCheck(&Disp_Check[2])             ;
        }
        break                                        ;
      case 2:
        if(active_digit<8)
        {
          active_digit++                              ;
          DrawRectFill((active_digit-2)*29+15,140,10,10,Dark_Grey); 
          DrawRectFill((active_digit-1)*29+15,140,10,10,Green); 
          if(LED[active_digit-1].mode&DIGIT_FLICKER)
            CheckCheck(&Disp_Check[0])               ;
          else
            unCheckCheck(&Disp_Check[0])             ;
          if(LED[active_digit-1].mode&DIGIT_OFF)
            CheckCheck(&Disp_Check[1])               ;
          else
            unCheckCheck(&Disp_Check[1])             ;
          if(!(LED[active_digit-1].data&SEGDP))
            CheckCheck(&Disp_Check[2])               ;
          else
            unCheckCheck(&Disp_Check[2])             ;
        }
        break                                        ;
      case 3:        
        temp[0] = Find_Data(LED[active_digit-1].data);
        if(++temp[0]>9)   temp[0] = 0                ;
        LED[active_digit-1].data |= 0x7F             ;
        LED[active_digit-1].data &= SMG[temp[0]]     ;
        Draw7Seg2436(temp[0],(active_digit-1)*29+5,
                     87,Red,Black                 )  ;        
        break                                        ;
      case 4:        
        temp[0] = Find_Data(LED[active_digit-1].data);
        if(--temp[0]>250)   temp[0] = 9              ;
        LED[active_digit-1].data |= 0x7F             ;
        LED[active_digit-1].data &= SMG[temp[0]]     ;
        Draw7Seg2436(temp[0],(active_digit-1)*29+5,
                     87,Red,Black                 )  ;        
        break                                        ;
      }
      for(i=0;i<3;i++)
      {
        if(!InCheckScope(TPoint.pos[0],
                         TPoint.pos[1],
                         &Disp_Check[i]))
        {
          if(Disp_Check[i].status&CHECK_CHECKED)
          {
            unCheckCheck(&Disp_Check[i])             ;
            switch(i)
            {
            case 0:
              LED_Flicker_Digit(active_digit,0)      ; 
              temp[0] = Find_Data(LED[active_digit-1].data)                ;
              if(!(LED[active_digit-1].mode&DIGIT_OFF))
              {
                Draw7Seg2436(temp[0],(active_digit-1)*29+5,
                             87,Red,Black                  )     ; 
                if(!(LED[active_digit-1].data&SEGDP))
                  DrawRectFill((active_digit-1)*29+30,120,3,3,Red)          ;
              }
              break                                  ;
            case 1:
              temp[0] = Find_Data(LED[active_digit-1].data)  ;
              Draw7Seg2436(temp[0],(active_digit-1)*29+5,
                           87,Red,Black                  )   ; 
              if(!(LED[active_digit-1].data&SEGDP))
                  DrawRectFill((active_digit-1)*29+30,120,3,3,Red)    ;
              LED[active_digit-1].mode  &=~DIGIT_OFF ;
              break                                  ;
            case 2:
              LED[active_digit-1].data  |= SEGDP     ;
              DrawRectFill((active_digit-1)*29+30,120,
                            3,3,Black)               ;
              break                                  ;
            }
          }
          else
          {
            CheckCheck(&Disp_Check[i])               ;
            switch(i)
            {
            case 0:
              LED_Flicker_Digit(active_digit,1)      ; 
              break                                  ;
            case 1:
              temp[0] = Find_Data(LED[active_digit-1].data)  ;
              Draw7Seg2436(temp[0],(active_digit-1)*29+5,
                           87,Black,Black                )   ; 
              DrawRectFill((active_digit-1)*29+30,120,
                            3,3,Black)               ;
              LED[active_digit-1].mode  |= DIGIT_OFF ;
              break                                  ;
            case 2:
              LED[active_digit-1].data  &=~SEGDP     ;
              DrawRectFill((active_digit-1)*29+30,120,
                           3,3,Red)                  ;
              break                                  ;
            }
          }
          break                                      ;
        }
      }
      if(  (TPoint.pos[0]<230&&TPoint.pos[0]>200&&TPoint.pos[1]>295)
         ||(TPoint.pos[0]>220&&TPoint.pos[1]<20             ))
          break                                      ;      
    }
    else if(Event&EVENT_FLICKER)
    {
      if(flicker++>0)
      {
        for(i=1;i<9;i++)
        {
          temp[0] = Find_Data(LED[i-1].data)                ;
          if(  !(LED[i-1].mode&DIGIT_OFF)
             && (LED[i-1].mode&DIGIT_FLICKER))
          {
            Draw7Seg2436(temp[0],(i-1)*29+5,
                         87,Red,Black                  )     ; 
            if(!(LED[i-1].data&SEGDP))
              DrawRectFill((i-1)*29+30,120,3,3,Red)          ;
          }
        }
        flicker  = 0x00                                    ;
      }
      else
      {
        for(i=1;i<9;i++)
        {
          temp[0] = Find_Data(LED[i-1].data)                ;
          if(  !(LED[i-1].mode&DIGIT_OFF)
             && (LED[i-1].mode&DIGIT_FLICKER))
          {
            Draw7Seg2436(temp[0],(i-1)*29+5,
                         87,Black,Black                 )   ; 
            if(!(LED[i-1].data&SEGDP))
              DrawRectFill((i-1)*29+30,120,3,3,Black)      ;
          }
        }
      }                  
    }
  } 
  DeleteButton(1)                                    ;
  DeleteButton(2)                                    ;
  DeleteButton(3)                                    ;
  DeleteButton(4)                                    ;
  return 0x00                                        ;
}