За 20 лет кодинга на Ассемблере упустил такую возможность - добавление значков только к пунктам popup menu
If OpenWindow(0, 0, 0, 230, 90, "Event handling example...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreatePopupMenu(0)
MenuTitle("")
MenuItem(0, "Item 1")
MenuItem(1, "Item 2")
MenuItem(2, "Item 3")
EndIf
hbmp=CreateImage(0,32,32)
StartDrawing(ImageOutput(0))
Box(0,0,31,31,$FFFFFF)
LineXY(0,0,31,31,255)
;DrawImage(ImageID(3),0,0)
StopDrawing()
hbmp1=CreateImage(1,32,32)
hbmp=LoadImage(2,"b64.bmp")
; LoadImage(3,"b64.ico")
; CopyImage(3,2)
If SetMenuItemBitmaps_(MenuID(0),0,#MF_BYCOMMAND,ImageID(0),ImageID(0))=0
Debug "0:"+Str(GetLastError_())
EndIf
If SetMenuItemBitmaps_(MenuID(0),0,#MF_BYPOSITION,ImageID(2),ImageID(2))=0
Debug "2:"+Str(GetLastError_())
EndIf
DisplayPopupMenu(0,WindowID(0))
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
If CreatePopupMenu(0)
MenuTitle("")
MenuItem(0, "Item 1")
MenuItem(1, "Item 2")
MenuItem(2, "Item 3")
EndIf
hbmp=CreateImage(0,32,32)
StartDrawing(ImageOutput(0))
Box(0,0,31,31,$FFFFFF)
LineXY(0,0,31,31,255)
;DrawImage(ImageID(3),0,0)
StopDrawing()
hbmp1=CreateImage(1,32,32)
hbmp=LoadImage(2,"b64.bmp")
; LoadImage(3,"b64.ico")
; CopyImage(3,2)
If SetMenuItemBitmaps_(MenuID(0),0,#MF_BYCOMMAND,ImageID(0),ImageID(0))=0
Debug "0:"+Str(GetLastError_())
EndIf
If SetMenuItemBitmaps_(MenuID(0),0,#MF_BYPOSITION,ImageID(2),ImageID(2))=0
Debug "2:"+Str(GetLastError_())
EndIf
DisplayPopupMenu(0,WindowID(0))
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Со значками этот трюк пока не проходит
Комментарии
Отправить комментарий