Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unwanted _screen clearing
Message
De
10/06/2003 17:24:05
 
 
À
10/06/2003 17:20:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00798388
Message ID:
00798651
Vues:
39
The idea is this (due to bug where @...says sent to printer assume window screen colors):
1. save screen
2. set screen colors to black on white
3. print
4. set screen colors back and restore fontname and fontsize (we have noticed that periodically the screen will assume the font used for printing)
5. restore screen
6. all of the above without the user noticing anything has changed to the screen

>But I'm confused by your LOCKSCREENS.
>You set to .T. immediately after you save the screen but only reset it to .F. immediately before you restore the screen IN ANOTHER ROUTINE.
>I don't think you can expect anything on the screen to occur 'as expected' while LOCKSCREEN = .T., so anything you do after it's set to .T. is unpredictable I would say.
>
>
>
>>The problem is addition to /similar to this:
>>
>>Re: Problem-Screen color attributes change print colors Thread #690511 Message #690548
>>
>>They are in separate routines because they are run before/after printing.
>>
>>
>>>REPLY #2 to this message:
>>>
>>>When I do
_screen.AddProperty("PrintScr")
>>>xxx=24567
>>>?xxx
>>>?xxx
>>>?xxx
>>>?xxx
>>>SAVE SCREEN TO _screen.Printscr
>>>CLEAR
>>>RESTORE SCREEN FROM _Screen.Printscr
in the Command Window it works as I would expect EVEN THOUGH the _Screen prop "PrintScr" says [NONE]!
>>>
>>>So my best gues is the LockScreens. Can you get away without them, or at least do both .T./.F. in each routine where you use them?
>>>
>>>
>>>
>>>>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