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
Re: How to scroll text drawn with DrawText
Quote:
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.
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
Re: How to scroll text drawn with DrawText
Quote:
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.