Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent and Grid Columns
Message
De
28/05/2010 02:37:30
 
 
À
27/05/2010 21:20:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01466311
Message ID:
01466339
Vues:
51
>If I remember correctly, the idea of the framework is to allow sorting on a second, third, ... column by doing a Ctrl-click. How will bindevent() figure out what parameters were passed to Header.MouseDown()?

The delegate method must have at least the number of parameters of the function or event it binds to

Stupid example -

If you take the parameters out of ScreenMouseDown, you will have an error when you click somewhere on the screen
=CreateObject('Resizer')


define class Resizer as relation

	function init()
		=DoDefault()
	
		=BindEvent(_screen, 'MouseDown', m.this, 'ScreenMouseDown', 1)
	
		=_screen.AddProperty('Resizer', m.this)
		
	endfunc
	
	
	function 	ScreenMouseDown(nButton, nShift, nXCoord, nYCoord)
	
		acti screen
		?'ScreenMouseDown', nButton, nShift, nXCoord, nYCoord
	endfunc
	
	function Destroy()
		
		try
			=UnBindEvents(m.this)
		
		catch
		
		endtry
		
		return DoDefault()
	endfunc
enddefine 
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform