Hi, I have a FNCTreeView with various InplaceEditors.
For one of the inplaceeditors, which is a custom descendant of TNumberBox, i want to use the OnChangeValue event.
My challenge is that i need to access properties of the TreeViewNode containing the inplaceeditor, but when the event is fired the parent and owner property of sender is the TreeView, not the node.
How can i access/find the corresponding node in the event handler?
Code excerpt:
//Editor constructor
constructor TNumberBoxTP.Create(AOwner:TComponent);
begin
inherited create(AOwner); //Owner is the tree
with self do begin
OnChangeValue:=TDetailTree(AOwner).onTPChange;
end;
end;
//event handler
procedure TDetailTree.onTPChange(Sender: TObject);
begin
showMessage(TComponent(sender).GetParentComponent.ClassName); //Finds Tree
showMessage(TComponent(sender).Owner.ClassName); //Finds Tree
end;