Exemplo n.º 1
0
ofxOscilloscope::ofxOscilloscope(ofPoint min, ofPoint max, ofTrueTypeFont legendFont,
	int legendWidth, ofColor outlineColor, ofColor zeroLineColor, ofColor backgroundColor,
	float plotLineWidth, float outlineWidth) {
	_min = min;
	_max = max;
	_legendWidth = legendWidth;

	// Create scopePlot
	min.x = min.x + _legendWidth;
	_scopePlot = ofxScopePlot(min, max, zeroLineColor, plotLineWidth);


	setBackgroundColor(backgroundColor);
	setOutlineColor(outlineColor);
	setOutlineWidth(outlineWidth);

	if(legendFont.isLoaded()) {
		setLegendFont(legendFont);
	} else {
		_legendFont.loadFont("verdana.ttf", 12, true, true);
			//_legendFont.setLineHeight(18.0f);
		//_legendFont.setLetterSpacing(1.037);
		//ofTrueTypeFont::setGlobalDpi(72);
	}

	// Default values
	_legendPadding = 10;
	_textSpacer = 20;
}
Exemplo n.º 2
0
void LegendItem::applyDefaults() {
  _auto = dialogDefaults().value(defaultsGroupName()+"/auto",true).toBool();

  _color = dialogDefaults().value(defaultsGroupName()+"/color",QColor(Qt::black)).value<QColor>();

  QFont font;
  font.fromString(dialogDefaults().value(defaultsGroupName()+"/font",font.toString()).toString());
  setLegendFont(font);

  setFontScale(dialogDefaults().value(defaultsGroupName()+"/fontScale", 12.0).toDouble());
  _verticalDisplay = dialogDefaults().value(defaultsGroupName()+"/verticalDisplay",true).toBool();
}
Exemplo n.º 3
0
void LegendItem::setFont(const QFont &f, const QColor &c) {
  setLegendColor(c);
  setLegendFont(f);
  setFontScale(f.pointSize());
}