2 * Parameter SpinBox, a custom Qt4 widget
3 * Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
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
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef PARAMSPINBOX_HPP_INCLUDED
19 #define PARAMSPINBOX_HPP_INCLUDED
21 #include "CarlaJuceUtils.hpp"
25 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
26 # include <QtWidgets/QProgressBar>
28 # include <QtGui/QProgressBar>
34 virtual ~TextCallback();
35 virtual const char* textCallBack() = 0;
38 class ParamProgressBar
: public QProgressBar
43 ParamProgressBar(QWidget
* parent
);
45 void set_minimum(float value
);
46 void set_maximum(float value
);
47 void set_value(float value
);
48 void set_label(QString label
);
49 void set_text_call(TextCallback
* textCall
);
52 void valueChangedFromBar(float value
);
55 void handleMouseEventPos(const QPoint
& pos
);
56 void mousePressEvent(QMouseEvent
* event
) override
;
57 void mouseMoveEvent(QMouseEvent
* event
) override
;
58 void mouseReleaseEvent(QMouseEvent
* event
) override
;
59 void paintEvent(QPaintEvent
* event
) override
;
69 TextCallback
* m_textCall
;
71 CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ParamProgressBar
)
74 #endif // PARAMSPINBOX_HPP_INCLUDED