Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting code into method at runtime
Message
 
To
10/12/2008 12:28:25
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01366206
Message ID:
01366481
Views:
12
>Any ideas?

It should work, here you have a silly sample
loForm			= Createobject('myForm')
loForm.Show(1)

define class myForm as Form

	add object myGrid as Grid
	add object myCustom as myCustom
	
	function Load()
		local i
		
		create cursor c_something (pk I autoinc, somedata C(10))
		for i = 1 to 100
			insert into c_something (somedata) values (Sys(2015))
		next i
		return .t.
	endfunc
	
	function Init()
		this.myGrid.RecordSource = 'c_something'
		Bindevent(this.myGrid, 'MouseEnter', this.myCustom, 'MouseEnter')
		return .t.
	endfunc
enddefine

define class myCustom as Custom
	procedure MouseEnter(nButton, nShift, nXCoord, nYCoord)
	
		wait window 'MouseEnter fired on Custom' timeout 2
	
	endproc

enddefine
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform