Skip to content
Snippets Groups Projects
Commit 8f116540 authored by mcmlxxix's avatar mcmlxxix
Browse files

message window with title (and subtitle). used by clock.js, cshell.js, chateng.js

parent 354854c5
No related branches found
No related tags found
No related merge requests found
function Window(name,x,y,w,h)
{
this.name=name?name:false;
this.x=x;
this.y=y;
this.columns=w;
this.rows=h;
this.active=false;
this.Draw=function(value)
{
var title="";
var color="";
if(this.name)
{
color=(this.active?"\1c\1h":"\1n");
title="\1n\1h\xB4" + color + this.name + (value?": " + value:"") + "\1n\1h\xC3";
}
console.gotoxy(this.x,this.y);
console.putmsg("\1n\1h\xDA");
DrawLine(false,false,this.columns-console.strlen(title),"\1n\1h");
console.putmsg(title + "\1n\1h\xBF");
for(line = 1; line<=this.rows; line++)
{
console.gotoxy(this.x,this.y+line);
printf("\1n\1h\xB3%*s\xB3",this.columns,"");
}
console.gotoxy(this.x,this.y + this.rows+1);
console.putmsg("\1n\1h\xC0");
DrawLine(false,false,this.columns,"\1n\1h");
var spot=console.getxy();
if(!(spot.y==console.screen_rows && spot.x==console.screen_columns)) console.putmsg("\1n\1h\xD9");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment