Make custom button and set toggle

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Make custom button and set toggle

Postby DKMaker » Fri Apr 07, 2023 7:50 pm

Hi i want to have a Custom button for a relay and i use a button with button number 20011 that works fine - but i want the green thing to light on as a toggle button - how do i emulate that?

Same as on Spindle CW / mist etc.. Can i somehow set the state for a "macro" button or what is the correct workarround to emulate this behavior.

And how do i select an item if lets say the item is under another object? I placed a label on a LED but i could not select it afterwards - so i had to move one of them to select it again, is there a hotkey to cycle between elements?
DKMaker
 
Posts: 13
Joined: Sun Feb 26, 2023 8:35 pm

Re: Make custom button and set toggle

Postby dezsoe » Fri Apr 07, 2023 9:14 pm

Set toggletype to true and use double images. The left half is for the off, the right is for the on state. In your macro use AS3.Switchbutton(true/false, buttonnomber); to turn the button on/off.

toggle1.png
toggle1.png (12.2 KiB) Viewed 2765 times

jsp_up.png
jsp_up.png (6.53 KiB) Viewed 2765 times

At the moment you can only select the topmost control.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Make custom button and set toggle

Postby ger21 » Sat Apr 08, 2023 1:24 am

And how do i select an item if lets say the item is under another object?

The way we used to do this with Mach3 is to place the LED first, then place a transparent button over the LED.
But you don't need to do this in UCCNC, because you have Toggle Buttons, as explained above.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am


Return to Macros

Who is online

Users browsing this forum: No registered users and 11 guests