68 lines
1.7 KiB
C#
68 lines
1.7 KiB
C#
///
|
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
using ResultsBrowser.Resources;
|
|
|
|
namespace ResultsBrowser.Forms
|
|
{
|
|
public partial class HistogramOptionsDlg : Form
|
|
{
|
|
IList<Results.WMeterRsltItemSpec> items;
|
|
public IList<Results.WMeterRsltItemSpec> SelectedItems;
|
|
|
|
IList<CheckBox> checkBoxes;
|
|
|
|
public HistogramOptionsDlg(IList<Results.WMeterRsltItemSpec> items)
|
|
{
|
|
InitializeComponent();
|
|
this.items = items;
|
|
|
|
checkBoxes = new List<CheckBox>();
|
|
}
|
|
|
|
private void HistogramOptionsDlg_Load(object sender, EventArgs e)
|
|
{
|
|
Localize();
|
|
|
|
foreach (var item in items)
|
|
{
|
|
CheckBox cb = new CheckBox();
|
|
cb.Text = item.Caption;
|
|
cb.Checked = false;
|
|
flowLayoutPanel1.Controls.Add(cb);
|
|
checkBoxes.Add(cb);
|
|
}
|
|
}
|
|
|
|
void Localize()
|
|
{
|
|
Text = Strings.Statistics;
|
|
okButton.Text = Strings.OkBtnText;
|
|
cancelButton.Text = Strings.CancelBtnText;
|
|
}
|
|
|
|
private void okButton_Click(object sender, EventArgs e)
|
|
{
|
|
SelectedItems = new List<Results.WMeterRsltItemSpec>();
|
|
for (int i = 0; i < items.Count; i++)
|
|
{
|
|
if (checkBoxes[i].Checked) SelectedItems.Add(items[i]);
|
|
}
|
|
|
|
//Program.LocalSettings.RowItemCaption = RowItem.Caption;
|
|
// ...
|
|
//Program.LocalSettings.Save();
|
|
|
|
DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
|
|
private void cancelButton_Click(object sender, EventArgs e)
|
|
{
|
|
}
|
|
}
|
|
}
|