📄 box.h
字号:
/*******************************************************************************
模 块: 常用对话框.
功 能: Msgbox, QuestionBox, LoginBox, InputBox, PasswordBox
程序员: 雷中南.
版 本: v1.1
时 间: 1999-05-10
*******************************************************************************/
#ifndef _MSGBOX
#define _MSGBOX
#include "window.h"
#include "button.h"
#include "edit.h"
//消息窗,允许显示一行消息.
class MsgBox : public Window
{
public:
//构造函数.输入参数为:消息.
MsgBox(char *buf);
//析构函数.
~MsgBox();
//消息.
char *Msg;
//按钮.
Button *btOK;
//运行窗口.
void DoIt();
//画窗口.
void Draw();
};
//问题消息窗,可以给一行消息,允许用户选择处理方法.
class QuestionBox : public Window
{
public:
//构造函数.输入参数为:消息.
QuestionBox(char *buf, char *bt1, char *bt2);
//析构函数.
~QuestionBox();
//消息.
char *Msg;
//按钮.
Button *btOK;
Button *btNO;
//运行窗口.
void DoIt();
//画窗口.
void Draw();
};
//登录窗口,可输入用户名以及密码.
class LoginBox : public Window
{
public:
//构造函数.
LoginBox();
//析构函数.
~LoginBox();
//运行窗口.
void DoIt();
//用户框.
Edit *User;
//口令框.
Edit *Password;
//确定按钮.
Button *btOK;
//取消按钮.
Button *btNO;
//获取用户名.
char *GetUser();
//获取口令.
char *GetPassword();
//画窗口.
void Draw();
};
//输入对话窗,允许给出一行标题,并允许输入相应信息.可选择确定和取消.
class InputBox : public Window
{
public:
//构造函数.
InputBox(char *buf);
//析构函数.
~InputBox();
//消息.
char *Msg;
//设置文本.
void SetText(char *buf);
//文本.
char *Text();
//输入文本框.
Edit *InputLine;
//按钮
Button *btOK;
Button *btNO;
//运行.
void DoIt();
//重画窗口.
void Draw();
};
//密码窗,允许输入密码,密码以'*'显示
class PasswordBox : public Window
{
public:
//构造函数.
PasswordBox();
//析构函数.
~PasswordBox();
//返回密码文本.
char *Text();
//密码文本框.
Edit *InputLine;
//运行.
void DoIt();
//重画窗口.
void Draw();
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -