 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
fuzzles
Joined: 03 Aug 2008 Posts: 2
|
Posted: Sun Aug 03, 2008 2:44 am Post subject: |
|
|
how to repace the gui, menu toolbar (File, help...) with the mmenu ?
cant get it to work this way. |
|
| Back to top |
|
 |
Learning one
Joined: 04 Apr 2009 Posts: 1001 Location: Croatia
|
Posted: Tue Dec 29, 2009 11:54 pm Post subject: |
|
|
Just wanted to bring MMenu back to 1. page and say:
Majkinetor, thank you for MMenu! |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Wed Dec 30, 2009 8:52 am Post subject: |
|
|
You are welcome  _________________
 |
|
| Back to top |
|
 |
Deo Guest
|
Posted: Wed May 05, 2010 11:09 pm Post subject: Icons Resize |
|
|
Hi all
Is it possible to resize icons of items in menu (all icons set through path:index even if index = 0) to the selected size explicitly?
Currently all icons got through the path:index are 32x32 even if icon size in menu is 16x16
it looks like on screenshots
| Code: |
SIZE_OF_ICONS_DEFAULT := 16 ; 16,24,32
MHandl1 := MMenu_Create("S" . SIZE_OF_ICONS_DEFAULT)
MMenu_Add(MHandl1, "shortcut", "shell32.dll:4" ,"","")
MMenu_Add(MHandl1, "shortcut1", "shell32.dll:5" ,"","")
MMenu_Add(MHandl1, "shortcut2", "shell32.dll:6" ,"","")
MouseGetPos,X,Y
MMenu_Show(MHandl1,X,Y, "Target")
#Include include
#Include MMenu.ahk
#Include Structs.ahk
return
Target:
exitapp
|
size of icons - 32
http://img94.imageshack.us/i/screenshot00037c.png/ - size 16
http://img26.imageshack.us/i/screenshot00036r.png/ - size 32 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Thu May 06, 2010 6:10 am Post subject: |
|
|
As far as I remember, setting size does not work for icons in the dll. If u use icons from ico files it will work. _________________
 |
|
| Back to top |
|
 |
Deo Guest
|
Posted: Thu May 06, 2010 8:59 am Post subject: |
|
|
yea, i've noticed that ico resized correctly, but not ico:0
it's a little disappointing, because resizing to desired size working correctly for TreeView control icons or for Gui Picture control
resizing also work for "Menu Icons"
Is it possible to implement resizing into the MMenu code? I would very appreciate it |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Thu May 06, 2010 9:55 am Post subject: |
|
|
Yes, definitely, but I don't have time for that atm. You could try it yourself _________________
 |
|
| Back to top |
|
 |
Deo Guest
|
Posted: Thu May 06, 2010 12:37 pm Post subject: |
|
|
ok, i've changed the code of MMenu.ahk so it now resize icons properly
| Code: | MMenu_loadIcon(pPath, pSize=0)
{
idx := InStr(pPath, ":", 0, 0)
if idx >=4
{
resPath := SubStr( pPath, 1, idx-1)
resIdx := Substr( pPath, idx+1, 8)
;~ return MMenu_GetIcon( resPath, resIdx )
return DllCall("user32\CopyImage"
, "UInt", MMenu_GetIcon(resPath,resIdx) ;icon handle
, "uint", 2 ; IMAGE_ICON
, "int", pSize
, "int", pSize
, "UInt",0x8) ;LR_COPYDELETEORG
}
return, DllCall( "LoadImage"
, "uint", 0
, "str", pPath
, "uint", 2 ; IMAGE_ICON
, "int", pSize
, "int", pSize
, "uint", 0x10 | 0x20) ; LR_LOADFROMFILE | LR_TRANSPARENT
} |
think it would be useful to include this fix into the topic's bundle |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Thu May 06, 2010 1:40 pm Post subject: |
|
|
Thanks. _________________
 |
|
| Back to top |
|
 |
Petru
Joined: 17 Dec 2007 Posts: 235 Location: Galati, Romania
|
Posted: Fri May 14, 2010 1:32 pm Post subject: |
|
|
| How can I use MMenu to create menubars for GUIs? |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Fri May 14, 2010 4:07 pm Post subject: |
|
|
The only way to do it is to create standard AHK menu bar, then display MMenu when user clicks the main menu item, precisely positioned bellow the clicked item.
The same goes for Tray menu.
However, this will not be complete simulation unless you also monitor LEFT|RIGHT arrow which normally jumps to different menus of the main menu while menu is being open. _________________
 |
|
| Back to top |
|
 |
Deo
Joined: 16 May 2010 Posts: 172
|
Posted: Sat May 22, 2010 9:30 am Post subject: |
|
|
Man, can you advice plz, what i need to change in the MMenu code to disable checkmarks at all and free space to the left from menu item that holded for it
I think i need to change menu item style by inserting the num
MNS_NOCHECK = 0x80000000
But i can't find the exact place in code where it can be used |
|
| Back to top |
|
 |
godsstigma
Joined: 04 Nov 2008 Posts: 222 Location: Memphis, TN
|
Posted: Thu Jun 10, 2010 10:49 pm Post subject: |
|
|
| Is there a way to remove a separator without having to destroy and re-build the menu? |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Fri Jun 11, 2010 9:26 am Post subject: |
|
|
Yes. Use its ID or position to remove it. MMenu is dynamic thing. You can delete, edit or remove items during run time. _________________
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Wed Jun 16, 2010 1:01 pm Post subject: |
|
|
| Deo wrote: | I think i need to change menu item style by inserting the num
MNS_NOCHECK = 0x80000000 | It must be applied by calling SetMenuInfo. For instance,
| Code: | MMenu_setMenuStyle( menu, 0x80000000 )
...
MMenu_setMenuStyle( pMenu, dwStyle ) {
local hMenu := MMenu_aMenu[%pMenu%]
MMenu_mi_fMask := 0x10 ;MIM_STYLE
MMenu_mi_dwStyle := dwStyle
MENUINFO_Set("MMenu_mi")
API_SetMenuInfo( hMenu, &MMenu_mi )
} |
However, since MMenu custom measures and draws all items, setting the style isn't sufficient. The following line in MMenu_onDraw unconditionally adjusts the icon position by the size of a standard checkmark:
| Code: | | API_DrawIconEx(MMenu_di_hDC, (API_GetMenuCheckMarkDimensions() & 0xFFFF) + 4, MMenu_di_rcItem_Top, MMenu_di_itemData, 0, 0, 0, 0, 3) |
There are a few solutions:
- If you'll never use check marks, remove the red code and set the MNS_NOCHECK style for every menu.
- Use GetMenuInfo to determine whether the menu has MNS_NOCHECK before making the adjustment.
- Add a variable for each menu to track whether it has MNS_NOCHECK, and check this before making the adjustment.
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|