Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you (I mean can I) programatically subclass a method
Message
From
18/01/2000 14:59:31
 
 
To
18/01/2000 14:23:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00319562
Message ID:
00319586
Views:
13
>Now I want to do something in the keypress event which is only in options and not in the option group. Can anyone suggest a way to programatically override the keypress method of the options in the init method of the OptionGroup?

The thing to do in this case, is loop threw all the Options, saving stuff, remove the option, and add a new one based on a class you've pre defined (this isn't tested, just off the top of my head):
*OptionGroup.Ini()
local loButton, lnLeft, , lnTop, lcName, lcCaption
for lnI = This.ButtonCount to 1 step -1
	loButton = eval('this.' + This.Buttons[lnI].name)
	lnLeft = loButton.Left
	lnTop = loButton.Top
	lcName = loButton.Name
	lcCaption = loButton.Caption
	This.RemoveObject(lcName)
	This.NewObject(lcName, 'YourClass', 'YourLibrary')
	loButton = eval('this.' + lcName)
	loButton.Top = lnTop
	loButton.Left = lnLeft
	loButton.Caption = lcCaption
	loButton.AutoSize = .t.
	loButton.Visible = .t.
endfor
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform