PVDynamic_DisplayMenuBarIcon ()

Top  Previous  Next

Display PVGadgets MenuBarIcons that have been added to a Form.

 

Use:

PVDynamic_DisplayMenuBarIcon()

 

 

 

Example:

 

Init_PVDynamic()

#Window_Main=0

#MenuBar_Main=1

#MenuBar_Main_Exit=2

#MenuBarIcon_Main_Exit=2

 

LoadImage(#MenuBarIcon_Main_Exit,"images\exit.ico")

 

 

Procedure WindowCallback(WindowID,Message,wParam,lParam)

ReturnValue=#PB_ProcessPureBasicEvents

If Message=#WM_MEASUREITEM

ReturnValue=PVDynamic_MenuBarSize(WindowID,lParam)

EndIf

If Message=#WM_DRAWITEM

ReturnValue=PVDynamic_MenuBar(lParam,-1,-1)

EndIf

ProcedureReturn  ReturnValue

EndProcedure

 

 

If OpenWindow(#Window_Main,175,0,400,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Menu")

CreateMenu(#MenuBar_Main,WindowID(#Window_Main))

MenuTitle("File")

MenuItem(#MenuBar_Main_Exit,"Exit")

PVDynamic_AddMenuBarIcon(#Window_Main,#MenuBar_Main_Exit,"Exit",#MenuBarIcon_Main_Exit)

PVDynamic_DisplayMenuBarIcon()

 

SetWindowCallback(@WindowCallback())

 

Repeat

Until WaitWindowEvent()=#PB_Event_CloseWindow

EndIf