GadgetDisabled

BlitzMax Forums/MaxGUI Module/GadgetDisabled

Jur(Posted 2012) [#1]
I have a problem that GadgetDisabled and ActiveGadget are not working. Can you tell me why this code prints "BUTTON NOT DISABLED" and "BUTTON NOT ACTIVE" ?




Zeke(Posted 2012) [#2]
this is maxgui GadgetDisabled() function:
Function GadgetDisabled( gadget:TGadget, recursive% = False )
	If recursive Then
		While Not (gadget.State()&STATE_DISABLED)
			gadget = gadget.parent
			If Not gadget Return False
		Wend
		Return True
	EndIf	
	Return (gadget.State()&STATE_DISABLED)
End Function

function returns 4 if gadget is disabled. so[bbcode]If GadgetDisabled(button)=True Then[/bbcode] is not "true" (because GadgetDisabled(button)=4)

This works:[bbcode]If GadgetDisabled(button) Then[/bbcode]

Small fix to GadgetDisabled() function(last line changed):
Return Return (gadget.State()&STATE_DISABLED)>0



Jur(Posted 2012) [#3]
Thanks. Yes, this could be marked as a small bug, as it is writen in the docs, that the function returns true or false.