| 1 | /* |
| 2 | * File: PanelButton.cpp |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: Aug 7, 2009 |
| 6 | * |
| 7 | * Copyright (c) 2009-2013 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation, either version 3 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include "PanelButton.h"cxx . . $ `<file>/HercStudio/PanelButton.h`/ |
| 26 | #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/ |
| 27 | #include "Environment.h"cxx . . $ `<file>/HercStudio/Environment.h`/ |
| 28 | |
| 29 | #include <iostream> |
| 30 | #include <QPainter> |
| 31 | #include <QPixmap> |
| 32 | |
| 33 | |
| 34 | PanelButtoncxx . . $ PanelButton#::PanelButtoncxx . . $ PanelButton#PanelButton(93919d61bc3bcddf).(const QStringcxx . . $ QString#& upButtonName, const QStringcxx . . $ QString#& downButtonName, QWidgetcxx . . $ QWidget# * parent) : |
| 35 | QPushButtoncxx . . $ QPushButton#(parent), mDowncxx . . $ PanelButton#mDown.(false), mUpButtonNamecxx . . $ PanelButton#mUpButtonName.(upButtonName), mDownButtonNamecxx . . $ PanelButton#mDownButtonName.(downButtonName) |
| 36 | |
| 37 | { |
| 38 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(this,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(pressed()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(pressedSignal())); |
| 39 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(this,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(released()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(releasedSignal())); |
| 40 | } |
| 41 | |
| 42 | PanelButtoncxx . . $ PanelButton#::~cxx . . $ PanelButton#`~PanelButton`(49f6e7a06ebc5aa8).PanelButtoncxx . . $ PanelButton#() |
| 43 | { |
| 44 | |
| 45 | } |
| 46 | |
| 47 | void PanelButtoncxx . . $ PanelButton#::replaceButtoncxx . . $ PanelButton#replaceButton(c1427772cd1877b0).(const QStringcxx . . $ QString#& upButtonName, const QStringcxx . . $ QString#& downButtonName) |
| 48 | { |
| 49 | mUpButtonNamecxx . . $ PanelButton#mUpButtonName. =cxx . . $ QString#`operator=`(6a89d0b7f4d2681c). upButtonName; |
| 50 | mDownButtonNamecxx . . $ PanelButton#mDownButtonName. =cxx . . $ QString#`operator=`(6a89d0b7f4d2681c). downButtonName; |
| 51 | repaintcxx . . $ QWidget#repaint(49f6e7a06ebc5aa8).(); |
| 52 | } |
| 53 | void PanelButtoncxx . . $ PanelButton#::paintEventcxx . . $ PanelButton#paintEvent(f239c9e85d61a220).(QPaintEventcxx . . $ QPaintEvent# *) |
| 54 | { |
| 55 | QStringcxx . . $ QString# filename = mUpButtonNamecxx . . $ QString#QString(3520e46b33348bf6).; |
| 56 | if (mDowncxx . . $ PanelButton#mDown.) |
| 57 | filename =cxx . . $ QString#`operator=`(6a89d0b7f4d2681c). mDownButtonNamecxx . . $ PanelButton#mDownButtonName.; |
| 58 | QPixmapcxx . . $ QPixmap# newPixcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(filename); |
| 59 | QPaintercxx . . $ QPainter# paintercxx . . $ QPainter#QPainter(dd2eedc069b0ab5f).(this); |
| 60 | painter.drawPixmapcxx . . $ QPainter#drawPixmap(c906314a67120896).(0, 0, newPix); |
| 61 | resizecxx . . $ QWidget#resize(3e454b8ccf442868).(33,25); |
| 62 | } |
| 63 | |
| 64 | void PanelButtoncxx . . $ PanelButton#::pressedSignalcxx . . $ PanelButton#pressedSignal(49f6e7a06ebc5aa8).() |
| 65 | { |
| 66 | mDowncxx . . $ PanelButton#mDown. = true; |
| 67 | repaintcxx . . $ QWidget#repaint(49f6e7a06ebc5aa8).(); |
| 68 | } |
| 69 | |
| 70 | void PanelButtoncxx . . $ PanelButton#::releasedSignalcxx . . $ PanelButton#releasedSignal(49f6e7a06ebc5aa8).() |
| 71 | { |
| 72 | mDowncxx . . $ PanelButton#mDown. = false; |
| 73 | repaintcxx . . $ QWidget#repaint(49f6e7a06ebc5aa8).(); |
| 74 | } |
| 75 | |
| 76 |