beren
May 5th, 1999, 08:43 AM
Hia... I'm building a control up from scratch which resembels the CEdit-control, except that different parts of the text can be formatted differently at will. I.e, a certain portion of the text can be marked as a link, some of the text can be set bold, italic, another font, another font size or whatever the user requires. It's all saved in a tagged format in a HTML-like way.
Now, I've got it all parsed and put into CTextPart-objects which are stored in a CObList which I go through and call OnDraw with the pDC and rcBounds. This is where my problems reside:
1. How can I make a cursor like the one blinking in a normal text-editor?
2. I'm using OutText, but it doesn't seem to do react to neither newline-characters or line wrapping. How should I go ahead for supporting multiple lines?
3. When using multiple lines, how can I draw the entire virtual area so that I can support scroll-bars?
4. When having called OutText once, the rcBounds isn't updated, so that next time I call OutText (in the following CTextPart) the text is appended to the window. As is, it overwrites the entire thing.
And please, if I'm heading in the wrong direction, let me know! :)
Niklas
Now, I've got it all parsed and put into CTextPart-objects which are stored in a CObList which I go through and call OnDraw with the pDC and rcBounds. This is where my problems reside:
1. How can I make a cursor like the one blinking in a normal text-editor?
2. I'm using OutText, but it doesn't seem to do react to neither newline-characters or line wrapping. How should I go ahead for supporting multiple lines?
3. When using multiple lines, how can I draw the entire virtual area so that I can support scroll-bars?
4. When having called OutText once, the rcBounds isn't updated, so that next time I call OutText (in the following CTextPart) the text is appended to the window. As is, it overwrites the entire thing.
And please, if I'm heading in the wrong direction, let me know! :)
Niklas