public override void PressButton(int buttonId) { if (curMenu == 0) { //This is the currently displayed menu switch (buttonId) { case 0: playButton.Press(); break; case 1: calibrateButton.Press(); break; case 2: settingsButton.Press(); break; case 3: quitButton.Press(); break; default: break; } } else { //The currently displayed menu is in one of the submenus so pass the call down switch (curMenu) { case 1: elementSelectMenu.PressButton(buttonId); break; case 2: gestureCalibrateMenu.PressButton(buttonId); break; case 3: //Settings menu break; default: break; } } }