Convert create scenario dialogs, reimplement part of the scenario creation process, and allow text edit fields to contain default values in the XML definition.

- Note: This does not mean that scenario creation is now possible, since it relies on scenario saving which is still not implemented.
This commit is contained in:
2014-12-04 22:34:37 -05:00
parent ecd0867b65
commit 4f6ce11dd9
9 changed files with 233 additions and 214 deletions

View File

@@ -702,6 +702,20 @@ template<> pair<string,cTextField*> cDialog::parse(Element& who /*field*/){
frame.right = frame.left + width;
frame.bottom = frame.top + height;
p.second->setBounds(frame);
string content;
for(node = node.begin(&who); node != node.end(); node++){
string val;
int type = node->Type();
node->GetValue(&val);
if(type == TiXmlNode::TEXT)
// TODO: One small problem with this: newlines should be replaced by a space instead of being removed altogether. Or something like that.
copy_if(val.begin(), val.end(), std::inserter(content, content.end()), isAllowableCharacter);
else{
val = '<' + val + '>';
throw xBadVal("text","<content>",val,node->Row(),node->Column(),fname);
}
}
p.second->setText(content);
if(p.first == ""){
do{
p.first = generateRandomString();