Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QToggleButton.h

Go to the documentation of this file.
00001 /*
00002  * QToggleButton.h
00003  * $Id: QToggleButton.h,v 1.3 2001/11/20 16:23:48 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  * As a special exception to the GPL, the QGLViewer authors (Markus
00022  * Janich, Michael Meissner, Richard Guenther, Alexander Buck and Thomas
00023  * Woerner) give permission to link this program with Qt (non-)commercial
00024  * edition, and distribute the resulting executable, without including
00025  * the source code for the Qt (non-)commercial edition in the source
00026  * distribution.
00027  *
00028  */
00029 
00030 //  Description : Class QToggleButton
00031 //  Purpose     : Provides funcionality of a togglebutton with two pixmaps
00032 
00033 
00034 #ifndef __QTOGGLEBUTTON_H_
00035 #define __QTOGGLEBUTTON_H_
00036 
00037 
00038 // Qt
00040 #include <qpushbutton.h>
00041 
00042 
00043 // System
00045 
00046 
00047 // Own
00049 
00050 
00051 // Forward declarations
00053 class QString;
00054 class QPixmap;
00055 class QWidget;
00056 
00057 // for Qt 2.x compatibility
00058 #if QT_VERSION < 300
00059 #define Q_CHECK_PTR CHECK_PTR
00060 #endif
00061 
00062 
00064 
00070 class QToggleButton : public QPushButton
00071 {
00072   Q_OBJECT
00073 
00074 public:
00076   QToggleButton( QWidget *parent=0, const char *name=0 );
00078   QToggleButton( const char *text1, const char *text2, QWidget *parent=0, const char *name=0 );
00080   ~QToggleButton();
00081 
00082   void setText( const QString &) {};        // overwrite inherited method
00083   void setPixmap( const QPixmap &) {};      // overwrite inherited method
00084 
00086   void setText( const QString &up_text, const QString &down_text = "" );
00088   void setPixmap( const QPixmap &up_pixmap, const QPixmap &down_pixmap );
00089 
00090 private slots:
00091   void togglePixmap(bool on);
00092 
00093 private:
00094   QString toggled_btext;
00095   QPixmap *toggled_bpixmap;
00096 };
00097 
00098 
00099 #endif  // __QTOGGLEBUTTON_H_

Generated on Wed Sep 14 04:50:34 2005 for QGLViewer by  doxygen 1.4.4