The buttons above have three states:

 

Clicking a button changes it to the selected state and any previously clicked buttons to the visited state.

 

Click here to download the example as a library object