Machsupport Forum

Mach Discussion => Mach Screens => Screen designer tips and tutorials => Topic started by: Punisher on March 26, 2021, 09:30:55 PM

Title: Editable text for label
Post by: Punisher on March 26, 2021, 09:30:55 PM
I'm looking for a way to edit the text in a user defined label. I want it to work similar to a dro where once it is selected text can be input. Then the text can be called on from scripts.

Is this something that is possible with mach3? If it's not possible with oem functions has someone come up with a workaround?

Title: Re: Editable text for label
Post by: TPS on March 27, 2021, 03:03:48 AM
you can only do it by placing a tranparent button above the Label and run a script to read, Change (by using a Dialog) and
write back the entered text to the Label

Code: [Select]
text = GetUserLabel(25)

Begin Dialog EnterText 420,120,160,96,"Enter Text"
   OKButton 30,68,40,14
   CancelButton 90,68,40,14
   TextBox 8, 26, 146, 18, .FText
End Dialog

  Dim Dlg1 As EnterText
  Dlg1.FText = text
  Button = Dialog (Dlg1)
  If Button = 0 Then Exit Sub

SetUserLabel(25, text)
something like this, not tested, should work.