AutoHotkey Community

It is currently May 27th, 2012, 3:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 149 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject:
PostPosted: August 3rd, 2008, 3:44 am 
Offline

Joined: August 3rd, 2008, 3:39 am
Posts: 2
how to repace the gui, menu toolbar (File, help...) with the mmenu ?

cant get it to work this way.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 12:54 am 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
Just wanted to bring MMenu back to 1. page and say:
Majkinetor, thank you for MMenu!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 9:52 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You are welcome :D

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Icons Resize
PostPosted: May 6th, 2010, 12:09 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 7:10 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 9:59 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 10:55 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Yes, definitely, but I don't have time for that atm. You could try it yourself

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 1:37 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 2:40 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Thanks.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2010, 2:32 pm 
Offline

Joined: December 17th, 2007, 6:39 pm
Posts: 235
Location: Galati, Romania
How can I use MMenu to create menubars for GUIs?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2010, 5:07 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2010, 10:30 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2010, 11:49 pm 
Offline

Joined: November 4th, 2008, 10:25 pm
Posts: 222
Location: Memphis, TN
Is there a way to remove a separator without having to destroy and re-build the menu?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2010, 10:26 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Yes. Use its ID or position to remove it. MMenu is dynamic thing. You can delete, edit or remove items during run time.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2010, 2:01 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 149 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg, tidbit and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group