Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unwanted _screen clearing
Message
De
11/06/2003 14:24:34
 
 
À
11/06/2003 13:03:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00798388
Message ID:
00799062
Vues:
32
Worked for me too!
Thanks!
Here is what I tested:
CLEAR ALL 
set COLOR TO gr+/r, g/w+
_screen.fontname="Arial"
_screen.fontsize=8
clear
@10,10 say "this is line 1"
@12,10 say "this is line 2"
#IF "VISUAL" $ UPPER(VERSION())
	ox = CREATEOBJECT('form')
	ox.left = 10000
	ox.BackColor = RGB(255,255,255)
	ox.ForeColor = RGB(0,0,0)
	ox.show
#ENDIF
	SET DEVICE TO PRINTER
	??? "(s10H         "
	@1,1 SAY "This is a test"
	SET DEVICE TO SCREEN
	SET PRINTER TO
#IF "VISUAL" $ UPPER(VERSION())
	RELEASE ox
#ENDIF
>Try this, it works for me in a quick and dirty test:
>
>
>CLEAR ALL
>set COLOR TO gr+/r, g/w+
>clear
>@10,10 say "this is line 1"
>@12,10 say "this is line 2"
>#IF "VISUAL" $ UPPER(VERSION())
>	ox = CREATEOBJECT('form')
>	ox.left = 10000
>	ox.BackColor = RGB(255,255,255)
>	ox.ForeColor = RGB(0,0,0)
>	ox.show
>#ENDIF
>	SET DEVICE TO PRINTER
>	@1,1 SAY "This is a test"
>	SET DEVICE TO SCREEN
>	SET PRINTER TO
>#IF "VISUAL" $ UPPER(VERSION())
>	RELEASE ox
>#ENDIF
>
>
>>Thanks Jim, but one in a hundred times it does not work. Also, the screen flash is VERY undersirable, as the goal here is for the user to not notice anything is happening to the screen at all since this is in an attempt to workaround the bug where if you change your screen colors and print using @...say it uses the screen colors when you print. To avoid that, I have to change the screen colors to black on white while printing and then set it back. However, if I have information on the screen itself when this happens it gets wiped out when the lockscreen=.f. is issued and the restore screen does not always seem to work...
>>
>>
>>>Try replacing your WAIT WINDOW command with
>>>
>>>
>>>WAIT "" time .01
>>>
>>>
>>>or (if in VFP8)
>>>
>>>
>>>DOEVENTS FORCE
>>>
>>>
>>>>This works, but I cannot have a wait window and display a white screen in the process of waiting for the user to press a key...
>>>>
>>>>
>>>>set COLOR TO gr+/r, g/w+
>>>>glfontname=_screen.fontname
>>>>glfontsize=_screen.fontsize
>>>>cOldbackcolor=_screen.backcolor
>>>>coldforecolor=_screen.forecolor
>>>>coldfillcolor=_screen.fillcolor
>>>>clear
>>>>@10,10 say "this is line 1"
>>>>@12,10 say "this is line 2"
>>>>#IF "VISUAL" $ UPPER(VERSION())
>>>>	IF TYPE('printscr')="U"
>>>>		PUBLIC printscr
>>>>	ENDIF
>>>>	ACTIVATE SCREEN
>>>>	SAVE SCREEN TO printscr
>>>>	_screen.lockscreen=.t.
>>>>	_Screen.BackColor = RGB(255,255,255)
>>>>	_Screen.ForeColor = RGB(0,0,0)		
>>>>	_Screen.FillColor = RGB(255,255,255)	
>>>>	_screen.refresh
>>>>	ACTIVATE SCREEN
>>>>#ENDIF
>>>>
>>>>*redraw screen as it was
>>>>#IF 'VISUAL' $ UPPER(VERSION())
>>>>
>>>>	DECLARE Sleep IN Win32API;
>>>>	  		INTEGER nMilliseconds
>>>>	= Sleep(100) && Wait a 1/10th of a second.
>>>>
>>>>	ACTIVATE SCREEN
>>>>
>>>>	* TCH 7/10/2002 Added
>>>>		
>>>>	WITH _screen
>>>>*		.lockscreen=.T.
>>>>		.fontname=glFontName
>>>>		.fontsize=glFontSize
>>>>		.fontunderline=.f.
>>>>		.fontbold=.f.
>>>>		.BackColor = cOldbackcolor
>>>>		.ForeColor = cOldforecolor
>>>>		.FillColor = cOldfillcolor
>>>>	ENDWITH
>>>>
>>>>	_SCREEN.lockscreen=.F.
>>>>	
>>>>	WAIT WINDOW "Press anykey..."
>>>>
>>>>	IF TYPE('printscr')!="U"
>>>>		ACTIVATE SCREEN
>>>>		RESTORE SCREEN FROM printscr
>>>>	ENDIF
>>>>
>>>>	CLEAR DLLS "sleep"
>>>>	
>>>>
>>>>#ENDIF
>>>>
>>>>RETURN
>>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform