|
-
April 16th, 2013, 07:04 AM
#1
How to scroll text drawn with DrawText
Hi --
I have an emulation project I've been working for a long time (the Altair32 Altair/IMSAI emulator) and I'm trying to simulate a dot-matrix printer for list output in CP/M.
Here's what I have so far and where I'm stuck and need a push in the right direction. I'm using a dialog box with a green bar paper bitmap as the client area background. I used CreateFont to load a dot matrix printer TrueType font and have the base code to print on subsequent lines. So, based on the dialog size, font size, etc., I get about 10 lines of dot matrix printing, 80-characters wide. So far so good.
The problem arises in how do I scroll the text like on a printer? I thought about trying a static text control or an edit box, but the text to be printed is of an unknown size and ISTR that both of those controls have finite size limits (32k but maybe I'm wrong). They would also need to be transparent so that the green bar paper shows through.
Any thoughts or ideas would be greatly apprciated. Thanks!
Rich
http://www.classiccmp.org/cini
http://www.classiccmp.org/altair32
-
April 16th, 2013, 08:21 AM
#2
Re: How to scroll text drawn with DrawText
 Originally Posted by RichCini
The problem arises in how do I scroll the text like on a printer? I thought about trying a static text control or an edit box, but the text to be printed is of an unknown size and ISTR that both of those controls have finite size limits (32k but maybe I'm wrong). They would also need to be transparent so that the green bar paper shows through.
Check out ScrollWindow function.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
April 16th, 2013, 08:43 AM
#3
Re: How to scroll text drawn with DrawText
Vladimir --
Thanks. I don't know if this matters, but the dialog doesn't presently have scroll bars. I'll give ScrollWindow a try and see what I get.
Thanks again!
Rich
-
April 18th, 2013, 02:43 AM
#4
Re: How to scroll text drawn with DrawText
 Originally Posted by RichCini
Here's what I have so far and where I'm stuck and need a push in the right direction. I'm using a dialog box with a green bar paper bitmap as the client area background. I used CreateFont to load a dot matrix printer TrueType font and have the base code to print on subsequent lines. So, based on the dialog size, font size, etc., I get about 10 lines of dot matrix printing, 80-characters wide. So far so good.
The problem arises in how do I scroll the text like on a printer?
You do that precisely like CP/M did: you re-paint the whole window and fill it with the text output based on the newly changed top left position in your text buffer.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|