58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using WeifenLuo.WinFormsUI.Docking;
|
|
|
|
namespace friction
|
|
{
|
|
public partial class PanelMaterial : DockContent
|
|
{
|
|
MainForm m_Owner = null;
|
|
|
|
public PanelMaterial(MainForm owner)
|
|
{
|
|
InitializeComponent();
|
|
|
|
m_Owner = owner;
|
|
this.ApplyTheme();
|
|
|
|
Theme.Apply(this);
|
|
Theme.Apply(cbMaterialSpring);
|
|
Theme.Apply(cbMaterialTable);
|
|
Theme.Apply(btApply);
|
|
}
|
|
|
|
public void UpdateData(DataHandler data)
|
|
{
|
|
var SpringList = data.GetSpringList();
|
|
var TableList = data.GetTableList();
|
|
|
|
cbMaterialSpring.Items.Clear();
|
|
foreach (var x in SpringList)
|
|
cbMaterialSpring.Items.Add(x);
|
|
cbMaterialSpring.SelectedIndex = 0;
|
|
|
|
cbMaterialTable.Items.Clear();
|
|
cbMaterialTable.Items.Add("All");
|
|
foreach (var x in TableList)
|
|
cbMaterialTable.Items.Add(x);
|
|
cbMaterialTable.SelectedIndex = 0;
|
|
|
|
lbFileName.Text = data.GetFileName();
|
|
|
|
m_Owner.OnApplyData((string)cbMaterialSpring.SelectedItem, (string)cbMaterialTable.SelectedItem);
|
|
}
|
|
|
|
private void btApply_Click(object sender, EventArgs e)
|
|
{
|
|
m_Owner.OnApplyData((string)cbMaterialSpring.SelectedItem, (string)cbMaterialTable.SelectedItem);
|
|
}
|
|
}
|
|
}
|