1 /* DownButton.hpp 2 * Copyright (C) 2018, 2019 Sven Jähnichen 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 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <https://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef BWIDGETS_DOWNBUTTON_HPP_ 19 #define BWIDGETS_DOWNBUTTON_HPP_ 20 21 #include "Button.hpp" 22 #include "Label.hpp" 23 24 namespace BWidgets 25 { 26 /** 27 * Class BWidgets::DownButton 28 * 29 * Text button widget. Is is a BWidgets::Button and thus a 30 * BWidgets::ValueWidget having two conditions: on (value != 0) or off 31 * (value == 0) 32 */ 33 class DownButton : public Button 34 { 35 public: 36 DownButton (); 37 DownButton (const double x, const double y, const double width, const double height, const std::string& name, double defaultValue = 0.0); 38 39 /** 40 * Pattern cloning. Creates a new instance of the widget and copies all 41 * its properties. 42 */ 43 virtual Widget* clone () const override; 44 45 protected: 46 virtual void draw (const BUtilities::RectArea& area) override; 47 }; 48 49 } 50 51 #endif /* BWIDGETS_TOGGLEBUTTON_HPP_ */ 52