本文整理汇总了C++中CButtonUI类的典型用法代码示例。如果您正苦于以下问题:C++ CButtonUI类的具体用法?C++ CButtonUI怎么用?C++ CButtonUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CButtonUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG__
void SessionLayout::_AddGroupMemberToList(IN const std::string& sID, IN const BOOL bCreator)
{
module::UserInfoEntity userInfo;
if (!module::getUserListModule()->getUserInfoBySId(sID, userInfo))
{
LOG__(ERR, _T("can't find the userInfo:%s,GroupId:%s"),util::stringToCString(sID),util::stringToCString(m_sId));
return;
}
CDialogBuilder dlgBuilder;
CListContainerElementUI* pListElement = (CListContainerElementUI*)dlgBuilder.Create(_T("SessionDialog\\groupMembersListItem.xml"), (UINT)0, NULL, &m_paint_manager);
if (!pListElement)
{
LOG__(ERR, _T("群item创建失败"));
return;
}
CButtonUI* pLogo = static_cast<CButtonUI*>(pListElement->FindSubControl(_T("AvatarInfo")));
PTR_VOID(pLogo);
pLogo->SetBkImage(util::stringToCString(userInfo.getAvatarPath()));
if (bCreator)
{
CButtonUI* pCreator = static_cast<CButtonUI*>(pListElement->FindSubControl(_T("Creator")));
PTR_VOID(pCreator);
pCreator->SetVisible(true);
pCreator->SetUserData(_T("Creator"));
}
CLabelUI* pNameLable = static_cast<CLabelUI*>(pListElement->FindSubControl(_T("nickname")));
PTR_VOID(pNameLable);
pNameLable->SetText(userInfo.getRealName());
pListElement->SetUserData(util::stringToCString(userInfo.sId));
m_pGroupMemberList->Add(pListElement);
}
示例2: APP_LOG
void SessionLayout::_AddGroupMemberToList(IN const std::string& sID)
{
module::UserInfoEntity userInfo;
if (!module::getUserListModule()->getUserInfoBySId(sID, userInfo))
{
APP_LOG(LOG_ERROR, _T("SessionLayout::_updateGroupMembersList(),can't find the userInfo"));
return;
}
CDialogBuilder dlgBuilder;
CListContainerElementUI* pListElement = (CListContainerElementUI*)dlgBuilder.Create(_T("SessionDialog\\groupMembersListItem.xml"), (UINT)0, NULL, &m_paint_manager);
if (!pListElement)
{
APP_LOG(LOG_ERROR, _T("群item创建失败"));
return;
}
CButtonUI* pLogo = static_cast<CButtonUI*>(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());
pListElement->SetUserData(util::stringToCString(userInfo.sId));
m_pGroupMemberList->Add(pListElement);
}
示例3: Hot
bool CMusicListItemUI::Hot(bool bHot)
{
if( !IsEnabled()) return false;
if (m_pMusicListHotTab == NULL)
m_pMusicListHotTab = static_cast<CTabLayoutUI*>(m_pManager->FindSubControlByName(this, kMusicHotTabControlName));
if ( m_pMusicListHotTab != NULL )
{
CButtonUI *pBtnPalyButton = static_cast<CButtonUI*>(m_pManager->FindSubControlByName(this, kPlayControlControlName));
CLabelUI *pLblMusicIndex = static_cast<CLabelUI*>(m_pManager->FindSubControlByName(this, kMusicIndexControlName));
if ( pBtnPalyButton == NULL || pLblMusicIndex == NULL )
return false;
if (bHot)
{
m_pMusicListHotTab->SelectItem(1);
pBtnPalyButton->SetVisible(true);
pLblMusicIndex->SetVisible(false);
}
else
{
m_pMusicListHotTab->SelectItem(0);
pBtnPalyButton->SetVisible(false);
pLblMusicIndex->SetVisible(true);
}
}
Invalidate();
return true;
}
示例4: ShowPropPage
//显示道具页
void CRightFrame::ShowPropPage(UINT uPage)
{
if (uPage < 0)
{
return;
}
if (uPage >= m_uPropPageNums)
{
return;
}
//当前显示道具的页
m_uCurrPropPage = uPage;
int iMinPos = uPage * m_uPropPageSize;
int iMaxPos = iMinPos + m_uPropPageSize - 1;
for (int i = 0; i < MAX_PROP_NUMS; ++i)
{
if (m_pPropBtn[i])
{
m_pPropBtn[i]->SetVisible(i >= iMinPos && i <= iMaxPos);
}
}
CButtonUI* pBtnPrev = static_cast<CButtonUI*>(m_pm.FindControl("Prop_Btn_Prev"));
CButtonUI* pBtnNext = static_cast<CButtonUI*>(m_pm.FindControl("Prop_Btn_Next"));
pBtnPrev->SetEnabled(uPage > 0);
pBtnNext->SetEnabled(uPage < m_uPropPageNums - 1);
return;
}
示例5: CHorizontalLayoutUI
void CColorPicker::InitWindow()
{
CVerticalLayoutUI* pColorContiner = static_cast<CVerticalLayoutUI*>(GetPaintMgr()->FindControl(_T("color")));
for (int i = 0; (i < 5) && (pColorContiner != NULL); i ++)
{
CHorizontalLayoutUI* pLine = new CHorizontalLayoutUI();
pLine->SetFixedHeight(12);
pColorContiner->Add(pLine);
for (int j = 0; j < 8; j++)
{
CButtonUI* pOne = new CButtonUI();
pOne->ApplyAttributeList(_T("bordersize=\"1\" bordercolor=\"#FF000000\" width=\"10\" height=\"10\""));
pOne->SetBkColor(Colors[i][j]);
pLine->Add(pOne);
if (i < 7)
{
CControlUI* pMargin = new CControlUI();
pMargin->SetFixedWidth(2);
pLine->Add(pMargin);
}
}
}
SIZE size = GetPaintMgr()->GetInitSize();
MoveWindow( based_point_.x - static_cast<LONG>(size.cx / 2), based_point_.y - size.cy, size.cx, size.cy, FALSE);
}
示例6: SetItemSafeState
//设置某一安全的状态
void CSafeCenterWnd::SetItemSafeState(CheckItemType emType,bool bSafeType)
{
map<CheckItemType,TCheckNode>::iterator itFind
= m_mapSCTable.find(emType);
if (itFind == m_mapSCTable.end())
{
return;
}
TCheckNode* pCheckNode = &itFind->second;
pCheckNode->bOperated = bSafeType;
CButtonUI* pBntCtrl = static_cast<CButtonUI*>(m_pm.FindControl(pCheckNode->bntName.c_str()));
if (pBntCtrl)
{
if (!bSafeType)
{
pBntCtrl->SetText(pCheckNode->opText.c_str());
//pBntCtrl->SetEnabled(true);
}
else
{
pBntCtrl->SetText(pCheckNode->norText.c_str());
//pBntCtrl->SetEnabled(false);
}
}
return;
}
示例7: OnBnExpression
//点击选择表情
void CRightFrame::OnBnExpression()
{
CLoveSendClassInExe* pGameFrame = static_cast<CLoveSendClassInExe*>(m_pRoom);
CGameTalkText* pExpressWnd = &pGameFrame->m_ExpressWnd;
//建立表情窗口
if (pExpressWnd->GetSafeHwnd() == NULL)
{
pExpressWnd->CreateExpressionWnd(pGameFrame);
}
//移动窗口
CButtonUI* pFaceBtn = static_cast<CButtonUI*>(m_pm.FindControl("Talk_Btn_Face"));
RECT rcFaceBtn = pFaceBtn->GetPos();
RECT rcRightWnd;
RECT rcGameWnd;
::GetWindowRect(m_hWnd,&rcRightWnd);
::GetWindowRect(pGameFrame->m_hWnd,&rcGameWnd);
::CSize siExpress;
pExpressWnd->GetFixSize(siExpress);
pGameFrame->SafeMoveWindow(pExpressWnd,
(rcRightWnd.left + rcFaceBtn.right) - siExpress.cx + 176,
rcRightWnd.top + rcFaceBtn.top - siExpress.cy - 3,
siExpress.cx,siExpress.cy);
pExpressWnd->ShowWindow(SW_SHOW);
pExpressWnd->SetFocus();
}
示例8: ClearSearchResult
void CSearchBussinessPartnerPage::ClearSearchResult()
{
CButtonUI* pBtnAvatar = static_cast<CButtonUI*>(m_PaintManager.FindControl(btn_avatar));
if (NULL != pBtnAvatar)
{
pBtnAvatar->SetBkImage(_T(""));
}
CLabelUI* pLabelNickname = static_cast<CLabelUI*>(m_PaintManager.FindControl(label_nick));
if (NULL != pLabelNickname)
{
pLabelNickname->SetText(_T(""));
}
CLabelUI* pLabelCompany = static_cast<CLabelUI*>(m_PaintManager.FindControl(label_company));
if (NULL != pLabelCompany)
{
pLabelCompany->SetText(_T(""));
}
CButtonUI* pAddFriend = static_cast<CButtonUI*>(m_PaintManager.FindControl(btn_add_friend));
if (NULL != pAddFriend)
{
pAddFriend->SetVisible(false);
}
if (NULL != m_pCurUserInfo)
{
delete m_pCurUserInfo;
m_pCurUserInfo = NULL;
}
}
示例9: Initialize
//隐藏加好友的按钮
bool CSearchBussinessPartnerPage::Initialize()
{
CButtonUI* pBtnAdd = static_cast<CButtonUI*>(m_PaintManager.FindControl(btn_add_friend));
if (NULL != pBtnAdd)
{
pBtnAdd->SetVisible(false);
}
return true;
}
示例10: Notify
void CWndAbout::Notify( TNotifyUI &msg )
{
__super::Notify(msg);
if (msg.sType == DUI_MSGTYPE_CLICK)
{
if (msg.pSender->GetName() == _T("btn_link"))
{
CButtonUI *pBtn = static_cast<CButtonUI*>(m_PaintManager.FindControl(_T("btn_link")));
CDuiString strLink = pBtn->GetText();
::ShellExecute(NULL, _T("open"), strLink.GetData(), NULL, NULL, SW_SHOWNORMAL);
}
}
}
示例11: LOWORD
LRESULT CScalableLayout::MessageHandler( UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled )
{
if (uMsg == WM_MOUSEWHEEL)
{
WORD fwKeys = LOWORD(wParam); // key flags
if (fwKeys != 0)
{
return 0;
}
short zDelta = (short) HIWORD(wParam); // wheel rotation
POINT pt;
pt.x = (short) LOWORD(lParam); // horizontal position of pointer
pt.y = (short) HIWORD(lParam); // vertical position of pointer
::ScreenToClient(m_hParentWnd,&pt);
if (zDelta > 0)
{
// zoom in
CControlUI *pHit = GetManager()->FindControl(pt);
CButtonUI *pHitButton = dynamic_cast<CButtonUI*>(pHit);
if (pHitButton == 0)
{
return 0;
}
ZoomIn(pHitButton->GetName());
}
else
{
RECT rc = m_pContainer->GetPos();
if (!::PtInRect(&rc,pt))
{
return 0;
}
ZoomOut();
}
bHandled = TRUE;
return 0;
}
return 0;
}
示例12: GetPaintMgr
void CLoginWindow::Login(const CString& email,const CString& pwd,bool isMD5,bool isKeepLogin)
{
spUserContextT pContext = theRuntimeState->GetCurrentContext(NULL);
spLogonUserInfoT theUser = pContext->GetUser();
if(theUser && 0 == theUser->sLogonEmail.CompareNoCase(email))
{
CControlUI *pCtl = GetPaintMgr()->FindControl(_T("login"));
CButtonUI *pLoginBtn = static_cast<CButtonUI*>(pCtl);
assert(pLoginBtn);
if(pLoginBtn)
CInfoWindow::ShowInfoWindow(this->m_hWnd,pLoginBtn->GetPos(),_T("Óû§ÒѾµÇ¼!!!"));
return;
}
CControlUI *pEmailEdit = GetPaintMgr()->FindControl(_T("email"));
if(pEmailEdit)
{
pEmailEdit->SetText(email);
}
std::string sUtf8UserName = em_utility::mci::unicode_2_utf8(email);
std::string sUtf8Password = em_utility::mci::unicode_2_utf8(pwd);
std::string sUtf8PasswordMD5 = (isMD5 ? sUtf8Password : em_utility::md5_checksum::get_md5((const unsigned char*)sUtf8Password.c_str(),(unsigned int)sUtf8Password.length()));
m_sUserName = email;
m_sPasswordMd5 = em_utility::mci::utf8_2_CString(sUtf8PasswordMD5.c_str());
//m_isKeepLogin = isKeepLogin;
EnableWindow(FALSE);
// theWebServiceMgr->AsynSendRequest(m_hWnd,url::Requester::MakeLogin2(sUtf8UserName,sUtf8PasswordMD5));
// CurlData* pData = new CurlData;
// pData->SetURL("http://localhost/YMusic/login.php");
// pData->n_type = url::WSRT_LOGIN;
// std::string sparam;
// sparam = "email=";
// sparam += sUtf8UserName;
// sparam += "&";
// sparam += "password=";
// sparam += sUtf8PasswordMD5;
// pData->SetData(sparam.c_str());
// HttpManagerProto::Instance()->DoHttpPost(pData);
// CHttpThread* pthread = new CHttpThread(pData,m_hWnd,WM_WEB_SERVICE);
// pthread->Start();
CHttpCenter::Instance()->MakeLogin(sUtf8UserName,sUtf8PasswordMD5);
}
示例13: _T
bool CBookClient::AddNode(BOOK_INFO *item)
{
if (item == NULL) return false;
BOOK_INFO *node = new BOOK_INFO;
node->strName = item->strName;
node->nImage = item->nImage;
node->strPath = item->strPath;
node->nBookmark = item->nBookmark;
CContainerUI* pDesk = NULL;
if( !m_dlgBuilder.GetMarkup()->IsValid() )
{
pDesk = static_cast<CContainerUI*>(m_dlgBuilder.Create(_T("iBook.xml"), (UINT)0, NULL, &m_pm));
}
else
{
pDesk = static_cast<CContainerUI*>(m_dlgBuilder.Create((UINT)0, &m_pm));
}
if( pDesk != NULL )
{
this->Add(pDesk);
CButtonUI* btn = static_cast<CButtonUI*>(m_pm.FindSubControlByName(pDesk, _T("btnBookEx")));
CLabelUI *text = static_cast<CLabelUI*>(m_pm.FindSubControlByName(pDesk, _T("labelBookEx")));
CButtonUI *btnEdit = static_cast<CButtonUI*>(m_pm.FindSubControlByName(pDesk, _T("btnbookdel")));
if (btn == NULL || text == NULL || btnEdit == NULL) return false;
CDuiString strImage;
strImage.Format(_T("book\\%02d.png"), node->nImage);
btn->SetBkImage(strImage);
text->SetText(node->strName);
btnEdit->SetVisible(m_bEdit);
pDesk->SetTag((UINT_PTR)node);
}
else
{
delete node;
node = NULL;
return false;
}
return true;
}
示例14: LOG__
void CreateDiscussionGrpDialog::_updateSearchResultList(IN const std::vector<std::string>& nameList)
{
if (nameList.empty())
{
return;
}
for (std::string sid : nameList)
{
module::UserInfoEntity userInfo;
if (!module::getUserListModule()->getUserInfoBySId(sid, userInfo))
{
LOG__(ERR, _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;
}
pListElement->SetName(_T("SearchResultItem"));
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->SetVisible(false);
}
pListElement->SetUserData(util::stringToCString(userInfo.sId));
m_pListSearchResult->Add(pListElement);
}
}
示例15: IMPL_LUA_FUNC
IMPL_LUA_FUNC(LuaCButtonUI, GetPushedImage)
{
try
{
CButtonUI* self;
self = static_cast<CButtonUI*>(LuaStatic::CheckUserData(l, 1));
CDuiString pstrText = self->GetPushedImage();
lua_op_t<CDuiString>::push_stack(l, pstrText);
return 1;
}
catch (...)
{
DuiException(_T("LuaCButtonUI::GetPushedImage"));
return 0;
}
}