Enabled/Disabled concern

I am sure I am missing something here, but have a concern.

I have a flash video of this but it would not let me upload it, so I will try to explain it.

To duplicate:

Create a window with 2 buttons on it.
Enable one button disable the other.
Add some code to the mousePressed event of the buttons. Based on text I think you know which code I put on which button.

(For example: system.gui.messageBox("From Button1 I am enabled so this should run") and on other system.gui.messageBox( "I am NOT enabled and should not run")

Even when you click on the disabled button the code runs. If this code turned something on or off and a operator clicked on the button thinking it would have no effect because button is disabled on screen I think bad things could happen.

This is on Ignition 7.4.1 (b906)

Yes, that is true. Even if the component is disabled the mouse events fire. If you put the code on the actionPerformed than nothing would happen when it is disabled. If you want to keep the code on the mouse events your script can check to see if the component is enabled:[code]if event.source.enabled:

do your code[/code]In 7.5, when you setup security you can disable all the events.

Thanks, Travis

Is there an easy way to search for code on that event through projects?

If you use find and replace (Ctrl+F) within a project it will search the entire project for a line of code. This will only search the currently opened project, it will not search through projects that are not open.

Thanks, Greg

I seen that, was more looking for something that would say you have some code tied to this event so I could make sure it was nothing that should not run if it was disabled.