C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 05-18-2007, 07:11 AM   #1
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
dtextp: a codeforming text editor

What is codeform? codeform version 1.2.0 #2
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
and you'll see what I mean. The calls to iot::textcol are still occuring, as shown by the extra characters it prints:
Code:
void io_t::textcol(io_t::col_t col) {
#ifdef DEBUG_COLOURS
    std::cout << '|';
#endif
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), col);
}
Note that this debugging mode makes it nearly impossible to type anything, so just load an already-existing file. dtextp.cpp works quite well.

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   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 03:32 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22