Implement Button Event model in C++.