Editing Button Functionality

MSM Mill mode support
Post Reply
danielbriggs
Posts: 22
Joined: Sun Nov 16, 2014 8:49 am

Editing Button Functionality

Post by danielbriggs »

Hi Dave,
I would like to change the function of the "last wizard" button on the Load screen to load the same wizard every time (Newfangled Addons - A suite of handy wizards).

Can you point me in the right direction on how to:
- Edit the functionality of the button to load this wizard directly
- Change the text on the button to reflect this new function (if allowed?) to "Newfangled" say.

I've tried "Operator -> Edit Button Script" but it launches the wizard instead of editing that button.

It's the only wizard I use, so would save time getting the list and selecting the right one after first boot.

Best Regards,
Daniel
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: Editing Button Functionality

Post by DaveCVI »

Hi Daniel,
danielbriggs wrote:Hi Dave,
I would like to change the function of the "last wizard" button on the Load screen to load the same wizard every time (Newfangled Addons - A suite of handy wizards).
I'll point you in the start direction, but I'm unsure if what you want can be done simply or not...
danielbriggs wrote: Can you point me in the right direction on how to:
- Edit the functionality of the button to load this wizard directly
First you will need to get familiar with how screen sets are constructed and how they relate to script files etc.
Section 15 of the MSM user manual covers customizing MSM screen sets.

To edit what a button does you will need to edit the image button in a screen set editor. I recommend using MachScreen for this.
danielbriggs wrote: Can you point me in the right direction on how to:
...
- Change the text on the button to reflect this new function (if allowed?) to "Newfangled" say.
Changing the text of the button requires editing the bitmap image for the button, or making a new button with the text you want. This can be done using the button sources that are optionally installed with MSM. RealDraw was used as the image editing tool for MSM bitmaps.
danielbriggs wrote: I've tried "Operator -> Edit Button Script" but it launches the wizard instead of editing that button.
That mach menu item is only good for editing buttons that have a script embedded inside the button within the screen set... which is not the case for that button.

This is where it may get hard... the current button calls mach with an OEM code (280) to reload the last wizard. Thus the knowledge re what was the last wizard etc is embedded inside mach. I don't know of a way to load a specific wizard from the NFW wizard set. The pick wizard button also calls a mach OEM code (320) to display the pick dialog... I don't know of a mach function where you can pass the name or a number of the wizard that you want to start up. There may be one, I just don't remember it.

There is a mach script call: "LoadWizard" - but it is not what you want. It will load a wizard file from disk by name. But the NFW set of wizards is not a single wizard, and the internal set of wizards are a layer removed fro this. You can load the NFW wizards set, but not pick which specific NFW wizard you want.

If it were me, I'd start by trying to figure out how to get a script to load a specific NFW wizard. If you can solve that, patching it into a screen set (MSM or any other screen set) it the easy part.

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
danielbriggs
Posts: 22
Joined: Sun Nov 16, 2014 8:49 am

Re: Editing Button Functionality

Post by danielbriggs »

Thanks for the prompt response Dave; much appreciated.

It looks like we might be in luck,
As per: http://www.machsupport.com/Mach3Wiki/in ... EM_Buttons

Therefore my "problem" is somewhat simplified:
How do I change the button from launching OEM code 280 to 321?
What is MachScreen? Is this part of the default install?

Re: Graphics... I assume I edit the large background PNG and not a specific LED/button file?

Thanks,
Dan
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: Editing Button Functionality

Post by DaveCVI »

Hi,
danielbriggs wrote:Thanks for the prompt response Dave; much appreciated.

It looks like we might be in luck,
As per: http://www.machsupport.com/Mach3Wiki/in ... EM_Buttons

Therefore my "problem" is somewhat simplified:
I don't think you are that lucky - I believe that code firs up the NFS wizard set - i.e. the entire wizard program, it does not let you select a sub wizard of the new fangled set to run.
But I could be wrong - a good first goal would be to learn how to make up a button that uses that OEM code, then you can test it.
danielbriggs wrote: How do I change the button from launching OEM code 280 to 321?
You use MachScreen...
danielbriggs wrote: What is MachScreen? Is this part of the default install?
Nope. It is a separate program that is used to edit mach screen set files.
You are going to have to climb a learning curve and learn how mach screen set bits and pieces are put together.
danielbriggs wrote: Re: Graphics... I assume I edit the large background PNG and not a specific LED/button file?

Thanks,
Dan
Nope. You will edit a copy of the button graphics source file to add the text you want. then you save the bit map file that results; then you tell the screen set to use that new bit map file... etc.

This will not all make sense until you start to learn how screen sets are put together. ...and MSM is not the simplest case of a screen set... please start reading thru the customizing MSM chapter of the MSM manual as a place to get started.

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
danielbriggs
Posts: 22
Joined: Sun Nov 16, 2014 8:49 am

Re: Editing Button Functionality

Post by danielbriggs »

Dave,
All working perfectly now! Many thanks for the superb guidance.

Image

Best Regards,
Dan
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: Editing Button Functionality

Post by DaveCVI »

Great!

Did that OEm code end up opening just the NFW set, or did you find a way to open the set to a specific wizard with the button?

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
danielbriggs
Posts: 22
Joined: Sun Nov 16, 2014 8:49 am

Re: Editing Button Functionality

Post by danielbriggs »

Ah yes, the NF set opens, (not a specific sub-wizard of that e.g. multiple hole drilling)
This was the desired behaviour.

I did find some mention on the Mach forums about passing a wizard name (e.g. any other non-NF wizard) to another function which looked like it would work, but I didn't pursue it.

Thanks again for your help.
Regards,
Dan
Post Reply