TristanD
01-20-2007, 05:39 AM
The is an project i made on request.. It populates a tree object with files from a folder and when double click on a node it open the file
How to set it up Yourself :
Create a tree object..
On Global Functions:
function GetFolderContentsFromDialog()
folderbrowse = Dialog.FolderBrowse("Please select a folder:", _SourceDrive);
Zip = File.Find(folderbrowse, "*.rar", true, false, ShowSearchProgress, nil);
if Zip then
for i,v in Zip do
tbSplit = String.SplitPath(v);
name = tbSplit.Filename
tblNodeData = {};
tblNodeData.Text = name;
tblNodeData.Data = v;
Tree.InsertNode("Tree1", "3", tblNodeData);
end
end
end
function GetFolderContents()
Zip = File.Find(_SourceFolder, "*.rar", true, false, ShowSearchProgress, nil);
if Zip then
for i,v in Zip do
tbSplit = String.SplitPath(v);
name = tbSplit.Filename
tblNodeData = {};
tblNodeData.Text = name;
tblNodeData.Data = v;
Tree.InsertNode("Tree1", "3", tblNodeData);
end
end
end
function RunNodeFile()
sel_node = Tree.GetSelectedNode("Tree1");
node = Tree.GetNode("Tree1", sel_node);
node_data = node.Data
File.Open(node_data, "", SW_SHOWNORMAL);
end
On Show (two options possible)
1 Populate from a folder chosen with a dialog
GetFolderContentsFromDialog()
2 Populate From the sourcefolder
GetFolderContents()
Tree, On Double Click
RunNodeFile()
Thats it
If you dont feel like copy and pasting the whole time then use my prebuild project ;)
How to set it up Yourself :
Create a tree object..
On Global Functions:
function GetFolderContentsFromDialog()
folderbrowse = Dialog.FolderBrowse("Please select a folder:", _SourceDrive);
Zip = File.Find(folderbrowse, "*.rar", true, false, ShowSearchProgress, nil);
if Zip then
for i,v in Zip do
tbSplit = String.SplitPath(v);
name = tbSplit.Filename
tblNodeData = {};
tblNodeData.Text = name;
tblNodeData.Data = v;
Tree.InsertNode("Tree1", "3", tblNodeData);
end
end
end
function GetFolderContents()
Zip = File.Find(_SourceFolder, "*.rar", true, false, ShowSearchProgress, nil);
if Zip then
for i,v in Zip do
tbSplit = String.SplitPath(v);
name = tbSplit.Filename
tblNodeData = {};
tblNodeData.Text = name;
tblNodeData.Data = v;
Tree.InsertNode("Tree1", "3", tblNodeData);
end
end
end
function RunNodeFile()
sel_node = Tree.GetSelectedNode("Tree1");
node = Tree.GetNode("Tree1", sel_node);
node_data = node.Data
File.Open(node_data, "", SW_SHOWNORMAL);
end
On Show (two options possible)
1 Populate from a folder chosen with a dialog
GetFolderContentsFromDialog()
2 Populate From the sourcefolder
GetFolderContents()
Tree, On Double Click
RunNodeFile()
Thats it
If you dont feel like copy and pasting the whole time then use my prebuild project ;)