📄 screen.cpp
字号:
// Screen.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include "screen.h"
#include "Vt100Disp.h"
extern int g_iArrPara[50]; //??
extern int iWidth;
struct struScreen struScrMsp; //??
int G0=0; //字符集G0
int G1=2; //字符集G1
//屏幕控制****************************************
int InitScreen()
{
memset(&struScrMsp,0,sizeof(struScrMsp));
struScrMsp.iScreenMode=1;
struScrMsp.iScreenWidth=iWidth;
struScrMsp.iOriginMode=1;
return 0;
}
//0---CSI 12h
//禁止本端回显,键盘数据仅送给主机
int SetLocDisplayforbid()
{
struScrMsp.iLocDisplay=0;
return 0;
}
//1---CSI 12l
//允许本端回显,键盘数据送给主机和屏幕
int SetLocDisplayallow()
{
struScrMsp.iLocDisplay=1;
return 0;
}
//0---CSI ?5h
//屏幕显示为白底黑字
int SetScreenModeBlackWord()
{
//??
struScrMsp.iScreenMode=0;
return 0;
}
//1---CSI ?5l
//屏幕显示为黑底白字
int SetScreenModeWhiteWord()
{
//??
struScrMsp.iScreenMode=1;
return 0;
}
//0---CSI ?3h 132列显示
int SetScreenWidth132()
{
//?
struScrMsp.iScreenWidth=132;
iWidth=132;
return 0;
}
//1---CSI ?3l 80列显示
int SetScreenWidth80()
{
//?
struScrMsp.iScreenWidth=80;
iWidth=80;
return 0;
}
//开窗,设置滚动区域
int SetRollWindow()
{
if (g_iArrPara[0] !=2)
return 1;
struScrMsp.iTopRow=g_iArrPara[1]-1;
struScrMsp.iButtomRow=g_iArrPara[2]-1;
return 0;
}
//0---CSI ?6h
//以用户指定的滚动区域的首行行首为参考原点
int SetOriginModeUsr()
{
struScrMsp.iOriginMode=0;
return 0;
}
//1---CSI ?6l
//以屏幕的首行行首为参考原点
int SetOriginModeHome()
{
struScrMsp.iOriginMode=1;
return 0;
}
//0---CSI ? 7 h
//当字符显示到行末时,自动回到下行行首接着显示;
//如果在滚动区域底行行末,则上滚一行再显示
int SetRowBackNext()
{
struScrMsp.iRowBack=0;
return 0;
}
//1---CSI ? 7 l
//当字符显示到行末时,仍在行末光标位置显示,
//覆盖原有的字符,除非接收到移动光标的命令
int SetRowBackNoMove()
{
struScrMsp.iRowBack=1;
return 0;
}
//以下函数暂留空MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
//滚动模式*******************
//CSI ?4h 平滑滚动
int SetRollModeSmooth()
{
return 0;
}
//CSI ?4l 跳跃滚动
int SetRollModeLeap()
{
return 0;
}
//扩展滚动模式***************
//CSI /0s 不滚动
int SetRowBackExtNoMove()
{
return 0;
}
//CSI /1s 平滑慢滚
int SetRowBackExtSmoothSlow()
{
return 0;
}
//CSI /2s 跳跃滚动
int SetRowBackExtLeap()
{
return 0;
}
//CSI /3s 平滑快滚
int SetRowBackExtSmoothFast()
{
return 0;
}
//监督模式
//CSI 3h 监督有效,显示控制符,供程序员调试程序用
int SetIntendanceHaveEffect()
{
return 0;
}
//CSI 3l 监督无效,执行控制符,正常运行程序
int SetIntendanceNoEffect()
{
return 0;
}
//状态行类型
//CSI 0$~ 禁止状态行(VT300有效)
int SetStaRowForbid()
{
return 0;
}
//CSI 1$~ 允许状态行(VT300有效)
int SetStaRowAllow()
{
return 0;
}
//CSI 2$~ 主机可写状态行(VT300有效)
int SetStaRowAllowWrite()
{
return 0;
}
//选择状态行显示
//CSI 0$| 主机可写状态行时,在主屏显示数据(VT300有效)
int SetMainScreenDisply()
{
return 0;
}
//CSI 1$| 主机可写状态行时,在状态行显示数据(VT300有效)
int SetStaRowDisplay()
{
return 0;
}
int SetMainScreenDisplay()
{
return 0;
}
int SeleCharSetG0_B()
{
G0=0;
return 0;
}
int SeleCharSetG0_0()
{
G0=2;
return 0;
}
int SeleCharSetG1_B()
{
G1=0;
return 0;
}
int SeleCharSetG1_0()
{
G1=2;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -