Text console button?

I was wondering if there was a way to make a text button?
Sure. Easy as can be. Just use the asci line drawing characters and color them, shade the area around to create 2d effects, modify it when the button is pushed, etc.. We did piles of that kind of stuff back in the DOS days. I know what your next question is. How do you do it?
Well do you have a tutorial for it?
No, but tomorrow I'll hunt up some old code I have showing how to do it.

But basically, in the asci (or is it ansi - I get those confused) tables are various graphics type characters that of course take up one character 'block' in console mode programs. I'm talking about a character - not a pixel. But anyway, there are lines, corners, etc. You can string these together to create 'buttons', 'windows', etc. What you have to do is color them so they stand out against the console window. For example, you can create a button with the text 'Execute' in the middle of it.

Next you have to test for button clicks in the area of the button, and to do that you have to track the mouse with the various Windows Console Mode Api Input Functions. When the button is 'pushed' you have to shift things around to give it that appearance. You would achieve this by having various block characters around the button shaded a different color to simulate a 3d appearance.

It really is fun to do.

You see, back in the 1980s and early 1990s before Windows and other GUI OSs took hold, all of us were doing these things in DOS, i.e., creating 'fake' GUI programs in DOS which faked the GUI Controls used in real GUI OSs.

When I first learned Windows, which was like in Windows 95 times around middle 90s, I soon discovered Microsoft's Console Api as it is known. With those functions you could duplicate the old DOS character mode 'graphics' and make it look like an old DOS graphics mode program. But it wasn't. It was running 32 bit. One might question the reason or motivation of writing programs that look like DOS character mode programs in a 32 bit environment (now 64 bit). I eventually dropped it after spending a lot of time doing it and learning about it, for the simple reason that it didn't really make much practical sense doing that. It was a lot of fun though. I'm an old timer, and actually like the look of those old interfaces.

Are you unaware of all this old history???


I'm only 12, I started programming when I was 8, ok. I still don't know all this history, I do research it every once in a while though.
Topic archived. No new replies allowed.