Hello Guest it is March 28, 2024, 07:26:44 PM

Author Topic: The right ""Function" for a button!  (Read 11596 times)

0 Members and 1 Guest are viewing this topic.

The right ""Function" for a button!
« on: March 13, 2014, 04:13:36 PM »
Might someone please tell me what Function Code, F-Code number, etc., goes in the MachScreen Properties Box, sub-panel - BUTTON, when setting up a Button to load a Bitmap (picture)?

I want to bring up the bitmap "G-Code_US.bmp" from the Mach3\Bitmaps\MillBitmaps\ path to show an informational picture of all the G-Codes and their assigned tasks.

I set up a button with the text "G-Code" on it (I will do the same for the M-Codes later). Tried the Function, "Execute Basic-Script" with F-code 34. That automatically enters LoadFile( and the correct path to the file) to the Execute Code parameter.I then saved the screen, loaded it to Mach3, and when the G-Code button is pushed- Nothing!! Says in the Status block, "Scripter Compile Error. In:" I don't see any other "Function" that appears would work. Soooooo, HELP!

Thanks!
Bob
(the New Guy to MachScreen)

"For those who fought for it, Freedom has a flavor the protected will never know"

UNKNOWN
Re: The right ""Function" for a button!
« Reply #1 on: March 13, 2014, 04:53:26 PM »
Not sure if this is what you want.
I never used it much but I did put a button on the screen that brings up the GCode list with explanations ... like this.

Select a  Button and add it to the screen.

Select Execute Code, then Basic Script.

Then put this      HtmlDialog( GetMainFolder()+"Mach3MillGcode.htm" )     in the open window and save.

Then label the button text G Codes (or whatever you'd like).

Worked fine here (actually surprised me)

Had this all ready for ya yesterday, just as I was ready to post, you cancelled. I assumed you got it. :)

Hope it helped, regards,
Russ
 :)
Re: The right ""Function" for a button!
« Reply #2 on: March 13, 2014, 05:23:43 PM »
OK Bob, I think I see what you mean, not what I offered.
I need to play with this designer a bit anyway, so different than screen4.

Klauss is sure to help ... if not, others will I'm sure.

Regards,
Russ
Re: The right ""Function" for a button!
« Reply #3 on: March 13, 2014, 05:54:54 PM »
Russ,
Yea, I thought I had it yesterday too! Nope!!!

However, I JUST GOT IT!!!!! Finally.

I had been entering the Function and F-Code first and the Execute Code line was always automatically filled with some LoadFile command. I just read your post and decided to put the HtmlDialog( GetMainFolder()+"Mach3MillGcode.htm" ) command in the Execute Code line FIRST. Then it WORKED!

Thanks!! Ya saved me from going bald(er) pulling my hair out!!

Bob
"For those who fought for it, Freedom has a flavor the protected will never know"

UNKNOWN
Re: The right ""Function" for a button!
« Reply #4 on: March 13, 2014, 06:05:32 PM »
Jeesh ! whoodathunk ?

Thanks for showing ME how, good job Bob.
Regards,

Russ

I like your foot note .... so true.

Your freedoms are like your teeth.
They require maintenance.
Ignore them, and one by one, they will go away.

 

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: The right ""Function" for a button!
« Reply #5 on: March 13, 2014, 06:16:30 PM »
I don't believe that there's any way to load a bitmap into Mach3.

You probably have two or three options, if you want to load a bitmap.

I think that it may be possible to have an external program open the bitmap. Unfortunately, I don't know how to do it.

You can always place the bitmap on a separate page of the screen, and have the button change to that page.

Or, you can make the bitmap part of a dual state LED, and toggle it on and off. But when it's off,  you have an empty space on the screen.

None of these options are what you're probably looking for.

I'm assuming that you can probably put the bitmap in an html file, and use Russ's method?

I just checked, and yes, you can do it that way.

Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: The right ""Function" for a button!
« Reply #6 on: March 13, 2014, 06:17:46 PM »
Russ,
Yea, I thought I had it yesterday too! Nope!!!

However, I JUST GOT IT!!!!! Finally.

I had been entering the Function and F-Code first and the Execute Code line was always automatically filled with some LoadFile command. I just read your post and decided to put the HtmlDialog( GetMainFolder()+"Mach3MillGcode.htm" ) command in the Execute Code line FIRST. Then it WORKED!

Thanks!! Ya saved me from going bald(er) pulling my hair out!!

Bob

Your loading an html file, not a bitmap file like you asked. Two different things.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: The right ""Function" for a button!
« Reply #7 on: March 13, 2014, 06:26:58 PM »

Your loading an html file, not a bitmap file like you asked. Two different things.

Hi Gerry,
That's what I noticed after I posted.
I like the HTML much better as it has a lot of info, the bmp is just a list ... but PRETTY  :)
Russ
Re: The right ""Function" for a button!
« Reply #8 on: March 13, 2014, 06:33:36 PM »
The files in the my folder,  C:\Mach3\Bitmaps\MillBitmaps\ are all either .jpg, .bmp, or png. I don't see any html files.

However, when I put in the Execute Code as: HtmlDialog( GetMainFolder()+"Mach3MillGcode.htm" ) in MachScreen, and push the G-Code button once the screen set is sent to Mach3, it brings up the G-Code picture! Not sure where it's finding an .html file for the G-Code, cause I sure as hell don't see it.

I also tried the M-Code .bmp and entering the same Function, F-code and Execute Code (with the file name changed of course) and all I get on the Mach3 screen is a white square where the picture should be. Here I go again!!

Bob
"For those who fought for it, Freedom has a flavor the protected will never know"

UNKNOWN

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: The right ""Function" for a button!
« Reply #9 on: March 13, 2014, 06:42:33 PM »
The html file is in the Mach3 folder, and your code is loading it.

Mach3MillGcode.htm

Your not loading a bitmap or picture at all.

However, it is possible to create an html file with bitmaps or images in it, and load it the same way.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html