terminalctrl.h

来自「LastWave」· C头文件 代码 · 共 93 行

H
93
字号
#ifndef _TERMINALCTRL_H_#define _TERMINALCTRL_H_// Define a new frame type for implementing a terminalclass TerminalCtrl : public wxTextCtrl{public:    STREAM streamIn,streamOut,streamErr;    TerminalCtrl(wxFrame *parent, const wxString& title,                 const wxPoint& pos, const wxSize& size);    void PrintStr(char *str);    void PrintErrStr(char *str);    void PrintChar(char c);     void Flush();     void CursorGoForward(int n);     void CursorGoBackward(int n);     void InsertChar(char c, char *str);    void DeleteInsertChar(int n, char *str);         void KeyDown(wxKeyEvent& event);    void KeyChar(wxKeyEvent& event);    void MouseDownEvents(wxMouseEvent& event);    void MouseUpEvents(wxMouseEvent& event);    void MouseMotionEvent(wxMouseEvent& event);    void Idle(wxIdleEvent & event);    void WaitNextEvent();#if wxUSE_CLIPBOARD    void DoPasteFromClipboard();    void DoCopyToClipboard();#endif        DECLARE_EVENT_TABLE()};// Define a new frame typeclass TerminalFrame: public wxFrame{private:public:    TerminalCtrl* textCtrl;    TerminalFrame(wxFrame *parent, const wxString& title,            const wxPoint& pos, const wxSize& size);    void PrintStr(char *str) {textCtrl->PrintStr(str);};    void PrintErrStr(char *str) {textCtrl->PrintErrStr(str);};    void PrintChar(char c)  {textCtrl->PrintChar(c);};    void Flush()  {textCtrl->Flush();};    void CursorGoForward(int n)  {textCtrl->CursorGoForward(n);};    void CursorGoBackward(int n)  {textCtrl->CursorGoBackward(n);};    void InsertChar(char c, char *str) {textCtrl->InsertChar(c,str);};    void DeleteInsertChar(int n, char *str)  {textCtrl->DeleteInsertChar(n,str);};    void OnActivate(wxActivateEvent& event);    void Clear() {textCtrl->Clear();}public:#if wxUSE_CLIPBOARD    void OnPasteFromClipboard(wxCommandEvent& WXUNUSED(event)) {textCtrl->DoPasteFromClipboard();}    void OnCopyToClipboard(wxCommandEvent& WXUNUSED(event)) {textCtrl->DoCopyToClipboard();}#endif        void OnQuit(wxCommandEvent& event);    void OnAbout(wxCommandEvent& event);        DECLARE_EVENT_TABLE()};// ID for the menu commandsenum{    TYPES_QUIT = wxID_EXIT,    TYPES_ABOUT = wxID_ABOUT,    // clipboard menu    TEXT_CLIPBOARD_COPY = 200,    TEXT_CLIPBOARD_PASTE,};extern bool GetKeyDownLWEvent(wxWindow *w, wxKeyEvent& event, struct event &ev); extern bool GetKeyCharLWEvent(wxWindow *w, wxKeyEvent& event, struct event &ev); #endif

⌨️ 快捷键说明

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