Custom text edit control???
-
I'm looking for an example how to write custom text edit control. Not a subclassed textbox but one that is written from the ground up.
Why do you need one ? I've looked and not found one in the past, but I got around the vagaries of the text box control ( namely that it draws itself out of the paint event ) with a bit of work. Christian Graus - Microsoft MVP - C++
-
Why do you need one ? I've looked and not found one in the past, but I got around the vagaries of the text box control ( namely that it draws itself out of the paint event ) with a bit of work. Christian Graus - Microsoft MVP - C++
Because I need to have a control over each line/paragraph etc. I want to make something like a custom text editor that outputs to a custom XML formats, depending on the context or the template. For now I cannot find any XML editor that can do what I need and I think the built in TextBox and RichTextBox controls won't do what I want to do. This is what I want to do and the next thing that is independent of the above is that I want to see how text is handled in text editors and displayed on a form/control.
-
I'm looking for an example how to write custom text edit control. Not a subclassed textbox but one that is written from the ground up.
I have written one from complete scratch (iow painting every pixel). You can have a look at the source, but beware, the editor control alone is current almost 200kb (7000+ lines) in size. Follow either link below and see the link on the left of the page. :)**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
-
I have written one from complete scratch (iow painting every pixel). You can have a look at the source, but beware, the editor control alone is current almost 200kb (7000+ lines) in size. Follow either link below and see the link on the left of the page. :)**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
-
I know your control, leppie! Thank you! I was overwhelmed :) I hoped there was something simpler. I much time have you spent researching, planning and creating it? Have you ever thought writing an article about it?
Cristoff wrote:
much time have you spent researching, planning and creating it?
It had a few incarnations, so I am not really sure :~ The project has been ongoing now for over 3 years :)
Cristoff wrote:
Have you ever thought writing an article about it?
Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone :| I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited :) What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such. Hope this helps a bit, I used a similar path. :)**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
-
Cristoff wrote:
much time have you spent researching, planning and creating it?
It had a few incarnations, so I am not really sure :~ The project has been ongoing now for over 3 years :)
Cristoff wrote:
Have you ever thought writing an article about it?
Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone :| I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited :) What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such. Hope this helps a bit, I used a similar path. :)**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
I'd love to see this too... let me know when you publicize it :)
-
Cristoff wrote:
much time have you spent researching, planning and creating it?
It had a few incarnations, so I am not really sure :~ The project has been ongoing now for over 3 years :)
Cristoff wrote:
Have you ever thought writing an article about it?
Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone :| I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited :) What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such. Hope this helps a bit, I used a similar path. :)**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
Thank you for the tips. How would you use string[]? For example you'll reserve 1000 lines then when 999 are used you'll expand the array by another 1000 lines. We'll this be fast and good enough? Colors I might not need but who knows :) What I need to know is exactly what line I'm editing.