Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

QToggleButton.h

Go to the documentation of this file.
00001 /*
00002  * QToggleButton.h
00003  * $Id: QToggleButton.h,v 1.1.1.1 2001/06/06 15:36:52 guenth Exp $
00004  *
00005  * Copyright (C) 1999, 2000 Markus Janich
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 //  Description : Class QToggleButton
00024 //  Purpose     : Provides funcionality of a togglebutton with two pixmaps
00025 
00026 
00027 #ifndef __QTOGGLEBUTTON_H_
00028 #define __QTOGGLEBUTTON_H_
00029 
00030 
00031 // Qt
00033 #include <qpushbutton.h>
00034 
00035 
00036 // System
00038 
00039 
00040 // Own
00042 
00043 
00044 // Forward declarations
00046 class QString;
00047 class QPixmap;
00048 class QWidget;
00049 
00050 // for Qt 2.x compatibility
00051 #if QT_VERSION >= 300
00052 #define CHECK_PTR Q_CHECK_PTR
00053 #endif
00054 
00055 
00057 
00063 class QToggleButton : public QPushButton
00064 {
00065   Q_OBJECT
00066 
00067 public:
00069   QToggleButton( QWidget *parent=0, const char *name=0 );
00071   QToggleButton( const char *text1, const char *text2, QWidget *parent=0, const char *name=0 );
00073   ~QToggleButton();
00074 
00075   void setText( const QString &) {};        // overwrite inherited method
00076   void setPixmap( const QPixmap &) {};      // overwrite inherited method
00077 
00079   void setText( const QString &up_text, const QString &down_text = "" );
00081   void setPixmap( const QPixmap &up_pixmap, const QPixmap &down_pixmap );
00082 
00083 private slots:
00084   void togglePixmap(bool on);
00085 
00086 private:
00087   QString toggled_btext;
00088   QPixmap *toggled_bpixmap;
00089 };
00090 
00091 
00092 #endif  // __QTOGGLEBUTTON_H_

Generated at Thu Oct 4 17:17:26 2001 for QGLViewer by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001