Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent and Grid Columns
Message
From
28/05/2010 02:37:30
 
 
To
27/05/2010 21:20:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01466311
Message ID:
01466339
Views:
50
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform