1 /* 2 * GroupBox.h - LMMS-groupbox 3 * 4 * Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net> 5 * 6 * This file is part of LMMS - https://lmms.io 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public 19 * License along with this program (see COPYING); if not, write to the 20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 * Boston, MA 02110-1301 USA. 22 * 23 */ 24 25 26 #ifndef GROUP_BOX_H 27 #define GROUP_BOX_H 28 29 #include <QWidget> 30 31 #include "AutomatableModelView.h" 32 #include "PixmapButton.h" 33 34 35 class QPixmap; 36 37 38 class GroupBox : public QWidget, public BoolModelView 39 { 40 Q_OBJECT 41 public: 42 GroupBox( const QString & _caption, QWidget * _parent = NULL ); 43 virtual ~GroupBox(); 44 45 virtual void modelChanged(); 46 ledButton()47 PixmapButton * ledButton() 48 { 49 return m_led; 50 } 51 titleBarHeight()52 int titleBarHeight() const 53 { 54 return m_titleBarHeight; 55 } 56 57 58 protected: 59 virtual void mousePressEvent( QMouseEvent * _me ); 60 virtual void paintEvent( QPaintEvent * _pe ); 61 62 63 private: 64 void updatePixmap(); 65 66 PixmapButton * m_led; 67 QString m_caption; 68 const int m_titleBarHeight; 69 70 } ; 71 72 73 typedef BoolModel groupBoxModel; 74 75 76 #endif 77