📄 border.c
字号:
/*
******************************************************************
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -