![]() |
| The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
|
Post Reply
|
| Author | |
talon
Beta Tester
Joined: August 14 2004 Location: Australia Status: Offline Points: 20 |
Post Options
Thanks(0)
Quote Reply
Topic: OpenQM screen coloursPosted: February 10 2006 at 2:18pm |
|
Goo'day,
VT420 emulation. There's been a bit of a debate raging on the OpenQM list regarding screen colours, particularly trying to change the background colour, so that the entire screen's background colour changes, instead of just the background behind entered/displayed text. The only way I can find for this to happen is to employ "AccuTerm Settings" and pick a colour combination, eg "240" for black on white, "252" for red on whilte, "172" for red on green, etc. Is there any other "private command" (yep! tried ESC:STX:A and B to no avail), or any ESC sequence, script, anything, anywhere, we can use to effect "whole of screen" background colours for vt emulations? Short of changing the background colour, and printing 1920 (80x24) spaces and starting all over again? <grin> or, pehaps, <not so grin> |
|
|
Regards,
Bruce Nichol Talon Computer Services |
|
![]() |
|
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
Posted: February 13 2006 at 8:43am |
|
Hi Bruce -
The way AccuTerm handles the screen background color is dependent on the terminal emulation in use. Also, AccuTerm's colors are intimately connected with the display attributes. The "normal" attribute defines the screen's background color. When you look in the Colors tab of the settings, there is a "change" button next to the color sample for every attribute. Click the "normal" attribute "change" button to select the background color for the screen. This is the color used to clear the screen, under most terminal types. PC Monitor emulation, which does not (yet) have terminal definitions for QM, is special, in that the background color currently in effect is used when the screen is cleared, or when a new row scrolls onto the bottom of the screen. This behavior is consistent with the actual terminals being emulated. The current color is used for displaying any characters received from the host. It does not affect the entire screen (except in the case of PC Montor when erasing the screen). You can select the current foreground/background colors in several ways. You can always use the native visual attribute commands, like reverse video or underline. The colors chosen are the ones defined on the Colors tab of the settings dialog. You can also use the AccuTerm private commands (ESC STX A, ESC STX B) which are documented in the AccuTerm Programmers Guide. Also, the ANSI and PC Monitor emulations have native commands (escape seqnences) for selecting foreground/background color. To set the entire background to the current color, you would need fill the screen with spaces. AccuTerm uses a palette of 16 colors for all foreground and background colors. The default palette is similar to the original IBM-PC color monitor colors, and consists of 8 light colors, and 8 darker colors. The palette can be customized. By using AccuTerm's scripting feature, you can change nearly any setting or property of the screen. This includes the colors that are mapped to the visual attributes, including the "normal" attribute. The Session object has a Colors property that associates a foreground/background color with each display attribute (the Settings object includes the same property - you can use either one). The Programmers Guide, AccuTerm Object Reference chapter, describes the Colors property. Basically, the property acts like an array, with the index selecting the desired attribute (0 for normal, 4 for reverse, etc.), and the value being composed of two 4-bit numbers for the foreground and background color. The manual includes a table showing the color indexes - just add the index for the desired foreground color and the index of the desired background color. You can execute a script from the host, by enclosing the script code inside an escape sequence. The escape sequence for launching a script is documented in the Programmers Guide, in the AccuTerm Programming chapter. For example, to use a script to set the background color for the Normal attribute to Cyan, and the foreground color to Dark Blue, you could use the following script:
Note here that Dark Blue foreground is 1, Cyan background is 176, hence the combined color value is 176 + 1 = 177. Colors() index 0 is the "normal" attribute. After running this script, simply clear the screen, and it will take on the new bakground color. Thanks, Pete |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |