1900
« on: March 20, 2018, 06:40:34 AM »
Sub Main()
Begin Dialog SelectCentering 430,250,125,96,"SELEZIONA GCODE"
OKButton 15,68,40,14
CancelButton 70,68,40,14
GroupBox 12,5,100,52,"GCODE",.GroupBox1
OptionGroup .OptionGroup1
OptionButton 20,20,70,8," GCODE LAVORI",.OptionButton1
OptionButton 20,40,70,8," GCODE MACH3" ,.OptionButton2
End Dialog
Dim Dlg1 As SelectCentering
Button = Dialog (Dlg1)
If Button = 0 Then Exit Sub
Selected = Dlg1.OptionGroup1
'laser is selected ************************************************************
If Selected = 0 Then '*********************************************************
'Gcode Selection Box
Dim MyList()
Begin Dialog GcodeFileDlgL 60, 60, 190, 220, "LAVORI Gcode ", .DlgFuncL
ListBox 10, 10, 150, 180, MyList(), .List1, 2
CancelButton 42, 198, 40, 12
OKButton 90, 198, 40, 12
End Dialog
Dim frame As GcodeFileDlgL
' Dim frame As GcodeFileDlg
' Show the GcodeFile dialog
button =Dialog(frame)
End If '**************************************************************
'web is selected ****************************************************
If Selected = 1 Then '***********************************************
'Gcode Selection Box
Dim MyList()
Begin Dialog GcodeFileDlgM 60, 60, 190, 220, "MACH3 Gcode ", .DlgFuncM
ListBox 10, 10, 150, 180, MyList(), .List1, 2
CancelButton 42, 198, 40, 12
OKButton 90, 198, 40, 12
End Dialog
Dim frame1 As GcodeFileDlgM
' Show the GcodeFile dialog
button = Dialog(frame1)
End If '***********************************************
End Sub
Function DlgFuncL( controlID As String, action As Integer, suppValue As Integer)
Select Case action
Case 1 ' Initialize
temp = Dir( "C:\LAVORI\GCODE\*.*" )
count = 0
While temp <> ""
count = count + 1
temp = Dir
Wend
Dim x() As String
ReDim x(count)
x(0) = Dir( "C:\LAVORI\GCODE\*.*" )
For i = 1 To count
x(i) = Dir
Next i
DlgListBoxArray "List1", x()
Case 2 ' select
If controlID = "OK" Then
LoadFIle("C:\LAVORI\GCODE\" &DlgText("List1"))
End If
End Select
End Function
Function DlgFuncM( controlID As String, action As Integer, suppValue As Integer)
Select Case action
Case 1 ' Initialize
temp = Dir( "C:\MACH3\GCODE\*.*" )
count = 0
While temp <> ""
count = count + 1
temp = Dir
Wend
Dim x() As String
ReDim x(count)
x(0) = Dir( "C:\MACH3\GCODE\*.*" )
For i = 1 To count
x(i) = Dir
Next i
DlgListBoxArray "List1", x()
Case 2 ' select
If controlID = "OK" Then
LoadFIle("C:\MACH3\GCODE\" &DlgText("List1"))
End If
End Select
End Function