Forum > LCL
[SOLVED] VST db Click
(1/1)
Pe3s:
Hello, how do I correct the code so that double-clicking works only on child elements?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.VSTDblClick(Sender: TObject);var Data: PData; Node: PVirtualNode;begin Node:= VST.FocusedNode; if Node <> nil then begin Data := VST.GetNodeData(Node); ShellExecute(Handle, 'open', PChar(Data^.Link), nil, nil, SW_SHOW); end;end;
paweld:
You can use the same function as in case setting icons, which is GetNodeLevel.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.VSTDblClick(Sender: TObject);var Data: PData; Node: PVirtualNode;begin Node:= VST.FocusedNode; if (Node <> nil) and (VST.GetNodeLevel(Node) > 0) then begin Data := VST.GetNodeData(Node); ShellExecute(Handle, 'open', PChar(Data^.Link), nil, nil, SW_SHOW); end;end;
Pe3s:
@paweld, Thank you :)
Navigation
[0] Message Index