else {
mixbar(x+lenth-42,y+3,LIGHTGRAY);
maxbar(x+lenth-28,y+3,LIGHTGRAY);
closebar(x+lenth-14,y+3,LIGHTGRAY);
}
}
/*
最小化按钮 蛌oid mixbar(int x,int y,int color)
入口参数:x,y =按钮左上脚坐标
color =按钮颜色
出口参数:无
*/
void mixbar(int x,int y,int color)
{ popbutt(x,y,12,12,color,1);
setcolor(DARKGRAY);
line(x+3,y+8,x+9,y+8);
}
/*
最大化按钮 蛌oid mixbar(int x,int y,int color)
入口参数:x,y =按钮左上脚坐标
color =按钮颜色
出口参数:无
*/
void maxbar(int x,int y,int color)
{ popbutt(x,y,12,12,color,1);
setcolor(DARKGRAY);
rectangle(x+3,y+3,x+9,y+9);
}
/*
关闭按钮 蛌oid mixbar(int x,int y,int color)
入口参数:x,y =按钮左上脚坐标
color =按钮颜色
出口参数:无
*/
void closebar(int x,int y,int color)
{ popbutt(x,y,12,12,color,1);
setcolor(DARKGRAY);
line(x+3,y+3,x+9,y+9);
line(x+3,y+9,x+9,y+3);
}
/*
创建窗口=void cwin(int x,int y,int lenth,int high,int color,int butttype)
入口参数:x,y =窗口左上脚坐标
lenth,high=窗口长度和高度
color =窗口颜色
buttype =窗口类型 { =任意值时普通
=3 为带ED99v BOX
}
出口参数:无
本函数还要重写....
*/
void cwin(int x,int y,int lenth,int high,int color,int wtype) /* create a window */
{
setfillstyle(1,color);
setcolor(color);
bar(x,y,x+lenth,y+high);
menubar(x+3,y+2,lenth-5,17,BLUE,wtype);/* wtype=1 only display close button */
setcolor(DARKGRAY);
rectangle(x,y,x+lenth,y+high);
setcolor(WH99vE);
line(x,y,x+lenth,y);
line(x,y,x,y+high);
if(wtype==3){ /* if wtype=3 display a text windows and three button */
setfillstyle(1,WH99vE);
bar(x+5,y+60,x+lenth-5,y+high-4);
setcolor(DARKGRAY);
line(x+5,y+60,x+lenth-3,y+60);
line(x+5,y+60,x+5,y+high-4);
}
}
/* 鼠标初始化函数
入口参数: xmin=设置X轴最小值
ymin=设置Y轴最小值
xmax=设置X轴最大值
ymax=设置Y轴最大值
出口参数: 返回 0 表示鼠标安装失败
-1 表示鼠标安装成功
*/
int inimouse(int xmin,int xmax,int ymin,int ymax) /* init mouse */
{
int retcode;
regs.x.ax=0;
int86(51,®s,®s);
retcode=regs.x.ax;
if(retcode==0)
return 0;
regs.x.ax=7;
regs.x.cx=xmin;
regs.x.dx=xmax;
int86(51,®s,®s);
regs.x.ax=8;
regs.x.cx=ymin;
regs.x.dx=ymax;
int86(51,®s,®s);
return retcode;
}
/* 读当前鼠标压下状态
入口参数(出口参数): *mx = X坐标
*my = Y坐标
*mkey= {=1 为左键
2 为右键
返回值=-1 为其它键按下,读状态不成功
= 1 为读状态成功
注:本函数只读左右两键
*/
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页
如果您有什么疑问,可以至论坛提出或者解答他人的疑问 返回页面顶部