The Carapace Emulator is a lightweight ActiveX control which displays
Videotex. As an ActiveX control, the
Emulator must be embedded in an OLE container before it can be
used. For example, the Emulator can be placed on a web page
and viewed using InternetExplorer -- Microsoft's web browser.
For details, see Embedding the Emulator.
Carapace provides a stand-alone executable which contains the emulator ActiveX control.
The Emulator itself does not do any data communications. Instead, the Emulator uses a different object for its comms. See Emulator Communications Agent for details.
The Emulator is a simple character grid -- it contains rows and columns of cells where each cell:
The Emulator displays this character grid to the user taking into account the particular cell attributes.
The Carapace Emulator is accessed using COM (or OLE as it used to be called!). The important identifiers for the Emulator are as follows:
| ActiveX control name | Carapace Emulator Control |
| program id (progId) | Carapace.Emulator |
| class id (CLSID) | E3F52F18-C297-11D3-81CA-0050048C7269 |
An example showing Emulator creation when embedding in a web page is given here.
The following properties are accessible on the Emulator's primary dispatch interface:
| property name | property type | description |
|---|---|---|
protocol |
String | name of the current protocol displayed by the Emulator
-- currently, the only legal value is Videotex
|
commsAgentId |
String | progId or CLSID of the agent used for the Emulator's communications
-- default: Carapace.EmulatorCommsAgent. See
Emulator Communications Agent
for further details.
|
commsAgent |
Dispatch | the dispatch interface of the Emulator Communications Agent |
flashInterval |
Integer | interval (milli-seconds) between flashing any appropriate screen cells -- the default is 500 milli-seconds |
cursorFormat |
String | the format for the cursor -- legal values are:
|
fontName |
String | the name of the font used by the emulator. The default
value is Courier New. Another suitable font
might be Times New Roman for instance. Look in
the Window's Control Panel to see the names of fonts which
you have installed.
|
fontWeight |
Integer | the weight of the font used by the emulator. This is an integer between 0 and 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used. |
printQuality |
String | the type of printing to perform on request -- legal values are:
|
The methods offered by the Emulator can be partitioned as follows:
| displaying information | displaying information 'on screen' |
| communications | managing the communications with the host |
| cursor control | moving the cursor around the screen |
| utility methods | various support methods |
The following methods relate to the display of information on the Emulator's screen.
| method name | description |
|---|---|
display |
display the supplied characters at the current cursor position -- the characters are assumed to be in the current protocol |
setText |
put text on screen at a given location |
setMosaics |
put a simple pattern on screen at a given location |
clearScreen |
clear the entire screen |
setColour |
set the colour attributes for the supplied cell |
setRowColour |
set the colour attributes for the remainder of the supplied row starting at the given column |
setRowOption |
set the boolean attributes for the remainder of the supplied row starting at the given column |
setAttributes |
set the attributes at the supplied position from the supplied encoding |
flash |
flash (ie. invert the colours of) all cells which have their 'flashing' attribute set |
The following methods relate to the communication with the host via the Emulator Communications Agent.
| method name | description |
|---|---|
connect |
connect to the supplied host using the installed comms agent |
connectionState |
return the state of the current connection |
disconnect |
disconnect from the current host using the installed comms agent |
The following methods relate to the screen cursor.
| method name | description |
|---|---|
setCursor |
set the cursor position |
cursorOn |
enable the cursor - so it will be displayed to the user |
cursorOff |
disable the cursor - so it will not be displayed to the user |
up |
move the cursor up a row |
down |
move the cursor down a row |
left |
move the cursor back a column |
right |
move the cursor forward a column |
| method name | description |
|---|---|
encode |
encode the entire display into a string form |
decode |
decode the entire display from the supplied string form |
execScript |
use the comms agent to execute the supplied Carapace script |
AboutBox |
display the standard dialog box which gives name and version information for the Emulator |
displayDisplay the supplied characters at the current cursor position -- the characters are assumed to be in the current protocol.
Arguments:
| characters | String |
Return type: the empty List ()
setTextPut text on screen at a given location. This does not affect the cursor position.
Arguments:
| text | String |
| row | Integer |
| column | Integer |
Return type: the empty List ()
setMosaicsPut a simple pattern on screen at a given location. Each screen cell can hold a simple pattern made of rectangular tiles -- a mosaic. A mosaic is 3 tiles high, and 2 tiles wide. The mosaic can be represented as 6 bits where a bit set means 'colour that tile'.
To make it easy to define the mosaic, this function setMosaics
takes a string representation of a 6-bit binary number eg. "101011"
which represents the following mosaic:
10
10
11
Arguments:
| bitPattern | String |
| row | Integer |
| column | Integer |
| length | Integer |
Return type: the empty List ()
clearScreenClear the entire screen.
Arguments: none
Return type: the empty List ()
setColourSet the colour attributes for the supplied cell.
The first argument (flag) defines which colour attributes
are to be set as follows:
0 | background |
1 | foreground |
2 | mosaic foreground |
The second argument (colour) is the colour code as follows:
0 | Black |
1 | Blue |
2 | Green |
3 | Cyan |
4 | Red |
5 | Magenta |
6 | Yellow |
7 | White |
8 | DarkGrey |
9 | Grey |
10 | LightGrey |
Arguments:
| flag | Integer |
| colour | Integer |
| row | Integer |
| column | Integer |
Return type: the empty List ()
setRowColourSet the colour attributes for the remainder of the supplied row starting at the given column.
The first argument (flag) defines which colour attributes
are to be set as follows.
The second argument (colour) is the colour code.
Arguments:
| flag | Integer |
| colour | Integer |
| row | Integer |
| column | Integer |
Return type: the empty List ()
setAttributesSet the attributes at the supplied position from the supplied encoding.
The attributes for a single cell are encoded as a 3-character string according to the following rules (where bits are numbered 0-7, with bit 7 being the most significant bit):
1st byte:
2nd byte:
3rd byte:
Arguments:
| encodedAttributes | String |
| row | Integer |
| column | Integer |
Return type: the empty List ()
flashflash (ie. invert the colours of) all cells which have their 'flashing' attribute set.
Arguments: none
Return type: the empty List ()
setCommsAgentInstall the supplied object (dispatch interface) to act as the Emulator Communications Agent.
Arguments:
| agent | Dispatch |
Return type: the empty List ()
connectConnect to the supplied host using the installed comms agent. The address must be in a format which the agent understands.
Arguments:
| address | String |
Return type: the empty List ()
connectionStateReturn the state of the current connection. Possible return values are:
Disconnected
Connecting
Connected
Disconnecting
Arguments: none
Return type: String
disconnectDisconnect from the current host using the installed comms agent.
Arguments: none
Return type: the empty List ()
setCursorSet the cursor position.
Arguments:
| row | Integer |
| column | Integer |
Return type: the empty List ()
cursorOnEnable the cursor - so it will be displayed to the user.
Arguments: none
Return type: the empty List ()
cursorOffDisable the cursor - so it will not be displayed to the user.
Arguments: none
Return type: the empty List ()
upMove the cursor up a row.
Arguments: none
Return type: the empty List ()
downMove the cursor down a row.
Arguments: none
Return type: the empty List ()
leftMove the cursor back a column.
Arguments: none
Return type: the empty List ()
rightMove the cursor forward a column.
Arguments: none
Return type: the empty List ()
encodeEncode the entire display into a string form.
Arguments: none
Return type: the empty List ()
decodeDecode the entire display from the supplied string form.
Arguments:
| data | String |
Return type: the empty List ()
AboutBoxDisplay the standard dialog box which gives name and version information for the Emulator.
Arguments: none
Return type: the empty List ()
execScriptUse the comms agent to execute the supplied Carapace script. An error is raised if no such agent is currently installed.
Arguments:
| scriptCommands | String |
Return type: Object
| Contents | Index | Current topic: communications | Related topics: communications classes, objects |