Example #1
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
}
Example #2
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
}