Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Little macros for beta testers, debugging etc.
Posted by: siria
Date: February 17, 2015 11:02PM

My old but still most important macro for checking the lists of automatic variables, like $OnLoad, $OnStartup etc.: OnEventCheck
http://kmeleonbrowser.org/forum/read.php?9,117154

Two new little macros for testing injectJS and rebarmenu:
http://kmeleonbrowser.org/forum/read.php?9,130237

Feel free to add more macros of all sorts for testing!
Not necessarily as links, can also be attached right inside here.

=====
2015-11-16: macro "test_iniwrite.kmm", to check encoding (attached below)



Edited 3 time(s). Last edit at 11/15/2015 11:14PM by siria.

Attachments: test_iniwrite.kmm (1.6 KB)  
Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 18, 2015 02:39PM

@ siria

My latest version of K75t.

There is a right click menu for the first button. Clicking on the various buttons will produce some documentation in message box or status bar.

I still need to know the method of identifying parts of a png file. I think Dorian noted the method in an announcement, but I have just not had time to find it.

Attachments: K75t.7z (4.6 KB)  
Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: siria
Date: February 18, 2015 08:04PM

Thanks for posting it again smiling smiley
Didn't get around yet to test it on that other computer (will later), but you might try putting " " around each size number. The menuicon didn't work right without them when I struggled with it in the adblock macro.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 19, 2015 04:15PM

Siria was correct that the width and height values should be expressed as strings. I have done that in version 3 and now the problems are confined just to the macro created bar.

An image of type png which has cold and hot sections will work without any height and width values. A mouseover will change the image from cold to hot.

Attachments: K75t_30.7z (6.2 KB)  
Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: siria
Date: February 19, 2015 07:03PM

Yogi just used setbuttonimage to change his privbar behaviour and says in KM74 there's a bug, that happens only if the icons contain an alphachannel. Perhaps setcmdicon has some trouble with a-channel too, perhaps it depends from the pics? Haven't tested it myself yet.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: Dorian
Date: February 19, 2015 10:30PM

Quotes around numbers do nothing except adding an extra string to number conversion.

@JamesD

Instead of:
setcmdicon("macros(_K75t_code)", "blocks.png[0]", 16, 16, "blocks.png[1]", "blocks.png[2]"  );

You should use:

setcmdicon("macros(_K75t_code)", "blocks.png[0]", 16, 16);

Kmeleon will pick hot and disabled icons automatically



Edited 1 time(s). Last edit at 02/19/2015 10:34PM by Dorian.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: siria
Date: February 19, 2015 11:28PM

(_HOWTO_ Howto setcmdicon by macro, create menuicon and toolbar button image)

Quote
Dorian
Instead of:
     setcmdicon("macros(_K75t_code)", "blocks.png[0]", 16, 16, "blocks.png[1]", "blocks.png[2]"  );
You should use:
     setcmdicon("macros(_K75t_code)", "blocks.png[0]", 16, 16);
Kmeleon will pick hot and disabled icons automatically

Thanks, with a clear example that command is finally getting clearer to me.

And James and Yogis reminder about macro-created bars explains why setcmdicon only worked on menuicons when I tested it with the ABP button!

The only question mark left is now the size.
Is there still only 1 size possible for ALL buttons created by the new methods?
Or what if mixed methods are used, traditional and new macro commands, would that allow mixed button sizes?

Oh and this: is it correct that this new version command always needs multi-row images to show hot/cold/dead icons?
Not possible to use separate images anymore like privcold/privhot, or side-by-side pics like ABPlus?



Edited 3 time(s). Last edit at 10/06/2019 11:19AM by siria.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 20, 2015 02:22PM

Quote
Dorian
Quotes around numbers do nothing except adding an extra string to number conversion.

Thanks for clearing that up, Dorian.

Quote
siria
The only question mark left is now the size.
Is there still only 1 size possible for ALL buttons created by the new methods?
Or what if mixed methods are used, traditional and new macro commands, would that allow mixed button sizes?

Preferences > GUI Appearance > General has a field called "Toolbar size." The size that the buttons will appear is set there. The size of the actual button image is set in the setcmdicon statement. KM automatically makes the adjustments.

