Title: Basic text editor
Darimus - January 10, 2005 12:34 AM (GMT)
My original intention for this was to open exes and change stuff in them but for some reason that didn't work at all, but it serves as a nice text editor
Code and executable found
here
donprogc++ - January 10, 2005 04:14 AM (GMT)
You meant to edit the binary data right
ive made a text editor too
nice job
MonkeyMan - January 10, 2005 08:31 PM (GMT)
I got ideas for a simple hex editor but it is still in planning stage. Plus sense I want to work away from the Windows API I was thinking about using wxWindows or something similar. Still planning though.
donprogc++ - January 11, 2005 03:26 AM (GMT)
just wanted to point something out Darimus
for faster code use inline functions
| CODE |
HWND Textbox::GetWindow() { return hWnd; }
|
to declare an inline function in a class you must include the function in the class not just prototype it
| CODE |
class Textbox { public: Textbox(HWND hwnd); void Resize(); void AddText(const char* text,byte mode,bool AddLF); void DispBuffer(); void ClearText(); HWND Textbox::GetWindow(){return hWnd;} //inline function void WordWrap(); void Insert(byte type); void SetFont(byte in); private: HWND hWnd; HWND wnd; string Text; bool Wrap; };
|
Darimus - January 11, 2005 05:00 AM (GMT)
Ok I updated it... I changed the function as you said Don, and I also changed the way it opens files so it opens 100% correctly now... (Text files used to open in a way that if the last line didn't end in \n, it would add one due to some bug... That's fixed now.)
Also... a major bug that I didn't realize until recently is that if you typed too much the menu went away and it wouldn't let you bring up task manager and/or use the right-click context menu on the edit box or the program -_- ... but that's fixed now.
All known bugs have been fixed... but regretfully... i've yet to succesfully figure out how to do Word Wrap :/
still the same place to
download it
KTC - January 12, 2005 12:17 AM (GMT)
Erm, there's no problem with inlining a member function that's defined outside the class.
| CODE |
class Textbox { public: Textbox(HWND hwnd); void Resize(); void AddText(const char* text,byte mode,bool AddLF); void DispBuffer(); void ClearText(); HWND Textbox(); void WordWrap(); void Insert(byte type); void SetFont(byte in); private: HWND hWnd; HWND wnd; string Text; bool Wrap; };
// ...
inline HWND Textbox::GetWindow() { return hWnd; }
// ... |
The inline keyword can be declared in the declaration, definition, or both. There is however the issue that inline'd function need to be defined in every file in which they're called. To still maintain the separation of the interface and its implementation, its usually defined after the class declaration but in the same file.
donprogc++ - January 12, 2005 02:07 AM (GMT)
Yea it mostly depends on style of coding
Darimus - January 16, 2005 06:14 PM (GMT)
I added shortcuts keys and uploaded it again.
I also changed it so that when you "activate" it, after like minimizing it, it will automatically set keyboard focus to the edit control