-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGoToBar.plg
91 lines (85 loc) · 2.86 KB
/
GoToBar.plg
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
{
Initialize "() {
// v.1.0.0
AddToPluginsMenu('Go To Bar','Run'); }"
Run "() {
score = Sibelius.ActiveScore;
selection = score.Selection;
varBarNumber = '';
dialogResult = Sibelius.ShowDialog(BarNumDialog, Self);
if (dialogResult = false or Length(varBarNumber) = 0) {
return false;
}
varBarNumber = RoundDown(varBarNumber);
if (isSelectionEmpty(selection)) {
selection.Clear();
selection.SelectPassage(varBarNumber, varBarNumber);
} else {
topStaff = selection.TopStaff;
botStaff = selection.BottomStaff;
selection.Clear();
selection.SelectPassage(varBarNumber, varBarNumber, topStaff, botStaff);
}
Sibelius.MoveActiveViewToSelection();
}"
isSelectionEmpty "(selection) {
for each obj in selection {
if (IsObject(obj)) {
return false;
}
}
return true;}"
BarNumDialog "Dialog"
{
Title "Go to Bar Number"
X "540"
Y "380"
Width "122"
Height "69"
Controls
{
Button
{
Title "Cancel"
X "8"
Y "32"
Width "50"
Height "14"
DefaultButton "0"
ID "btnCancel"
Value
Method
SetFocus "0"
EndDialog "0"
}
Button
{
Title "OK"
X "64"
Y "32"
Width "50"
Height "14"
DefaultButton "1"
ID "btnOk"
Value
Method
SetFocus "0"
EndDialog "1"
}
Edit
{
Title "Bar number"
X "8"
Y "11"
Width "104"
Height "14"
ID "inputBarNumber"
Value "varBarNumber"
Method
SetFocus "1"
}
}
}
varBarNumber "2"
}