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; }
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; }