home *** CD-ROM | disk | FTP | other *** search
- PROGRAM CHANGE_COLOR_DEMO;
- USES CRT,DOS,IOSTUFF,GETCOLOR;
- VAR
- Fore,Back : Integer;
- Ch : Char;
- {===================================================================}
- BEGIN
- Fore := LightGray;
- Back := Blue;
- SetColor(Fore,Back);
- ClrScr;
- WriteSt('ChooseColor allows the user to choose the foreground and ',5,5);
- WriteSt('background colors from a color smorgasbord menu. Note that',5,6);
- WriteSt('The currrent colors are indicated on the menu initially.',5,7);
- WriteSt('Hit any key to proceed.',5,8);
- Ch := ReadKey;
-
- SetChooseColor(20,5); { Set the location of the menu at 20,5 }
- Repeat
- ChooseColor(Fore,Back); { Note that the colors are LightGray and Blue}
- { going in. But ChooseColor will return the }
- { new colors in Fore and Back. You must call}
- { SetColor to activate the new colors before }
- { you write. }
- SetColor(Fore,Back); { Sets TextAttr to chosen colors }
- FillScr('*'); { Fill screen to show how colors look }
- WriteSt('Do it again?',1,25);Clreol;
- Ch := ReadKey;
- Until Ch in ['n','N'];
-
- End.
-