



I am using a custom class that extends CTextButton using this DRAW function override function posted below. In mac this is centred in the middle but is cutoff in the windows iteration. Is there something I am not implementing or is this something I need to do mysellf using IF WIN?Â
Thanks in advanced if anyone knows!Â
void MeterLabel::draw(CDrawContext* context)
{
bool highlight = value > 0.5 ? true : false;
context->setDrawMode(kAntiAliasing);
context->setLineWidth(frameWidth);
//PD-Hold-S
if (maxHold == true)
{
if ((getValue()) > getMaxPeak())
{
setMaxPeak(getValue());
}
}
else
{
setMaxPeak(getValue());
}
//PD-Hold-S
//--- convert to dB
float yt = 20 * log10(getMaxPeak() * 100);
//--- perform 00.00 String instead of 00.00000000000
std::stringstream stream;
stream << std::fixed << std::setprecision(1) << yt;
s = stream.str();
if (getMaxPeak()*100.0 < 0.001)
{
s = "-INF";
}
CRect r = (getViewSize()); //declares a rectangle the size of the view
CBitmap* iconToDraw = highlight ? (iconHighlighted ? iconHighlighted : icon) : (icon ? icon : iconHighlighted);
CDrawMethods::drawIconAndText(context, iconToDraw, iconPosition, getTextAlignment(), getTextMargin(), r, s, getFont(), highlight ? getTextColorHighlighted() : getTextColor());
setDirty(false);
}
Most Users Ever Online: 152
Currently Online:
9 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Chaes: 56
Skyler: 48
StevieD: 46
Derek: 46
Frodson: 45
Peter: 43
TheSmile: 43
Nickolai: 43
clau_ste: 39
jeanlecode: 37
Member Stats:
Guest Posters: 1
Members: 768
Moderators: 1
Admins: 6
Forum Stats:
Groups: 13
Forums: 42
Topics: 842
Posts: 3347
Moderators: W Pirkle: 689