Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom editor help #14

Open
midikidi opened this issue Feb 22, 2021 · 6 comments
Open

Custom editor help #14

midikidi opened this issue Feb 22, 2021 · 6 comments

Comments

@midikidi
Copy link

Fantastic project thankyou for sharing your code)
please help me .

PVE4 FE NODE EDIOR (screen shot)
Example parameter module shows
a slider and a combo box how can this be acheived
or otjer multiple components
is it possible for an example
how to change code below ?

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

@komorra
Copy link
Owner

komorra commented Feb 27, 2021

If I understood you correctly, do you mean to change that code you've posted for usage of slider or combo box? for example to read value of slider in the node body?

@midikidi
Copy link
Author

I have created custom combo box, list box,text box,checkbox and trackbar no problem. I can read and write to these custom nodes.
But I saw in a screenshot of PVE4 FE NODE EDITOR you created a node with 2 custom controls, I want to create a custom node with a combo box and a trackbar together in same node
example

@komorra
Copy link
Owner

komorra commented Feb 28, 2021

Ah I see. Well, to do this, you must first create a custom user control in winforms that is empty (let's name it MyCustomControl for now). Now you must insert into MyCustomControl one trackbar and one combobox in the places that fits your needs, and add custom code to retrieving or setting their values in MyCustomControl. The final step, when MyCustomControl is finished and working, is to use it as a custom editor for node. This is exactly what I'm doing on screenshot. Hope this helps.

@midikidi
Copy link
Author

midikidi commented Mar 3, 2021

Great got it sorted 3 controls in a user defined form and getting values just need to implement set. there is a minor issue if i load my custom node it appears ok, I have matched the background color but if i click on the orange bar at the top of the node the whole node is not repainted
loaded box
clicked on node orange bar

@midikidi
Copy link
Author

midikidi commented Mar 3, 2021

Im curious I work with Devexpress for winforms I will see if those components work

@midikidi
Copy link
Author

midikidi commented Mar 6, 2021

Problem resolved made user form transparent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants