|
请问如何做到让右侧的ListView显示左侧的TreeView勾选后显示列表,并要进行排序[01]、[02]……。
附上界面代码:
#include <GUIConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#Include <GuiListView.au3>
Local $i,$m,$n,$TreeItem[10][10],$Item[10][10]
Local $inipath = @ScriptDir&"\Soft.ini"
$Form = GUICreate("",420,320,-1,-1)
;建立左侧树状分支
$Treeview = GUICtrlCreateTreeView(6, 6, 150, 240,BitOR($TVS_HASBUTTONS,$TVS_CHECKBOXES,$TVS_HASLINES,$TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
;程序分类,读取soft.ini的[Main]段
For $i = 1 To 9
$IniSection = IniRead($inipath, "Main", $i, "None")
If $IniSection = "None" Then ExitLoop
$TreeItem[$i][0] = GUICtrlCreateTreeViewItem($IniSection, $TreeView)
Next
;程序分支
For $m = 1 to 9
For $n = 1 to 5
$name = IniRead($inipath, $m&"-"&$n, "softname", "None")
$Item[$m][$n] = GUICtrlCreateTreeViewItem($name, $TreeItem[$m][0])
Next
Next
;展开树状结构
For $i = 1 To 9
GUICtrlSetState($TreeItem[$i][0], $GUI_EXPAND)
Next
;建立右侧列表
$List = GUICtrlCreateListView("",160,6,250,240,BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES,$LVS_EX_TRACKSELECT,$WS_HSCROLL, $WS_VSCROLL))
$button = GUICtrlCreateButton("确 定",310,266,60,28)
GUISetState(@SW_SHOW)
While 1
$nMsg=GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $TreeItem[1][0] And BitAND(GUICtrlRead($TreeItem[1][0]),$GUI_CHECKED)=$GUI_CHECKED
For $i = 1 To 5
GUICtrlSetState($Item[1][$i], $GUI_CHECKED)
Next
Case $nMsg = $TreeItem[1][0] And BitAND(GUICtrlRead($TreeItem[1][0]),$GUI_UNCHECKED)=$GUI_UNCHECKED
For $i = 1 To 5
GUICtrlSetState($Item[1][$i], $GUI_UNCHECKED)
Next
Case $nMsg = $TreeItem[2][0] And BitAND(GUICtrlRead($TreeItem[2][0]),$GUI_CHECKED)=$GUI_CHECKED
For $i = 1 To 5
GUICtrlSetState($Item[2][$i], $GUI_CHECKED)
Next
Case $nMsg = $TreeItem[2][0] And BitAND(GUICtrlRead($TreeItem[2][0]),$GUI_UNCHECKED)=$GUI_UNCHECKED
For $i = 1 To 5
GUICtrlSetState($Item[2][$i], $GUI_UNCHECKED)
Next
EndSelect
WEnd
[ 本帖最后由 xulinghai 于 2009-3-13 20:22 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|