~ubuntu-branches/ubuntu/raring/voxbo/raring

« back to all changes in this revision

Viewing changes to vbview/vbqt_scalewidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2010-06-06 11:33:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100606113311-v3c13imdkkd5n7ae
Tags: upstream-1.8.5~svn1172
ImportĀ upstreamĀ versionĀ 1.8.5~svn1172

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// vbqt_scalewidget.h
 
3
// Copyright (c) 2010 by The VoxBo Development Team
 
4
 
 
5
// This file is part of VoxBo
 
6
// 
 
7
// VoxBo is free software: you can redistribute it and/or modify it
 
8
// under the terms of the GNU General Public License as published by
 
9
// the Free Software Foundation, either version 3 of the License, or
 
10
// (at your option) any later version.
 
11
// 
 
12
// VoxBo is distributed in the hope that it will be useful, but
 
13
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
// General Public License for more details.
 
16
// 
 
17
// You should have received a copy of the GNU General Public License
 
18
// along with VoxBo.  If not, see <http://www.gnu.org/licenses/>.
 
19
// 
 
20
// For general information on VoxBo, including the latest complete
 
21
// source code and binary distributions, manual, and associated files,
 
22
// see the VoxBo home page at: http://www.voxbo.org/
 
23
// 
 
24
// original version written by Dan Kimberg
 
25
 
 
26
#include <qimage.h>
 
27
#include <qpainter.h>
 
28
#include <QMouseEvent>
 
29
#include <QFrame>
 
30
#include <stdlib.h>
 
31
 
 
32
class VBScalewidget : public QFrame {
 
33
  Q_OBJECT
 
34
public:
 
35
  VBScalewidget(QWidget *parent=0);
 
36
  void drawContents(QPainter *);
 
37
public slots:
 
38
  void setscale(float low,float high,QColor negcolor1,QColor negcolor2,
 
39
              QColor poscolor1,QColor poscolor2);
 
40
  void setscale(float low,float high,QColor poscolor1,QColor poscolor2);
 
41
protected:
 
42
  // void drawContents(QPainter *p,int clipx,int clipy,int clipw,int cliph);
 
43
private slots:
 
44
signals:
 
45
  void newcolors(QColor,QColor,QColor,QColor);
 
46
private:
 
47
  void contextmenu();
 
48
  void drawcolorbars(QPainter *,QRect,int);
 
49
  void mousePressEvent(QMouseEvent *);
 
50
  void mouseDoubleClickEvent(QMouseEvent *);
 
51
  void paintEvent(QPaintEvent *pe);
 
52
  void shaderect(QPainter *paint,QRect &r,QColor &c1,QColor &c2);
 
53
 
 
54
  QColor q_negcolor1,q_negcolor2,q_poscolor1,q_poscolor2;
 
55
  float q_low,q_high;
 
56
  bool f_vertical;
 
57
  QRect posrect,negrect;
 
58
};