Refactor switch into a single assignment.

ToolType is a typedef enum. The compiler will recognize it as an int can be assigned from buttonIndex.