@@ -22,17 +22,6 @@ public TrassenPanel()
22
22
private void CenterElements ( )
23
23
{
24
24
label_Trasse . Left = ( ClientSize . Width - label_Trasse . Width ) / 2 ;
25
- //int totalControlWidth = flowLayoutPanel.Controls.Cast<Control>().Sum(c => c.Width + flowLayoutPanel.Margin.Horizontal);
26
- //int availableWidth = flowLayoutPanel.ClientSize.Width;
27
- //if (totalControlWidth < availableWidth)
28
- //{
29
- // int padding = (availableWidth - totalControlWidth) / 2;
30
- // flowLayoutPanel.Padding = new Padding(padding, flowLayoutPanel.Padding.Top, padding, flowLayoutPanel.Padding.Bottom);
31
- //}
32
- //else
33
- //{
34
- // flowLayoutPanel.Padding = new Padding(0);
35
- //}
36
25
}
37
26
private void Tb_TRA_DragEnter ( object sender , DragEventArgs e )
38
27
{
@@ -66,8 +55,11 @@ private void Tb_TRA_DragDrop(object sender, DragEventArgs e)
66
55
TextBox tb = ( TextBox ) sender ;
67
56
if ( tb != null && fileInfo . Extension . Equals ( ".tra" , StringComparison . OrdinalIgnoreCase ) )
68
57
{
58
+ TreeNode previousNode = ( TreeNode ) tb . Tag ;
59
+ if ( previousNode != null ) { previousNode . BackColor = Color . Empty ; }
69
60
tb . Tag = node ;
70
61
tb . Text = fileInfo . Name ;
62
+ node . BackColor = BackColor ;
71
63
}
72
64
}
73
65
}
@@ -103,13 +95,16 @@ private void Tb_GRA_DragDrop(object sender, DragEventArgs e)
103
95
TextBox tb = ( TextBox ) sender ;
104
96
if ( tb != null && fileInfo . Extension . Equals ( ".gra" , StringComparison . OrdinalIgnoreCase ) )
105
97
{
98
+ TreeNode previousNode = ( TreeNode ) tb . Tag ;
99
+ if ( previousNode != null ) { previousNode . BackColor = Color . Empty ; }
106
100
tb . Tag = node ;
107
101
tb . Text = fileInfo . Name ;
102
+ node . BackColor = BackColor ;
108
103
}
109
104
}
110
105
}
111
106
112
- private void tb_TRA_TextChanged ( object sender , EventArgs e )
107
+ private void tb_XRA_TextChanged ( object sender , EventArgs e )
113
108
{
114
109
List < TextBox > textBoxes = new List < TextBox > { tb_TRA_L , tb_TRA_S , tb_TRA_R , tb_GRA_L , tb_GRA_R } ;
115
110
textBoxes . Remove ( sender as TextBox ) ;
@@ -126,8 +121,11 @@ private void tb_TRA_TextChanged(object sender, EventArgs e)
126
121
{
127
122
if ( n . Tag . ToString ( ) . EndsWith ( filename , StringComparison . OrdinalIgnoreCase ) )
128
123
{
124
+ TreeNode previousNode = ( TreeNode ) tb . Tag ;
125
+ if ( previousNode != null ) { previousNode . BackColor = Color . Empty ; }
129
126
tb . Tag = n ;
130
127
tb . Text = filename ;
128
+ n . BackColor = BackColor ;
131
129
return ;
132
130
}
133
131
}
@@ -176,6 +174,7 @@ private void btn_Load_Click(object sender, EventArgs e)
176
174
trasseR . Interpolate3D ( null , 10 ) ;
177
175
trasseR . Plot ( ) ;
178
176
}
177
+
179
178
}
180
179
}
181
180
}
0 commit comments