func OnWndButtonUp(nFlags uint32, pPt *xcgui.POINT, pbHandled *bool) int { pt := *pPt hMenu := xcgui.XMenuCreate() xcgui.XMenuAddItem(hMenu, 201, xcgui.StringToUTF16Ptr("窗格1"), xcgui.NULL, xcgui.NULL) xcgui.XMenuAddItem(hMenu, 202, xcgui.StringToUTF16Ptr("窗格2"), xcgui.NULL, xcgui.NULL) xcgui.XMenuAddItem(hMenu, 203, xcgui.StringToUTF16Ptr("窗格3"), xcgui.NULL, xcgui.NULL) xcgui.ClientToScreen(xcgui.XWndGetHWND(mw), &pt) xcgui.XMenuPopup(hMenu, xcgui.XWndGetHWND(mw), pt.X, pt.Y, xcgui.NULL, xcgui.NULL) return 0 }
func OnWndButtonUp(nFlags uint32, pPt *xcgui.POINT, pbHandled *bool) int { pt := *pPt hMenu := xcgui.XMenu_Create() xcgui.XMenu_AddItem(hMenu, 201, "窗格1", 0, 0) xcgui.XMenu_AddItem(hMenu, 202, "窗格2", 0, 0) xcgui.XMenu_AddItem(hMenu, 203, "窗格3", 0, 0) xcgui.ClientToScreen(xcgui.XWnd_GetHWND(mw), &pt) xcgui.XMenu_Popup(hMenu, xcgui.XWnd_GetHWND(mw), pt.X, pt.Y, 0, 0) return 0 }
func OnbtnClick(hEventEle xcgui.HELE, pbHandled *bool) int { hMenu := xcgui.XMenu_Create() xcgui.XMenu_SetBkImage(hMenu, xcgui.XImage_LoadFile("../img/comma_face_12.png", true)) xcgui.XMenu_AddItemIcon(hMenu, 201, "111", xcgui.XC_ID_ROOT, xcgui.XImage_LoadFile("../img/plus.png", false), xcgui.MENU_STATE_FLAGS_CHECK) xcgui.XMenu_AddItem(hMenu, 202, "222", 0, 0) xcgui.XMenu_AddItem(hMenu, 203, "333", 0, 0) xcgui.XMenu_AddItem(hMenu, 204, "444", 203, 0) xcgui.XMenu_AddItem(hMenu, 205, "555", 203, 0) rcButton := new(xcgui.RECT) xcgui.XEle_GetRect(hEventEle, rcButton) pt := xcgui.POINT{int(rcButton.Left), int(rcButton.Bottom)} xcgui.ClientToScreen(xcgui.XWnd_GetHWND(hWindow), &pt) xcgui.XMenu_Popup(hMenu, xcgui.XWnd_GetHWND(hWindow), pt.X, pt.Y, 0, 0) return 0 }