Exemple #1
0
GText::GText(std::string content, sf::Font * font, STYLE style, float x, float y)
: /*sf::Text(), */_font(font) {
    setString(content);
    setFont(*_font);
    setPosition(x, y);
    resetStyle(style);
}
Exemple #2
0
/**
 * Resets the style to use the default properties.
 * @param  node The style node to reset
 */
void LexerStyleModel::resetStyle(Node* node)
{
	StyleData* data = static_cast<StyleData*>(node->data());
	QsciLexer* lexer = data->lexer_;
	int style = data->style_;

	for (uint i = 0; i != _LastProperty; i++) {
		StyleProperty prop = static_cast<StyleProperty>(i);
		setProperty(QVariant(), node, prop,
		            propertyDefaultValue(lexer, style, prop));
	}

	// Recursive call.
	for (int i = 0; i < node->childCount(); i++)
		resetStyle(node->child(i));
}
Exemple #3
0
/**
 * Restores the default styles.
 */
void LexerStyleModel::resetStyles()
{
	resetStyle(root_.child(0));
	reset();
}