What's the best way to make a Terminal window?

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

I need to make a terminal window to emulate special characters of a vintage
PC. I don't think I can use a console because you can't change its
font...can you?

So what is the best way to make a terminal window that has a scrollback and
is easy to position the cursor? How does hyperterminal & SmartTerm do it?

Thanks!
 
Terry said:
I need to make a terminal window to emulate special characters of a
vintage PC. I don't think I can use a console because you can't
change its font...can you?

Presumably you can just use a multiline textbox, so you can set the
background, font colour etc as you like.
 
A textbox is not easy when it comes to placing text at certain locations on
the screen.
 
Terry said:
A textbox is not easy when it comes to placing text at certain
locations on the screen.

That's true. I thought you might be working on a line by line basis.

Can you not use a panel and use GDI+ to place strings wherever you want on
the panel?
 
As Leon said, you
'll need to use a Panel and draw on it with GDI+. There are some examples in
the SDK documentation. Search for DrawString method.

If you're going to handle things like color and character attributes, then
you'll need to create a screen buffer. It should probably be done by creating
a matrix of characters:
dim ScreenBuffer(80,25)

and drawing this matrix to the screen one line at a time. To handle
atrributes and color, you can create an additional buffer:
dim ScreenColors(80,25)

Then, using DrawString in the panel's Paint event, you can draw each row and
column to the panel. To draw your cursor, just use the DrawBox method. Use a
timer set to 1000 or so to re-draw the cursor and make it blink.

There are ways to optimize this approach; but that's where I'd start. Once
you get the hang of how that works, you can try other ways of speeding things
up to get your text displayed faster (if it's necessary). Personally, I find
GDI to be slow, so I use OpenGL for graphic output. If I need text, I have a
library that creates text characters as OpenGL display lists.
 
Terry,

I cannot see what is wrong with Leons advise to use a textbox.

When that is in multiline mode.

With a toolbar wit toolbar buttons docked in top
And the textbox docked as fill

Than you can make in my opinion the nicest dialog windows as you want.

And the user can make it exactly in the size he wants by resizing his form.

Just my idea

Cor
 
Back
Top