Page 1 of 1

Feature request for VoltageLabel()

Posted: Thu Jan 19, 2023 7:25 pm
by seal58
I've got many trouble during development of my new module.

There are VoltageLabels, that can be edited by user. Any change provides a message in Notify()-Label_Changed. So input data can be processed.

These labels are modified by the code too. And everytime this results in an unwanted notification event.

So I suppose to add the method SetTextNoNotification() to VoltageLabel as it is available in similar manner for VoltageKnob.SetValue(). :idea:

Re: Feature request for VoltageLabel()

Posted: Fri Jan 20, 2023 1:27 am
by UrbanCyborg
+1

Reid

Re: Feature request for VoltageLabel()

Posted: Fri Jan 20, 2023 7:26 am
by honki-bobo
+1, though you can easily workaround this by introducing a boolean to indicate if a notification should be executed or not.

In the variables section, you'd declare

Code: Select all

private boolean notify = true;
Then, in Notify() you'd write something like

Code: Select all

case Label_Changed:
{
	if (component == textLabel1) {
		if (notify) {
			// handle change by user
		} else {
			// handle change by code
			notify = true;
		}
	}
}
break;
And finally, where you change the label text in the code:

Code: Select all

notify = false;
textLabel1.SetText("It wasn't me... the code did this.");