Skip to content

Linking Inputs

Michael Wolf edited this page Mar 7, 2018 · 2 revisions

Sometimes you want two inputs to drive the same value:

...
LINKP_Instance, otherInput,
...

Example:

Adding a colour wheel control and two sliders coupled with the hue and saturation sliders.

mInputs[0] = AddInput("Hue", "WheelHue",
	LINKID_DataType, CLSID_DataType_Number,
	INPID_InputControl, COLORWHEELCONTROL_ID,
	IC_ControlGroup, grpID,
	IC_ControlID, COLORWHEELCONTROL_HUE,
	TAG_DONE);
mInputs[1] = AddInput("Saturation", "WheelSaturation",
	LINKID_DataType, CLSID_DataType_Number,
	INPID_InputControl, COLORWHEELCONTROL_ID,
	IC_ControlGroup, grpID,
	IC_ControlID, COLORWHEELCONTROL_SATURATION,
	INP_Default, 1.0,
	TAG_DONE);
mInputs[2] = AddInput("Tint Angle", "WheelAngle",
	LINKID_DataType, CLSID_DataType_Number,
	INPID_InputControl, COLORWHEELCONTROL_ID,
	IC_ControlGroup, grpID,
	IC_ControlID, COLORWHEELCONTROL_TINTANGLE,
	TAG_DONE);
mInputs[3] = op.AddInput("Tint Length", "WheelLength",
	LINKID_DataType, CLSID_DataType_Number,
	INPID_InputControl, COLORWHEELCONTROL_ID,
	TAG_DONE);

mInputs[4] = AddInput("Hue", "Hue",
	LINKID_DataType, CLSID_DataType_Number,
	INPID_InputControl, SLIDERCONTROL_ID,
	INP_MinAllowed, -1.0,
	INP_MaxAllowed, 1.0,
	INP_Default, 0.0,
	LINKP_Instance, mInputs[0],
	TAG_DONE);
mInputs[5] = AddInput("Saturation", "Saturation",
	LINKID_DataType, CLSID_DataType_Number,
	INPID_InputControl, SLIDERCONTROL_ID,
	INP_MinAllowed, 0.0,
	INP_MaxAllowed, 2.0,
	INP_Default, 1.0,
	LINKP_Instance, mInputs[1],
	TAG_DONE);
Clone this wiki locally