Quote
siria
Oh and this: is it correct that this new version command always needs multi-row images to show hot/cold/dead icons?
Not possible to use separate images anymore like privcold/privhot, or side-by-side pics like ABPlus?

All kinds of images possible. Check the second button in K75t. It uses four individual images.

$_K75t_face == 1 ? $_K75t_face = 0 :$_K75t_face = 1 ;
setcmdicon("macros(_K75twice_code)", "miscB3".$_K75t_face.".png", 16, 16, "miscB3".$_K75t_face+2.".png" );

And "Flags" in the first button uses a horizontal bmp image.

setcmdicon("macros(_K75t_code)", "JS_Flag.bmp[0]", 16, 16, "JS_Flag.bmp[3]", "JS_Flag.bmp[2]" );

If I get the time, I will work on updating K75t to reflect the information which Dorian provided and to add more explanation to the message boxes.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: siria
Date: February 20, 2015 04:57PM

Sorry for my stupid questions, had completely forgotten that I can currently look it up myself in beta3 *blush* Assuming that the default skin is built with the new system, then different sizes are obviously still possible or the privbar wouldn't still be so broad...

And thanks for all the info James. So it's also still possible to use traditional horizontal pics with the new command too. Great!
Some day I'll have to dig deeper into this new system, when getting around. For the moment I'm just glad the old commands still work too, for compatibility reasons smiling smiley

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 20, 2015 06:44PM

No question, which when answered, gains knowledge is stupid. Just look at how many times I have revised K75t. I am working on a new version now.

I still have one method to find/explore. I am sure Dorian posted a method to point to an individual part of a multi-part png file. I just have not had time to find that post. By multi-part I mean a file with an array of more the one in both directions.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: Dorian
Date: February 20, 2015 07:00PM

Quote
siria
The only question mark left is now the size.
Is there still only 1 size possible for ALL buttons created by the new methods?
Or what if mixed methods are used, traditional and new macro commands, would that allow mixed button sizes?

You can still have different different toolbar size, but I may have to fix at least the height in the future.

Quote
JamesD
I still have one method to find/explore. I am sure Dorian posted a method to point to an individual part of a multi-part png file. I just have not had time to find that post. By multi-part I mean a file with an array of more the one in both directions.

That was with JS and chrome file, still not implement for macro

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: siria
Date: February 20, 2015 07:32PM

Quote
Dorian
You can still have different different toolbar size, but I may have to fix at least the height in the future.

Really glad about that smiling smiley Was 'slightly' scared when in the very first announcement you mentioned something about all buttons needing the same size - ouf.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 21, 2015 01:00AM

Here is another variation of K75t. I hope most of it is correct now.

There is a right click menu under the first button, and that button only shows it's new image after a mouse over.

Attachments: K75t_35.7z (6.5 KB)  
Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: Dorian
Date: February 21, 2015 07:38PM

You will have to change it again because I think I'll change the syntax

Use the whole image:
setcmdicon("command", "image.png");

Extract icon in horizontal image, can have second and third line for hot and dead:
setcmdicon("command", "image.png[1,16,16]");

Extract based on coordinate (top, right, bottom, left)
setcmdicon("command", "image.png[0,16,16,0]", "image.png[0,32,16,16]"), "image2.png[16,48,32,32]")winking smiley;

And also, equivalent to old SetButtonImage plugin msg:
setbuttonicon("toolbar", "command", "cold", "hot", "dead");
For one button only and custom sized toolbar.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 21, 2015 10:46PM

Quote
Dorian
You will have to change it again because I think I'll change the syntax

That will not be a problem. My schedule next week looks too full for KM work anyway. I will be back home from holiday in early March.

Is there a possibility that you can add a field for tooltip?
addbutton(toolbarname, command, menu, tooltip)

Have you any progress on KM_Prefs, Error Console - view source, or Proxy system? I am not expert on any of these, but I will try anything which helps K-Meleon.

Options: ReplyQuote
Re: Little macros for beta testers, debugging etc.
Posted by: JamesD
Date: February 24, 2015 10:51PM

This version of K75t is updated to work with K-Meleon 75 Beta 3 Update 1.

Attachments: K75t_40.7z (7 KB)  
Options: ReplyQuote


K-Meleon forum is powered by Phorum.