Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Multi-column menu


  • Please log in to reply
6 replies to this topic
Petru
  • Members
  • 236 posts
  • Last active: Jan 19 2012 06:47 PM
  • Joined: 17 Dec 2007
How to create a menu that has its elements disposed in two or more columns?

Petru
  • Members
  • 236 posts
  • Last active: Jan 19 2012 06:47 PM
  • Joined: 17 Dec 2007
Nothing? Just nothing? No answer? Nobody knows the answer? :shock:

garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005
nada, nincs vàlasz, talàn ez ...
menu / submenu example:
;---------- SUBMENUS ----------------------------
Menu, SOUND  , Add, Volume        ,volume
Menu, SOUND  , Add, Volume-Record ,volumeRecord

Menu, AAAA, Add, &Exit             , FileExit

Menu, BBBB, Add, Sound           ,:Sound          ;<<
Menu, BBBB, Add,
Menu, BBBB, Add, Display         , Display1

Menu, MyMenuBar, Add, &File , :AAAA
Menu, MyMenuBar, Add, &TOOLS, :BBBB
Gui,3: Menu, MyMenuBar
Gui,3:Show,            x100   y20     h340  w640 ,TEST
return
;-------------------------------------------------------------------
volume:
run,sndvol32
return

volumerecord:
run,sndvol32 /rec
return

display1:
run,c:\windows\system32\Desk.cpl
return

Fileexit:
3Guiclose:
exitapp


Petru
  • Members
  • 236 posts
  • Last active: Jan 19 2012 06:47 PM
  • Joined: 17 Dec 2007
Posted Image
This is what I was telling you about, not submenus.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
<!-- m -->http://www.autohotke...334.html#171334<!-- m -->

Petru
  • Members
  • 236 posts
  • Last active: Jan 19 2012 06:47 PM
  • Joined: 17 Dec 2007
Thank you. It works well, but it leaves an empty space on the newly created column. How to fix this?

Menu, Emoti, Add, :), IntroduEmoticonita
  Menu, Emoti, Add, :(, IntroduEmoticonita
  Menu, Emoti, Add, :|, IntroduEmoticonita
  Menu, Emoti, Add, :D, IntroduEmoticonita
  Menu, Emoti, Add, BREAK, IntroduEmoticonita
  MenuHandle := MI_GetMenuHandle("Emoti")
  MenuBreak=4
  VarSetCapacity(mii,48,0)
  NumPut(48,mii)
  NumPut(0x10,mii,4) ; fMask = MIIM_TYPE
  NumPut(0x160,mii,8) ; fType = RGB_VERTICALBARBREAK
  DllCall("SetMenuItemInfo","uint",MenuHandle,"uint",MenuBreak,"uint",1,"uint",&mii)
  Menu, Emoti, Add, :((, IntroduEmoticonita
  Menu, Emoti, Add, :(), IntroduEmoticonita
  Menu, Emoti, Add, X(, IntroduEmoticonita
  Menu, Emoti, Add, :S, IntroduEmoticonita

IntroduEmoticonita:
return


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
The code Tekl posted in that thread is incorrect. The value 0x160, which has been labeled "RGB_VERTICALBARBREAK" is actually a combination of three flags:
[*:lsw002oh]MFT_MENUBARBREAK - Places the menu item in a new column, separating the old and new column with a vertical line.
[*:lsw002oh]MFT_MENUBREAK - Places the menu item in a new column, without a vertical line.
[*:lsw002oh]MFT_OWNERDRAW - Assigns responsibility for drawing the menu item to the window that owns the menu.MFT_MENUBARBREAK and MFT_MENUBREAK do not replace the menu item with a separator - they start a new column directly before the menu item. This means SetMenuItemInfo should be used after adding at least one menu item for the second column.

Since the script doesn't handle owner-drawing of the menu item, it remains blank. The blank space in the left column is there merely because there are more items in the right column than the left.

Finally, using the MIIM_TYPE flag and setting only MFT_MENUBARBREAK appears to replace the menu item with a horizontal separator. Instead, the MIIM_FTYPE flag should be used.

Menu, Emoti, Add, :), IntroduEmoticonita
  Menu, Emoti, Add, :(, IntroduEmoticonita
  Menu, Emoti, Add, :|, IntroduEmoticonita
  Menu, Emoti, Add, :D, IntroduEmoticonita
  MenuBreak=4
  Menu, Emoti, Add, :((, IntroduEmoticonita
  Menu, Emoti, Add, :(), IntroduEmoticonita
  Menu, Emoti, Add, X(, IntroduEmoticonita
  Menu, Emoti, Add, :S, IntroduEmoticonita

  MenuHandle := MI_GetMenuHandle("Emoti")
  VarSetCapacity(mii,48,0),NumPut(48,mii)
  NumPut(0x100,mii,4) ; fMask = MIIM_FTYPE
  NumPut(0x20,mii,8)  ; fType = MFT_MENUBARBREAK
  DllCall("SetMenuItemInfo","uint",MenuHandle,"uint",MenuBreak,"uint",1,"uint",&mii)

Menu, Emoti, Show
ExitApp

IntroduEmoticonita:
return