Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem-Screen color attributes change print colors
Message
From
16/08/2002 16:13:46
 
 
To
16/08/2002 15:56:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00690511
Message ID:
00690531
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
Tracy,

Does MS KB #Q154170 relate?

good luck

>We have a FPD26 app that has been partially converted to VFP7. Some of the screens are still the original FPD26 screens being run as the .sprs. In the original app (FPD26) we allowed the users to change the foxpro screens colors. This has never been a problem til now. Since some of the screens are still dos screens, when the user changes the screen colors, the printing no longer works. Sometimes it prints out as solid black boxes and sometimes it prints out as the actual screen color (if using a color printer) like GB+/R for instance will printout as GB+/R on a color printer. However, only the screen attributes have been changed, so why does the printer font change? Please see my code below to duplicate this problem. I can duplicate it over and over but cannot figure a way of resolving it. It is different depending on the printer of course but some of our users have Okidata Microline 320s and some have HP4000, and some have Lexmarks, etc.
>
>TIA!!!!!!!!!!!
>TRACY
>
>
>
>*SETCOLOR.PRG
>
>set COLOR OF SCHEME 1 to W+/G, W+/BG, GR+/B, GR+/B, R+/B, W+/GR, GR+/RB, N+/N, GR+/B, R+/B
>set COLOR OF SCHEME 2 to W+/n, W+/BG, GR+/B, GR+/B, R+/B, W+/GR, GR+/RB, N+/N, GR+/B, R+/B
>set COLOR OF SCHEME 3 to W+/B, W+/BG, GR+/B, GR+/B, R+/B, W+/GR, GR+/RB, N+/N, GR+/B, R+/B
>
>* DO SETSCHEME
>
>DO setscreen1
>? "THESE ARE THE NEW COLORS"
>*Test printing
>set PRINTER TO NAME GETPRINTER()
>set DEVICE TO printer
>@1,10 SAY "TEST 1"
>@5,10 say "This is the first line of text"
>@8,10 say "This is the 2nd line of text"
>set PRINTER to
>set DEVICE TO screen
>
>WAIT WINDOW "Press anykey for test 2"
>*Test with set printer font
>DO setscreen2
>set DEVICE TO printer
>SET PRINTER FONT 'TIMES NEW ROMAN',10
>@1,10 SAY "TEST 2"
>@5,10 say "This is the first line of text"
>@8,10 say "This is the 2nd line of text"
>set PRINTER to
>set DEVICE TO screen
>
>RETURN
>
>****************************************************************
>PROCEDURE setscreen1
>#IF 'VISUAL' $ UPPER(VERSION())
>		
>	sRGB = RGBSCHEME(1,1)
>	sRGB = STRTRAN(sRGB, 'RGB(', '')
>	sRGB = STRTRAN(sRGB, ')', '')
>		
>	nRed = VAL(SUBSTR(sRGB, 1, AT(',', sRGB, 1)-1))
>	nGreen = VAL(SUBSTR(sRGB, AT(',', sRGB, 1)+1, AT(',', sRGB, 2)-1))
>	nBlue = VAL(SUBSTR(sRGB, AT(',', sRGB, 2)+1, AT(',', sRGB, 3)-1))
>		
>	_SCREEN.ForeColor = RGB(nRed, nGreen, nBlue)
>
>	nRed = VAL(SUBSTR(sRGB, AT(',', sRGB, 3)+1, AT(',', sRGB, 4)-1))
>	nGreen = VAL(SUBSTR(sRGB, AT(',', sRGB, 4)+1, AT(',', sRGB, 5)-1))
>	nBlue = VAL(SUBSTR(sRGB, AT(',', sRGB, 5)+1))
>
>	_SCREEN.BackColor = RGB(nRed, nGreen, nBlue)
>	_SCREEN.FillColor = RGB(nRed, nGreen, nBlue)
>	
>#ENDIF
>CLEAR
>RETURN
>
>****************************************************************
>PROCEDURE setschem
>PRIVATE dbfarea,crntreso,newscheme
>
>dbfarea = ALIAS()
>crntreso = SYS(2005)
>
>SELECT 0
>USE (crntreso) ALIAS "TEMPRESO"
>
>LOCATE FOR id = "SCRN_BORDER"
>IF FOUND()
>	m.borderfill = DATA
>ENDIF
>
>USE IN TEMPRESO
>IF !EMPTY(dbfarea)
>	SELECT (dbfarea)
>ENDIF
>
>*---Define Color Atributes for Policy Profiler.
>screenatr = SCHEME(1,1)
>inputsatr = SCHEME(1,2)
>statusatr = SCHEME(1,4)
>revcolor  = rev_vid(inputsatr)
>
>?"SCREEN ATTRIBUTES:"
>?screenatr
>?inputsatr
>?statusatr
>?revcolor
>
>RETURN
>
>****************************************************************
>FUNCTION rev_vid
>PARAMETER TEXT
>RETURN SUBSTR(TEXT,AT(",",TEXT)+1)
>RETURN
>
>****************************************************************
>PROCEDURE setscreen2
>#IF 'VISUAL' $ UPPER(VERSION())
>		
>	sRGB = RGBSCHEME(2,1)
>	sRGB = STRTRAN(sRGB, 'RGB(', '')
>	sRGB = STRTRAN(sRGB, ')', '')
>		
>	nRed = VAL(SUBSTR(sRGB, 1, AT(',', sRGB, 1)-1))
>	nGreen = VAL(SUBSTR(sRGB, AT(',', sRGB, 1)+1, AT(',', sRGB, 2)-1))
>	nBlue = VAL(SUBSTR(sRGB, AT(',', sRGB, 2)+1, AT(',', sRGB, 3)-1))
>		
>	_SCREEN.ForeColor = RGB(nRed, nGreen, nBlue)
>
>	nRed = VAL(SUBSTR(sRGB, AT(',', sRGB, 3)+1, AT(',', sRGB, 4)-1))
>	nGreen = VAL(SUBSTR(sRGB, AT(',', sRGB, 4)+1, AT(',', sRGB, 5)-1))
>	nBlue = VAL(SUBSTR(sRGB, AT(',', sRGB, 5)+1))
>
>	_SCREEN.BackColor = RGB(nRed, nGreen, nBlue)
>	_SCREEN.FillColor = RGB(nRed, nGreen, nBlue)
>	
>#ENDIF
>CLEAR
>RETURN
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform