Feature request for VoltageLabel()

Post Reply
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Feature request for VoltageLabel()

Post 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:
UrbanCyborg
Posts: 625
Joined: Mon Nov 15, 2021 9:23 pm

Re: Feature request for VoltageLabel()

Post by UrbanCyborg »

+1

Reid
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
honki-bobo
Posts: 310
Joined: Sat Nov 09, 2019 1:18 pm

Re: Feature request for VoltageLabel()

Post 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.");
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
Post Reply

Return to “Module Designer”