Refactor dialog parsing to reduce code duplication

- Refactor dialog format parameter management to use a single protected control function
- Format parameters "frame" and "frame style" merged
- Colour is now a first-class format parameter (though it still has a separate setter)
This commit is contained in:
2020-02-20 23:41:40 -05:00
parent 3c748ca071
commit 12bde373b1
20 changed files with 805 additions and 980 deletions

View File

@@ -37,12 +37,11 @@ class cStack : public cContainer {
std::vector<std::map<std::string,storage_t>> storage;
std::map<std::string,cControl*> controls;
bool drawFramed = false;
bool manageFormat(eFormat prop, bool set, boost::any* val) override;
public:
std::string parse(ticpp::Element& who, std::string fname) override;
void setFormat(eFormat prop, short val) override;
short getFormat(eFormat prop) override;
void setColour(sf::Color clr) override;
sf::Color getColour() override;
bool parseAttribute(ticpp::Attribute& attr, std::string tagName, std::string fname) override;
bool parseContent(ticpp::Node& content, int n, std::string tagName, std::string fname, std::string& text) override;
void validatePostParse(ticpp::Element& who, std::string fname, const std::set<std::string>& attrs, const std::multiset<std::string>& nodes) override;
bool isClickable() override;
bool isFocusable() override;
bool isScrollable() override;