messagewindow.h
来自「Unix下的MUD客户端程序」· C头文件 代码 · 共 58 行
H
58 行
// This is a small derivative of Window that is numbered and// can be written to and created by the user and can also dump output// coming into it to the log fileclass MessageWindow: public ScrollableWindow, public Numbered {public: MessageWindow(Window *_parent, const char *_alias, const char *_logfile, int _w, int _h, int _x, int _y, Style _style, int _timeout, bool _popOnInput, int _color); static List<MessageWindow*> list; static MessageWindow* find(const char *_name); void addInput(const char *s) { if (popOnInput) { show(true); popUp(); } printf("%s\n", s); if (logfile.len()) { FILE *fp = fopen(logfile, "a"); if (fp) { fprintf(fp, "%s\n", s); fclose(fp); } } } virtual void idle() { if (visible && last_input+timeout < current_time) show(false); } virtual void popUp() { last_input = current_time; Window::popUp(); } ~MessageWindow() { list.remove(this); } private: String alias; // What is the window called? String logfile; // Name of logfile to log to (if not empty) bool popOnInput; // Should the window show itself when new input arrives? int timeout; // How long before hiding the window? time_t last_input; // When did we last get some input from this Window? int default_color; // set to that before clear etc.};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?