So much for me getting to bed, just couldn't get this out of my mind. At least I'll go to bed contented now
We know that using a plugin buttonpress event to execute Callbutton(770); works WHEN the button press was an actual mouse click on a screen button (5678 in this case).
- Code: Select all
//Called when the user presses a button on the UCCNC GUI or if a Callbutton function is executed.
//The int buttonnumber parameter is the ID of the caller button.
// The bool onscreen parameter is true if the button was pressed on the GUI and is false if the Callbutton function was called.
public void Buttonpress_event(int buttonnumber, bool onscreen)
{
//if (onscreen)
//{
if (buttonnumber == 5678)
{
UC.Callbutton(770);
}
//}
}
So instead of mouse clicking that screen button, I tried calling the screen button in the plugin - UC.Callbutton(5678);
And also commenting out the "if (onscreen)" so the plugin buttonpress event did not care what pressed the screen button (i.e. mouse click or Callbutton() function)
That did the trick. Not a perfect solution as I have to create 2 screen buttons to execute Jog Panel Show and Jog Panel Hide functions via a plugin.
But at least it's a workaround
So there does seem to be a bug. Should simply be able to execute UC.Callbutton(770); anywhere in the plugin, but seems that's not the case.
Thanks for all the brains that helped work this out.
Keith