aardio 文档

aardio 范例:遍历树形控件

//遍历树形控件
import win.ui;
/*DSG{{*/
var winform = win.form(text="treeview控件遍的节点";right=349;bottom=249;parent=...)
winform.add(
btnSelectAll={cls="button";text="全选";left=172;top=206;right=271;bottom=232;z=2};
treeview={cls="treeview";left=22;top=17;right=326;bottom=190;asel=false;bgcolor=15793151;edge=1;exstyle=131072;style=256;z=1}
)
/*}}*/

var hitem = winform.treeview.insertItem( text="程序目录" );
var hSubItem = winform.treeview.insertItem( { text="子目录" },hitem/*父节点*/);

hitem = winform.treeview.insertItem( { 
        text = "children数组指定子节点"; 
        children = { 
            { text = "子节点"  };
            { text = "子节点2" };
        }
} ) 

winform.btnSelectAll.oncommand = function(id,event){ 

    winform.treeview.enum(
        function(hItem,parent){             
            winform.treeview.setChecked(hItem,true)
        }
    )
} 

winform.show() 
win.loopMessage();




Markdown 格式