📄 newtest.c
字号:
#include <graphics.h>
#include <bios.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
/*#include "c:\MyTele\MyCCode\Message.h"
#include "c:\MyTele\MyCCode\Common.h"
#include "c:\MyTele\MyCCode\KeyMenu.h"
#include "c:\MyTele\MyCCode\Frame.h"*/
#include "e:\Progra~1\MyCCode\Message.h"
#include "e:\Progra~1\MyCCode\Common.h"
#include "e:\Progra~1\MyCCode\KeyMenu.h"
#include "e:\Progra~1\MyCCode\Frame.h"
#include "e:\Progra~1\MyCCode\List.h"
extern int KeyboardMessage[2];//[0]KeyType, [1]KeyCode.
extern TRAIN trains[40];
int colortable[3]={30,41,52}; //RGB max is not 256 is 64.
void Initface();
void setcolortable(int Index,int table[]);
//////////////////////////////////////////////////////
void main()
{
int MenuID=0;
Initface();
while(1)
{
PostKeybrdMessage();
if(KeyboardMessage[1]==SPECIAL_KEY_ALT)
{
MenuID=MenuFunction();
OperateID(MenuID);
}
TwoListFunction();
}
closegraph();
}
////////////////////////////////////////////////////////
void setcolortable(int Index,int table[])
{
int j;
outportb(0x3c8,Index);
for(j=0;j<3;j++)
{
outportb(0x3c9,table[j]);
}
}
void Initface()
{
int drv=0,mode;
initgraph(&drv,&mode,"d:\\borlandc\\bgi");
setcolortable(FRAME_COLOR,colortable);
colortable[0]=3;
colortable[1]=33;
colortable[2]=63;
setcolortable(3,colortable);
DrawCaptain(0,0,639,
FRAME_COLOR,CAPTAIN_COLOR,
"Train Schedule - Designed by Dengxiao (99070508)",
1);
DrawTitle(0,13,639,28,
FRAME_COLOR,MENUTEXT_COLOR,
8);//none will be select
//Main list/////////////////////////////////
DrawWindow(0,29,450,279,
FRAME_COLOR,ACTIVE_COLOR,
"Main list",1,
2,0);
DrawTrainList(3,42,447,//height is ruled
ACTIVE_COLOR,
17);
////////////////////////////////////////////
DrawWindow(451,29,639,279,
FRAME_COLOR,ACTIVE_COLOR,
"Main statistics",1,
2,1);
DrawStaticsGird(451,29);
//Find list/////////////////////////////////
DrawWindow(0,280,450,479,
FRAME_COLOR,SLEEP_COLOR,
"Find list",0,
2,0);
DrawTrainList(3,293,447,//height is ruled
SLEEP_COLOR,
13);
/////////////////////////////////////////////
DrawWindow(451,280,639,479,
FRAME_COLOR,SLEEP_COLOR,
"Find statistics",0,
2,1);
DrawStaticsGird(451,280);
New(0);
/*UpdateStaticsData(451,29,0);
UpdateStaticsData(451,280,1);*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -