Merge pull request #40 from lovesnow/development

Add XML Class node to support XML attribute definition control attribute
This commit is contained in:
Dylan 2019-06-06 17:35:32 +08:00 committed by GitHub
commit 452bc14706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,10 +235,15 @@ Box* WindowBuilder::Create(CreateControlCallback pCallback, Window* pManager, Bo
strClassName = strValue;
}
else if( strName == _T("value") ) {
strAttribute = strValue;
strAttribute.append(strValue);
}
else {
strAttribute.append(StringHelper::Printf(L" %s=\"%s\"",
strName.c_str(), strValue.c_str()));
}
}
if( !strClassName.empty() ) {
StringHelper::TrimLeft(strAttribute);
GlobalManager::AddClass(strClassName, strAttribute);
}
}
@ -277,11 +282,16 @@ Box* WindowBuilder::Create(CreateControlCallback pCallback, Window* pManager, Bo
strClassName = strValue;
}
else if( strName == _T("value") ) {
strAttribute = strValue;
strAttribute.append(strValue);
}
else {
strAttribute.append(StringHelper::Printf(L" %s=\"%s\"",
strName.c_str(), strValue.c_str()));
}
}
if( !strClassName.empty() ) {
ASSERT( GlobalManager::GetClassAttributes(strClassName).empty() ); //窗口中的Class不能与全局的重名
StringHelper::TrimLeft(strAttribute);
pManager->AddClass(strClassName, strAttribute);
}
}