本文整理汇总了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();
}
示例2: SetFocusToTalkInput
//设置焦点于聊天输入框
void CRightFrame::SetFocusToTalkInput()
{
CEditUI* pEditCtrl = static_cast<CEditUI*>(m_pm.FindControl("Talk_Edt_Inp"));
if (pEditCtrl)
{
pEditCtrl->SetFocus();
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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();
}
}
}
}