diff --git a/Wardrobe/GUI.Designer.vb b/Wardrobe/GUI.Designer.vb index 54242f6..7efec01 100644 --- a/Wardrobe/GUI.Designer.vb +++ b/Wardrobe/GUI.Designer.vb @@ -40,13 +40,13 @@ Partial Class GUI Me.Label5 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.Label7 = New System.Windows.Forms.Label() - Me.Label8 = New System.Windows.Forms.Label() Me.ComboBox_Width = New System.Windows.Forms.ComboBox() Me.ComboBox_Length = New System.Windows.Forms.ComboBox() Me.Button_Square = New System.Windows.Forms.Button() Me.Label9 = New System.Windows.Forms.Label() Me.ComboBox_Material = New System.Windows.Forms.ComboBox() Me.Label_Material = New System.Windows.Forms.Label() + Me.CheckBox1 = New System.Windows.Forms.CheckBox() Me.SuspendLayout() ' 'DrawingPanel @@ -68,7 +68,7 @@ Partial Class GUI ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label1.Location = New System.Drawing.Point(864, 46) + Me.Label1.Location = New System.Drawing.Point(45, 348) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(44, 17) Me.Label1.TabIndex = 4 @@ -78,7 +78,7 @@ Partial Class GUI ' Me.Label2.AutoSize = True Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label2.Location = New System.Drawing.Point(853, 79) + Me.Label2.Location = New System.Drawing.Point(34, 408) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(52, 17) Me.Label2.TabIndex = 5 @@ -97,7 +97,7 @@ Partial Class GUI ' 'AngleButton ' - Me.AngleButton.Location = New System.Drawing.Point(11, 201) + Me.AngleButton.Location = New System.Drawing.Point(586, 55) Me.AngleButton.Margin = New System.Windows.Forms.Padding(2) Me.AngleButton.Name = "AngleButton" Me.AngleButton.Size = New System.Drawing.Size(92, 28) @@ -133,7 +133,7 @@ Partial Class GUI Me.ComboBox_MeshSize.Enabled = False Me.ComboBox_MeshSize.FormattingEnabled = True Me.ComboBox_MeshSize.Items.AddRange(New Object() {"12x100 (B9)", "25x50 (F4)", "34x37 (H3)"}) - Me.ComboBox_MeshSize.Location = New System.Drawing.Point(380, 46) + Me.ComboBox_MeshSize.Location = New System.Drawing.Point(91, 144) Me.ComboBox_MeshSize.Margin = New System.Windows.Forms.Padding(2) Me.ComboBox_MeshSize.Name = "ComboBox_MeshSize" Me.ComboBox_MeshSize.Size = New System.Drawing.Size(141, 21) @@ -145,7 +145,7 @@ Partial Class GUI Me.ComboBox_Thickness.Enabled = False Me.ComboBox_Thickness.FormattingEnabled = True Me.ComboBox_Thickness.Items.AddRange(New Object() {"2", "3", "4"}) - Me.ComboBox_Thickness.Location = New System.Drawing.Point(640, 88) + Me.ComboBox_Thickness.Location = New System.Drawing.Point(91, 253) Me.ComboBox_Thickness.Margin = New System.Windows.Forms.Padding(2) Me.ComboBox_Thickness.Name = "ComboBox_Thickness" Me.ComboBox_Thickness.Size = New System.Drawing.Size(141, 21) @@ -157,7 +157,7 @@ Partial Class GUI Me.ComboBox_Height.Enabled = False Me.ComboBox_Height.FormattingEnabled = True Me.ComboBox_Height.Items.AddRange(New Object() {"20", "25", "30"}) - Me.ComboBox_Height.Location = New System.Drawing.Point(640, 47) + Me.ComboBox_Height.Location = New System.Drawing.Point(91, 212) Me.ComboBox_Height.Margin = New System.Windows.Forms.Padding(2) Me.ComboBox_Height.Name = "ComboBox_Height" Me.ComboBox_Height.Size = New System.Drawing.Size(141, 21) @@ -177,7 +177,7 @@ Partial Class GUI ' Me.Label4.AutoSize = True Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label4.Location = New System.Drawing.Point(302, 47) + Me.Label4.Location = New System.Drawing.Point(13, 145) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(73, 17) Me.Label4.TabIndex = 18 @@ -187,7 +187,7 @@ Partial Class GUI ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(563, 89) + Me.Label5.Location = New System.Drawing.Point(14, 254) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(72, 17) Me.Label5.TabIndex = 19 @@ -197,7 +197,7 @@ Partial Class GUI ' Me.Label6.AutoSize = True Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label6.Location = New System.Drawing.Point(586, 47) + Me.Label6.Location = New System.Drawing.Point(37, 212) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(49, 17) Me.Label6.TabIndex = 20 @@ -207,29 +207,19 @@ Partial Class GUI ' Me.Label7.AutoSize = True Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label7.Location = New System.Drawing.Point(8, 151) + Me.Label7.Location = New System.Drawing.Point(306, 28) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(78, 17) Me.Label7.TabIndex = 21 Me.Label7.Text = "Functions" ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.BackColor = System.Drawing.Color.Black - Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 1.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label8.Location = New System.Drawing.Point(10, 178) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(220, 2) - Me.Label8.TabIndex = 22 - Me.Label8.Text = resources.GetString("Label8.Text") - ' 'ComboBox_Width ' + Me.ComboBox_Width.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.ComboBox_Width.Enabled = False Me.ComboBox_Width.FormattingEnabled = True Me.ComboBox_Width.Items.AddRange(New Object() {"500", "700", "722", "1000"}) - Me.ComboBox_Width.Location = New System.Drawing.Point(913, 46) + Me.ComboBox_Width.Location = New System.Drawing.Point(94, 348) Me.ComboBox_Width.Margin = New System.Windows.Forms.Padding(2) Me.ComboBox_Width.Name = "ComboBox_Width" Me.ComboBox_Width.Size = New System.Drawing.Size(141, 21) @@ -240,7 +230,7 @@ Partial Class GUI Me.ComboBox_Length.Enabled = False Me.ComboBox_Length.FormattingEnabled = True Me.ComboBox_Length.Items.AddRange(New Object() {"300", "600", "900", "1000", "3000"}) - Me.ComboBox_Length.Location = New System.Drawing.Point(913, 79) + Me.ComboBox_Length.Location = New System.Drawing.Point(94, 408) Me.ComboBox_Length.Margin = New System.Windows.Forms.Padding(2) Me.ComboBox_Length.Name = "ComboBox_Length" Me.ComboBox_Length.Size = New System.Drawing.Size(141, 21) @@ -248,7 +238,7 @@ Partial Class GUI ' 'Button_Square ' - Me.Button_Square.Location = New System.Drawing.Point(11, 281) + Me.Button_Square.Location = New System.Drawing.Point(728, 55) Me.Button_Square.Name = "Button_Square" Me.Button_Square.Size = New System.Drawing.Size(92, 28) Me.Button_Square.TabIndex = 25 @@ -287,30 +277,44 @@ Partial Class GUI Me.Label_Material.TabIndex = 28 Me.Label_Material.Text = "Material" ' + 'CheckBox1 + ' + Me.CheckBox1.AutoSize = True + Me.CheckBox1.Checked = True + Me.CheckBox1.CheckState = System.Windows.Forms.CheckState.Checked + Me.CheckBox1.Location = New System.Drawing.Point(94, 316) + Me.CheckBox1.Margin = New System.Windows.Forms.Padding(2) + Me.CheckBox1.Name = "CheckBox1" + Me.CheckBox1.Size = New System.Drawing.Size(121, 18) + Me.CheckBox1.TabIndex = 29 + Me.CheckBox1.Text = "Whole mesh widths" + Me.CheckBox1.UseCompatibleTextRendering = True + Me.CheckBox1.UseVisualStyleBackColor = True + ' 'GUI ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(1384, 761) + Me.ClientSize = New System.Drawing.Size(1155, 687) + Me.Controls.Add(Me.AngleButton) + Me.Controls.Add(Me.Button_Square) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.CheckBox1) Me.Controls.Add(Me.ComboBox_Material) Me.Controls.Add(Me.Label_Material) Me.Controls.Add(Me.Label9) - Me.Controls.Add(Me.Button_Square) Me.Controls.Add(Me.ComboBox_Length) Me.Controls.Add(Me.ComboBox_Width) Me.Controls.Add(Me.ComboBox_MeshSize) Me.Controls.Add(Me.ComboBox_TypeChooser) Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label8) Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label7) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.SettingsButton) Me.Controls.Add(Me.ExportSWButton) Me.Controls.Add(Me.ComboBox_Height) Me.Controls.Add(Me.ComboBox_Thickness) - Me.Controls.Add(Me.AngleButton) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.DrawingPanel) @@ -340,11 +344,11 @@ Partial Class GUI Friend WithEvents Label5 As Label Friend WithEvents Label6 As Label Friend WithEvents Label7 As Label - Friend WithEvents Label8 As Label Friend WithEvents ComboBox_Width As ComboBox Friend WithEvents ComboBox_Length As ComboBox Friend WithEvents Button_Square As Button Friend WithEvents Label9 As Label Friend WithEvents ComboBox_Material As ComboBox Friend WithEvents Label_Material As Label + Friend WithEvents CheckBox1 As CheckBox End Class diff --git a/Wardrobe/GUI.resx b/Wardrobe/GUI.resx index d2e1272..44db532 100644 --- a/Wardrobe/GUI.resx +++ b/Wardrobe/GUI.resx @@ -120,9 +120,6 @@ 17, 17 - - - 83 diff --git a/Wardrobe/GUI.vb b/Wardrobe/GUI.vb index b222f2c..8bf68b7 100644 --- a/Wardrobe/GUI.vb +++ b/Wardrobe/GUI.vb @@ -1,8 +1,8 @@ Imports XCCLibrary Public Class GUI - Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb" - 'Public Shared filepath As String = "C:\Users\xperd\OneDrive\Dokument\Exjobb" + 'Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb" + Public Shared filepath As String = "C:\Users\xperd\OneDrive\Dokument\Exjobb" Dim filesFolder As String = filepath ' Hämta från settings Dim HLCtFolder As String = filepath & "\X2021" ' Hämta från settings @@ -422,19 +422,41 @@ Public Class GUI ComboBox_Length.Text = ComboBox_Length.Items(0) End Sub - + Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged + If CheckBox1.Checked Then + ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDownList + Else + ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown + End If + End Sub ' --- Grating width changed --- Private Sub WidthB_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Width.TextChanged + + If ComboBox_Width.Text <> "" Then If CDec(ComboBox_Width.Text) > 0 Then gratingMaxW = CDec(ComboBox_Width.Text) Update_GratingPoints() End If End If + + 'If stocked length options exist + If gratingMaxW = 500 Then + Dim stockedCheckBox As New CheckBox + stockedCheckBox.Name = "CheckBox_Stocked" + stockedCheckBox.Text = "Only stocked lengths" + stockedCheckBox.Left = 94 + stockedCheckBox.Top = 386 + stockedCheckBox.Checked = True + Me.Controls.Add(stockedCheckBox) + End If End Sub + + + ' --- Check if width is a number --- Private Sub ComboBox_Width_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBox_Width.KeyPress Check_IfNumber(e)