1 /* 2 * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ 9 #include "OptionsInput.h" 10 11 #include "MenuOptions.h" 12 13 //----------------------------------------------------------------- OptionsInput(MenuOptions * menu)14OptionsInput::OptionsInput(MenuOptions *menu) 15 : StateInput(menu) 16 { 17 } 18 //----------------------------------------------------------------- 19 MenuOptions * getMenu()20OptionsInput::getMenu() 21 { 22 return dynamic_cast<MenuOptions*>(m_state); 23 } 24 //----------------------------------------------------------------- 25 /** 26 * Toggle menu. 27 */ 28 void enableMenu()29OptionsInput::enableMenu() 30 { 31 quitState(); 32 } 33 //----------------------------------------------------------------- 34 void mouseEvent(const MouseStroke & buttons)35OptionsInput::mouseEvent(const MouseStroke &buttons) 36 { 37 getMenu()->mouseButton(buttons); 38 } 39 40