-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrmUstawMINdB.cs
62 lines (56 loc) · 1.87 KB
/
FrmUstawMINdB.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AnalizatorFalkowy
{
public partial class FrmUstawMINdB : Form
{
private Spektrogram spektrogram;
private ToolStripMenuItem menuUstaw;
public FrmUstawMINdB(Spektrogram spektrogram, ToolStripMenuItem menuUstaw)
{
this.spektrogram = spektrogram;
this.menuUstaw = menuUstaw;
InitializeComponent();
numMindB.Value = Convert.ToDecimal(spektrogram.MinDecybeli);
}
private void btnOK_Click(object sender, EventArgs e)
{
spektrogram.MinDecybeli = (int)numMindB.Value;
UstawZaznaczenieMenu();
this.Close();
}
private void UstawZaznaczenieMenu()
{
foreach (ToolStripMenuItem menu in menuUstaw.DropDownItems)
menu.Checked = false;
switch (spektrogram.MinDecybeli)
{
case -40:
((ToolStripMenuItem)(menuUstaw.DropDownItems[0])).Checked = true;
break;
case -50:
((ToolStripMenuItem)(menuUstaw.DropDownItems[1])).Checked = true;
break;
case -60:
((ToolStripMenuItem)(menuUstaw.DropDownItems[2])).Checked = true;
break;
case -70:
((ToolStripMenuItem)(menuUstaw.DropDownItems[3])).Checked = true;
break;
case -80:
((ToolStripMenuItem)(menuUstaw.DropDownItems[4])).Checked = true;
break;
}
}
private void btnAnuluj_Click(object sender, EventArgs e)
{
this.Close();
}
}
}