-
Notifications
You must be signed in to change notification settings - Fork 5
/
frmSelectTracks.cs
executable file
·88 lines (75 loc) · 2.14 KB
/
frmSelectTracks.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MarkAble2
{
public partial class frmSelectTracks : Form
{
public frmSelectTracks()
{
InitializeComponent();
}
private TrackList myTracks;
public frmSelectTracks(TrackList tracks)
{
InitializeComponent();
myTracks = tracks;
}
private void frmSelectTracks_Load(object sender, EventArgs e)
{
lstTracks.Items.Clear();
for (int i = 0; i < myTracks.Count; i++)
{
var track = myTracks[i];
lstTracks.Items.Add(i.ToString("00") + " " + track.Name);
}
CheckAll();
}
private void CheckAll()
{
for (int i = 0; i < lstTracks.Items.Count; i++)
{
lstTracks.SetItemChecked(i,true);
}
}
private void UnCheckAll()
{
for (int i = 0; i < lstTracks.Items.Count; i++)
{
lstTracks.SetItemChecked(i, false);
}
}
private void butCheckAll_Click(object sender, EventArgs e)
{
CheckAll();
}
private void butCheckNone_Click(object sender, EventArgs e)
{
UnCheckAll();
}
private void butNext_Click(object sender, EventArgs e)
{
for (int i = lstTracks.Items.Count -1; i >= 0; i--)
{
if (!lstTracks.GetItemChecked(i))
{
myTracks.RemoveAt(i);
}
}
DialogResult = DialogResult.OK;
}
private void butCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void chkStopShowing_CheckedChanged(object sender, EventArgs e)
{
Global.Options.AllowTrackSelection = !chkStopShowing.Checked; //note the negative here.
Global.Options.Save();
}
}
}