本文整理汇总了C++中CEditUI类的典型用法代码示例。如果您正苦于以下问题:C++ CEditUI类的具体用法?C++ CEditUI怎么用?C++ CEditUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEditUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void CEditWnd::Init(CEditUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = CalPos();
UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
if (m_pOwner->IsPasswordMode()) uStyle |= ES_PASSWORD;
Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE);
Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
if (m_pOwner->IsPasswordMode()) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
Edit_SetText(m_hWnd, m_pOwner->GetText());
Edit_SetModify(m_hWnd, FALSE);
SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);
m_bInit = true;
}
示例2: if
void ZYGroupCreator::Notify(TNotifyUI& msg) {
if (!_tcscmp(msg.sType, _T("windowinit"))) {
::SetWindowLong(m_hWnd, GWL_STYLE, ::GetWindowLong(m_hWnd, GWL_STYLE) & ~WS_CAPTION | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
}
else if (!_tcscmp(msg.sType, _T("click"))) {
if (!_tcscmp(msg.pSender->GetName(), _T("closebutton")) || !_tcscmp(msg.pSender->GetName(), _T("cancelbutton"))) {
Close();
} else if (!_tcscmp(msg.pSender->GetName(), _T("okbutton"))) {
CEditUI *edit;
if ((edit = (CEditUI *) m_paintManagerUi.FindControl(_T("groupname")))) {
CStdString sql;
CStdString groupname = edit->GetText();
if (!groupname.IsEmpty()) {
sql.Format(_T("INSERT INTO `group` (name) VALUES ('%s'); "), groupname.GetData());
if (ZYDbHelper::GetInstance()->Query(sql.GetData(), NULL)) {
if (m_cb) {
m_cb->OnGroup(groupname.GetData());
}
Close();
}
}
}
}
}
}
示例3: OnBtnNetSegmentAdd
void CSettingDlg::OnBtnNetSegmentAdd()
{
CEditUI* pEditNetSegment = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("edit_netsegment")));
CListUI* pListNetSegment = static_cast<CListUI*>(m_PaintManager.FindControl(_T("list_netsegment")));
ASSERT(pEditNetSegment != NULL && pListNetSegment != NULL);
CDuiString strText = pEditNetSegment->GetText();
if (strText.IsEmpty())
{
return ;
}
//DUI__Trace(_T("inet_addr(strText) = 0x%08X."), inet_addr(strText));
// inet_addr(strText) == INADDR_NONE 并不能判断,比如输入一个"1",inet_addr会返回0x01000000 [12/27/2014 ybt]
if (!IsValidAddrString(strText))
{
MessageBox(m_hWnd, _T("请输入正确的IP地址."), APPNAME_STR, MB_OK);
return ;
}
pEditNetSegment->SetText(_T(""));
CListLabelElementUI* pLableElement = new CListLabelElementUI;
pLableElement->SetText(strText);
pListNetSegment->Add(pLableElement);
m_bNetworkChange = TRUE;
}
示例4: 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();
}
示例5: ClearTalkInput
//清空聊天输入框
void CRightFrame::ClearTalkInput()
{
CEditUI* pEditCtrl = static_cast<CEditUI*>(m_pm.FindControl("Talk_Edt_Inp"));
if (pEditCtrl)
{
pEditCtrl->SetText(_T(""));
}
}
示例6: SetFocusToTalkInput
//设置焦点于聊天输入框
void CRightFrame::SetFocusToTalkInput()
{
CEditUI* pEditCtrl = static_cast<CEditUI*>(m_pm.FindControl("Talk_Edt_Inp"));
if (pEditCtrl)
{
pEditCtrl->SetFocus();
}
}
示例7: GetData
void CLoginWnd::GetData()
{
CEditUI* pAccount = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("account")));
m_strAccount = pAccount->GetText();
CEditUI* pWord = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("password")));
m_strPassWord = pWord->GetText();
COptionUI* pLeft = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("remember")));
m_IsLeftSelected = pLeft->IsSelected();
COptionUI* pRight = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("autolog")));
m_IsRightSeleced = pRight->IsSelected();
}
示例8: AddExpressionToTalkInput
//添加表情到聊天输入框
void CRightFrame::AddExpressionToTalkInput(char* szExpression)
{
CEditUI* pEditCtrl = static_cast<CEditUI*>(m_pm.FindControl("Talk_Edt_Inp"));
CStdString str = pEditCtrl->GetText();
str += szExpression;
pEditCtrl->SetText(str);
return;
}
示例9: OnPrepare
void OnPrepare()
{
std::vector<CStdString> src;
src.push_back("windows");
src.push_back("win32");
src.push_back("directui");
CEditUI* pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("edit1")));
if (pEdit)
{
pEdit->SetAutoCompleteSource(src);
}
}
示例10: OnKillFocusSignature
void MainFrame::OnKillFocusSignature(TNotifyUI& msg)
{
msg.pSender->SetVisible(false);
CControlUI* signature_tip = m_PaintManager.FindControl(kSignatureTipsControlName);
if (signature_tip != NULL)
{
CEditUI* signature = static_cast<CEditUI*>(msg.pSender);
if (signature != NULL)
signature_tip->SetText(signature->GetText());
signature_tip->SetVisible(true);
}
}
示例11: if
void CLoginFrameWnd::Notify(TNotifyUI& msg)
{
if( msg.sType == _T("click") ) {
if( msg.pSender->GetName() == _T("closebtn") ) { PostQuitMessage(0); return; }
else if( msg.pSender->GetName() == _T("loginBtn") ) { Close(); return; }
}
else if( msg.sType == _T("itemselect") ) {
if( msg.pSender->GetName() == _T("accountcombo") ) {
CEditUI* pAccountEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("accountedit")));
if( pAccountEdit ) pAccountEdit->SetText(msg.pSender->GetText());
}
}
}
示例12: CMsgBox
void CSearchBussinessPartnerPage::OnQueryPartner()
{
m_pBtnQuery->SetEnabled(false);
if (!m_strFindPhoneNo.empty())
{
CMsgBox* pMsgBox = new CMsgBox("查找", "正在查找......", MSGBOX_ICON_WARNING);
pMsgBox->ShowModal(this->GetHWND());
return;
}
CEditUI* pUsername = static_cast<CEditUI*>(m_PaintManager.FindControl(edit_phone));
m_strFindPhoneNo = pUsername->GetText().GetData();
if (m_strFindPhoneNo.empty())
{
CMsgBox* pMsgBox = new CMsgBox("查找", "请输入手机号", MSGBOX_ICON_WARNING);
pMsgBox->ShowModal(this->GetHWND());
m_pBtnQuery->SetEnabled(true);
return;
}
if (!CRegexHelper::IsValidMobileNo(m_strFindPhoneNo.c_str()))
{
CMsgBox* pMsgBox = new CMsgBox("查找", "输入的手机号码格式错误", MSGBOX_ICON_WARNING);
pMsgBox->ShowModal(this->GetHWND());
m_strFindPhoneNo.clear();
m_pBtnQuery->SetEnabled(true);
return;
}
if (CWebClient::IsValidUser(m_strFindPhoneNo))
{
CController::Instance()->GetUserInfoMgr()->FetchVCardByAccount(m_strFindPhoneNo);
}
else
{
ClearSearchResult();
CMsgBox* pMsgBox = new CMsgBox("查找联系人", "该用户还不是平台用户,是否需要邀请其加入平台?", MSGBOX_ICON_ASK, MSGBOX_IDYES|MSGBOX_IDNO);
if (MSGBOX_IDYES == pMsgBox->ShowModal(this->GetHWND()))
{
tstring strErrDes;
if (CWebClient::InviteBussinessParter(m_strFindPhoneNo, strErrDes))
{
CMsgBox* pMsgBox = new CMsgBox("添加商业伙伴", "添加商业伙伴成功");
pMsgBox->ShowModal();
}
}
m_strFindPhoneNo.clear();
m_pBtnQuery->SetEnabled(true);
}
}
示例13: InitWindow
void CLoginWnd::InitWindow()
{
COptionUI* pLeft = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("remember")));
COptionUI* pRight = static_cast<COptionUI*>(m_PaintManager.FindControl(_T("autolog")));
CEditUI* pName = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("account")));
CEditUI* pPassWord = static_cast<CEditUI*>(m_PaintManager.FindControl(_T("password")));
HANDLE hFile = CreateFile(L"..\\logstate.dat",GENERIC_WRITE|GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
return;
}
char account[128];
memset(account,0,sizeof(account));
char password[128];
memset(password,0,sizeof(password));
char left[32];
memset(left,0,sizeof(left));
char right[32];
memset(right,0,sizeof(right));
DWORD num = 0;
ReadFile(hFile,account,sizeof(account),&num,NULL);
SetFilePointer(hFile,150,NULL,FILE_BEGIN);
ReadFile(hFile,password,sizeof(password),&num,NULL);
SetFilePointer(hFile,300,NULL,FILE_BEGIN);
ReadFile(hFile,left,sizeof(left),&num,NULL);
SetFilePointer(hFile,350,NULL,FILE_BEGIN);
ReadFile(hFile,right,sizeof(right),&num,NULL);
CloseHandle(hFile);
if (strcmp(left,"yes")==0)
{
pLeft->Selected(true);
WCHAR wAccount[256];
memset(wAccount,0,sizeof(wAccount));
WCHAR wPassword[256];
memset(wPassword,0,sizeof(wPassword));
CCommonConvert::Char2WChar(account,sizeof(account),wAccount);
CCommonConvert::Char2WChar(password,sizeof(password),wPassword);
pName->SetText(wAccount);
pPassWord->SetText(wPassword);
}
if (strcmp(right,"yes")==0)
{
pRight->Selected(true);
Login();
HMODULE hd = ::GetModuleHandle(NULL);
LPTSTR lpFileName = NULL;
::GetModuleFileName(hd,lpFileName,MAX_PATH);
::WritePrivateProfileString(_T("Windows"),_T("load"),lpFileName,_T("c:windows\\win.ini"));
}
}
示例14: Create
UINT CModifyMemoWnd::ShowModal(HWND hParnt)
{
Create(m_hWnd, (_T("")), UI_WNDSTYLE_DIALOG, UI_WNDSTYLE_EX_FRAME, 0, 0, 0, 0, NULL);
CenterWindow();
//初始化备注
CEditUI* pEditMemo = static_cast<CEditUI*>(m_PaintManager.FindControl(memo_edit));
if (NULL != pEditMemo)
{
pEditMemo->SetText(m_strCurMemo.c_str());
}
return CWindowWnd::ShowModal();
}
示例15: _T
void RedisConfigUI::DoApplyData()
{
CEditUI exampleEditUI;
CComboUI exampleComboUI;
RedisClient::TDicConfig::const_iterator it = m_dicConfig.begin();
RedisClient::TDicConfig::const_iterator itend = m_dicConfig.end();
RedisClient::TDicConfig config;
for ( ; it!=itend; ++it)
{
CDuiString name = _T("redisconfig_");
CDuiString key = CharacterSet::ANSIToUnicode(it->first).c_str();
name.Append(key);
CControlUI* pCtl = GetPaintMgr()->FindControl(name);
string val ;
if (pCtl->GetClass() == exampleEditUI.GetClass())
{
CEditUI* pEdit = static_cast<CEditUI*> (pCtl);
val = CharacterSet::UnicodeToANSI(pEdit->GetText().GetData());
}
else if (pCtl->GetClass() == exampleComboUI.GetClass())
{
CComboUI* pCombo = static_cast<CComboUI*> (pCtl);
int idx = pCombo->GetCurSel();
if (it->first == "loglevel")
{
if (idx == 0) val = "debug";
else if (idx == 1) val = "verbose";
else if (idx == 2) val = "notice";
else if (idx == 3) val = "warning";
}
else
{
if (idx == 0) val = "yes";
else if (idx == 1) val = "no";
}
}
if (val != it->second)
{
config.insert(std::make_pair(it->first, val));
}
}
if (SetConfig(config) && GetConfig())
{
DoFillData();
}
}