NEdit* NEdit::SelectAll() { NAssertError(IsWndValid(), _T("call parent->AddChild first")); if(!IsWndValid()) return this; ::SendMessage(realWindow_, EM_SETSEL, 0, -1); return this; }
NEdit* NEdit::SetReadOnly(bool readOnly) { NAssertError(IsWndValid(), _T("call parent->AddChild first")); if(!IsWndValid()) return this; ::SendMessage(realWindow_, EM_SETREADONLY, readOnly, 0); return this; }
NEdit* NEdit::ShowTooltip(TooltipIconType iconType, LPCTSTR szTitle, LPCTSTR szText) { NAssertError(IsWndValid(), _T("call parent->AddChild first")); if(!IsWndValid()) return this; nui::Base::NInstPtr<nui::Data::NStringBundle> stringBundle(MemToolParam); Base::NString strTitle = stringBundle->GetString(szTitle); Base::NString strText = stringBundle->GetString(szText); EDITBALLOONTIP tip = {sizeof(EDITBALLOONTIP)}; tip.pszText = strText.GetData(); tip.pszTitle = strTitle.GetData(); tip.ttiIcon = iconType; ::SendMessage(realWindow_, EM_SHOWBALLOONTIP, 0, (LPARAM)&tip); return this; }
NEdit* NEdit::SetHintText(LPCTSTR hintText) { nui::Base::NInstPtr<nui::Data::NStringBundle> stringBundle(MemToolParam); hintText_ = stringBundle->GetString(hintText); if(!IsWndValid()) return this; ::SendMessage(realWindow_, EM_SETCUEBANNER, TRUE, (LPARAM)hintText_.GetData()); return this; }
Base::NString NWndUi::GetText() const { if(IsWndValid()) { TCHAR szText[1000]; ::GetWindowText(realWindow_, szText, 999); szText[1000] = 0; return szText; } return __super::GetText(); }
// NFrame // data void NWndUi::SetText(const Base::NString& text) { __super::SetText(text); if(IsWndValid()) ::SetWindowText(realWindow_, GetText().GetData()); }