First, we want to sincerely thank you - the development team - for your ongoing hard work. DOpus' scripting capabilities have revolutionized file management flexibility, and the Script Dialog feature in particular has become an indispensable tool for creating customized interfaces in our daily workflows.![]()
During regular use, I’ve noticed that while the Button Script Dialog currently supports controls like Edit, Button, and ListView—which cover many basic scenarios—it lacks support for displaying hierarchical data effectively. For example, when dealing with nested structures like tag hierarchies, functional menus, or left-side navigation trees (common in many software systems), the existing controls fall short.
If TreeView support could be added to the Button Script Dialog, combined with the existing event mechanisms (e.g., node clicks, expand/collapse events), it would greatly simplify the implementation of dynamic hierarchical structures. Of course, this is just a suggestion, and feasibility would depend on technical considerations.
Example Use Case (Pseudocode)
Below is a simplified demonstration of how TreeView could be utilized to display hierarchical data in a script dialog:
// Sample hierarchical data (e.g., fetched from a server)
var systemFunctions = [
{"id": 1, "name": "System Management", "parentId": 0},
{"id": 2, "name": "User Management", "parentId": 1},
{"id": 3, "name": "Add User", "parentId": 2},
{"id": 4, "name": "Edit User", "parentId": 2},
{"id": 5, "name": "Role Configuration", "parentId": 1},
{"id": 6, "name": "Create Role", "parentId": 5},
{"id": 7, "name": "Data Center", "parentId": 0},
{"id": 8, "name": "Data Backup", "parentId": 7},
{"id": 9, "name": "Manual Backup", "parentId": 8},
{"id": 10, "name": "Auto Backup Settings", "parentId": 8}
];
// Initialize dialog container (simplified; actual implementation may vary)
//var shell = new ActiveXObject("WScript.Shell");
//var hwnd = shell.HWND; // Get window handle as container
// Create TreeView control (requires COM support, e.g., MSComctlLib)
//var treeView = new ActiveXObject("MSComctlLib.TreeCtrl");
var treeView = Dialog.Control("treeView1");
//treeView.Parent = hwnd;
//treeView.Left = 20;
//treeView.Top = 20;
//treeView.Width = 350;
//treeView.Height = 400;
//treeView.Visible = true;
treeView.LineStyle = 1; // Show connecting lines
treeView.Style = 7; // Enable full-row selection
treeView.HideSelection = false; // Keep selection visible when focus is lost
// Map node IDs to TreeView nodes for quick parent lookup
var nodeMap = {};
// Recursive function to build the tree
function addNodesByParentId(parentId) {
var children = systemFunctions.filter(item => item.parentId === parentId);
children.forEach(item => {
var parentKey = parentId === 0 ? "root" : nodeMap[parentId].Key;
var node = treeView.Nodes.Add(parentKey, 4, "node_" + item.id, item.name);
nodeMap[item.id] = node;
addNodesByParentId(item.id); // Recursively add children
});
}
// Initialize root node
var rootNode = treeView.Nodes.Add();
rootNode.Text = "System Functions";
rootNode.Key = "root";
rootNode.Expanded = true;
// Build the tree
addNodesByParentId(0);
// Handle node clicks
function treeViewClick() {
var selectedNode = treeView.SelectedItem;
if (selectedNode && selectedNode.Key !== "root") {
var functionId = parseInt(selectedNode.Key.replace("node_", ""));
DOpus.Output("Selected Function: " + selectedNode.Text + "\nID: " + functionId);
// Additional logic (e.g., trigger actions based on selection)
}
};
// Keep dialog open for interaction (adjust as needed)
// DOpus.Delay(20000); // Display for 20 seconds
Why This Matters
-
•Better Organization: TreeView would allow users to visualize and navigate nested structures intuitively.
-
•Dynamic Interaction: Combined with DOpus’s event system, it could enable rich user interactions (e.g., expanding/collapsing branches, context menus).
-
•Consistency: Many modern file managers and IDEs use TreeView for hierarchical displays—aligning DOpus with these conventions would improve usability.
Final Thoughts
This is just one potential enhancement, but I believe it would add significant value for power users managing complex workflows. Thank you again for your dedication to making DOpus an exceptional tool—I look forward to seeing how it evolves!![]()