Exemple #1
0
func main() {
	hWindow = xcgui.XWnd_Create(100, 100, 400, 300, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE)

	hButton := xcgui.XBtn_Create(20, 50, 120, 20, "popu-modalWindow", xcgui.HXCGUI(hWindow))
	xcgui.XEle_RegEventC(hButton, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClick))
	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)

	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
Exemple #2
0
func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(10, 5, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE)

	xcgui.XEle_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow))

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)

	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
Exemple #3
0
func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE)

	hCheck1 := xcgui.XBtn_Create(20, 40, 100, 20, "Radio1", xcgui.HXCGUI(hWindow))
	hCheck2 := xcgui.XBtn_Create(20, 70, 100, 20, "Radio2", xcgui.HXCGUI(hWindow))
	hCheck3 := xcgui.XBtn_Create(20, 100, 100, 20, "Radio3", xcgui.HXCGUI(hWindow))

	xcgui.XBtn_SetGroupID(hCheck1, 1)
	xcgui.XBtn_SetGroupID(hCheck2, 1)
	xcgui.XBtn_SetGroupID(hCheck3, 1)

	xcgui.XBtn_SetType(hCheck1, xcgui.BUTTON_TYPE_RADIO)
	xcgui.XBtn_SetType(hCheck2, xcgui.BUTTON_TYPE_RADIO)
	xcgui.XBtn_SetType(hCheck3, xcgui.BUTTON_TYPE_RADIO)

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
Exemple #4
0
func OnBtnClick(pbHandled *bool) int {
	hWindowModal := xcgui.XModalWnd_Create(200, 200, "炫彩界面窗口", xcgui.XWnd_GetHWND(hWindow), xcgui.XC_WINDOW_STYLE_MODAL)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindowModal)), xcgui.BUTTON_TYPE_CLOSE)

	nResult := xcgui.XModalWnd_DoModal(hWindowModal)

	log.Println("exit modal ", nResult)

	*pbHandled = true

	return 0
}
Exemple #5
0
func main() {
	mw = xcgui.XFrameWnd_Create(0, 0, 600, 400, "炫彩界面库窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(3, 3, 20, 20, "X", xcgui.HXCGUI(mw)), xcgui.BUTTON_TYPE_CLOSE)

	hPane1 := xcgui.XPane_Create("111", 200, 200, mw)
	hPane2 := xcgui.XPane_Create("2222222222", 200, 200, mw)
	hPane3 := xcgui.XPane_Create("333", 200, 200, mw)

	xcgui.XFrameWnd_AddPane(mw, 0, hPane1, xcgui.Align_left)

	xcgui.XFrameWnd_AddPane(mw, 0, hPane2, xcgui.Align_bottom)

	xcgui.XFrameWnd_AddPane(mw, 0, hPane3, xcgui.Align_right)

	xcgui.XWnd_RegEventC(mw, xcgui.WM_RBUTTONUP, xcgui.CallBack(OnWndButtonUp))

	xcgui.XWnd_AdjustLayout(mw)
	xcgui.XWnd_ShowWindow(mw, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
Exemple #6
0
func main() {
	xcgui.XInitXCGUI()
	hwnd := xcgui.XWnd_Create(400, 200, 300, 200, "标题", xcgui.NULL, xcgui.XC_WINDOW_STYLE_DEFAULT)

	parent := xcgui.HXCGUI(hwnd)
	//button
	btn := xcgui.XBtn_Create(10, 5, 80, 22, "关闭", parent)
	xcgui.XBtn_SetType(btn, xcgui.BUTTON_TYPE_CLOSE)
	//监听btn事件
	xcgui.XEle_RegEventC(btn, xcgui.XE_BNCLICK, syscall.NewCallback(OnBtnClick))
	//label
	lb := xcgui.XShapeText_Create(50, 100, 100, 22, "hello world!", parent)
	xcgui.XShapeText_SetText(lb, "hello 世界!")
	xcgui.XShapeText_SetTextColor(lb, 0xff0000, 255)

	//取text及长度
	str := xcgui.XShapeText_GetTextGo(lb)
	fmt.Println(str)
	fmt.Println(xcgui.XShapeText_GetTextLength(lb))

	xcgui.XWnd_ShowWindow(hwnd, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
Exemple #7
0
func (b *Button) SetType(nType xc.Button_type_) {
	xc.XBtn_SetType(b.hEle, nType)
}