📄 note.cc
字号:
#include "note.h"#include <stdio.h> // printf, putcharnote::~note(){ delete s;}note::note(){ s = new script( NULL ); s -> id_mask = ID_MAIN; last = NULL; next = NULL; // note list cols = 80; rows = 30; // text() ?// font, font_bitmap, cursor, x, y}void note::clear(){ printf( "\x1B[H\x1B[J" ); // home the cursor, clear the screen fflush( stdout );}void note::repos( int col, int row ){ if( col == cols ) printf( "\x1B[%d;%df", ( y = row ) + 1, ( x = col ) ); else printf( "\x1B[%d;%df", ( y = row ) + 1, ( x = col ) + 1 ); fflush( stdout );}void note::repos_up(){ if( x == cols ) printf( "\x1B[%d;%df", y--, x ); else printf( "\x1B[%d;%df", y--, x + 1 ); fflush( stdout );}void note::repos_down(){ if( x == cols ) printf( "\x1B[%d;%df", ++y + 1, x ); else printf( "\x1B[%d;%df", ++y + 1, x + 1 ); fflush( stdout );}void note::repos_left(){ printf( "\x1B[%d;%df", y + 1, x-- ); fflush( stdout );}void note::repos_right(){ x++; if( x == cols ) printf( "\x1B[%d;%df", y + 1, x ); else printf( "\x1B[%d;%df", y + 1, x + 1 ); fflush( stdout );}void note::erase( int col, int row, int len ){ printf( "\x1B[%d;%df", row + 1, col + 1 ); int it = 0; for(; it < len; it++ ) { putchar( ' ' ); } repos( x, y ); fflush( stdout );}char note::write( register char c, int col, int row ){ printf( "\x1B[%d;%df%c", row + 1, col + 1, c ); repos( x, y ); fflush( stdout ); return c;}#include <stdio.h>char* note::write( register char* str, int col, int row ){ int i = 0; for(; str[ i ] != '\0'; i++ ) { printf( "\x1B[%d;%df%c", row + 1, col + i + 1, str[ i ] ); } repos( x, y ); fflush( stdout );}char note::write_hex( register char c ){/* static int col = 0; char text[ 2 ]; strcpy( text, " \0" ); text[ 0 ] = c + '0'; brfont_write( text, ( int )ceil( col * FONT_X ), 0, font, ( BITMAP* )views[ 0 ] -> bitmap ); // was screen::bitmap col++; return c;*/}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -