Skip to content

Commit

Permalink
Add XML Class node to support XML attribute definition control attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
smallevilbeast committed Jun 6, 2019
1 parent 11dbe93 commit e817180
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tool_kits/duilib/Core/WindowBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit e817180

Please sign in to comment.