Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Init does not fire
Message
 
To
10/10/2007 11:39:53
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01259860
Message ID:
01260064
Views:
18
>>>>When you suspend, in the debugger put THIS into the watch window, then drill down its .Buttons array, or check .optionbutton3 (or whatever they may be called).
>>>
>>>Dragan -
>>>Neat trick, thanks.
>>>Following your suggestion shows that all 6 of the buttons are drived from the same class. So I would presume (SWAG) that the problem lies with the group container and not with the individual buttons. ???
>>
>>Strange. What is in the Init of the base class? Can you output something to make sure it doesn't indeed fire?
>
>I have code like this in each of the 6 buttons
>
>* button.init
>messagebox("button 1 fires")
>
>Obviously this is for testing only, but it shows me that only the first 2 buttons reach the init code. My ultimate purpose is to set the enabled property based on the users authorization but that's less visible than the messagebox. (not really but not as dramatic)
>Also,
>
>* baseclass.button.init
>thisform.resizeobject(this)
>if authlevel < this.authorization
>	this.enabled = .F.
>endif
>dodefault()
>
>* baseclass.buttongroup.init
>thisform.resizeobject(this)
>for each loButton in this.Buttons
>thisform.resizeobject(loButton)
>next
>if authlevel < this.authorization
>this.enabled = .F.
>endif
>dodefault()
>
>Nothing really exotic.


Just for debugging. Add a Command button in the form. In its Click event put the code already suggested:
lcText = []
FOR EACH oButton IN thisform.OptionGroupXX.Buttons && Put the real name of the option group here
    lcText = lcText  + oButton.Name + [  ]+oButton.Class+CHR(13)+CHR(10)
NEXT
MessageBox(lcText)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform