How do you group or identify which instance of a repeated object (pushbutton or slider) has been changed?

64 views
asked Jan 12 in GUI Development by tcbeaton

I am creating a DMX lighting controller with multiple sliders and pushbuttons, each an instance of the same object. When a slider or button state changes, the same DMX messages get sent from the application, with the only difference being the channel number which is affected. Is there a way to combine the objects into an array, so they share common code for their events and can be identified with an offset index?

Thanks for any assistance, and sorry if this is a simple question, I'm new to Embedded Wizard.

Below is a screenshot of the current interface GUI to give some context to my question.

Thanks,

--Tom

1 Answer

0 votes
answered Jan 13 by Manfred Schweyer

Hi Tom,

welcome to the forum!

I assume that your application is based on the widgets using the customized steel appearance (e.g. based on the example WidgetsDemo).

As you probably know, each slider can be combined with a data provider by using the Outlet property. This makes it possible that each slider shows always the actual value of a certain property and that the property is always updated when the slider is changed by the user. By using this infrastructure, every slider can be connected to its own data value.

Now, when you want to have one location where you update the hardware, you can implement a slot method (e.g. DmxUpdateSlot) and connect all sliders OnChange slot method with this single DmxUpdateSlot method. Then, your DmxUpdateSlot method will be called when one of the sliders is moved.

If you want to determine the slider that has changed its value, you can evaluate the sender within the slot method.

Does this answer your question?

Best regards,

Manfred.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...