当前位置: 首页>>代码示例>>C++>>正文


C++ CEditUI::SetFocus方法代码示例

本文整理汇总了C++中CEditUI::SetFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ CEditUI::SetFocus方法的具体用法?C++ CEditUI::SetFocus怎么用?C++ CEditUI::SetFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEditUI的用法示例。


在下文中一共展示了CEditUI::SetFocus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Init

void CLoginFrameWnd::Init() 
{
	CComboUI* pAccountCombo = static_cast<CComboUI*>(m_pm.FindControl(_T("accountcombo")));
	CEditUI* pAccountEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("accountedit")));
	if( pAccountCombo && pAccountEdit ) pAccountEdit->SetText(pAccountCombo->GetText());
	pAccountEdit->SetFocus();
}
开发者ID:killbug2004,项目名称:DvrWorkstation,代码行数:7,代码来源:CLoginFrameWnd.cpp

示例2: SetFocusToTalkInput

//设置焦点于聊天输入框
void CRightFrame::SetFocusToTalkInput()
{
	CEditUI* pEditCtrl = static_cast<CEditUI*>(m_pm.FindControl("Talk_Edt_Inp"));
	if (pEditCtrl)
	{
		pEditCtrl->SetFocus();
	}
}
开发者ID:liuwanbing,项目名称:liuwanbing,代码行数:9,代码来源:RightFrame.cpp

示例3: MessageHandler

LRESULT CLoginFrameWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
{
	if( uMsg == WM_KEYDOWN ) {
		if( wParam == VK_RETURN ) {
			CEditUI* pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("accountedit")));
			if( pEdit->GetText().IsEmpty() ) pEdit->SetFocus();
			else {
				pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("pwdedit")));
				if( pEdit->GetText().IsEmpty() ) pEdit->SetFocus();
				else Close();
			}
			return true;
		}
		else if( wParam == VK_ESCAPE ) {
			PostQuitMessage(0);
			return true;
		}

	}
	return false;
}
开发者ID:killbug2004,项目名称:DvrWorkstation,代码行数:21,代码来源:CLoginFrameWnd.cpp

示例4: MessageHandler

LRESULT CSelectOnlineUserWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
{

	if (uMsg == WM_KEYDOWN) {
		if (wParam == VK_RETURN) {
			CEditUI* pEdit = static_cast<CEditUI*>(m_pm.FindControl(DEF_ACCOUNT_ID_EDIT));
			if (pEdit->GetText().IsEmpty()) pEdit->SetFocus();
			else {
				pEdit = static_cast<CEditUI*>(m_pm.FindControl(DEF_PASSWORD_TEXT_EDIT));
				if (pEdit->GetText().IsEmpty()) pEdit->SetFocus();
				//else Close();
			}
			return true;
		}
		else if (wParam == VK_ESCAPE) {
			//PostQuitMessage(0);
			return true;
		}

	}

	return false;
}
开发者ID:StrokeAce,项目名称:YunKa_New,代码行数:23,代码来源:select_online_user_wnd.cpp

示例5: Notify

void imsdkDemoLogin::Notify(TNotifyUI& msg) {
    if (msg.sType == _T("click")) {
        if (msg.pSender == m_pCloseBtn) {
            PostQuitMessage(0);
            return;
        }
        if (msg.pSender == m_pLoginBtn) {
            CEditUI* pEditServer = static_cast<CEditUI*>(m_pm.FindControl(_T("editServer")));
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("editAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("editPassword")));
            std::string server = getString(pEditServer->GetText().GetData());
            std::string account = getString(pEditAccount->GetText().GetData());
            std::string password = getString(pEditPassword->GetText().GetData());
            gClientDemo.login(server, account, password, std::bind(&imsdkDemoLogin::onLoginCb, this, std::placeholders::_1));
            //Close(7);
        }
        if (msg.pSender == m_pSignCodeBtn) {
            CEditUI* pEditServer = static_cast<CEditUI*>(m_pm.FindControl(_T("signServer")));
            CEditUI* pEditPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("signPhone")));
            std::string server = getString(pEditServer->GetText().GetData());
            std::string phone = getString(pEditPhone->GetText().GetData());

            gClientDemo.getRegCode(server, phone);
            m_secGetSignCode = 30;
            m_pSignCodeBtn->SetEnabled(false);
            std::string strText = std::to_string(m_secGetSignCode) + "s后重试";
            auto strT = getWString(strText.c_str());
            m_pSignCodeBtn->SetText(strT.c_str());
            ::SetTimer(GetHWND(), 7, 1000, NULL);
        }
        if (msg.pSender == m_pSignUpBtn) {
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("signAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("signPassword")));
            CEditUI* pEditSignCode = static_cast<CEditUI*>(m_pm.FindControl(_T("signCode")));
            std::string account = getString(pEditAccount->GetText().GetData());
            std::string password = getString(pEditPassword->GetText().GetData());
            std::string signcode = getString(pEditSignCode->GetText().GetData());
            gClientDemo.reg(account, password, signcode);
        }
    }
    else if (msg.sType == _T("selectchanged")) {
        CDuiString name = msg.pSender->GetName();
        CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("login")));
        if (name == _T("optLogin")){
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("editAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("editPassword")));
            pEditAccount->SetText(_T("手机号"));
            pEditPassword->SetText(_T("密码"));
            pControl->SelectItem(0);
        }
        else if (name == _T("optSignUp")) {
            CEditUI* pEditPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("signPhone")));
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("signAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("signPassword")));
            CEditUI* pEditSignCode = static_cast<CEditUI*>(m_pm.FindControl(_T("signCode")));
            pEditPhone->SetText(_T("手机号"));
            pEditAccount->SetText(_T("用户名"));
            pEditPassword->SetText(_T("密码"));
            pEditSignCode->SetText(_T("验证码"));

            pControl->SelectItem(1);
        }
    }
    else if (msg.sType == _T("return"))
    {
        // Enter键注册、登录
        CTabLayoutUI* pTab = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("login")));
        if (0 == pTab->GetCurSel()){
            //
            CEditUI* pEditServer = static_cast<CEditUI*>(m_pm.FindControl(_T("editServer")));
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("editAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("editPassword")));
            if (pEditPassword->IsFocused())
            {
                std::string server = getString(pEditServer->GetText().GetData());
                std::string account = getString(pEditAccount->GetText().GetData());
                std::string password = getString(pEditPassword->GetText().GetData());
                gClientDemo.login(server, account, password, std::bind(&imsdkDemoLogin::onLoginCb, this, std::placeholders::_1));
            }
            if (pEditAccount->IsFocused())
            {
                pEditPassword->SetFocus();
            }
        }
        else
        {
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("signAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("signPassword")));
            CEditUI* pEditSignCode = static_cast<CEditUI*>(m_pm.FindControl(_T("signCode")));
            std::string account = getString(pEditAccount->GetText().GetData());
            std::string password = getString(pEditPassword->GetText().GetData());
            std::string signcode = getString(pEditSignCode->GetText().GetData());
            gClientDemo.reg(account, password, signcode);
        }
    }
}
开发者ID:VRVIM,项目名称:VIM_PC_SDK,代码行数:96,代码来源:DemoLogin.cpp

