PDA

View Full Version : SetDisplayText Weirdness


junioreq
11-11-2010, 12:08 AM
Using this code,because Iplug shows "0" instead of "0.0" in the text/caption controls:


GetParam (kWidth)->InitDouble ("Width",1.0,0.0,3.0,0.01,"");
GetParam (kWidth)->SetDisplayText (0.0,"MONO");


Shows "MONO" at any value under 1.0 and when I right click on the control, I get a weird dropdown menu haha for some reason:

http://stash.reaper.fm/oldsb/436090/menu.PNG

Also, I'd use textcontrols, but they only take strings and you cant pass in parameters. And I don't want to be converting sprintf every darn control.


~Rob.

Tale
11-11-2010, 04:10 AM
Any control that has one or more SetDisplayText() labels attached to it will automatically get a drop-down list instead of a text input box. One could probably add a method to override this default behaviour.

junioreq
11-11-2010, 12:26 PM
So, how else do we get it to display "0.0" instead of 0 ?

~Rob.

olilarkin
11-12-2010, 03:05 AM
in Iparam.cpp, change this line in

void IParam::GetDisplayForHost(double value, bool normalized, char* rDisplay)

if (displayValue == 0.0) {
strcpy(rDisplay, "0");
}

RRokkenAudio
11-12-2010, 03:59 AM
aww cool! I was wondering what, "GetDisplayFromHost" was, I couldn't figure out, what the the host would have anything to do with the display of the plugin. Thank you, The terminology is still a bit confusing.



~Rob.