Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent user from switching pages?
Message
De
29/07/2005 10:20:08
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
29/07/2005 10:10:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Divers
Thread ID:
01036788
Message ID:
01036973
Vues:
7
Here is some code
DEFINE CLASS cpage AS page
	lRefreshOnPageChange = .f. 
	name = "cpage"
	*// backcolor = 16638920 
	PROCEDURE init()
		DODEFAULT()
		* this ldirtyflag is on my form and bindevent fires when the value changes.  
		* My framework automaticly changes the flag when user enteres data. 
		IF PEMSTATUS(thisform,"ldirtyflag",5)
			BINDEVENT(thisform,"ldirtyflag",this,"setdatatosavestatus",1)
		ENDIF 	
	ENDPROC 

	PROCEDURE activate()
		thisform.lockscreen = .f.
		IF this.parent.nCurrentPage <> this.Parent.activepage
			this.Parent.activatepage(this.Parent.activepage)
			this.Refresh()
		ENDIF 
		this.parent.ncurrentpage = this.Parent.activepage
		DODEFAULT()
	ENDPROC 

	PROCEDURE deactivate()
		thisform.lockscreen = .t.
		this.parent.pagechange(this.Parent.activepage)
		IF PEMSTATUS(this.Parent,"nLastActivePage",5)
			this.Parent.nLastActivePage = this.Parent.activepage 
		ENDIF 
		DODEFAULT()
	ENDPROC 

	PROCEDURE setdatatosavestatus()
		IF this.Parent.activepage <> this.pageorder
			this.Enabled = not thisform.ldirtyflag
		ENDIF 
	ENDPROC 
	
ENDDEFINE
>Sounds interesting ... both for its application here, and also because I'd like to know more about BINDEVENT. Can you provide more details?
>
>>James,
>>
>>Another option that I use is to disable all the tabs except the current tab until a move is allowed. I do this using bind event and it seems very easy and flexable to use.
>>
>>
>>>Is there some simple way to prevent a user from switching pages by clicking on the tab for the page? I want to be able to do so if the information on the current page is incomplete.
>>>
>>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform