2
kCalculator, a simple scientific calculator for KDE
4
Copyright (C) 2003 Klaus Niederkrueger <kniederk@math.uni-koeln.de>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2
Copyright (C) 2001 - 2013 Evan Teran
5
Copyright (C) 2003 - 2005 Klaus Niederkrueger
6
kniederk@math.uni-koeln.de
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 2 of the License, or
11
(at your option) any later version.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program. If not, see <http://www.gnu.org/licenses/>.
22
22
#include "kcalc_const_button.h"
29
29
#include "kcalc_const_button.moc"
31
31
//------------------------------------------------------------------------------
32
// Name: KCalcConstButton(QWidget *parent)
32
// Name: KCalcConstButton
33
33
// Desc: constructor
34
34
//------------------------------------------------------------------------------
35
35
KCalcConstButton::KCalcConstButton(QWidget *parent) : KCalcButton(parent), button_num_(-1) {
42
42
//------------------------------------------------------------------------------
43
// Name: KCalcConstButton(const QString &label, QWidget *parent, const QString &tooltip)
43
// Name: KCalcConstButton
44
44
// Desc: constructor
45
45
//------------------------------------------------------------------------------
46
46
KCalcConstButton::KCalcConstButton(const QString &label, QWidget *parent, const QString &tooltip) : KCalcButton(label, parent, tooltip), button_num_(-1) {
52
52
//------------------------------------------------------------------------------
53
// Name: constant() const
54
54
// Desc: get the value of the const as a QString
55
55
//------------------------------------------------------------------------------
56
56
QString KCalcConstButton::constant() const {
61
61
//------------------------------------------------------------------------------
62
// Name: setButtonNumber(int num)
62
// Name: setButtonNumber
63
63
// Desc: remembers the "index" of the const button
64
64
//------------------------------------------------------------------------------
65
65
void KCalcConstButton::setButtonNumber(int num) {
70
70
//------------------------------------------------------------------------------
71
// Name: setLabelAndTooltip()
71
// Name: setLabelAndTooltip
72
72
// Desc: sets both the label and the tooltip for the const button
73
73
//------------------------------------------------------------------------------
74
74
void KCalcConstButton::setLabelAndTooltip() {
86
86
//------------------------------------------------------------------------------
87
// Name: initPopupMenu()
87
// Name: initPopupMenu
88
88
// Desc: initializes the const button popup
89
89
//------------------------------------------------------------------------------
90
90
void KCalcConstButton::initPopupMenu() {
106
106
//------------------------------------------------------------------------------
107
// Name: slotConfigureButton()
107
// Name: slotConfigureButton
108
108
// Desc: lets the user set the name for a constant
109
109
//------------------------------------------------------------------------------
110
110
void KCalcConstButton::slotConfigureButton() {
120
120
//------------------------------------------------------------------------------
121
// Name: slotChooseScientificConst(const science_constant &const_chosen)
121
// Name: slotChooseScientificConst
122
122
// Desc: set the buttons's scientific constant
123
123
//------------------------------------------------------------------------------
124
124
void KCalcConstButton::slotChooseScientificConst(const science_constant &const_chosen) {
131
131
//------------------------------------------------------------------------------
132
// Name: slotClicked()
133
133
// Desc: constant button was clicked
134
134
//------------------------------------------------------------------------------
135
135
void KCalcConstButton::slotClicked() {