?? window.h
字號:
#ifndef __WINDOW_H__
#define __WINDOW_H__
#include "State.h"
#include "Key.h"
#include "Type.h"
class Window
{
private:
enum
{
// 窗口中最大文本行數
MaxLine = 60,
// 文本行的最大長度
MaxLenOfLine = 60,
// 窗口標題的最大長度
MaxLenOfTitle = 70
};
// 窗口左上角坐標
int x0;
int y0;
// 窗口右下角坐標
int x1;
int y1;
// 是否有垂直滾動條標志
bool VerticalSign;
// 是否有陰影標志
bool Black;
// 垂直滾動條游標位置
int VerticalPos;
// 窗口文本高度,在計算游標位置時使用
int TotHigh;
// 當前文本行數量
int TotLine;
// 存儲文本行內容
char Line[MaxLine][MaxLenOfLine];
// 存儲標題內容
char Title[MaxLenOfTitle];
// 邊框前景色
int FrameForeground;
// 邊框背景色
int FrameBackground;
// 文本前景色
int TextForeground;
// 文本背景色
int TextBackground;
public:
Window(const int, const int, const int, const int, const int = true, const int = true);
~Window();
// 設置顏色
void SetColor(const int, const int, const int, const int);
// 設置標題
void SetTitle(const char []);
void SetTotHigh(const int);
// 顯示窗口
void Show();
// 滾動垂直滾動條
void ScrollVertical(const int);
// 滾動文本
void ScrollText(const int);
// 重置垂直滾動條
void ResetVertical();
// 等待用戶上下翻屏
void Work();
// 等待用戶輸入信息
void GetInput(char *, const int, const int, const int);
// 等待用戶按任意鍵
void Wait();
// 添加文本行
void Add(const char []);
// 隱藏窗口
void Hide();
// 清除文本行
void ClearText();
// 重新打印標題
void RefreshTitle();
void Clear();
// 返回窗口的頂部行號
inline int Top() const {return x0;}
// 返回窗口的底部行號
inline int Bottom() const {return x1;}
// 返回窗口的左部列號
inline int Left() const {return y0;}
// 返回窗口的右部列號
inline int Right() const {return y1;}
// 返回窗口文本區的高度
inline int High() const {return x1 - x0 - 1;}
// 返回窗口的標題
inline char* Caption() {return Title;}
};
// Window類中調用的外部函數
extern void Receive(int &);
extern void SetColor(const int,const int);
extern void PrintChar(const int,const int,const char);
extern void PrintLine(const int);
extern void ClearHeadBlank(char *);
extern void ClearTailBlank(char *);
extern void ShowError(const ErrorType, const int = -1, const char [] = "");
// Window類中引用的外部變量
extern int x0;
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -