IGH_VariableParameterComponent
ReferencesImplement this interface in your component if you want to enable variable parameter UI.
Methods
CanInsertParameter
#This function will get called before an attempt is made to insert a parameter. Since this method is potentially called on Canvas redraws, it must be fast.
Parameters:
| side (GH_ParameterSide) | Parameter side. |
| index (int) | Insertion index of parameter. Index=0 means the parameter will be in the topmost spot. |
Returns: Return True if your component supports a variable parameter at the given location.
CanRemoveParameter
#This function will get called before an attempt is made to remove a parameter. Since this method is potentially called on Canvas redraws, it must be fast.
Parameters:
| side (GH_ParameterSide) | Parameter side. |
| index (int) | Removal index of parameter. |
Returns: Return True if your component supports removing a parameter at the given location.
CreateParameter
#This function will be called when a new parameter is about to be inserted. You must provide a valid parameter or insertion will be skipped. You do not, repeat not, need to insert the parameter yourself.
Parameters:
| side (GH_ParameterSide) | Parameter side. |
| index (int) | Insertion index of parameter. Index=0 means the parameter will be in the topmost spot. |
Returns: A valid IGH_Param instance to be inserted.
DestroyParameter
#This function will be called when a parameter is about to be removed. You do not need to do anything, but this would be a good time to remove any event handlers that might be attached to the parameter in question.
Parameters:
| side (GH_ParameterSide) | Parameter side. |
| index (int) | Removal index of parameter. |
Returns: Return True if the parameter in question can indeed be removed. Note, this is only in emergencies, typically the CanRemoveParameter function should return false if the parameter in question is not removable.
VariableParameterMaintenance
#void VariableParameterMaintenance()
This method will be called when a closely related set of variable parameter operations completes. This would be a good time to ensure all Nicknames and parameter properties are correct. This method will also be called upon IO operations such as Open, Paste, Undo and Redo.