Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: AutoPlay Media Studio
Показать сообщение отдельно

Новый участник


Сообщения: 5
Благодарности: 0

Профиль | Отправить PM | Цитировать


Вложения
Тип файла: rar My Project.rar
(366.0 Kb, 10 просмотров)

помогите пожалуйста решить проблему с AutoPlay Media Studio стандартный шаблон pdf document wiewer, раскрывает список дерево папка, файл,что нужно прописать или изменить чтоб раскрывалось папка,папка,файл или папка,папка,папка,файл.

Скрытый текст
-- PDF Root Folder Defined in Global Functions
-- Variable: sPDFRootFolder

sFirstPDFToLoad = "";

function AddToTree(sFullPath)
if (sFirstPDFToLoad == '') then
sFirstPDFToLoad = sFullPath;
end

-- Split the path
tPathParts = String.SplitPath(sFullPath);

-- Get length of root folder (so we know how many chars to skip)
nRootLength = String.Length(sPDFRootFolder);

-- sFullPath minus last character
sFullFolderPath = tPathParts.Drive .. tPathParts.Folder;
nFullFolderPathLength = String.Length(sFullFolderPath);
sFullFolderPath = String.Mid(sFullFolderPath, 1, nFullFolderPathLength - 1);

-- Check of PDF should be inserted into root of tree
if(String.Compare(sPDFRootFolder, sFullFolderPath) == 0) then
-- We're inserting this PDF into the root, configure node values
tNodeData = {};
tNodeData['Text']=tPathParts.Filename;
tNodeData['Data']=sFullPath;
tNodeData['ImageIndex']="0";

-- Insert the node
Tree.InsertNode("Tree1", Tree.GetChildCount("Tree1", "0") + 1, tNodeData);
else
-- We need to search for an existing node by 'folder' value (ie sub folder) ... so let's create the search string

-- Initialize
sSearchString = tPathParts.Folder;

-- Strip the last slash off
sSearchString = String.TrimRight(sSearchString, '\\');

-- Find the last occuring slash (will be before the final folder name
nPosLastSlash = String.ReverseFind(sSearchString, '\\');

-- Get rid of all the stuff before the last occuring slash
sSearchString = String.Mid(sSearchString, nPosLastSlash + 1, -1);

-- Search the tree by node name (folder name)
sFoundNodeIndex = Tree.FindNodeByText("Tree1", "0", sSearchString);

if sFoundNodeIndex == "" then
-- Node wasn't found, create it

-- Create node data (data part is left blank ... this is a 'category', not a document)
tNodeData = {};
tNodeData['Text']=sSearchString;
tNodeData['Data']="";
tNodeData['ImageIndex']="1";
sParentIndex = Tree.GetChildCount("Tree1", "0") + 1;
Tree.InsertNode("Tree1", sParentIndex, tNodeData);
else
sParentIndex = sFoundNodeIndex;
end

-- Insert actual file
tNodeData = {};
tNodeData['Text']=tPathParts.Filename;
tNodeData['Data']=sFullPath;
tNodeData['ImageIndex']="0";
Tree.InsertNode("Tree1", sParentIndex .. "." .. (Tree.GetChildCount("Tree1", sParentIndex) + 1), tNodeData);
end

return true;
end


-- Find all PDF's in the folder
File.Find(sPDFRootFolder, "*.pdf", true, false, nil, AddToTree);

-- Load the first PDF
PDF.LoadFile("PDF1", sFirstPDFToLoad);

Отправлено: 00:11, 01-12-2014 | #5

Название темы: AutoPlay Media Studio