Replace hard-coded magic values "1" and "2" with their symbolic enum constants. This improves readability and maintainability.
Fix for buttons nested in a read-only (disabled) control section; before, this would remove the read-only protection after the button but with this change the read-only state is preserved (but the button itself is unaffected).