-
Notifications
You must be signed in to change notification settings - Fork 17
/
GlbTrn.pas
112 lines (95 loc) · 2.64 KB
/
GlbTrn.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
This is part of Vortex Tracker II project
(c)2000-2009 S.V.Bulba
Author: Sergey Bulba, [email protected]
Support page: http://bulba.untergrund.net/
Version 2.0 and later
(c)2017-2021 Ivan Pirog, [email protected]
https://github.com/ivanpirog/vortextracker
}
unit GlbTrn;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TGlbTrans = class(TForm)
GroupBox1: TGroupBox;
CheckBox4: TCheckBox;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
GroupBox2: TGroupBox;
UpDown8: TUpDown;
Edit8: TEdit;
Label8: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Edit2: TEdit;
UpDown1: TUpDown;
Button1: TButton;
Button2: TButton;
procedure Edit2Exit(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Edit8Exit(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
GlbTrans: TGlbTrans;
implementation
uses Main, Childwin, trfuncs;
{$R *.DFM}
procedure TGlbTrans.Edit2Exit(Sender: TObject);
begin
Edit2.Text := IntToStr(UpDown1.Position)
end;
procedure TGlbTrans.FormShow(Sender: TObject);
begin
if MainForm.MDIChildCount <> 0 then
UpDown1.Position := TMDIChild(MainForm.ActiveMDIChild).PatNum;
Edit8.SelectAll;
Edit8.SetFocus
end;
procedure TGlbTrans.Edit8Exit(Sender: TObject);
begin
Edit8.Text := IntToStr(UpDown8.Position)
end;
procedure TGlbTrans.Button1Click(Sender: TObject);
var
i: integer;
Chans: TChansArrayBool;
CurrentWindow: TMDIChild;
begin
if MainForm.MDIChildCount = 0 then exit;
if not CheckBox1.Checked and
not CheckBox2.Checked and
not CheckBox3.Checked and
not CheckBox4.Checked then exit;
if UpDown8.Position = 0 then exit;
CurrentWindow := TMDIChild(MainForm.ActiveMDIChild);
Chans[0] := CheckBox1.Checked;
Chans[1] := CheckBox2.Checked;
Chans[2] := CheckBox3.Checked;
if RadioButton1.Checked then
begin
if MessageDlg('This operation cannot be undo. Are you sure you want to continue?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
CurrentWindow.DisposeUndo(True);
for i := 0 to MaxPatNum do MainForm.TransposeColumns(CurrentWindow, i,
CheckBox4.Checked, Chans, 0, MaxPatLen - 1, UpDown8.Position, False);
end;
end
else
MainForm.TransposeColumns(CurrentWindow, UpDown1.Position,
CheckBox4.Checked, Chans, 0, MaxPatLen - 1, UpDown8.Position, True);
end;
procedure TGlbTrans.Button2Click(Sender: TObject);
begin
Hide
end;
end.