示例#1
0
文件: listBox.go 项目: CodyGuo/xcgui
func OnBtnClickAdd(pbHandled *bool) int {
	hAdapter := xcgui.XListBox_GetAdapter(hListBox)
	xcgui.XAdapterTable_InsertItemText(hAdapter, xcgui.XAdapterTable_GetCount(hAdapter), "test - insert"+fmt.Sprint(xcgui.XAdapterTable_GetCount(hAdapter)))
	xcgui.XEle_RedrawEle(hListBox)

	return 0
}
示例#2
0
文件: listBox.go 项目: CodyGuo/xcgui
func OnBtnClickDelEx(pbHandled *bool) int {
	hAdapter := xcgui.XListBox_GetAdapter(hListBox)
	ok := xcgui.XAdapterTable_DeleteItemEx(hAdapter, 1, 3)
	if ok {
		xcgui.XEle_RedrawEle(hListBox)
	}

	return 0
}
示例#3
0
文件: listBox.go 项目: CodyGuo/xcgui
func OnBtnClickDel(pbHandled *bool) int {
	hAdapter := xcgui.XListBox_GetAdapter(hListBox)
	array := make([]uint16, 256)
	count := xcgui.XListBox_GetSelectAll(hListBox, &array[0], 256)
	for i := 0; i < count*2; i += 2 {
		ok := xcgui.XAdapterTable_DeleteItem(hAdapter, int(array[i]))
		if ok {
			xcgui.XEle_RedrawEle(hListBox)
		}
	}

	return 0
}
示例#4
0
文件: listBox.go 项目: CodyGuo/xcgui
func OnListBoxSelect(iItem int, pbHandled *bool) int {
	xcgui.XRichEdit_DeleteAll(hRichEidt)
	array := make([]uint16, 256)
	count := xcgui.XListBox_GetSelectAll(hListBox, &array[0], 256)

	hAdapter := xcgui.XListBox_GetAdapter(hListBox)
	var szItemList string
	name := make([]uint16, 256)
	for i := 0; i < count*2; i += 2 {
		ok := xcgui.XAdapterTable_GetItemText(hAdapter, int(array[i]), 0, &name[0], 256)
		if ok {
			szItemList += xcgui.UTF16PtrToString(&name[0])
			szItemList += "\n"
		}
	}

	xcgui.XRichEdit_SetText(hRichEidt, szItemList)

	return 0
}