Exemplo n.º 1
0
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
}
Exemplo n.º 2
0
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
}
Exemplo n.º 3
0
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
}
Exemplo n.º 4
0
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
}