#include "foscreen.h"
#include "log.h"

FoScreen::FoScreen() {
	oMain = new NTCurses::NTCurses( 0 , 0 , uWidth , uHeight , true );
	oMain->UpdatePanels();
}


void FoScreen::RefreshScreen() {
	oMain->Move( 0 , 0 );
	oMain->SetAttr( oMain->GetAttrFromString( "W+G" ) );
	for (unsigned int y = 0; y<uHeight ; y++ ) {
		for (unsigned int x = 0; x<uWidth ; x++ ) {
			if (!x && !y) oMain->PutChar( ACS_ULCORNER );
			else if (x==uWidth-1 && !y) oMain->PutChar( ACS_URCORNER );
			else if (!x && y==uHeight-1) oMain->PutChar( ACS_LLCORNER );
			else if (x==uWidth-1 && y==uHeight-1) oMain->PutChar( ACS_LRCORNER );			else if (!y || y==uHeight-1) oMain->PutChar( ACS_HLINE );
			else if (!x || x==uWidth-1) oMain->PutChar( ACS_VLINE );
			else oMain->PutChar( ' ' );
		}
	}
	oMain->Refresh();
	// oMain->UpdatePanels();
}

FoScreen::~FoScreen() {
	delete oMain;
}
