![]() |
| | #1 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,698
| dtextp: a codeforming text editor Also see the links at the bottom of this post for more information about codeform. I've started writing a text editor in C++ that uses codeform, called dtextp. It's very basic and it updates the entire screen every time you press a key and it uses Windows functions. But it demonstrates codeform quite nicely. Here's the download link. It's 544,336 bytes. http://dwks.theprogrammingsite.com/m...own/dtextp.zip (Yes, the scroll-past-EOL is intentional.) Pass dtextp the name of a file on the command line, and it will open it. (Actually, it opens any number of files properly, but I haven't added a key to switch buffers.) Once you're in the editor, you can press F2 to save or SHIFT-F2 for save as. I intend to make dtextp update only the required portions of the screen like ncurses with the io_t class, and also port it to ncurses so it will run under Linux. Feel free to tell me if you find any bugs with dtextp, especially bugs relating to how the code is coloured. I'm more concerned about that code, though it is likely to have fewer bugs. There are several bugs that I've noticed. I don't have time to list them here, but they can all be attributed to my programming, except this one. Occasionally, an entire line will all of a sudden be devoid of colour, but then you press a key and the colours appear again. I've done extensive debugging to see why this is, but it seems to be a bug with Windows and not with my program. Uncomment the line Code: #define DEBUG_COLOURS Code: void io_t::textcol(io_t::col_t col) {
#ifdef DEBUG_COLOURS
std::cout << '|';
#endif
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), col);
}
I know I haven't fixed the template bug with codeform online yet . . . sorry. I haven't had time. If you want to create HTML, download codeform itself. I hope that no one minds . . . I've uploaded some of the threads that I started about codeform before the board crashed. As well as a very old version of the codeform #2 thread, the one I link to at the top of this post. They can be accessed from this page, which is, of course, subject to change: http://dwks.theprogrammingsite.com/m...read/index.htm
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, nort, etc. |
| dwks is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| text editor | akki | C Programming | 5 | 07-11-2009 02:05 PM |
| Text editor | L_U_K_E | C++ Programming | 49 | 05-02-2006 04:42 PM |
| struct question | caduardo21 | Windows Programming | 5 | 01-31-2005 04:49 PM |
| creating very simple text editor using c | if13121 | C Programming | 6 | 11-25-2004 09:49 AM |
| help about text editor | nag | C++ Programming | 2 | 04-24-2003 11:45 AM |