Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Build navigation form
Message
De
01/03/2016 08:17:26
 
 
À
29/02/2016 15:56:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01632297
Message ID:
01632335
Vues:
157
Thanks to Borislav and Dragan for available help.
finally the simple things appear sometime as complex and unsolvable.this one finally is very simple to get.
i build a small class to do the job but in vfp screen (not on designer environment itself whose is a part of hidden vfp ide).
i create a toolbar class and run it to make it docked as any vfp toolbar.it interact directly with any opened form by designer.
run the code,open any form with the form designer (modi form) and navigate on methods with the 2 buttons (back,forward).
read the summary help in button1.
with _screen
If Type(".oToolbar")="O" And !Isnull(.oToolbar)
Else
	.AddProperty("otoolbar",.F.)
Endif
.oToolbar=Create("ylistener_form")
.oToolbar.Show
endwith
*
Define Class ylistener_form As Toolbar
	Caption = "Toolbar1"
	Height = 29
	Left = 0
	Top = 0
	Width = 127
	lx = .F.
	ycount = .F.

	Add Object image1 As Image With ;
		Picture = Home(1)+"GRAPHICS\ICONS\WRITING\BOOK02.ICO", ;
		Stretch = 0, ;
		Height = 15, ;
		Left = 5, ;
		MousePointer = 15, ;
		Top = 3, ;
		Width = 16, ;
		Name = "Image1"

	Add Object separator6 As Separator With ;
		Top = 3, ;
		Left = 28, ;
		Height = 0, ;
		Width = 0, ;
		Name = "Separator6"

	Add Object command2 As CommandButton With ;
		Top = 3, ;
		Left = 28, ;
		Height = 23, ;
		Width = 23, ;
		FontBold = .T., ;
		FontName = "Webdings", ;
		FontSize = 11, ;
		Caption = "3", ;
		MousePointer = 15, ;
		ToolTipText = "Back", ;
		ForeColor = Rgb(255,0,0), ;
		BackColor = Rgb(128,255,0), ;
		Name = "Command2"

	Add Object separator7 As Separator With ;
		Top = 3, ;
		Left = 58, ;
		Height = 0, ;
		Width = 0, ;
		Name = "Separator7"

	Add Object command3 As CommandButton With ;
		Top = 3, ;
		Left = 58, ;
		Height = 22, ;
		Width = 23, ;
		FontBold = .T., ;
		FontName = "Webdings", ;
		FontSize = 11, ;
		Caption = "4", ;
		MousePointer = 15, ;
		ToolTipText = "Forward", ;
		ForeColor = Rgb(255,0,0), ;
		BackColor = Rgb(128,255,0), ;
		Name = "Command3"

	Add Object separator5 As Separator With ;
		Top = 3, ;
		Left = 88, ;
		Height = 0, ;
		Width = 0, ;
		Name = "Separator5"

	Add Object label1 As Label With ;
		AutoSize = .T., ;
		FontBold = .T., ;
		FontSize = 11, ;
		Caption = "X", ;
		Height = 20, ;
		Left = 88, ;
		MousePointer = 15, ;
		Top = 3, ;
		Width = 12, ;
		ForeColor = Rgb(255,0,0), ;
		Name = "Label1"

	Add Object timer1 As Timer With ;
		Top = 3, ;
		Left = 99, ;
		Height = 23, ;
		Width = 23, ;
		Interval = 1000, ;
		Name = "Timer1"

	Procedure Init
		This.Dock(0)
		Declare Integer Sleep In kernel32 Integer
		This.lx=""
	Endproc

	Procedure image1.Click
		Local m.myvar
		TEXT to m.myvar noshow
this class works on form designer with design mode.
it detects the form opened and can navigate into its
method (back or forward).
it does anything if there is no form opened.
a timer controls if there is a form opend in designer with 
an interval :1 second.it alerts for its name if form changed.
it docked as toolbar on the main vfp window.
simply execute the code to launch it and issue
modi form ?
in command window
		ENDTEXT
		Messagebox(m.myvar,0+32+4096,"Help")
	Endproc

	Procedure command2.Click
		Try
			If ! Empty(This.Parent.lx)
				Keyboard("{PGUP}")
				Sleep(20)
				Keyboard("{PGUP}")
			Endi
		Catch
		Endtry
	Endproc


	Procedure command3.Click
		Try
			If ! Empty(This.Parent.lx)
				Keyboard("{PGDN}")
				Sleep(20)
				Keyboard("{PGDN}")
			Endi
		Catch
		Endtry
	Endproc


	Procedure label1.Click
		This.Parent.timer1.Enabled=.F.
		_Screen.oToolbar=Null
	Endproc


	Procedure timer1.Timer
		*ASELOBJ( ArrayName, [ 1 | 2 | 3 ] )   &&*2  Full path and name of .scx or .vcx file
		Local gnObjects
		gnObjects=Aselobj(myArray,3)
		*3 Creates three-element array containing information in context with the currently active code editing window:
		* object reference to a container object, the full path and name of the .scx or .vcx file, and
		*the full path and name of the #INCLUDE file, if available.

		If gnObjects>=1

			Y=myArray(2,2)

			If !Lower(This.Parent.lx)==Lower(m.y)
				This.Parent.ycount=0
				This.Parent.lx=m.y
			Endi

			If This.Parent.ycount=0
				Messagebox(This.Parent.lx,0+32+4096,'Alert- form changed in designer !',2000)
				This.Parent.ycount=1
			Endi
		Endi
	Endproc


Enddefine
*
*-- EndDefine: ylistener_form
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform