
/*
  *  example.cc , v 0.4 1996/05/02
  *
  * 
  *  o  based on NCurses
  *  o  OO - Designed and Implemented
  *  o  redirects the outputstream to the screen using the
  *     ostream interface  
  *  o  compatible with the constream interface of Borlands 
  *     C++ DOS package 
  *
  *
  *  Copyright (c) 1996 Dipl.-Ing.,Dipl.-Ing.(FH)  Jurgen Eidt
  *  All rights reserved.  
  *  GPL-Copying-policy.
  *  
  *  Redistribution and use in source and binary forms are permitted
  *  provided that the above copyright notice and this paragraph are
  *  duplicated in all such forms and that any documentation,
  *  advertising materials, and other materials related to such
  *  distribution and use acknowledge that the software was developed
  *  by Jurgen Eidt.  The name may not be used to endorse or promote 
  *  products derived from this software without specific prior written 
  *  permission.
  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * 
  *  	Jurgen Eidt
  *  	Dromersheimer Str. 2
  *  	D-55411 Bingen am Rhein
  *     Germany
  * 
  *  	E-Mail: jurgen@tap.de 
  *  	FidoNet: 2:2455/240.25
  * 
*/


#include"constream.h"
#include<istream.h>

//
// example of using the constream-interface,
// see README for some Documentation ...
//


int main()
{
  // define some window's
  constream back, status(2, 3, 50, 10), words;
  
  // define the window's attributes
  back << setclr(BLUE) << setbk(WHITE);
  back.clrscr(ACS_CKBOARD);

  status << setbk(BLUE);
  status.clrscr();

  words.window(25, 14, COLS-7, LINES-6);
  words << setclr(MAGENTA) << setbk(CYAN);
  words.clrscr();

  // example of using the window-objects 
  for(int l = 0; l < 100; l++)
  {
    status << setclr(l) << "Line No.: " << l << endl;
    words << setclr(l) << "Hello World, ";
    if(l%3) 
      words << highvideo;
    else
      words << normvideo;
  }

  status << setclr(WHITE) << endl
         << highvideo << "   constream , v 0.4" << endl
         << setclr(CYAN) << "   1996/05/02, Jurgen Eidt <jurgen@tap.de>"
         << "                 FidoNet   2:2455/240.25" << endl
         << normvideo << endl;

  status << setclr(RED) << highvideo << " - Type " 
         << reverseon << blinkon << "a key" << blinkoff << reverseoff 
         << setclr(YELLOW) << " to " << normvideo
         << setbk(WHITE) << "finish" << setbk(BLUE)
         << endl << setclr(MAGENTA) << " ... - and then "
         << highvideo << "ENTER :-)" << endl;

  char c; cin >> c;
    
  return 0;
}
