Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you (I mean can I) programatically subclass a method
Message
De
18/01/2000 14:59:31
 
 
À
18/01/2000 14:23:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00319562
Message ID:
00319586
Vues:
12
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform