コード例 #1
0
ファイル: frame.go プロジェクト: CodyGuo/xcgui
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
}
コード例 #2
0
ファイル: notifyicon.go プロジェクト: CodyGuo/xcgui
func RunXCMenu() {
	var p xcgui.POINT
	xcgui.GetCursorPos(&p)
	hMenu := xcgui.XMenu_Create()
	xcgui.XMenu_AddItem(hMenu, 101, "炫彩菜单101", 0, xcgui.MENU_ITEM_FLAGS_POPUP)
	xcgui.XMenu_AddItem(hMenu, 102, "炫彩菜单102", 0, 0)
	xcgui.XMenu_AddItem(hMenu, 103, "炫彩菜单103", 0, 0)
	xcgui.XMenu_AddItem(hMenu, 104, "炫彩菜单104", 0, 0)
	xcgui.XMenu_AddItem(hMenu, 105, "炫彩菜单105", 0, 0)
	xcgui.XMenu_AddItem(hMenu, 106, "退出程序", 0, 0)

	xcgui.XMenu_AddItem(hMenu, 1011, "炫彩菜单101-1", 101, 0)
	xcgui.XMenu_AddItem(hMenu, 1012, "炫彩菜单101-2", 101, 0)

	xcgui.SetForegroundWindow(xcgui.XWnd_GetHWND(hWindow))
	xcgui.XMenu_Popup(hMenu, xcgui.XWnd_GetHWND(hWindow), p.X, p.Y, 0, 0)
}
コード例 #3
0
ファイル: menu.go プロジェクト: CodyGuo/xcgui
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
}