Hi everybody,
I am doing a app that needs the user to insert nodes with a simple clik.
I've modified the mousup event this way:
Original:
cmInsertNode:
begin
try
if (Button = mbLeft) and not (ssDouble in Shift) and not IsRectEmpty(SelectionRect) then InsertNode(@SelectionRect);
Modified:
cmInsertNode:
begin
try
if (Button = mbLeft) and not (ssDouble in Shift) then
begin
if IsRectEmpty(SelectionRect)then SelectionRect := MakeRect(Point(x,y), Point(x+10,y+10));
InsertNode(@SelectionRect)
end;
It's working very well. But when the graph zoom is not 100% the node is not inserted in the point I clik, it seems that x and y need to be calculated ?
Any help ?.
Thanks.
Serg...