border.c

来自「在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LE」· C语言 代码 · 共 94 行

C
94
字号
/*
******************************************************************
*                  XIAMEN YAXON NETWORK CO.LTD.  
*                   XINXI BUILDING,HULI,XIAMEN
*      (c) Copyright 2002,XIAMEN YAXON NETWORK CO.LTD. ,XIAMEN
*                     All Rights Reserved
*
* FileName     :  BORDER.C
* Programmer(s):  WuJingYu
* Description  : 
******************************************************************
*/

/*
*****************************************************************
*                  REVISION HISTORY
*                 
* Date:    2002-10-16
*****************************************************************
*/ 
#define BORDER_GLOBALSE 

#include "includes.h"
#include "Lcd.h"

static INT8U  PosRow1,PosCol1,PosRow2,PosCol2;

void GetBorderPara(OUTBOX *boxptr)
{
     PosRow1 = boxptr->row_dot;
     PosCol1 = boxptr->col_dot;
     PosRow2 = PosRow1 + boxptr->numrow * (2*FONTROW + boxptr->space_dot);
     PosCol2 = PosCol1 + boxptr->numcol * FONTCOL;
     
     if (PosRow1 < FONTROW/2) 
     {
         PosRow1 = 0;
     }
     else 
     {
        PosRow1 -= FONTROW/2;    
     }
     
     if (PosCol1 < FONTCOL/2) 
     { 
        PosCol1 = 0;
     }
     else 
     {
        PosCol1 -= FONTCOL/2;
     }   
     
     if (boxptr->scrollbar != SCROLLBAR_NONE) 
     {
        PosCol2 += FONTCOL;
     } 
     else 
     {
        PosCol2 += FONTCOL/2;
     }
        
     PosRow2 += 1;
}

void CreateBorder(OUTBOX *boxptr)
{
     GetBorderPara(boxptr);
     
     switch (boxptr->borderstyle) 
     {
        case BORDER_NONE:
           break;
        case BORDER_2D:
           DrawRect(PosRow1,PosCol1,PosRow2,PosCol2,0);
           break; 
        case BORDER_3D:
           DrawRect(PosRow1,PosCol1,PosRow2,PosCol2,1);
           break;
        default:
           break;   
     }
}

void ClearBorder(OUTBOX *boxptr,BOOLEAN updatelcd)
{
     GetBorderPara(boxptr);
     ClearArea(PosRow1,PosCol1,PosRow2-PosRow1,PosCol2-PosCol1);
     
     if (updatelcd) 
     {
         LcdUpdate_dots(PosRow1,PosCol1,PosRow2-PosRow1,PosCol2-PosCol1);
     }   
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?