关于C语言的界面编辑问题

来源:百度知道 编辑:UC知道 时间:2024/06/20 04:27:36
可对文本文件进行简单的屏幕编辑,就是说需要类似Turbo C3.0 的编辑环境的界面
实现文本编辑的基本功能,可擦可写,可以用方向键控制光标,也可以直接有鼠标控制,还有菜单选项,例如有file、option之类的。
总之要求就是模仿TC的界面,但不需要TC那么复杂。
编程环境TC

希望能帮忙解释下文本的数据结构如何设计,最好能有源码。想研究一下,先谢谢了!

我这个是模仿的TC界面,不过没有功能,代码太多不想写了
#include <stdio.h>
#include <dos.h>
#include <bios.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define DOWN 0x5000
#define UP 0x4800
#define SPACE 0x3920
#define Esc 0x011b
#define ENTER 0x1c0d
#define Backspace 0xe08
#define ALT_B 12288
#define ALT_M 12800
#define ALT_H 8960

int key;
int textx,texty;
char save[4096];
char c[4096];
int i,j;
struct menustruct
{
char name[10];
char str[10][20];
int n;
}ml[3];

void Menu();
void Selectitem();
void DrawSelectitem();
void Run();
void RedText(int x,int y,char *z);
void DrawMl(int n);
void DrawFrame(int l,int u,int r,int d,int tcolor,int bcolor);

void main()
{

Menu();
Run();
}

void