wxterminal.cc

来自「LastWave」· CC 代码 · 共 166 行

CC
166
字号
// For compilers that support precompilation, includes "wx/wx.h".#include "wx/wxprec.h"// for all others, include the necessary headers (this file is usually all you// need because it includes almost all "standard" wxWidgets headers)#ifndef WX_PRECOMP#include "wx/wx.h"#endifextern "C" {#include "lastwave.h"}#include "terminalCtrl.h"#include "wxmain.h"extern MyApp *myApp;/* * Initialization of the terminal console */extern "C" void XXInitTerminal(void);void XXInitTerminal(void){}/*  * Close the terminal */ extern "C" void XXCloseTerminal(void);void XXCloseTerminal(void){}/*  * Make a beep */ extern "C" void XXTerminalBeep(void); void XXTerminalBeep(void){}/* * Just print a string (not editable ==> no track of the cursor) */extern "C" void XXTerminalPrintStr(char *str); void  XXTerminalPrintStr(char *str){    myApp->terminal->PrintStr(str);} extern "C" void XXTerminalPrintErrStr(char *str); void  XXTerminalPrintErrStr(char *str){  myApp->terminal->PrintErrStr(str);}/*  * Same thing as above but with a character */extern "C" void XXTerminalPrintChar(char c); void  XXTerminalPrintChar(char c){    myApp->terminal->PrintChar(c);}/* * Just flushes the terminal output */ extern "C" void XXTerminalFlush(void); void XXTerminalFlush(void){  myApp->terminal->Flush();}/* * Make the cursor go forward by one space */ extern "C" void XXTerminalCursorGoForward(int n); void  XXTerminalCursorGoForward(int n){  myApp->terminal->CursorGoForward(n);}/* * Make the cursor go backward by one space */extern "C" void XXTerminalCursorGoBackward(int n); void  XXTerminalCursorGoBackward(int n){  myApp->terminal->CursorGoBackward(n);}/* * Print an editable character from the cursor position  * The 'str' corresponds to what is already displayed on the screen * and should be redrawn (shifted by 1 character). * The cursor should stay at the same position. */ extern "C" void XXTerminalInsertChar(char c,char *str);void  XXTerminalInsertChar(char c,char *str){  myApp->terminal->InsertChar(c,str);}/* * Same as above but "inserts" a delete character n times */ extern "C" void XXTerminalDeleteInsertChar(int n, char *str); void  XXTerminalDeleteInsertChar(int n, char *str){  myApp->terminal->DeleteInsertChar(n,str);}/* Move the terminal window */extern "C" void XXTerminalMoveWindow(int x,int y); void XXTerminalMoveWindow(int x,int y){  myApp->terminal->Move(x,y);}/* Resize the terminal window */extern "C" void XXTerminalResizeWindow(int w,int h); void XXTerminalResizeWindow(int w,int h){  myApp->terminal->SetSize(-1,-1,w,h);}/* get size of the terminal window */extern "C" void XXTerminalGetsizeWindow(int *w,int *h); void XXTerminalGetsizeWindow(int *w,int *h){  myApp->terminal->GetSize(w,h);}/* Clear terminal window */extern "C" void XXClear(); void XXClear(){  myApp->terminal->Clear();}

⌨️ 快捷键说明

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