Restore QL windows to defaults

Anything QL Software or Programming Related.
Post Reply
kladogen
ROM Dongle
Posts: 10
Joined: Mon Feb 21, 2022 5:38 pm

Restore QL windows to defaults

Post by kladogen »

Hi,

I would like to know the default parameters for the QL windows, i.e. the red, white and command window so I can restore them at the end of program that changes the window size / mode.
Or maybe a command that can restore them into their original sizes etc?

Thanks,

Antonis


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: Restore QL windows to defaults

Post by dilwyn »

If your QL has Toolkit 2 available, you can use the WTV and WMON commands to reset the windows.

WTV 4 resets the windows to television mode 4 windows (where the #1 and #2 windows overlap)
WTV 8 does the same in mode 8.

WMON 4 resets the windows to monitor mode 4 windows (the side by side red and white windows)
WMON 8 does the same for mode 8.

If you don't have Toolkit 2, the following WINDOW commands will restore the windows. This sort of useful information is available in the SuperBASIC Reference Manual https://superbasic-manual.readthedocs.io/en/latest/

For Monitor mode:
WINDOW #0,512,50,0,206
WINDOW #1,256,202,256,0:BORDER #1,1,255
WINDOW #2,256,202,0,0 : BORDER #2,1,255

For Television mode:
WINDOW #0,448,40,32,16
WINDOW #1,448,200,32,16
WINDOW #2,448,200,32,16

No border command is needed for television mode. You might wish to add CLS #0, CLS #1 and CLS #2 commands if you prefer the windows to be cleared after resetting.

If ever you start to use SMSQ/E, the WINDOW commands will be slightly different, as window #0 has a border too, and there is a small gap between the #0 window and the other windows in Monitor mode.


User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Restore QL windows to defaults

Post by tofro »

kladogen wrote: Wed Oct 04, 2023 10:29 pm Hi,

I would like to know the default parameters for the QL windows, i.e. the red, white and command window so I can restore them at the end of program that changes the window size / mode.
Or maybe a command that can restore them into their original sizes etc?
If you have TKII (which you definitly should) that's the simplest thing:

WTV restores the original TV Window setup and
WMON does the same for the monitor configuration.

Dilwyn was faster this time. :)

The commands he gave you for a system not equipped with TK2 are the well-earned punishment for that severe omission :) .


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dex
Gold Card
Posts: 286
Joined: Thu Dec 23, 2010 1:40 pm

Re: Restore QL windows to defaults

Post by dex »

tofro wrote: Wed Oct 04, 2023 10:57 pmWTV restores the original TV Window setup
Not quite true.

WTV without parameter restores to MODE 4, not 8 (on my QLs, at least).
What is what I use, resolution to fit onto normal TV, but with more characters per line like in WMON modes.


ones' complement
Over Heated PSU
Posts: 133
Joined: Tue Nov 30, 2021 1:19 am

Re: Restore QL windows to defaults

Post by ones' complement »

Me too. I just hit F2 and enter WTV as a quick way to get mode 4 with wider edit window than F1/WMON defaults. Also prefer dark paper, less harsh on my old eyes, white paper is like trying read print off a torch shone in your face :)


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: Restore QL windows to defaults

Post by dilwyn »

ones' complement wrote: Thu Oct 05, 2023 11:51 am Me too. I just hit F2 and enter WTV as a quick way to get mode 4 with wider edit window than F1/WMON defaults. Also prefer dark paper, less harsh on my old eyes, white paper is like trying read print off a torch shone in your face :)
Agree, ones' complement.
I wish the QL had a "dark mode" for use at night, where it automatically gave everything red or black paper colour. Could probably be done as a small compiled task which sat there, checking the time, and at the appropriate time in the evening started interfering with BASIC channels, altering the paper and ink colours when it spots white or blue background, so your eyes get less blue and white in the runup to bedtime. Never tried it, no idea if it could work, but given the QL's limited colours it might be more annoying than useful. A possible programming challenge for someone, maybe?

Might be more feasible under GD2/WMAN2 on high colour systems, where you could create a "daytime" and "evening" system palette, with a background program altering the system palette at the appropriate time.

Back to original topic, if you wanted to maximise screen window sizes and your 512 pixel width display actually fits your monitor/tv screen without losing bits at the edges, quite easy to write a simple procedure to add to your programs so that you can at any time in a programming session go back to max windows sizes. I use one called XTV (standing for eXtended TV, as opposed to WTV). Short enough to condense to one line in the procedure:

DEF PROC XTV
WINDOW #2,512,200,0,0 : CLS #2
WINDOW #1,512,200,0,0 : CLS
WINDOW #0,512,50,0,200 : CLS #0
END DEF XTV

You can add PAPER, INK, etc to suit your own preferences. Even create two, one 'lighter' colours for daytime use, and a DTV with darker colours for evening use! Or even test the DATE$ value for hours from, say, 1900 in the procedure with something like:

d$=DATE$:IF d$(13 TO 14) >= 19 THEN PAPER 0: INK 4 : ELSE PAPER 7:INK 0

If you want it to work for SBASIC too, you could probably add a test for VER$="HBA1" then use SCR_XLIM and SCR_YLIM to max every window out, something like this just before the END DEF XTV (adjust for borders if required)


IF VER$ = "HBA1" THEN
REMark if in SBASIC (SMSQ/E)
WINDOW #2,SCR_XLIM,SCR_YLIM-50,0,0
WINDOW #1,SCR_XLIM,SCR_YLIM-50,0,0
WINDOW #0,SCR_XLIM,50,0,SCR_YLIM-50
END IF

(typed from memory, apologies in advance for any typos)

Drifted a bit off-topic in this post, hope it provides readers with some ideas.


kladogen
ROM Dongle
Posts: 10
Joined: Mon Feb 21, 2022 5:38 pm

Re: Restore QL windows to defaults

Post by kladogen »

Thanks allot!


Post Reply