Jump to content


Photo

[module] MMenu 1.0 b1


  • Please log in to reply
126 replies to this topic

#1 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 21 March 2007 - 08:23 PM

MMenu 1.0 b1

        Download   

MMenu is the replacement for the standard AutoHotKey Menu command. Among other options, it alows menu items to have icons, and solves limitation of standard menus about item identification – besides title, which is nonreliable way to identify items, MMenu gives you an option to identify menu items by ID or position. Mmenu gives you full control over the menu you created, even while it is displayed.

To use this extension simply include MMenu.ahk in your script via #include directive.

First check out _MMenuTest.ahk. Then take a look at documentation to get familar with the syntax. For now, include mmenu the way it is included in _MMenuTest.




Posted Image



How to use: copy includes folder where your script is and put this at the end of your script

#include includes
#include MMenu.ahk
#include structs.ahk

Some nice screenshots: white, black, for kids.

Have fun :p

NOTE: If you don't see icons, desable WindowBlinds or exclude AutoHotKey from skinning in its options.

NOTE2: For now all very dynamic MMenu usages (like script that creates and deletes over 100 menus in an hour) should reload the script once in while (every few hours, depending on script usage), otherwise, on each menu/item creation MMenu's Destroy function will get slower and Select event for menus that have submenus. If you don't use this functions, its OK.


Icon resizing fix:
<!-- m -->http://www.autohotke... ... 194#353194<!-- m -->

#2 Laszlo

Laszlo
  • Fellows
  • 4713 posts

Posted 21 March 2007 - 08:57 PM

Beautiful!

(There is a little problem with the ToolTip in the demo: it does not get cleared, new info is added to the bottom.)

#3 n-l-i-d

n-l-i-d
  • Guests

Posted 21 March 2007 - 09:39 PM

Great stuff!

I like your modular approach too. 8)

#4 BoBo

BoBo
  • Guests

Posted 21 March 2007 - 10:06 PM

:shock: Wow ! 8)

#5 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 21 March 2007 - 10:10 PM

Thanks guys. :D

There is a little problem with the ToolTip in the demo: it does not get cleared, new info is added to the bottom.

The tooltip should be cleared after 500 characthers. New info is added to the bottom intentionly so to see history of events.

#6 jballi

jballi
  • Members
  • 940 posts

Posted 22 March 2007 - 01:14 AM

Those 13x13 menu icons are very hard to see/find/create/etc. so I definitely see myself using this in the future. Thanks for sharing! :)

#7 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 24 March 2007 - 04:08 PM

I made documentation online. Check out the first post or click here

#8 ahklerner

ahklerner
  • Members
  • 1382 posts

Posted 25 March 2007 - 11:55 AM

Test script work in Vista too.!

#9 PhiLho

PhiLho
  • Fellows
  • 6850 posts

Posted 25 March 2007 - 12:06 PM

Um, the animated Gif in this topic is nice but the demo is a bit too much in the size of the images... The screenshots are more balanced.
This sure will answer many requests.
Good layout if the note/manual page too, clean and clear. Some typos remain, perhaps check it with some spellchecker.

#10 kiu

kiu
  • Members
  • 234 posts

Posted 26 March 2007 - 08:55 PM

I'm impressed with the possibilities of this API. I like menus and as I seen this post I made a script to improve my alttab script. I will publish it as soon as I will test it a little bit. I think that I will extend my clipboard script and fast folder browser with this API. So, thank you majkinetor

#11 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 26 March 2007 - 09:23 PM

The API will be upgraded with Getter functions to support better dynamic menu creation. I left this for the end along with removal of some variables that are not needed and that I left now for debuging and maintaining reason.

Keep in mind that currently, using the title as an item identifier is slowest of all 3 identification methods. Position and ID will instantly get you the menu item while if you reference it by title, entire menu will be traversed until this item is found (first one with that title). This is almost instant for normal menus, but you may create menu that have 1000 or more items, or instance, the one holding System32 folder.

I didn't mention that MMenu is already well tested. It is currently used by at least 20 or more ppl testing alpha release of Favmenu 3 script, the one that you can see above in the colored menu screenshots. I am aware kiu that your "fast folder browser" is someting similar to Favmenu3 at least when OpenSave dialogs are in question. Check Favmenu3 alpha to see if you should save your working entusiams for something else (but I guess you are too attached now :) ). FM3 works in all places that you can set or get folder. You can check out animated gifs here, and the latest alpha here.

2PhiLho

Thx for report, I did spellchecker on documentation, and will update it on next release. For your "size" problem, I don't think that ~200KB is big and this is beta release. Final will be 1 file - MMenu.ahk.


2all
If you have any suggestions to API its good to say it now until I close it for eternity.

#12 kiu

kiu
  • Members
  • 234 posts

Posted 26 March 2007 - 09:40 PM

thanks for the specifications, but for now the enthusiasm is for alttab replacement. If you want to see it, check http://www.autohotke...p=112744#112744 and let me know

#13 kiu

kiu
  • Members
  • 234 posts

Posted 26 March 2007 - 09:45 PM

also note that the main purpose of "fast folder browser" is to browse folders quickly, so the purpose is different from your FavMenu :wink:

#14 PhiLho

PhiLho
  • Fellows
  • 6850 posts

Posted 27 March 2007 - 05:05 AM

For your "size" problem, I don't think that ~200KB is big and this is beta release. Final will be 1 file - MMenu.ahk.

No, I meant that the images in the sub-menus are really big (pixel-wise) for my taste, but I understand that's for demo, and it can even have it usefulness.

#15 majkinetor

majkinetor
  • Fellows
  • 4511 posts

Posted 27 March 2007 - 09:54 AM

AH, I missunderstood you.

I didnt want to prevent any kind of usage, good software should provoide possibilities, not restrictions. So you can put anything as a icon size parameter of the menu, from 8 - 888 :). I already seen some ppl using horizontal menu with large icons to simulate windows menu with icons :)

The code goes something like this and with some tweaking you can show submenus bellow, not aside:

main := MMenu_Create("S64 O5")

	s1 := MMenu_Create("")
	s2 := MMenu_Create("")

	MMenu_Add( main, "Configuration", "icons\gear.ico", 0, "[color=orange]b[/color] d M" s1)
	MMenu_Add( main, "Time", "icons\home.ico", 0, "[color=orange]b[/color] d M" s2)
	MMenu_Add( main, "Chat room", "icons\chat.ico", 0, "b d M" s1 )
	MMenu_Add( main, "Exit","icons\pen_red.ico" ,0, "b d M" s2 )


	MMenu_Add( s1, "Configuration")
	MMenu_Add( s1, "Time")
	MMenu_Add( s1, "Configuration")
	MMenu_Add( s1, "Time")
	MMenu_Add( s1, "Configuration")
	MMenu_Add( s1, "Time")
	MMenu_Add( s1, "Configuration")
	MMenu_Add( s1, "Time")
	MMenu_Add( s1, "Configuration")
	MMenu_Add( s1, "Time")
	MMenu_Add( s1, "Configuration")
	MMenu_Add( s1, "Time")
	MMenu_Add( s2, "Chat room")
	MMenu_Add( s2, "Exit")
	MMenu_Add( s2, "Chat room")
	MMenu_Add( s2, "Exit")

	MMenu_Show(main, 100, 100, "OnClick")

return

OnClick:
return