⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagebox.h

📁 Unix下的MUD客户端程序
💻 H
字号:
// The message box displays a message and either// 1) Disappears and dies after N seconds// or 2) waits for user to press RETURN// This class should be usually derived from, overriding the execute()// method#define CENTER "\001"class MessageBox : public Window{public:    // If wait == 0, wait until a key is pressed    MessageBox(Window *_parent, const char *_message, int _wait);        virtual void execute() {}    virtual void idle()    {        if (wait > 0 && current_time > creation_time+wait)        {            execute();            die();        }    }        bool keypress(int key)    {        if (wait == 0)        {            if(key == '\n' || key == '\r')            {                execute();                die();            }            return true;        }                return false;    }    private:    String message;    time_t creation_time;    int wait;};void messageBox(int wait, const char *fmt, ...);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -