1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /*************************************************************************** 3 * button.h 4 * 5 * Sun Oct 9 13:01:56 CEST 2011 6 * Copyright 2011 Bent Bisballe Nyeng 7 * deva@aasimon.org 8 ****************************************************************************/ 9 10 /* 11 * This file is part of DrumGizmo. 12 * 13 * DrumGizmo is free software; you can redistribute it and/or modify 14 * it under the terms of the GNU Lesser General Public License as published by 15 * the Free Software Foundation; either version 3 of the License, or 16 * (at your option) any later version. 17 * 18 * DrumGizmo is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public License 24 * along with DrumGizmo; if not, write to the Free Software 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 26 */ 27 #pragma once 28 29 #include "button_base.h" 30 #include "font.h" 31 #include "texturedbox.h" 32 33 namespace GUI { 34 35 class Button 36 : public ButtonBase { 37 public: 38 Button(Widget* parent); 39 virtual ~Button(); 40 41 protected: 42 // From Widget: 43 virtual void repaintEvent(RepaintEvent* e) override; 44 45 private: 46 TexturedBox box_up{getImageCache(), ":resources/pushbutton.png", 47 0, 0, // atlas offset (x, y) 48 7, 1, 7, // dx1, dx2, dx3 49 6, 12, 9}; // dy1, dy2, dy3 50 51 TexturedBox box_down{getImageCache(), ":resources/pushbutton.png", 52 15, 0, // atlas offset (x, y) 53 7, 1, 7, // dx1, dx2, dx3 54 6, 12, 9}; // dy1, dy2, dy3 55 56 TexturedBox box_grey{getImageCache(), ":resources/pushbutton.png", 57 30, 0, // atlas offset (x, y) 58 7, 1, 7, // dx1, dx2, dx3 59 6, 12, 9}; // dy1, dy2, dy3 60 61 Font font{":resources/fontemboss.png"}; 62 }; 63 64 } // GUI:: 65