本帖最后由 chzj589 于 2016-12-19 12:04 编辑
这几天又学习炫彩界面,上面的函数不会使用,
我想炫彩界面复制List列表1到List列表2,有请guland 帮助,谢谢!
代码:-------------------------------------------------------------
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
Global $_hAdapter
#include "XCGUI_Fun.au3"
XInitXCGUI()
$create = XWnd_Create("500", "500", "900", "700", "窗口测试", 47)
$str = XShapeText_Create("8", "6", "100", "20", " 复制List列表1到List列表2", $create)
$font = XFont_Create2("宋体", "12", True, False, False, False) ;创建字体
XShapeText_SetFont($str, $font) ;设置XShapeText元素字体
XShapeText_SetTextColor($str, 0x00ff66, 255) ;设置XShapeText元素颜色
$XList = XList_Create("20", "40", "840", "300", $create)
XList_SetItemHeightDefault($XList, 18, 25) ;设置项未选中高度,选中高度
$ggg = XList_SetItemTemplateXML($XList, @ScriptDir & "\List_Item.xml") ;加载列表模板
XList_AddColumn($XList, 100) ;设置列宽度
XList_AddColumn($XList, 100)
XList_AddColumn($XList, 100)
XList_AddColumn($XList, 100)
XList_AddColumn($XList, 100)
XList_AddColumn($XList, 100)
XList_AddColumn($XList, 100)
$XAm = XAdapterMap_Create()
XList_BindAdapterHeader($XList, $XAm)
$XA = XAdapterTable_Create()
XList_BindAdapter($XList, $XA)
XAdapterTable_AddColumn($XA, "name")
XAdapterTable_AddColumn($XA, "name2")
XAdapterTable_AddColumn($XA, "name3")
XAdapterTable_AddColumn($XA, "name4")
XAdapterTable_AddColumn($XA, "name5")
XAdapterTable_AddColumn($XA, "name6")
XAdapterTable_AddColumn($XA, "name7")
For $i = 0 To 10
XAdapterTable_AddItemTextEx($XA, "name", "ListBox")
XAdapterTable_SetItemText($XA, $i, 1, "ListBox-" & $i & "-1")
XAdapterTable_SetItemText($XA, $i, 2, "ListBox-" & $i & "-2")
XAdapterTable_SetItemText($XA, $i, 3, "ListBox-" & $i & "-1")
XAdapterTable_SetItemText($XA, $i, 4, "ListBox-" & $i & "-2")
XAdapterTable_SetItemText($XA, $i, 5, "ListBox-" & $i & "-1")
XAdapterTable_SetItemText($XA, $i, 6, "ListBox-" & $i & "-2")
Next
$XLista = XList_Create("20", "350", "840", "300", $create)
XList_SetItemHeightDefault($XLista, 18, 25) ;设置项未选中高度,选中高度
$ggg = XList_SetItemTemplateXML($XLista, @ScriptDir & "\List_Item.xml") ;加载列表模板
XList_AddColumn($XLista, 100) ;设置列宽度
XList_AddColumn($XLista, 100)
XList_AddColumn($XLista, 100)
XList_AddColumn($XLista, 100)
XList_AddColumn($XLista, 100)
XList_AddColumn($XLista, 100)
XList_AddColumn($XLista, 100)
$XAma = XAdapterMap_Create()
XList_BindAdapterHeader($XLista, $XAma)
$XAa = XAdapterTable_Create()
XList_BindAdapter($XLista, $XAa)
XAdapterTable_AddColumn($XAa, "name")
XAdapterTable_AddColumn($XAa, "name2")
XAdapterTable_AddColumn($XAa, "name3")
XAdapterTable_AddColumn($XAa, "name4")
XAdapterTable_AddColumn($XAa, "name5")
XAdapterTable_AddColumn($XAa, "name6")
XAdapterTable_AddColumn($XAa, "name7")
$btn2 = XBtn_Create("800", "660", "75", "25", "退出程序", $create)
$btn3 = XBtn_Create("700", "660", "75", "25", "复制List", $create)
XEle_RegEventC($btn2, "btn2")
XEle_RegEventC($btn3, "btn3")
XWnd_ShowWindow($create)
XRunXCGUI()
Func btn2($bh)
xquit_acn($create)
EndFunc ;==>btn2
Func btn3($bh)
;复制List
XListView_GetSelectItem($XList)
;获取选择项,
;$_hEle=控件句柄,
;返回值为数组,[0] 是否成功 [2] 分组索引 [3] 项索引
XListView_GetSelectItemCount($XList)
;获取选择项数量
;$_hEle=控件句柄
;返回值:选择项数量
XAdapterListView_Item_GetCount($hAdapter,$iGroup)
;获取指定组中项数量
;$hAdapter 数据适配器句柄
;$iGroup 组索引
;返回值:项数量
EndFunc ;==>btn3
|