Back to index

scribus-ng  1.3.4.dfsg+svn20071115
gradienteditor.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008                           gradienteditor  -  description
00009                              -------------------
00010     begin                : Mit Mai 26 2004
00011     copyright            : (C) 2004 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef GRADEDITOR_H
00025 #define GRADEDITOR_H
00026 
00027 #include <qlabel.h>
00028 #include <qvaluelist.h>
00029 #include <qspinbox.h>
00030 #include <qlayout.h>
00031 #include <qtooltip.h>
00032 
00033 #include "scribusapi.h"
00034 #include "vgradient.h"
00035 
00036 class SCRIBUS_API GradientPreview : public QLabel
00037 {
00038        Q_OBJECT
00039 
00040 public:
00041        GradientPreview(QWidget *pa);
00042        ~GradientPreview() {};
00043        void paintEvent(QPaintEvent *e);
00044        void mousePressEvent(QMouseEvent *m);
00045        void mouseReleaseEvent(QMouseEvent *);
00046        void mouseMoveEvent(QMouseEvent *m);
00047        void leaveEvent(QEvent*);
00048        void enterEvent(QEvent*);
00049        void updateDisplay();
00050        void setActColor(QColor c, QString n, int s);
00051        void setActTrans(double t);
00052        void setActStep(double t);
00053        VGradient fill_gradient;
00054        QValueList<int> StopM;
00055        bool Mpressed;
00056        bool outside;
00057        bool onlyselect;
00058        int ActStop;
00059 
00060 signals:
00061        void selectedColor(QString, int);
00062        void currTrans(double);
00063        void currStep(double);
00064        void gradientChanged();
00065 };
00066 
00067 class SCRIBUS_API GradientEditor : public QLabel
00068 {
00069        Q_OBJECT
00070 
00071 public:
00072        GradientEditor(QWidget *pa);
00073        ~GradientEditor() {};
00074        GradientPreview *Preview;
00075        QLabel *Desc;
00076        QSpinBox *Position;
00077 
00078 public slots:
00079        void setPos(double);
00080        void changePos(int);
00081        void languageChange();
00082 
00083 signals:
00084        void gradientChanged();
00085 
00086 protected:
00087        QVBoxLayout* Form1Layout;
00088        QHBoxLayout* Layout1;
00089 };
00090 
00091 #endif
00092