Share Tips, Code Samples, etc. with the Visual Prolog community.
Vitaly Markov
Active Member
Posts: 40
Joined: 30 Nov 2003 0:01

Static class consoleExt (Visual Prolog 7.2)

Unread post by Vitaly Markov »

The consoleExt is the extension of the pfc class console and consist of predicates for input-output color text:

Code: Select all

writeColor(Attribute, ...) % writes color text setAttr(X,Y,Attribute) % sets attribute in position X,Y writeChar(X,Y,Char) % writes Char in position X,Y (cursor position does not vary) Attribute = getAttr(X,Y) % gets attribute from position X,Y Char = getChar(X,Y) % gets character from position X,Y fillAttribute(X,Y,Number,Attribute). % sets attributes for a specified number of character cells, beginning at the specified coordinates fillChar(X,Y,Count,Char). % writes character specified number of times, beginning at the specified coordinates(cursor position does not vary) setCursor(X,Y) % sets cursor position
and conversion predicates:

Code: Select all

attr_colors(Attr,BackGroundColor,ForeGroundColor) (i,o,o) % converts Attribute to pair (BackGroundColor,ForeGroundColor) attr_colors(Attr,BackGroundColor,ForeGroundColor) (o,i,i) % converts pair (BackGroundColor,ForeGroundColor) to Attribute color_IRGB(Color,I,R,G,B) (i,o,o,o,o) % converts color to IRGB-components, IRGB={0,1} color_IRGB(Color,I,R,G,B) (o,i,i,i,i) % converts IRGB-components to color, IRGB={0,1}
Folder Example contains class consoleExt (folder consoleExt).
Attachments
example.zip
Folder Example contains class consoleExt (folder consoleExt).
(217.39 KiB) Downloaded 1288 times
Post Reply