📄 button.h
字号:
#define DOWN 1
#define UP 0
typedef struct
{
int left;
int top;
int right;
int bottom;
unsigned char forecolor;
unsigned char backcolor;
unsigned char state;
char *caption;
} BUTTON;
void draw3dbutton(BUTTON button,int ishz)
{
unsigned char c1=15,c2=0;
unsigned int len,cx,cy;
len=strlen(button.caption);
cx=(button.right-button.left-len*9)/2+button.left;
cy=(button.bottom-button.top-10)/2+button.top;
if (!button.state)
{
c1=0;
c2=15;
}
hline(button.left+2,button.right-2,button.bottom-2,c1);
hline(button.left,button.right,button.bottom,c1);
vline(button.top+2,button.bottom-2,button.right-2,c1);
vline(button.top,button.bottom,button.right,c1);
hline(button.left+2,button.right-2,button.top+2,c2);
hline(button.left,button.right,button.top,c2);
vline(button.top+2,button.bottom-2,button.left+2,c2);
vline(button.top,button.bottom,button.left,c2);
fill(button.left+3,button.top+3,button.right-3,button.bottom-3,button.backcolor);
if (ishz)
hz(cx+button.state,cy+button.state,0,button.caption);
else
text(cx+button.state,cy+button.state,button.caption,2,button.forecolor);
}
void novisable(BUTTON button)
{
fill(button.left,button.top,button.right,button.bottom,BACKCOLOR);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -