hydrogen
1.2.3
PatternFillDialog.cpp
Go to the documentation of this file.
1
/*
2
* Hydrogen
3
* Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4
* Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5
*
6
* http://www.hydrogen-music.org
7
*
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.
12
*
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.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see https://www.gnu.org/licenses
20
*
21
*
22
*/
23
24
#include "
PatternFillDialog.h
"
25
26
#include <
core/Hydrogen.h
>
27
#include <
core/Basics/Song.h
>
28
#include <
core/Basics/Pattern.h
>
29
30
PatternFillDialog::PatternFillDialog
(QWidget* parent,
FillRange
* pRange)
31
: QDialog(parent)
32
{
33
setupUi(
this
);
34
35
setWindowTitle( tr(
"Fill with selected pattern"
) );
36
adjustSize();
37
setFixedSize( width(), height() );
38
39
__fill_range
= pRange;
40
__text_changed
();
41
}
42
43
44
45
PatternFillDialog::~PatternFillDialog
()
46
{
47
}
48
49
50
51
void
PatternFillDialog::on_cancelBtn_clicked
()
52
{
53
reject();
54
}
55
56
57
58
void
PatternFillDialog::on_okBtn_clicked
()
59
{
60
__fill_range
->
fromVal
= fromText->text().toUInt();
61
__fill_range
->
toVal
= toText->text().toUInt();
62
__fill_range
->
bInsert
= fillRB->isChecked();
63
accept();
64
}
65
66
67
68
void
PatternFillDialog::on_fromText_textChanged
(
const
QString& )
69
{
70
__text_changed
();
71
}
72
73
74
void
PatternFillDialog::on_toText_textChanged
(
const
QString& )
75
{
76
__text_changed
();
77
}
78
79
80
81
void
PatternFillDialog::__text_changed
()
82
{
83
int
fromVal, toVal;
84
85
if
( ( fromVal = fromText->text().toUInt() ) &&
86
( toVal = toText->text().toUInt() ) &&
87
( toVal > fromVal ) ) {
88
89
okBtn->setEnabled(
true
);
90
}
91
else
{
92
okBtn->setEnabled(
false
);
93
}
94
}
Hydrogen.h
PatternFillDialog.h
Pattern.h
Song.h
PatternFillDialog::__fill_range
FillRange * __fill_range
Definition
PatternFillDialog.h:66
PatternFillDialog::on_cancelBtn_clicked
void on_cancelBtn_clicked()
Definition
PatternFillDialog.cpp:51
PatternFillDialog::on_toText_textChanged
void on_toText_textChanged(const QString &text)
Definition
PatternFillDialog.cpp:74
PatternFillDialog::~PatternFillDialog
~PatternFillDialog()
Definition
PatternFillDialog.cpp:45
PatternFillDialog::PatternFillDialog
PatternFillDialog(QWidget *parent, FillRange *range)
Definition
PatternFillDialog.cpp:30
PatternFillDialog::on_fromText_textChanged
void on_fromText_textChanged(const QString &text)
Definition
PatternFillDialog.cpp:68
PatternFillDialog::on_okBtn_clicked
void on_okBtn_clicked()
Definition
PatternFillDialog.cpp:58
PatternFillDialog::__text_changed
void __text_changed()
Does some name check.
Definition
PatternFillDialog.cpp:81
FillRange
Definition
PatternFillDialog.h:39
FillRange::bInsert
bool bInsert
Definition
PatternFillDialog.h:43
FillRange::fromVal
int fromVal
Definition
PatternFillDialog.h:41
FillRange::toVal
int toVal
Definition
PatternFillDialog.h:42
src
gui
src
SongEditor
PatternFillDialog.cpp
Generated by
1.10.0