Hi.
How I can make a bold item in a popup menu?
Thanks.
PopupMenu and bold items
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm
You need the api SetMenuItemInfo (see here) I wrote a quick example, basically you have to set one menu item as default, you choose which item by its position. Hope this helps.
Code: Select all
#MIIM_STATE=1
#MFS_DEFAULT=4096
OpenWindow(0,0,0,400,400,#PB_Window_SystemMenu | #PB_Window_ScreenCentered,"test")
CreatePopupMenu(0)
MenuItem(0,"Normal1")
MenuItem(1,"Normal2")
MenuItem(2,"Bold")
MenuItem(3,"Normal3")
bold.MENUITEMINFO
bold\cbSize=SizeOf(bold)
bold\fMask=#MIIM_STATE
bold\fState=#MFS_DEFAULT
SetMenuItemInfo_(MenuID(),2,#True,bold) ;2 specifies the item to be made bold
Repeat
ev=WaitWindowEvent()
If ev=#WM_RBUTTONUP
DisplayPopupMenu(0,WindowID(0))
EndIf
Until ev=#PB_Event_CloseWindow
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm
it seems that the hidden MenuID() command is the same like this :
Code: Select all
PeekL(IsMenu(0)
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm