Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DOS-style buttons/menus flashing in 8.0
Message
From
19/08/2003 23:41:42
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
 
 
To
19/08/2003 08:50:38
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00821160
Message ID:
00821669
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
Hi JoeK,

we have about 150 Screens still based on the FPW2.6 screen generator which generate the old @get - syntax into the .spr's.

What I did is work on all the FPW2.6 Scx as database tables, switch over the when, activate, deactivate and show- calls to expressions, deselcted "Center" and moved the screen area off the screen.
I defined global "hook" methods, which also recenter the screen after all the "working over" is done.

some snippets of the program changing all the .scx:
function setFields
if plModify
	replace ;
		Center with .f., ;
		VPos with  0, ;
		HPos with -125
endif

function setShow
Do Case
	case lower("g_RdShowExit") $ lower(Show)
		if Showtype <>0
			asse .f. mess "g_RdShowExitda, ShowType verkehrt"
			if plModify
				replace ShowType with 0
			endif
		endif
	Case empty(Alltrim(Show))
		if plModify
			replace Show with "g_RdShowExit()"
			replace ShowType with 0
		endif
	Case !empty(Alltrim(Show))
		if Showtype <>0
			asse .f. mess "Show nicht leer, ShowType verkehrt"
		else
		    if plModify
			replace Show with Show + " and g_RdShowExit()"
			replace ShowType with 0
		    endif
		endif
EndCase
which will translate into generated spr's with:
...
IF NOT WEXIST("_10w0xmxw4")
	DEFINE WINDOW _10w0xmxw4 ;
		AT 0.000, -125.00 ;
		SIZE 13.846,65.000 ;
		FONT "MS Sans Serif", 8 ;
		FLOAT ;
		NOCLOSE ;
		MINIMIZE ;
		SYSTEM
ENDIF

....

READ CYCLE ;
	ACTIVATE g_RdActExit() ;
	SHOW _10w0xmxxw() AND (g_RdShowExit())
which guarantees the hooks will be called at the correct time.
If you are working without screen dsigner genereated code, you will have to
jumt through your code and cahnge all the defines and reads manually.

Then I have the "global hook code", which moves the screen into the visible area after all the changes are made. You can also put other global handlings into these functions: but be aware, that VFP sometimes supresses screen drawing if the screen is not visible, so call the repaint afterwards: it is still faster by a lot, if no checks have to be applied to @get prompt.

It is still a kludge, but quite workable and gives "snappier" screens then the old FPW-app, even if I do a lot more now (like dynamically hiding certain parts of the @-get screens) which is totally impossible under FPW2.6.

And as long as I don't have the budget for a total screen conversion (mostly testing budget, it is a rather large app) the customer is still happy with cleaned up screens and a now total 32-Bit environment.
function g_wcenter
private lcWName
lcWName = lower(alltrim(woutput()))
*-- Masken von Hand:
*-- KnGrund, KnDatnut,
*-- KftmGrnd, KfTmTarg, KfTmTarp, KfDatnug, KfDatnpp, KfDatnpg
*-- KfMain_X, kftarAu2, kfAntr, KnANtr,
*-- In Antrag, noch nicht umgestellt (Speed Prüfen!)
*-- KfAllVor, KfAnlag, KfDfu, KfFzBis, KfTech, KfTechNP!!!, 
*-- KfVorlD, KnAllVor, KnTechVo
if wlcol(m.lcWName)<0 or wlrow(m.lcWName)<0
	* wait wind program() timeout 0.2

	*-- Das Move window muss VORHER geschehen, da VFP anscheinend merkt,
	*-- daß nix zu sehen ist und sonst der Screen sich NICHT ändert: Aaargh!
	move window ((m.lcWName)) center
	#if left(version(), 1)=="V"
		if 	m.lcWName == "kfhsn" or ;
				m.lcWName == "kftsn" or ;
				m.lcWName == "kfzlb" or ;
				m.lcWName == "kfvsg"
		else

			*-- Ohne Doevents tut et auch nicht: geht da was anderes ?
			*-- Hier noch schnellere Version möglich ?? Repaint ??
			doevents
			if lower(_screen.activeform.name) == m.lcWName
				*-- Faktor 4 gegenüber anderen Alternativen wie
				*-- Show Gets, Refresh()
				= _screen.activeform.paint()
			else
				*-- Hier vielleicht ein Show Gets Only / Off ??
				*-- Nada: dann wäre eine Unterteilung per Case / Function
				*-- in einzelene Update-Arten notwendig
				show gets
			endif
		endif
	#else
		show gets
	#endif
endif
return .t.

function g_RdActExit
parameter tcOpt
*-- globar Hook zum letztmöglichen Einsprung bei ReadActivate
*-- Rahmenmäßige Fenster/resp. _Screen.Form-Objekte
*-- einfügen in Snippet mit:
*  and g_RdActExit()
= g_wcenter()
#if left(version(), 1)=="F"
	return .t.
#else
	return .t.
#endif
HTH

Thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform