NIM_Duilib_Framework
NIM_Duilib_Framework copied to clipboard
OptionBox 如果receiver 是全局的一个控件,在设置除第一项之外的其它项selected属性后,无效
<!-- 账号登录、动态密码登录 选项卡 -->
<HBox margin="0,42,0,0" halign="center" height="auto" name="optionHBox" visible="true">
<OptionBox height="auto" cursortype="hand" group="login_opt" name="commonLogin" selected="true">
<Event type="select" receiver="account_tab" applyattribute="selectedid="0"" />
<Event type="unselect" receiver="account_tab" applyattribute="selectedid="1"" />
</OptionBox>
//当设置它为 selected="true" 无效
<OptionBox height="auto" cursortype="hand" group="login_opt" name="verifyLogin" >
<Event type="select" receiver="twoDimension_tab" applyattribute="selectedid="1"" />
<Event type="unselect" receiver="twoDimension_tab" applyattribute="selectedid="0"" />
</OptionBox>
//当设置它为 selected="true" 无效
<OptionBox height="auto" cursortype="hand" group="login_opt" name="towDimensionLogin">
<Event type="select" receiver="dynamic_tab" applyattribute="selectedid="1"" />
<Event type="unselect" receiver="dynamic_tab" applyattribute="selectedid="0"" />
</OptionBox>
</HBox>
<TabBox mouse="false" margin="0,70,0,0" mousechild="false" name="account_tab">
<HBox>
<Box>
<!-- 选中状态 -->
</Box>
<Control />
<Control />
</HBox>
<HBox>
<!-- 未选中状态 -->
</HBox>
</TabBox>
代码中: bool Control::OnApplyAttributeList(const std::wstring& strReceiver, const std::wstring& strList, EventArgs* eventArgs) { Control* pReceiverControl; if (strReceiver.substr(0, 2) == L".\" || strReceiver.substr(0, 2) == L"./") { //当前 pReceiverControl = ((Box*)this)->FindSubControl(strReceiver.substr(2)); } else { pReceiverControl = GetWindow()->FindControl(strReceiver); }
if (pReceiverControl) {
pReceiverControl->ApplyAttributeList(strList);
}
else {
ASSERT(FALSE);
}
return true;
}
pReceiverControl 为空
确实存在这个问题 selected="true"设置后程序运行不起来