~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to widgets/scldraw.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2005-08-23 17:19:39 UTC
  • mto: (4.1.1 breezy) (1.1.9) (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20050823171939-hd8fgzokb4dbj007
Tags: upstream-0.7.1+0.7.2pre2
ImportĀ upstreamĀ versionĀ 0.7.1+0.7.2pre2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//=========================================================
2
 
//  MusE
3
 
//  Linux Music Editor
4
 
//    $Id: scldraw.h,v 1.1.1.1 2003/10/29 10:06:34 wschweer Exp $
5
 
//
6
 
//    Copyright (C) 1997  Josef Wilgen
7
 
//      This program is free software; you can redistribute it and/or modify
8
 
//      it under the terms of the GNU General Public License, version 2,
9
 
//      as published by the Free Software Foundation.
10
 
//
11
 
//    (C) Copyright 2000 Werner Schweer (ws@seh.de)
12
 
//=========================================================
13
 
 
14
 
#ifndef __SCLDRAW_H__
15
 
#define __SCLDRAW_H__
16
 
 
17
 
#include <qglobal.h>
18
 
#include <qstring.h>
19
 
#include "dimap.h"
20
 
#include "scldiv.h"
21
 
#include <qfont.h>
22
 
#include <qrect.h>
23
 
#include <qcolor.h>
24
 
 
25
 
class QPainter;
26
 
class AutoScale;
27
 
 
28
 
class ScaleDraw : public DiMap {
29
 
   public:
30
 
      enum OrientationX { Bottom, Top, Left, Right, Round };
31
 
 
32
 
   private:
33
 
      ScaleDiv d_scldiv;
34
 
      static const int minLen;
35
 
      OrientationX d_orient;
36
 
        
37
 
      int d_xorg;
38
 
      int d_yorg;
39
 
      int d_len;
40
 
        
41
 
      int d_hpad;
42
 
      int d_vpad;
43
 
        
44
 
      int d_medLen;
45
 
      int d_majLen;
46
 
      int d_minLen;
47
 
 
48
 
      int d_minAngle;
49
 
      int d_maxAngle;
50
 
 
51
 
      double d_xCenter;
52
 
      double d_yCenter;
53
 
      double d_radius;
54
 
 
55
 
      char d_fmt;
56
 
      int d_prec;
57
 
        
58
 
      void drawTick(QPainter *p, double val, int len) const;
59
 
      void drawBackbone(QPainter *p) const;
60
 
      void drawLabel(QPainter *p, double val) const;
61
 
        
62
 
   public:
63
 
 
64
 
      ScaleDraw();
65
 
 
66
 
      void setScale(const ScaleDiv &s);
67
 
      void setScale(double vmin, double vmax, int maxMajIntv, int maxMinIntv,
68
 
           double step = 0.0, int logarithmic = 0);
69
 
      void setGeometry(int xorigin, int yorigin, int length, OrientationX o);
70
 
      void setAngleRange(double angle1, double angle2);
71
 
      void setLabelFormat(char f, int prec);
72
 
 
73
 
      const ScaleDiv& scaleDiv() const { return d_scldiv; }
74
 
      OrientationX orientation() const { return d_orient; }
75
 
      QRect maxBoundingRect(QPainter *p) const;
76
 
      int maxWidth(QPainter *p, bool worst = TRUE) const;
77
 
      int maxHeight(QPainter *p) const;
78
 
      int maxLabelWidth(QPainter *p, int worst = TRUE) const;
79
 
      void draw(QPainter *p) const;
80
 
      };
81
 
 
82
 
#endif
83
 
 
84
 
 
85
 
 
86
 
 
87
 
 
88
 
 
89