home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
sorties
/
2078
/
colors.kex
< prev
next >
Wrap
Text File
|
1993-04-01
|
2KB
|
45 lines
*┌───────────────────────────────────────────────────────────────────────┐
*│ interface to set colors interactively │
*│ preserves the =-value and puts the Attribute setting into the ?-stack │
*└───────────────────────────────────────────────────────────────────────┘
F = 'Filearea Curline Block Cblock Cmdline Idline Msgline Arrow Prefix Pending Scale Tofeof Ctofeof Tabline Shadow Statarea Divider';
if COMMAND() then M = 5;
else if SHADOW() then M = 15;
else if INPREFIX() then M = 10 - BLANK();
else if FOCUSTOF() | FOCUSEOF() then M = 12 + CURRENT();
else if INBLOCK() then M = 3 + CURRENT();
else M = 1 + CURRENT();
'sos save'; 'modify attributes'; ORIG = CMDLINE.3();
'cmsg ?'; 'sos execute'; L = CMDLINE.3();
'cmsg ?+'; 'sos execute'; 'cmsg'; 'sos restore';
'preserve'; 'set curline M-3'; 'set msgline ON M-1 3 OVERLAY';
do forever
if M = 0 then
do
A = BORDER.1(); if \ DATATYPE( A , 'N' ) then A = 0;
W = 'Border'; S = 'set' W;
end
else
do
'extract /ATTRIBUTES'; A = ATTRIBUTES.M;
W = WORD( F , M ); S = 'set color' W;
end
FG = A//8; BR = (A%8)//2; BG = (A%16)//8; BL = A%128; 'msg';
'msg COLORS U/D='FG'foreg. L/R='BG'backg. INS='BR'bright DEL='BL'blink PGU/D='SUBSTR( W , 1 , 8 )' ENTER,ESC';
'msg'; 'readv KEY'; R = READV.1;
if R = 'ENTER' then do; 'modify border'; 'sos execute'; 'modify attributes'; 'sos execute restore'; leave; end
else if R = 'ESC' then do; ORIG; leave; end
else if R = 'CURU' then FG = (FG+9)//8;
else if R = 'CURD' then FG = (FG+7)//8;
else if R = 'CURR' then BG = (BG+9)//8;
else if R = 'CURL' then BG = (BG+7)//8;
else if R = 'PGDN' then M = (M+19)//18;
else if R = 'PGUP' then M = (M+17)//18;
else if R = 'INS' then BR = (BR+1)//2;
else if R = 'DEL' then BL = (BL+1)//2;
else if WORD( R , 1 ) = 'ASCII' then do; S WORD( R , 2 ); iterate; end
else do; R = POS( UPPER( READV.2 ) , '01234567KBGCRMYW' ); if R > 0 then do; FG = BG; BG = (R-1)//8; end; end
S FG+8*BR+16*BG+128*BL;
end
'restore'; 'set =' L;