PDA

View Full Version : Math in caption control


junioreq
12-12-2009, 09:37 AM
Ok, what I have is 3 buttons, one is lp freq one is hp freq and one is a control that will move them both by a certain number left or right.

I want to update the lp and hp frequency caption controls when I move this "link" 3rd button.

So say i have hp at 50 and lp at 5000, I move the link knob and it goes to 60 and 5010.

How do i update the caption control for hp and lp?



double frequencydisplay = kband1freq + linkfreq;
pGraphics->AttachControl(new ICaptionControl(this, &IRECT(298, 8, 298, 8), frequencydisplay , &IText(&COLOR_WHITE), true));

That does not work. Should I put the caption controls inside the process loop for updating??? If i try the above code, i just get 1.o displaying in the caption.

EDIT: Just remembered reading that caption controls can only contain Values from a control... So what do i use now? instead of caption?

~Rob.

cc_
12-13-2009, 02:02 AM
Take a look at the example in this thread:
http://forum.cockos.com/showthread.php?t=45686

What you are trying to do sounds similar to the nudge button there, although you could easily adapt it to use a knob to control two other knobs in some way.