Hello Guest it is September 27, 2021, 10:00:03 AM

Author Topic: Create elements in Mach 4  (Read 1098 times)

0 Members and 1 Guest are viewing this topic.

Create elements in Mach 4
« on: January 27, 2020, 11:30:19 AM »
How can i create and populate elements in Mach 4. I am trying to create a tool table that is not a popup dialog but embedded into the main mach 4 interface. I am also trying to create a screen that has two elements that pull the Gcode files from. One is the USB location and the other is a Specific folder that i can use as a repository to store the G Code files on the PC. I really like how Tormach did it within Path Pilot. I have attached pic to give you an idea of what i'm trying to accomplish
« Last Edit: January 27, 2020, 11:34:57 AM by native34 »
Re: Create elements in Mach 4
« Reply #1 on: January 28, 2020, 07:44:58 AM »
Does anybody have any starting points for me to look into?
Re: Create elements in Mach 4
« Reply #2 on: January 28, 2020, 08:07:02 AM »
You could probably achieve it using wxWidgets.

Take a look at https://docs.wxwidgets.org/3.1/annotated.html (Note: not everything shown here is available in Mach4 as it uses wxLua)

wxFormBuilder will help you create the Lua code which can be used inside a Lua Panel in the Mach4 screen editor

The wxGenericDirCtrl control is a good starting point,  this may do what you want..  https://docs.wxwidgets.org/3.1/classwx_generic_dir_ctrl.html

Thanks
Re: Create elements in Mach 4
« Reply #3 on: January 29, 2020, 10:24:37 AM »
I have installed wxFormbuilder. How do i use it with Lua Panel to create the form elements and populate them?
Re: Create elements in Mach 4
« Reply #4 on: January 30, 2020, 09:43:49 AM »
Are there any examples on how to use Lua Panels?
Re: Create elements in Mach 4
« Reply #5 on: January 30, 2020, 01:37:35 PM »
Hi,
in the Lua Examples folder, ProbeToFile have a look at m401.mcs.

It first opens a frame, then a panel within the frame and finally a file dialogue within the panel.

wxLua is a whole learning curve on its own. wxFormBuilder is a very good tutor, you just have to roll up your sleeves and get stuck in.
You can bet it will take several weeks to get to grips with it. Remember this is a software suite that Mach4 incorporates into itself,
its not Mach4 itself. NFS has no part in determining the style and development of wxWidgets.

Given the learning curve of wxLua are you 100% sure you are prepared to put the effort into the two features you want?

I am no expert in either Lua nor, and in particular, wxLua but I will help if you are that keen, but you need to be keen
or it will be a wasted effort.

Craig
My wife left with my best friend...
     and I miss him!
Re: Create elements in Mach 4
« Reply #6 on: January 30, 2020, 02:53:31 PM »
Since no two individuals will ever agree on what should be included/excluded from a screen set NFS has given everyone the tools to make their own.  wxFormBuilder is similar to most Rad  dev systems but the linkage to a panel or interfacing with it is not well documented. 

I sent a pm to Bryanna suggesting a short step by step video of creating a form in wxFormbuilder and then using it in a panel.  Never got a response.

RT
Re: Create elements in Mach 4
« Reply #7 on: January 31, 2020, 07:36:38 AM »
Thank you JoeAverage, I have written programs in VB, VB.Net, ASP.NET. I am no expert in programming and to be quite honest the structure of programs are quite confusing to me, but somehow i seem to make it work in the end. I am willing to put in the work to get these features in my mach 4 screenset. I just wish there was better documentation and examples like there were when is was programming VB. They had pretty clear and concise examples and how you could implements them.

Offline Tweakie.CNC

*
  • *
  •  8,807 8,807
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Create elements in Mach 4
« Reply #8 on: January 31, 2020, 08:00:06 AM »

I sent a pm to Bryanna suggesting a short step by step video of creating a form in wxFormbuilder and then using it in a panel.  Never got a response.

RT

Hi RT,

Bryanna has not visited this forum in the last 8 months so she may have departed NFS.

Tweakie.
KEEP SAFE !
Re: Create elements in Mach 4
« Reply #9 on: January 31, 2020, 12:18:59 PM »
Are there any examples on how to use Lua Panels?

In Mach4Hobby\Wizards\panelscript.mcs, it shows a bit about using a panel in the Mach4 screen. In main(), mcLuaPanelParent is the Lua panel created in Mach4's screen editor and you're basically setting that as your top level panel.