Support underlined text in DialogXML
This commit is contained in:
@@ -162,6 +162,7 @@
|
|||||||
<xs:attribute name="name" type="xs:token"/>
|
<xs:attribute name="name" type="xs:token"/>
|
||||||
<xs:attributeGroup ref="frame"/>
|
<xs:attributeGroup ref="frame"/>
|
||||||
<xs:attributeGroup ref="font"/>
|
<xs:attributeGroup ref="font"/>
|
||||||
|
<xs:attribute name="underline" type="bool"/>
|
||||||
<xs:attribute ref="def-key"/>
|
<xs:attribute ref="def-key"/>
|
||||||
<xs:attribute name="fromlist" default="none" type="xs:string"/>
|
<xs:attribute name="fromlist" default="none" type="xs:string"/>
|
||||||
<xs:attributeGroup ref="rect-size"/>
|
<xs:attributeGroup ref="rect-size"/>
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ bool cTextMsg::parseAttribute(ticpp::Attribute& attr, std::string tagName, std::
|
|||||||
throw xBadVal(tagName, attr.Name(), val, attr.Row(), attr.Column(), fname);
|
throw xBadVal(tagName, attr.Name(), val, attr.Row(), attr.Column(), fname);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
} else if(attr.Name() == "underline") {
|
||||||
|
std::string val = attr.Value();
|
||||||
|
if(val == "true") underlined = true;
|
||||||
|
else if(val == "false") underlined = false;
|
||||||
|
else throw xBadVal(tagName, attr.Name(), val, attr.Row(), attr.Column(), fname);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return cControl::parseAttribute(attr, tagName, fname);
|
return cControl::parseAttribute(attr, tagName, fname);
|
||||||
}
|
}
|
||||||
@@ -120,6 +126,7 @@ void cTextMsg::draw(){
|
|||||||
TextStyle style;
|
TextStyle style;
|
||||||
style.font = textFont;
|
style.font = textFont;
|
||||||
style.pointSize = textSize;
|
style.pointSize = textSize;
|
||||||
|
style.underline = underlined;
|
||||||
drawFrame(2, frameStyle);
|
drawFrame(2, frameStyle);
|
||||||
sf::Color draw_color = color;
|
sf::Color draw_color = color;
|
||||||
if(depressed){
|
if(depressed){
|
||||||
|
|||||||
@@ -52,5 +52,6 @@ private:
|
|||||||
sf::Color color;
|
sf::Color color;
|
||||||
std::vector<boost::optional<std::string>> keyRefs;
|
std::vector<boost::optional<std::string>> keyRefs;
|
||||||
std::string fromList;
|
std::string fromList;
|
||||||
|
bool underlined = false;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ The `<text>` tag accepts the following attributes:
|
|||||||
|
|
||||||
* `framed` - See **Common Attributes** above. Defaults to `false`.
|
* `framed` - See **Common Attributes** above. Defaults to `false`.
|
||||||
* `outline` - See **Common Attributes** above.
|
* `outline` - See **Common Attributes** above.
|
||||||
|
* `underline` - If true, the text will be underlined.
|
||||||
* `fromlist`, `font`, `size`, `color`, `colour`, `def-key` -
|
* `fromlist`, `font`, `size`, `color`, `colour`, `def-key` -
|
||||||
See **Common Attributes** above.
|
See **Common Attributes** above.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user