做一个文本编辑器似乎已经不是很难了。
网上有很多源代码可以下载,也有具体的一步步的教程。
如:http://www.catch22.net/tuts/editor01.asp
但做一个graphical text editor呢?象WORD那样即可以画表格,也可以编辑带字体的文本。

图I
一开始我弄了这个(图I)用来画表格.table是一个对象,包含cell对象,以及rowInfo和colInfo。cell包含的string,char并不作为单独的一个对象。

图II

图III
后来改写,把每个char当成一个对象,但char对象和其它对象的compose却又成问题。。
Range的表示也成问题。
似乎table等对象只能绝对定位,无法实现象word中表格的对齐方式和文字围绕效果。
写得好累,有谁知道有开源的用C++写的graphical text editor,或者自己有写的,希望能交流一下啊。