Machsupport Forum
Mach Discussion => Mach Screens => Topic started by: babinda01 on April 17, 2013, 07:14:37 AM
-
Hi Guys
I am starting to write a new screen for a touchscreen, and I am try to work out something that has been bugging me for some time.
I am wanting to be able to have a screen where I can display all the gcode files in a certain folder, then using a pair of buttons (up and down) be able to scroll through the programs and then select the one I want. I am trying to get away from the dialog box that opens up to choose a program from.
Has anyone done something like this??? if so how. I did find a flash based screen that can do this, but I really don't want to use flash.
Thanks
Andrew
-
IF you look in the cypress for mach3 manual I believe it gives an example of what you want.
(;-) TP
-
Hi
Thanks for the info - I will have a play.
Regards
Andrew
-
Let me know if you cannot work it out I may have a working example here somewhere.
(;-) TP
-
I ran across the Code while working on something else . Hope it helps. You can also customize it to only show certain file types.
'Gcode Selection Box
Sub GcodeSelect
Dim MyList()
Begin Dialog GcodeFileDlg 60, 60, 190, 220, "Gcode file selection", .DlgFunc
ListBox 10, 10, 150, 180, MyList(), .List1, 2
CancelButton 42, 198, 40, 12
End Dialog
Dim frame As GcodeFileDlg
' Show the GcodeFile 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( "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
Fname = (DlgText("List1"))
LoadFIle("c:\Mach3\Gcode\" &DlgText("List1"))
End
End Select
End Function
End
-
Thanks heaps for that. I will have a good play this weekend to see if I can get it to look like what I want.
Thanks again
Andrew