예제 #1
0
MouseEventManager::ConditionStruc MouseEventManager::getCondition (xml::Node node)
{
	const std::string button = node.getAttributeValue("button");
	const std::string modifiers = node.getAttributeValue("modifiers");
	const std::string minSelectionCount = node.getAttributeValue("minSelectionCount");

	ConditionStruc returnValue;

	returnValue.buttonId = getButtonId(button);
	returnValue.modifierFlags = _modifiers.getModifierFlags(modifiers);
	returnValue.minSelectionCount = string::toInt(minSelectionCount, DEFAULT_MIN_SELECTION_COUNT);

	return returnValue;
}
예제 #2
0
MouseEventManager::ConditionStruc MouseEventManager::getCondition(const xml::Node& node)
{
	const std::string button = node.getAttributeValue("button");
	const std::string modifiers = node.getAttributeValue("modifiers");
	const std::string minSelectionCount = node.getAttributeValue("minSelectionCount");

	ConditionStruc returnValue;

	returnValue.buttonId = getButtonId(button);
	returnValue.modifierFlags = _modifiers.getModifierFlags(modifiers);

	try {
		returnValue.minSelectionCount = boost::lexical_cast<int>(minSelectionCount);
	}
	catch (boost::bad_lexical_cast e) {
		returnValue.minSelectionCount = DEFAULT_MIN_SELECTION_COUNT;
	}

	return returnValue;
}
예제 #3
0
/*	ColourScheme Constructor
 *  Builds the colourscheme structure and passes the found <colour> tags to the ColourItem constructor
 *  All the found <colour> items are stored in a vector of ColourItems
 */
ColourScheme::ColourScheme(xml::Node& schemeNode) {
	_readOnly = (schemeNode.getAttributeValue("readonly") == "1");

	// Select all <colour> nodes from the tree
	xml::NodeList colourNodes = schemeNode.getNamedChildren("colour");

	if (colourNodes.size() > 0) {
		// Assign the name of this scheme
		_name = schemeNode.getAttributeValue("name");

		// Cycle through all found colour tags and add them to this scheme
		for (unsigned int i = 0; i < colourNodes.size(); i++) {
			std::string colourName = colourNodes[i].getAttributeValue("name");
			_colours[colourName] = ColourItem(colourNodes[i]);
		}

	}
	else {
		globalOutputStream() << "ColourScheme: No scheme items found.\n";
	}
}
예제 #4
0
void PanedPosition::loadFromNode(xml::Node node) {
	_position = string::toInt(node.getAttributeValue("position"));
}