Thanks again, David!
I’ve changed my custom component attribute’s AppendToAttributeTree
like so:
public override void AppendToAttributeTree(List<IGH_Attributes> attributes)
{
List<IGH_Attributes> foo = new List<IGH_Attributes>();
base.AppendToAttributeTree(foo);
foo.Reverse();
attributes.AddRange(foo);
}
No I’m stuck with the annoying side-effects you mentioned
I’m able to handle mouse events on the component even if the end up on the parameters. For example, in my component attribute’s RespondToMouseDoubleClick
– which I would like to customize – I do
for (int i = 0; i < comp.Params.Input.Count; i++)
{
if (comp.Params.Input[i].Attributes.Bounds.Contains(e.CanvasLocation))
{
// TODO: Paint small menu on top of paramter...
}
}
However, I’m experiencing the problem that all other mouse events (up, down, move) do not get passed on to the underlying parameters. In RespondToMouseDown
I do:
for (int i = 0; i < comp.Params.Input.Count; i++)
{
if (comp.Params.Input[i].Attributes.Bounds.Contains(e.CanvasLocation))
{
// Pass the event to the parameter.
return GH_ObjectResponse.Ignore;
}
}
I thought that simply returning GH_ObjectResponse.Ignore
in the component attributes would cause the mouse event to be passed on to the next item in the attributes tree – which are the parameters.
I’ve also tried calling comp.Params.Output[i].Attributes.RespondToMouseDown(sender, e);
directly from the component’s mouse event handler, but that didn’t work either and also feels a little hacky.
If I modify the component’s isPickRegion
to return false
if the mouse is on one of the parameters the mouse events get handled by the parameters, but then of course I cannot catch my double click anymore
Any suggestions are greatly apprechiated!
Best and thanks again,
Paul