本文整理汇总了C++中CButtonUI::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CButtonUI::GetName方法的具体用法?C++ CButtonUI::GetName怎么用?C++ CButtonUI::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButtonUI
的用法示例。
在下文中一共展示了CButtonUI::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageHandler
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;
}
示例2: OnClick
void CQuizWnd::OnClick(TNotifyUI& msg)
{
AUTO_LOG_FUNCTION;
#ifdef _DEBUG
std::wstringstream ss;
ss << msg.pSender->GetName().GetData() << std::endl << std::ends;
OutputDebugString(ss.str().c_str());
#endif
CButtonUI* btn = static_cast<CButtonUI*>(msg.pSender);
std::wstring btnName = btn->GetName().GetData();
if (btnName.compare(0, ((wstring)BTN_QUESTION_PREFIX).length(), BTN_QUESTION_PREFIX) == 0) {
auto name = btnName.substr(((wstring)BTN_QUESTION_PREFIX).length());
// update buttion ui
UpdateButtonUi(btn, name);
if (name == L"done") {
// exam
done();
} else {
// show quiz
int ndx = std::stoi(name);
g_prev_clicked_button_option = nullptr;
ShowQuiz(ndx);
}
} else if (btnName.compare(0, ((wstring)BTN_OPTION_PREFIX).length(), BTN_OPTION_PREFIX) == 0) {
auto option = btnName.substr(((wstring)BTN_OPTION_PREFIX).length());
// update option ui
UpdateButtonUi2(btn, option);
// save user answer
if (g_cur_quiz_info) {
g_cur_quiz_info->set_user_answer(option);
}
}
return __super::OnClick(msg);
}
示例3: ShowMsgBox
int ShowMsgBox(HWND hwnd,
LPCTSTR lpszText,
LPCTSTR lpszCaption,
UINT nType)
{
if(!IsWindow())
{
// this->Create(hwnd,lpszCaption,UI_WNDSTYLE_DIALOG,UI_WNDSTYLE_EX_DIALOG);
this->Create(hwnd,lpszCaption,UI_WNDSTYLE_DIALOG,0);
}
CenterWindow();
CTextUI* pTitle = static_cast<CTextUI*>(GetPaintMgr()->FindControl(_T("title")));
CTextUI* pMsg = static_cast<CTextUI*>(GetPaintMgr()->FindControl(_T("msg")));
CButtonUI* pCancelBtn = static_cast<CButtonUI*>(GetPaintMgr()->FindControl(_T("cancel")));
CButtonUI* pOkBtn = static_cast<CButtonUI*>(GetPaintMgr()->FindControl(_T("yes")));
CTabLayoutUI* pTable = static_cast<CTabLayoutUI*>(GetPaintMgr()->FindControl(_T("icon")));
CCheckBoxUI* pCheckBox= static_cast<CCheckBoxUI*>(GetPaintMgr()->FindControl(_T("checkbox")));
ASSERT(pTitle);
ASSERT(pMsg);
ASSERT(pCancelBtn);
ASSERT(pOkBtn);
ASSERT(pTable);
ASSERT(pCheckBox);
if(pTitle) pTitle->SetText((lpszCaption ? lpszCaption : _T("")));
if(pMsg) pMsg->SetText((lpszText ? lpszText : _T("")));
if(pCancelBtn) pCancelBtn->SetFocus();
if(pTable)
{
if(nType & MBT_INFO)
pTable->SelectItem(0);
else if(nType & MBT_OK)
pTable->SelectItem(1);
else if(nType & MBT_WARN)
pTable->SelectItem(2);
}
const bool isShowCancel = (pCancelBtn && ((nType & MBBT_CANCEL) > 0));
const bool isShowOk = (pOkBtn && ((nType & MBBT_OK) > 0));
const bool isShowCheckBox = (pCheckBox &&((nType & MBBT_CHECKBOX) > 0));
const bool isShake = ((nType & MBT_SHAKE) > 0);
_bShakeWindow = isShake;
pCancelBtn->SetVisible(isShowCancel);
pOkBtn->SetVisible(isShowOk);
pCheckBox->SetVisible((/*isShowOk && */isShowCheckBox));
if(!isShowCancel && isShowOk)
{
pCancelBtn->SetVisible(true);
pOkBtn->SetVisible(false);
pCancelBtn->SetName(pOkBtn->GetName());
pCancelBtn->SetText(pOkBtn->GetText());
pCancelBtn->SetToolTip(pOkBtn->GetToolTip());
pCancelBtn->SetFocus();
}
return ShowModal();
}