jvanegmond Posted February 1, 2011 Share Posted February 1, 2011 There's nothing wrong with it, apart from I can't tell which buttons have been disabled. I would probably use your method under most circumstances. That's wrong. Again. You don't pay enough attention to the code. This line of code here: If BitAnd(GUICtrlGetState($button), $GUI_ENABLE) Then GUICtrlSetState($button, $GUI_DISABLE) Else GUICtrlSetState($button, $GUI_ENABLE) EndIf should give you a pretty good idea of how to get the enabled/disabled state of a button. If you need an array of enabled buttons, then do something like this: Func _getListOfDisabledButtons() ; Using a precalculation here in favor of _ArrayAdd since arrayadd seems more expensive (presumption) $total = 0 For $n = 0 to UBound($toggleButtons)-1 $button = $toggleButtons[$n] If BitAnd(GUICtrlGetState($button), $GUI_DISABLE) Then $total += 1 EndIf Next Local $ret[$total] $i = 0 For $n = 0 to UBound($toggleButtons)-1 $button = $toggleButtons[$n] If BitAnd(GUICtrlGetState($button), $GUI_DISABLE) Then $ret[$i] = $button $i += 1 EndIf Next Return $ret EndFunc github.com/jvanegmond Link to comment Share on other sites More sharing options...
czardas Posted February 1, 2011 Author Share Posted February 1, 2011 (edited) I think you misunderstood. I only want one button to be active, plus I prefer the visual appearance of the other buttons to remain the same - so I can see the (disabled button state) configuration prior to running the process. I could colour code the buttons, but surely it is easier to render all GUI's containing those buttons inactive? If BitAnd(GUICtrlGetState($button), $GUI_ENABLE) Then GUICtrlSetState($button, $GUI_DISABLE) Else GUICtrlSetState($button, $GUI_ENABLE) ; I don't want this! EndIf What I originally wanted to do was clear the queue of messages sent to all GUI's, but seeing as that seems to be too complicated, I sought an alternative. Is there anything wrong with the method I suggested, ... apart from not being able to minimize the window. Edited February 1, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
czardas Posted February 1, 2011 Author Share Posted February 1, 2011 (edited) After some consideration, I have decided to follow Manadar's advice. Edited February 2, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now