Screen and console

New to FreeBASIC? Post your questions here.
AnotherLife
Posts: 94
Joined: Feb 07, 2011 22:48

Screen and console

Postby AnotherLife » Jan 24, 2014 17:29

I'm using Screen 19, 8, 1, GFX_WINDOWED Or GFX_NO_SWITCH

It's kind of a terminal with a prompt. Is there a way to have a bigger console height and have a slider to go up and down ? Because now when I print lots of stuff the older stuff gets lost.
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Re: Screen and console

Postby sir_mud » Jan 24, 2014 19:49

If you're only doing text you don't have to use the screen statement, then you can resize your console and scrollback to your heart's content.
AnotherLife
Posts: 94
Joined: Feb 07, 2011 22:48

Re: Screen and console

Postby AnotherLife » Jan 24, 2014 20:31

Hmm, just did that and you're right I think. I'm using line input, too.

But it doesn't look as cool as it did before, got to fix that hehe. This also renders my nice command parsing code, clipboard handling and keyboard handling useless.

But now I can scroll up and down, paste AND copy , go back in the commandline without using backspace ... :-)
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Re: Screen and console

Postby sir_mud » Jan 24, 2014 21:53

AnotherLife wrote:But it doesn't look as cool as it did before, got to fix that hehe.

Window's default console font is not pretty, but you can click the icon to get a menu and change it.
AnotherLife
Posts: 94
Joined: Feb 07, 2011 22:48

Re: Screen and console

Postby AnotherLife » Jan 24, 2014 23:27

The main problem is that I want a fixed width (100), so I can print my stuff centered etc. And I also want to keep my command prompt at the bottom of the window. So I'm using width 100,37.

But looking at the console window's properties that also sets the screen buffer to these dimensions, so stuff gets permanently lost scrolled off-screen.

[....]
I think I fixed it by calling SetConsoleScreenBufferSize after using width. Eheheheheh

Now with the fixed dimensions, an executable icon, a window title, coloured text it looks cool again :-)
AnotherLife
Posts: 94
Joined: Feb 07, 2011 22:48

Re: Screen and console

Postby AnotherLife » Jan 25, 2014 0:04

Also trasparency and accepting drag'n'dropping files, not bad for a console window. Now if I could just disable resizing ...


[...]
And I removed the WS_THICKFRAME extended style, success.

Now to test this on all my virtual machines !

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 1 guest