本文整理汇总了C++中CControlUI::GetUserData方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlUI::GetUserData方法的具体用法?C++ CControlUI::GetUserData怎么用?C++ CControlUI::GetUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlUI
的用法示例。
在下文中一共展示了CControlUI::GetUserData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClick
void PropertyWin::OnClick(TNotifyUI& msg)
{
CControlUI* pUI = msg.pSender;
if(!pUI)
return ;
if (pUI->IsName(_T("close")))
{
Close(IDCANCEL);
}
else if (pUI->IsName(_T("ok")))
{
Close(IDOK);
}
else if (pUI->IsName(_T("file_pos")))
{
theMainWin->OnOpenFolderPath(pUI->GetUserData());
}
}
示例2: OnMenu_ZoomRatio
// “显示比例”菜单
void CMainWindow::OnMenu_ZoomRatio(TNotifyUI& msg)
{
CControlUI * pControl = (CControlUI *)msg.lParam;
tstring strMenuName = (TCHAR *)(LPCTSTR)pControl->GetUserData();
if (strMenuName == _T("Menu_ZoomRatio_400"))
m_pRecvEdit->SetZoom(16, 4);
else if (strMenuName == _T("Menu_ZoomRatio_200"))
m_pRecvEdit->SetZoom(8, 4);
else if (strMenuName == _T("Menu_ZoomRatio_150"))
m_pRecvEdit->SetZoom(6, 4);
else if (strMenuName == _T("Menu_ZoomRatio_125"))
m_pRecvEdit->SetZoom(5, 4);
else if (strMenuName == _T("Menu_ZoomRatio_100"))
m_pRecvEdit->SetZoom(0, 0);
else if (strMenuName == _T("Menu_ZoomRatio_75"))
m_pRecvEdit->SetZoom(3, 4);
else if (strMenuName == _T("Menu_ZoomRatio_50"))
m_pRecvEdit->SetZoom(1, 2);
else
return;
m_strCheckMenu = strMenuName;
}
示例3: Notify
void CMainWindow::Notify(TNotifyUI& msg)
{
if (msg.sType == _T("click"))
{
if (msg.pSender == m_pMinSysBtn)
OnBtn_Min(msg);
else if (msg.pSender == m_pMaxSysBtn)
OnBtn_Max(msg);
else if (msg.pSender == m_pRestoreSysBtn)
OnBtn_Restore(msg);
else if (msg.pSender == m_pCloseSysBtn)
OnBtn_Close(msg);
else if (msg.pSender == m_pCloseBtn)
OnBtn_Close(msg);
else if (msg.pSender == m_pBoldBtn)
OnBtn_Bold(msg);
else if (msg.pSender == m_pItalicBtn)
OnBtn_Italic(msg);
else if (msg.pSender == m_pUnderLineBtn)
OnBtn_UnderLine(msg);
else if (msg.pSender == m_pColorBtn)
OnBtn_Color(msg);
else if (msg.pSender == m_pSendBtn)
OnBtn_Send(msg);
else if (msg.pSender == m_pFontBtn)
OnBtn_Font(msg);
else if (msg.pSender == m_pFaceBtn)
OnBtn_Face(msg);
else if (msg.pSender == m_pImageBtn)
OnBtn_Image(msg);
}
else if (msg.sType == _T("itemselect"))
{
if (msg.pSender == m_pFontNameCombo)
OnCbo_SelChange_FontName(msg);
else if (msg.pSender == m_pFontSizeCombo)
OnCbo_SelChange_FontSize(msg);
}
else if (msg.sType == _T("timer"))
OnTimer(msg);
else if (msg.sType == _T("menu_msg"))
{
CControlUI * pControl = (CControlUI *)msg.lParam;
tstring strMenuName = (TCHAR *)(LPCTSTR)pControl->GetUserData();
if (strMenuName == _T("Menu_Cut"))
OnMenu_Cut(msg);
else if (strMenuName == _T("Menu_Copy"))
OnMenu_Copy(msg);
else if (strMenuName == _T("Menu_Paste"))
OnMenu_Paste(msg);
else if (strMenuName == _T("Menu_SelAll"))
OnMenu_SelAll(msg);
else if (strMenuName == _T("Menu_Clear"))
OnMenu_Clear(msg);
else if (strMenuName == _T("Menu_ZoomRatio_400")
|| strMenuName == _T("Menu_ZoomRatio_200")
|| strMenuName == _T("Menu_ZoomRatio_150")
|| strMenuName == _T("Menu_ZoomRatio_125")
|| strMenuName == _T("Menu_ZoomRatio_100")
|| strMenuName == _T("Menu_ZoomRatio_75")
|| strMenuName == _T("Menu_ZoomRatio_50"))
OnMenu_ZoomRatio(msg);
else if (strMenuName == _T("Menu_SaveAs"))
OnMenu_SaveAs(msg);
}
}
示例4: _AddToGroupMemberList
void CreateDiscussionGrpDialog::_AddToGroupMemberList(std::string sid)
{
if (sid.empty())
{
return;
}
//确认没有重复的项
for (int n = 0; n < m_pListGroupMembers->GetCount();n++)
{
CControlUI* pItem = m_pListGroupMembers->GetItemAt(n);
if (pItem)
{
CString strId = pItem->GetUserData();
if (!strId.IsEmpty())
{
std::string sId = util::cStringToString(strId);
if (sId == sid)
{
return;
}
}
}
}
//插入ITEM
module::UserInfoEntity userInfo;
if (!module::getUserListModule()->getUserInfoBySId(sid, userInfo))
{
LOG__(DEBG, _T("can't find the userInfo:%s"), util::stringToCString(sid));
return;
}
CDialogBuilder dlgBuilder;
CListContainerElementUI* pListElement = (CListContainerElementUI*)dlgBuilder.Create(_T("CreateDiscussionGrpDialog\\ListGroupMembersItem.xml"), (UINT)0, NULL, &m_PaintManager);
if (!pListElement)
{
LOG__(ERR, _T("群item创建失败"));
return;
}
CControlUI* pLogo = static_cast<CControlUI*>(pListElement->FindSubControl(_T("AvatarInfo")));
if (!pLogo)
{
return;
}
pLogo->SetBkImage(util::stringToCString(userInfo.getAvatarPath()));
CLabelUI* pNameLable = static_cast<CLabelUI*>(pListElement->FindSubControl(_T("nickname")));
if (!pNameLable)
{
return;
}
pNameLable->SetText(userInfo.getRealName());
CButtonUI* pRemoveBtn = static_cast<CButtonUI*>(pListElement->FindSubControl(_T("removebtn")));
if (pRemoveBtn)
{
//点击删除按钮的时候根据这个来判断是哪个项
pRemoveBtn->SetTag(UINT_PTR(pListElement));
}
if (module::getSysConfigModule()->userID() == userInfo.sId)//自己不能删除
{
pRemoveBtn->SetVisible(false);
}
pListElement->SetUserData(util::stringToCString(userInfo.sId));
m_pListGroupMembers->Add(pListElement);
}
示例5: OnClick
void CreateDiscussionGrpDialog::OnClick(TNotifyUI& msg)
{
__super::OnClick(msg);
if (0 == _tcsicmp(msg.pSender->GetName(), _T("okbtn"))
&& m_pListCreatFrom && m_pListGroupMembers)
{
CDuiString groupName = m_editGroupName->GetText();
if (groupName.IsEmpty())
{
m_TextErrorTip->SetText(util::getMultilingual()->getStringById(
_T("STRID_CREATEDISCUSSIONGRPDIALOG_ERROR_EMPTY_GROUPNAME")));
return;
}
if (m_pListGroupMembers->GetCount() < 2)
{
m_TextErrorTip->SetText(util::getMultilingual()->getStringById(
_T("STRID_CREATEDISCUSSIONGRPDIALOG_ERROR_COUNT")));
return;
}
std::vector<std::string> vecMembers;
for (int n = 0; n < m_pListGroupMembers->GetCount(); ++n)
{
CControlUI* pItem = m_pListGroupMembers->GetItemAt(n);
if (pItem)
{
CString strID = pItem->GetUserData();
vecMembers.push_back(util::cStringToString(strID));
}
}
std::string strGroupName = util::cStringToString(CString(groupName));
imcore::IMLibCoreStartOperationWithLambda( //创建讨论组
[=]()
{
IM::Group::IMGroupCreateReq imGroupCreateReq;
imGroupCreateReq.set_user_id(module::getSysConfigModule()->userId());
imGroupCreateReq.set_group_type(IM::BaseDefine::GroupType::GROUP_TYPE_TMP);
imGroupCreateReq.set_group_name(strGroupName);
imGroupCreateReq.set_group_avatar(std::string(""));//群头像先不传
for (auto sid : vecMembers)
{
imGroupCreateReq.add_member_id_list(util::stringToInt32(sid));
}
module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::DFFX_SID_GROUP
, IM::BaseDefine::GroupCmdID::DFFX_CID_GROUP_CREATE_REQUEST
, &imGroupCreateReq);
}
);
Close(IDCANCEL);
}
else if (0 == _tcsicmp(msg.pSender->GetName(), _T("removebtn")))
{
CListContainerElementUI* pListElement = reinterpret_cast<CListContainerElementUI*>(msg.pSender->GetTag());
if (pListElement)
{
m_pListGroupMembers->Remove(pListElement);
_refreshUIAddedNum();
}
}
}
示例6: OnOK
void CSettingDlg::OnOK()
{
int nWriteFlag = 0;
bool bNeedRestart = false;
bool bAvatarChanged = false;
Config* pCfg = Singleton<Config>::getInstance();
// 个人设置
if (m_bPersonalChange)
{
CDuiString strNickName = m_pEditNickName->GetText();
if (_tcscmp(strNickName, pCfg->szNickName) != 0) {
_tcsncpy(pCfg->szNickName, strNickName, MAX_NAMEBUF - 1);
nWriteFlag |= CONFIG_PERSONAL;
}
CDuiString strGroupName = m_pEditGroupName->GetText();
if (_tcscmp(strGroupName, pCfg->szGroupName) != 0) {
_tcsncpy(pCfg->szGroupName, strGroupName, MAX_NAMEBUF - 1);
nWriteFlag |= CONFIG_PERSONAL;
}
CDuiString strAvatarPath = m_pLabelAvatar->GetUserData();
if (_tcscmp(strAvatarPath, pCfg->szAvatar) != 0)
{
_tcsncpy(pCfg->szAvatar, strAvatarPath, MAX_PATH - 1);
nWriteFlag |= CONFIG_PERSONAL;
bAvatarChanged = true;
}
}
// 网络设置
if (m_bNetworkChange)
{
CControlUI* pControl = m_pComboAdapter->GetItemAt(m_pComboAdapter->GetCurSel());
CDuiString strAdapterName = pControl->GetUserData();
if (_tcscmp(strAdapterName, pCfg->szAdapterNameUse) != 0) {
_tcsncpy(pCfg->szAdapterNameUse, strAdapterName, MAX_PATH - 1);
bNeedRestart = true;
nWriteFlag |= CONFIG_NETWORK;
}
}
if (nWriteFlag != 0) {
pCfg->WriteConfig(nWriteFlag);
}
CMainDlg* pMainDlg = Singleton<CMainDlg>::getInstance();
if (m_bPersonalChange || m_bNetworkChange)
{
pMainDlg->UpdateInfo();
}
if (bNeedRestart)
{
::MessageBox(NULL, _T("需要重启程序"), _T("提示"), MB_OK);
pMainDlg->RestartApplication();
}
if (m_bPersonalChange)
{
pMainDlg->BroadcastEntry();
}
if (bAvatarChanged)
{
pMainDlg->BroadcastMsg(IM_ANSAVATAR, ::PathFindFileNameA(pCfg->szAvatar));
}
Close();
}