Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to persist a toolbar
Message
From
27/10/2002 15:13:16
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00715677
Message ID:
00715896
Views:
9
>Take aslo look at Developer-defined Btn(s) on Standard VFP toolbar Thread #611029.

This works. I've had problems with the .prg being locked during testing, so I've given it a temp name and made it vanish with the toolbar... in the end. Here's my modification of your and Zlatin's code:
*[2002.10.27 14:44:13] dragan -  if we used a little prg to restart this, kill it
	If Not Empty(This.ccreator) And File(This.ccreator)
		Erase (Forceext(This.ccreator,"*"))
	Endif
* .lAllowClose is set from exit button only
If This.lallowclose
	_Screen.otestbar=.Null.
Else
	Local lcSetSafety, lcExePath, lcPRG

	lcPRG = ForcePath(Forceext([tmp_]+Sys(2015), "prg"), JustPath(this.ClassLibrary))

	If _Screen.ReleaseType != 2 Then
		Local lcCommand, lcSetSafety, lcPrg
TEXT TEXTMERGE to lcCommand noshow
	_SCREEN.AddProperty('<<This.Name>>', NEWOBJECT('<<This.Class>>', '<<This.ClassLibrary>>'))
	_screen.<<this.Name>>.cCreator="<<lcPrg>>"
	ON KEY LABEL RIGHTMOUSE
ENDTEXT
		lcSetSafety = Set([SAFETY])
		Set Safety Off
		Strtofile(lcCommand, lcPRG)
		Set Safety &lcSetSafety
		On Key Label RIGHTMOUSE Do &lcPRG
*[2002.10.27 15:06:37] dragan -  open it just in case ctrl+f2 is not available
		Activate Window command
		KEYBOARD '{CTRL+F2}{RIGHTMOUSE}' CLEAR
	Endif
	Return .F.
Endif
Works great so far - thanks for nudging me in the right direction.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform