home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / toolkid / getcolor.dem < prev    next >
Encoding:
Text File  |  1980-01-01  |  1.2 KB  |  33 lines

  1. PROGRAM CHANGE_COLOR_DEMO;
  2. USES CRT,DOS,IOSTUFF,GETCOLOR;
  3. VAR
  4.     Fore,Back  : Integer;
  5.     Ch         : Char;
  6. {===================================================================}
  7. BEGIN
  8. Fore := LightGray;
  9. Back := Blue;
  10. SetColor(Fore,Back);
  11. ClrScr;
  12. WriteSt('ChooseColor allows the user to choose the foreground and ',5,5);
  13. WriteSt('background colors from a color smorgasbord menu.  Note that',5,6);
  14. WriteSt('The currrent colors are indicated on the menu initially.',5,7);
  15. WriteSt('Hit any key to proceed.',5,8);
  16. Ch := ReadKey;
  17.  
  18. SetChooseColor(20,5);      { Set the location of the menu at 20,5 }
  19. Repeat
  20.  ChooseColor(Fore,Back);   { Note that the colors are LightGray and Blue}
  21.                            { going in.  But ChooseColor will return the }
  22.                            { new colors in Fore and Back.  You must call}
  23.                            { SetColor to activate the new colors before }
  24.                            { you write.                                 }
  25.  SetColor(Fore,Back);      { Sets TextAttr to chosen colors             }
  26.  FillScr('*');             { Fill screen to show how colors look        }
  27.  WriteSt('Do it again?',1,25);Clreol;
  28.  Ch := ReadKey;
  29. Until Ch in ['n','N'];
  30.  
  31. End.
  32.  
  33.