void CFormatMsgDlg::OnOK() { SRichEdit *pEdit = FindChildByName2<SRichEdit>(L"re_xmlinput"); m_strMsg = pEdit->GetWindowText(); SEdit *pRepeat = FindChildByName2<SEdit>(L"edit_repeat"); SStringT strRepeat = pRepeat->GetWindowText(); m_nRepeat = _tstoi(strRepeat); EndDialog(IDOK); }
void CStudentSmsDlg::OnSmsInputNotify(EventArgs *e) { EventRENotify *e2 = sobj_cast<EventRENotify>(e); if(e2->iNotify != EN_CHANGE) return; SEdit *pEdit = sobj_cast<SEdit>(e->sender); int nLen = pEdit->GetWindowTextLength(); SWindow *pWordCount = FindChildByID(R.id.txt_wordcount); pWordCount->SetWindowText(SStringT().Format(_T("%d"),nLen)); pWordCount->EnableWindow(nLen<100,TRUE); }
BOOL SSearchDropdownList::CreateChildren(pugi::xml_node xmlNode) { BOOL bRet = __super::CreateChildren(xmlNode); if(!bRet) return FALSE; SEdit *pEdit = FindChildByName2<SEdit>(KName_SearchEdit); if(!pEdit) { return FALSE; } pEdit->SSendMessage(EM_SETEVENTMASK,0,ENM_CHANGE); pEdit->GetEventSet()->subscribeEvent(EVT_RE_NOTIFY,Subscriber(&SSearchDropdownList::OnEditNotify,this)); m_xmlDropdown.append_copy(xmlNode.child(KNode_PopupStyle)); return TRUE; }
void CFolderHander::OnBtnFileTypes(EventArgs *pEvt) { SWindow *pBtn = sobj_cast<SWindow>(pEvt->sender); CRect rcBtn = pBtn->GetWindowRect(); HWND hWnd = pBtn->GetContainer()->GetHostHwnd(); ::ClientToScreen(hWnd,(LPPOINT)&rcBtn); ::ClientToScreen(hWnd,(LPPOINT)&rcBtn+1); SMenu menu; menu.LoadMenu(_T("menu_filetype"),_T("xml")); for(int i=0;i<(int)m_lstLangExts.GetCount();i++) { SStringW strDesc = m_lstLangExts[i].strLang+L":"+m_lstLangExts[i].strExts; menu.InsertMenu(i,MF_BYPOSITION,i+10,S_CW2T(strDesc),-1); } int id = menu.TrackPopupMenu(TPM_RIGHTALIGN|TPM_RETURNCMD,rcBtn.right,rcBtn.bottom,hWnd); if(id!=0) { id-=10; SEdit *pEdit = m_pFolderRoot->FindChildByName2<SEdit>(L"edit_filetypes"); SASSERT(pEdit); if(pEdit->GetWindowTextLength()!=0) { pEdit->SetSel((DWORD)-1); pEdit->ReplaceSel(L";"); } pEdit->SetSel((DWORD)-1); pEdit->ReplaceSel(m_lstLangExts[id].strExts); } }
void CFolderHander::OnDirEnterFinish( EventArgs *pEvt ) { SEdit *pEdit = sobj_cast<SEdit>(pEvt->sender); SStringT strDir = pEdit->GetWindowText(); InitDir(S_CT2W(strDir),TRUE); }