• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • superkaramba
 

superkaramba

  • superkaramba
  • src
meter.cpp
1/***************************************************************************
2 * Copyright (C) 2003 by Hans Karlsson *
3 * karlsson.h@home.se *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
10#include "meter.h"
11
12Meter::Meter(karamba* k, int ix, int iy, int iw, int ih):
13 boundingBox(ix, iy, iw, ih), leftButtonAction(""), middleButtonAction(""),
14 rightButtonAction(""), clickable(true), hidden(0), minValue(0), maxValue(0),
15 color(0,0,0), m_karamba(k)
16{
17}
18
19Meter::Meter(karamba* k):
20 boundingBox(0, 0, 0, 0), leftButtonAction(""), middleButtonAction(""),
21 rightButtonAction(""), clickable(true), hidden(0), minValue(0), maxValue(0),
22 color(0,0,0), m_karamba(k)
23{
24}
25
26Meter::~Meter()
27{
28}
29
30bool Meter::click(TQMouseEvent*)
31{
32 return false;
33}
34
35void Meter::setSize(int ix, int iy, int iw, int ih)
36{
37 boundingBox.setRect(ix, iy, iw, ih);
38 recalculateValue();
39}
40
41void Meter::setThemePath( TQString path )
42{
43 themePath = path;
44}
45
46int Meter::getX()
47{
48 return boundingBox.x();
49}
50
51int Meter::getY()
52{
53 return boundingBox.y();
54}
55
56void Meter::setX(int newx)
57{
58 int temp = boundingBox.width();
59 boundingBox.setX(newx);
60 boundingBox.setWidth(temp);
61}
62
63void Meter::setY(int newy)
64{
65 int temp = boundingBox.height();
66 boundingBox.setY(newy);
67 boundingBox.setHeight(temp);
68}
69
70int Meter::getWidth()
71{
72 return boundingBox.width();
73}
74int Meter::getHeight()
75{
76 return boundingBox.height();
77}
78
79void Meter::setWidth(int width)
80{
81 boundingBox.setWidth(width);
82 recalculateValue();
83}
84
85void Meter::setHeight(int height)
86{
87 boundingBox.setHeight(height);
88 recalculateValue();
89}
90
91TQRect Meter::getBoundingBox()
92{
93 return boundingBox;
94}
95
96void Meter::setEnabled(bool e)
97{
98 clickable = e;
99}
100
101bool Meter::isEnabled()
102{
103 return clickable;
104}
105
106bool Meter::insideActiveArea(int x, int y)
107{
108 return boundingBox.contains(x, y) && clickable;
109}
110
111#include "meter.moc"

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

superkaramba

Skip menu "superkaramba"
  • kcalc
  •   knumber
  • superkaramba
Generated for superkaramba by doxygen 1.9.4
This website is maintained by Timothy Pearson.