本文整理汇总了C++中CEditUI::GetClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CEditUI::GetClass方法的具体用法?C++ CEditUI::GetClass怎么用?C++ CEditUI::GetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEditUI
的用法示例。
在下文中一共展示了CEditUI::GetClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoApplyData
void RedisConfigUI::DoApplyData()
{
CEditUI exampleEditUI;
CComboUI exampleComboUI;
RedisClient::TDicConfig::const_iterator it = m_dicConfig.begin();
RedisClient::TDicConfig::const_iterator itend = m_dicConfig.end();
RedisClient::TDicConfig config;
for ( ; it!=itend; ++it)
{
CDuiString name = _T("redisconfig_");
CDuiString key = CharacterSet::ANSIToUnicode(it->first).c_str();
name.Append(key);
CControlUI* pCtl = GetPaintMgr()->FindControl(name);
string val ;
if (pCtl->GetClass() == exampleEditUI.GetClass())
{
CEditUI* pEdit = static_cast<CEditUI*> (pCtl);
val = CharacterSet::UnicodeToANSI(pEdit->GetText().GetData());
}
else if (pCtl->GetClass() == exampleComboUI.GetClass())
{
CComboUI* pCombo = static_cast<CComboUI*> (pCtl);
int idx = pCombo->GetCurSel();
if (it->first == "loglevel")
{
if (idx == 0) val = "debug";
else if (idx == 1) val = "verbose";
else if (idx == 2) val = "notice";
else if (idx == 3) val = "warning";
}
else
{
if (idx == 0) val = "yes";
else if (idx == 1) val = "no";
}
}
if (val != it->second)
{
config.insert(std::make_pair(it->first, val));
}
}
if (SetConfig(config) && GetConfig())
{
DoFillData();
}
}
示例2: DoFillData
void RedisConfigUI::DoFillData()
{
CEditUI exampleEditUI;
CComboUI exampleComboUI;
RedisClient::TDicConfig::const_iterator it = m_dicConfig.begin();
RedisClient::TDicConfig::const_iterator itend = m_dicConfig.end();
for ( ; it!=itend; ++it)
{
CDuiString name = _T("redisconfig_");
CDuiString key = Base::CharacterSet::ANSIToUnicode(it->first).c_str();
CDuiString val = Base::CharacterSet::ANSIToUnicode(it->second).c_str();
name.Append(key);
CControlUI* pCtl = GetPaintMgr()->FindControl(name);
/// xml中未配置该项
if (pCtl == NULL) continue;
if (pCtl->GetClass() == exampleEditUI.GetClass())
{
CEditUI* pEdit = static_cast<CEditUI*> (pCtl);
pEdit->SetText(val);
}
else if (pCtl->GetClass() == exampleComboUI.GetClass())
{
CComboUI* pCombo = static_cast<CComboUI*> (pCtl);
int idx = 0;
if (val == _T("yes")) idx = 0;
else if (val == _T("no")) idx = 1;
else if (it->first == "loglevel")
{
string loglevel = it->second;
if (loglevel == "debug") idx = 0;
else if (loglevel == "verbose") idx = 1;
else if (loglevel == "notice") idx = 2;
else if (loglevel == "warning") idx = 3;
}
pCombo->SetInternVisible(true);
pCombo->SelectItem(idx);
pCombo->SetFocus();
}
}
}