Hi ALL, I am working on a new file loader for MACh3 that uses images of afile to load gcode files. I am having trouble getting the Pushbutton"LoadGcode File" to work. All the other componets work as needed.
From the screen you select the file from the listbox as you select the file the Program displays the IMAGE file on screen. when you find the correct file then you would push the load G code file button and it will load a gcode file of the same name to mach3.
The part that I cannot get to function would be CASE 3. I cannot find a clear description as to HOW to get a pushButton to function as needed.
IF anyone has an idea or a suggestion please fill free to add to it to get it to work correctly.
(;-) TP
' Macro to select Gcode files by BMP picture
Sub DrawBitmapSample
Dim MyList()
Begin Dialog BitmapDlg 60, 60, 590, 420, "Select Gcode FIle VIA BMP Image", .DlgFunc
ListBox 10, 10, 80, 180, MyList(), .List1, 2
Picture 100, 10, 480, 380, "c:\mach3\bitmaps\splash.bmp", 0, .Picture1
CancelButton 25, 198, 40, 12
'OKButton 50, 198, 40, 12
PushButton 10,225,80,12 , " Load G Code File ", .PB1
End Dialog
Dim frame As BitmapDlg
' Show the bitmap dialog
Dialog frame
End Sub
Function DlgFunc( controlID As String, action As Integer, suppValue As Integer)
DlgFunc = 1 ' Keep dialog active
Select Case action
Case 1 ' Initialize
temp = Dir( "D:\ScamData\Jobs\*.bmp" )
count = 0
While temp <> ""
count = count + 1
temp = Dir
Wend
Dim x() As String
ReDim x(count)
x(0) = Dir( "D:\ScamData\Jobs\*.bmp" )
For i = 1 To count
x(i) = Dir
Next i
DlgListBoxArray "List1", x()
Case 2 ' Click
Fname = ( "D:\ScamData\Jobs\" & DlgText("List1") )
DlgSetPicture "Picture1", Fname
Case 3 ' select File to load from Image
If button = 1 Then
sFile = Dlgtext("List1")
sFile = Left(sFile, InStr(1, sFile, ".") - 1)
Fext= ".TAP"
Lfile = sFile &Fext
If Dir ("C:\Mach3\Gcode\" & Lfile) ="" Then
MsgBox" File Does NOT Exist "
Message"Function Closed"
End
Else
Loadfile "C:\Mach3\Gcode\" &Lfile
End If
End If
End Select
End Function
End