Machsupport Forum

Mach Discussion => Mach Screens => Machscreen Screen Designer => Topic started by: BOHICAMAN on March 13, 2014, 04:13:36 PM

Title: The right ""Function" for a button!
Post by: BOHICAMAN 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)

Title: Re: The right ""Function" for a button!
Post by: Overloaded 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
 :)
Title: Re: The right ""Function" for a button!
Post by: Overloaded 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
Title: Re: The right ""Function" for a button!
Post by: BOHICAMAN 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
Title: Re: The right ""Function" for a button!
Post by: Overloaded 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.

 
Title: Re: The right ""Function" for a button!
Post by: ger21 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.

Title: Re: The right ""Function" for a button!
Post by: ger21 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.
Title: Re: The right ""Function" for a button!
Post by: Overloaded 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
Title: Re: The right ""Function" for a button!
Post by: BOHICAMAN 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
Title: Re: The right ""Function" for a button!
Post by: ger21 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.
Title: Re: The right ""Function" for a button!
Post by: Overloaded on March 13, 2014, 07:20:16 PM
Could you just duplicate page 8 and 9 of the standard 1024.set ?
Like Gerry mentioned earlier ?
Russ
Title: Re: The right ""Function" for a button!
Post by: BOHICAMAN on March 13, 2014, 07:46:16 PM
G-Code .htm now works. I am converting the M-Codes and the G-Gode Letters .bmp's to .htm's to try that. If I don't have any luck, I'll make them pages.

Appreciate the help guys!!

Bob
Title: Re: The right ""Function" for a button!
Post by: BOHICAMAN on March 13, 2014, 08:08:05 PM
Ok, two down, one to go! But, I'm quitin' for the day as I'm going crazy with this!!!!

Title: Re: The right ""Function" for a button!
Post by: Overloaded on March 13, 2014, 08:09:52 PM
Hey Bob,
 be sure to let us know how it ends up.

Thanks,
Russ
Title: Re: The right ""Function" for a button!
Post by: BOHICAMAN on March 13, 2014, 08:12:15 PM
I sure will. Again, THANKS to both you guys for the help!!

And even though it's made me nuts trying to figure the program out (as a newbee), I love MachScreen!!

Have a Good night!

Bob
Title: Re: The right ""Function" for a button!
Post by: BOHICAMAN on March 14, 2014, 12:18:58 PM
GOT IT DONE!
Here's what I finally learned...
Use the Function: Execute Basic-Script, F-code: 34, Execute code: HtmlDialog( GetMainFolder()+"Mach3MillGcode.htm" ), HtmlDialog( GetMainFolder()+"Mach3MillGcodeLetters.htm" ),
and HtmlDialog( GetMainFolder()+"Mach3MillMcode.htm" ) respectively, for each button (G-Codes, G-Code Letters, M-Codes).

I also converted and renamed the .bmp files in the C:\Mach3\Bitmaps\MillBitmaps\ folder for each of those bitmaps (G-codes_US.bmp, G-code-letters_US.bmp; M-codes_US.bmp) to .htm files and put them in the main Mach3 folder.

Now the buttons pull up their respective lists and place them on top of the screen for reference.

Thanks again for the assistance!!
Bob
Title: Re: The right ""Function" for a button!
Post by: Overloaded on March 14, 2014, 12:27:40 PM
Congrats. Bob, good job !

I'll put this post in my E-toolbox for future reference.  ;)
(now that the hard work and hair loss is taken care of)  :)

Russ
 8)