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

ocolorpopupmenu.h

Go to the documentation of this file.
00001 /*
00002                             This file is part of the Opie Project
00003 
00004                  Copyright (c)  2002 S. Prud'homme <prudhomme@laposte.net>
00005                                      Dan Williams <williamsdr@acm.org>
00006               =.
00007             .=l.
00008            .>+-=
00009  _;:,     .>    :=|.         This program is free software; you can
00010 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00011 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00012 .="- .-=="i,     .._         License as published by the Free Software
00013  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00014      ._= =}       :          or (at your option) any later version.
00015     .%`+i>       _;_.
00016     .i_,=:_.      -<s.       This program is distributed in the hope that
00017      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00018     : ..    .:,     . . .    without even the implied warranty of
00019     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00020   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00021 ..}^=.=       =       ;      Library General Public License for more
00022 ++=   -.     .`     .:       details.
00023  :     =  ...= . :.=-
00024  -.   .:....=;==+<;          You should have received a copy of the GNU
00025   -_. . .   )=.  =           Library General Public License along with
00026     --        :-=`           this library; see the file COPYING.LIB.
00027                              If not, write to the Free Software Foundation,
00028                              Inc., 59 Temple Place - Suite 330,
00029                              Boston, MA 02111-1307, USA.
00030 
00031 */
00032 
00033 #ifndef OCOLORPOPUPMENU_H
00034 #define OCOLORPOPUPMENU_H
00035 
00036 /* QT */
00037 
00038 #include <qframe.h>
00039 #include <qpopupmenu.h>
00040 
00041 class QWidget;
00042 class QGridLayout;
00043 
00044 namespace Opie
00045 {
00046 
00057 class OColorPanelButton : public QFrame
00058 {
00059     Q_OBJECT
00060 
00061 public:
00062 
00073     OColorPanelButton(const QColor& color, QWidget* parent = 0, const char* name = 0);
00074 
00079     ~OColorPanelButton();
00080 
00090     void setActive(bool active);
00091 
00101     void enterEvent(QEvent* e);
00102 
00112     void leaveEvent(QEvent* e);
00113 
00122     void paintEvent(QPaintEvent* e);
00123 
00135     void mouseReleaseEvent(QMouseEvent* e);
00136 
00137 signals:
00138 
00148     void selected(const QColor&);
00149 
00150 private:
00151     QColor m_color;
00152     bool m_active : 1;
00153     class ColorPanelButtonPrivate;
00154     ColorPanelButtonPrivate *d;
00155 };
00156 
00170 class OColorPopupMenu : public QPopupMenu
00171 {
00172     Q_OBJECT
00173 
00174 public:
00175 
00186  // FIXME add Wflags? -zecke
00187     OColorPopupMenu( const QColor& color, QWidget* parent = 0, const char* name = 0 );
00188 
00193     ~OColorPopupMenu();
00194 
00195 private:
00196     class ColorPopupMenuPrivate;
00197     ColorPopupMenuPrivate *d;
00198     QColor       m_color;
00199     QWidget*     colorPanel;
00200     QGridLayout* colorLayout;
00201 
00213     void addColor( const QColor& color, int row, int col );
00214 
00215 signals:
00216 
00226     void colorSelected( const QColor& color );
00227 
00228 protected slots:
00229 
00243     void buttonSelected( const QColor& color );
00244 
00257     void moreColorClicked();
00258 };
00259 
00260 };
00261 
00262 #endif // COLORPOPUPMENUANEL_H

Generated on Sat Nov 5 16:16:30 2005 for OPIE by  doxygen 1.4.2