示例6: OnClick

void CMainDialog::OnClick( CControlUI* pSender)
{
	if (pSender->GetName() == TEXT ("btnExit")) {
		PostQuitMessage(0);
		return;
	}
	else if (pSender->GetName() == _T ("btnTip")) {
		CControlUI* pbtnTip = static_cast <CControlUI*> (m_pm.FindControl(_T ("btnTip")));
		if (pbtnTip) {
			pbtnTip->SetVisible(false);
		}

		CEditUI* peditSearch = static_cast <CEditUI*> (m_pm.FindControl(_T ("editSearch")));
		if (peditSearch != NULL) {
			peditSearch->SetFocus();
		}
	}

	else if (pSender->GetName() == _T ("lstDelButton")) {
		int iIndex = 0;
		CMyList* pParent = static_cast <CMyList*> (pSender->GetParent()->GetParent());
		if (pParent) {
			iIndex = pParent->GetItemIndex(pSender->GetParent());
		}
		CDuiString str;
		str.Format(_T ("您要删除 %d 项"), iIndex);
		if (IDNO == MessageBox (GetHWND (), str, NULL, MB_OK | MB_YESNO)) return;
		CMyList* pList = static_cast <CMyList*> (m_pm.FindControl(_T ("lstControl")));
		ASSERT(pList);
		if (pList) {
			pList->RemoveAt(iIndex);
			
			CControlUI* pItem = pList->GetItemAt(iIndex+5);
			if (pItem) {
				const RECT& rc = pItem->GetPos();
				SIZE sz = {0, rc.top};
				pList->SetScrollPos(sz);
			}
		}
	}
	else if (pSender->GetName() == _T ("btnAddComboItem")) {
		CComboUI* pcbx = static_cast <CComboUI*> (m_pm.FindControl(_T ("combo1")));
		assert (pcbx);
		if (pcbx) {
			CListLabelElementUI* pItem = new CListLabelElementUI ();
			pItem->SetText(_T ("{b}{i}新加项{/i}{/b}"));
			pcbx->Add(pItem);
		}

		AddComboboxItem();
		CComboUI* pcbx2 = static_cast <CComboUI*> (m_pm.FindControl(_T ("combo2")));
	}
	else if (pSender->GetName() == _T ("btnGoIe")) {
		CActiveXUI* pActiveXUI = static_cast<CActiveXUI*>(m_pm.FindControl(_T("ie")));
		if( pActiveXUI ) {
			IWebBrowser2* pWebBrowser = NULL;
			pActiveXUI->GetControl(IID_IWebBrowser2, (void**)&pWebBrowser);
			if( pWebBrowser != NULL ) {
				CEditUI* pEdit = static_cast <CEditUI*> (m_pm.FindControl(_T ("editIePath")));
				ASSERT (pEdit);
				CDuiString strIePath = _T ("www.baidu.com");
				if (pEdit) {
					strIePath = pEdit->GetText();
				}

				WCHAR szPath [1024] = {0};
#if defined(_UNICODE) || defined(UNICODE)
				lstrcpyW (szPath, strIePath);
#else
				::MultiByteToWideChar(CP_ACP, 0, strIePath, -1, szPath, 1023);
#endif
				pWebBrowser->Navigate(szPath,NULL,NULL,NULL,NULL);  
				pWebBrowser->Release();
			}
		}
	}
}
开发者ID:yiminyangguang520,项目名称:duilib,代码行数:77,代码来源:MainDialog.cpp


注:本文中的CEditUI::SetFocus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。