How to create a menu that has its elements disposed in two or more columns?
Multi-column menu
Started by
Petru
, Oct 17 2008 06:08 PM
6 replies to this topic
#1
-
Posted 17 October 2008 - 06:08 PM
Nothing? Just nothing? No answer? Nobody knows the answer? :shock:
#2
-
Posted 17 October 2008 - 09:45 PM
nada, nincs vàlasz, talàn ez ...
menu / submenu example:
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
#3
-
Posted 17 October 2008 - 10:06 PM
This is what I was telling you about, not submenus.
#4
-
Posted 18 October 2008 - 08:57 PM
<!-- m -->http://www.autohotke...334.html#171334<!-- m -->
#5
-
Posted 18 October 2008 - 10:03 PM
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
#6
-
Posted 19 October 2008 - 08:48 AM
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.
[*: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
#7
-
Posted 20 October 2008 - 10:04 AM