📄 asystem.cpp
字号:
//---------------------------------------//
// 工程文件: ARON.PRJ
// 程序: SYSTEM.CPP
// 功能: 系统方面的函数集
// 时间: 97,9,24
// 作者: 胡丙龙
//---------------------------------------//
#include <alloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <graphics.h>
#include <process.h>
#include <conio.h>
#include <dos.h>
#include "afun.h"
#include "adps.h"
extern char filename[13];
extern DPS *head;
extern FILE *fp16;
extern char drlntp;
extern char mnumber[3];
extern char mtype[9];
extern char mlen[5];
extern char mradius[5];
extern char drcolor;
extern char modified;
extern char graphexist;
//--------------------------------------------------//
// 函数: QUIT()
// 功能: 退出,并检测修改过的文件是否存盘,确认退出
// 入口参数:
// 出口参数:
//--------------------------------------------------//
void Quit()
{
int x1,y1,len,high;
FILE *fp;
char oldcolor,yn[2];
char *notsave="文件没有存盘,存吗?";
void *buf;
HideMouse();
oldcolor=getcolor();
setfillstyle(1,7);
setcolor(15);
x1=80;
y1=341;
len=190;
high=50;
buf=malloc(imagesize(x1,y1,x1+len,y1+high));
getimage(x1,y1,x1+len,y1+high,buf);
if (!modified) { free(buf);return;}; //文件没有被修改,则返回
bar(x1,y1,x1+len,y1+high);
rectangle(x1,y1,x1+len,y1+high);
rectangle(x1+2,y1+2,x1+len-2,y1+high-2);
setfillstyle(1,7);
PutCC16(x1+18,y1+17,0,14,notsave);
GetData(YN,x1+18,y1+17,notsave,yn,1);
if (strcmp(yn,"Y")) { free(buf);return;}; //不存盘退出
putimage(x1,y1,buf,COPY_PUT);
free(buf);
ShowMouse();
setcolor(oldcolor);
WriteToFile();
return;
}
//--------------------------------------------------//
// 函数: REALQUIT()
// 功能: 退出系统,关闭图形和打开的文件
// 入口参数:
// 出口参数:
//--------------------------------------------------//
void RealQuit()
{
fclose(fp16);
if (graphexist==TRUE) free(head);
HideMouse();
closegraph();
exit(0);
}
//--------------------------------------------------//
// 函数: SHOWCURSTATE()
// 功能: 显示当前状态行:绘图颜色和线型
// 入口参数:
// 出口参数:
//--------------------------------------------------//
void ShowCurState()
{
setfillstyle(1,1);
bar(638-140,460,638,476);
bar(638-220,460,638-150-25,476);
bar(638-350,460,638-220-20,476);
bar(638-440,460,638-350-24,476);
bar(638-558,460,638-440-24,476);
setcolor(13);
outtextxy(638-140+4,466,"File:");
outtextxy(638-220+4,466,"No:");
outtextxy(638-350+4,466,"Type:");
outtextxy(638-440+4,466,"Len:");
outtextxy(638-558+4,466,"Radius:");
setcolor(7);
outtextxy(638-140+44,466,filename);
outtextxy(638-220+28,466,mnumber);
outtextxy(638-350+44,466,mtype);
outtextxy(638-440+34,466,mlen);
outtextxy(638-558+60,466,mradius);
}
//--------------------------------------------------//
// 函数: CLEARSTATE()
// 功能: 清除提示信息行的提示信息
// 入口参数:
// 出口参数:
//--------------------------------------------------//
void ClearState()
{
HideMouse();
setfillstyle(1,3);
bar(80,460,400,476);
ShowMouse();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -