NodeEditorWinforms icon indicating copy to clipboard operation
NodeEditorWinforms copied to clipboard

Great job....but how to....

Open nicolad76 opened this issue 8 years ago • 1 comments

Hi, really love what you did...but I need some guidance on how to develop nodes with complex logic. For instance I would like to make a node that takes an INT as input and it output TRUE/FALSE is the value is above a set number. The number must be entered in a text box on the node. How do I add the text box or other components to a node?

Thx!!!

nicolad76 avatar Oct 12 '17 09:10 nicolad76

The feature (referencing custom editors of nodes) was added by commit bffbe6d028745767b5e159de645db414f81d0d90 . If I understand you correctly this could be done via the following node code in your context class:

[Node("IsGreater",customEditor:typeof(NumericUpDown))]
public void IsGreater(int input, out bool output)
{
    var userThreshold = (int)(CurrentProcessingNode.CustomEditor as NumericUpDown).Value;
    output = input > userThreshold;
}

The final effect is shown in the image below: image

komorra avatar Jan 24 '21 22:01 komorra