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 EndCasewhich 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.
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. #endifHTH