本文整理汇总了C++中CDuiString::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CDuiString::IsEmpty方法的具体用法?C++ CDuiString::IsEmpty怎么用?C++ CDuiString::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDuiString
的用法示例。
在下文中一共展示了CDuiString::IsEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PaintText
void CGroupBoxUI::PaintText(HDC hDC)
{
CDuiString sText = GetText();
if( sText.IsEmpty() ) {
return;
}
if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
if( sText.IsEmpty() ) return;
CDuiRect rcText = m_rcItem;
rcText.Deflate(5,5);
SIZE szAvailable = { rcText.right - rcText.left, rcText.bottom - rcText.top };
SIZE sz = CalcrectSize(szAvailable);
//¼ÆËãÎÄ×ÖÇøÓò
rcText.left = rcText.left + 15;
rcText.top = rcText.top - 5;
rcText.right = rcText.left + sz.cx;
rcText.bottom = rcText.top + sz.cy;
if( IsEnabled() )
{
CRenderEngine::DrawText(hDC, m_pManager, rcText, sText, m_dwTextColor, m_iFont, m_uTextStyle,
GetAdjustColor(m_dwBackColor), FALSE);
}
else
{
CRenderEngine::DrawText(hDC, m_pManager, rcText, sText, m_dwDisabledTextColor, m_iFont, m_uTextStyle,
GetAdjustColor(m_dwBackColor), FALSE);
}
}
示例2: _DoLogin
void LoginDialog::_DoLogin()
{
LOG__(APP,_T("User Clicked LoginBtn"));
m_ptxtTip->SetText(_T(""));
CDuiString userName = m_pedtUserName->GetText();
CDuiString password = m_pedtPassword->GetText();
if (userName.IsEmpty())
{
CString csTip = util::getMultilingual()->getStringById(_T("STRID_LOGINDIALOG_USERNAME_EMPTY"));
m_ptxtTip->SetText(csTip);
return;
}
if (password.IsEmpty())
{
CString csTip = util::getMultilingual()->getStringById(_T("STRID_LOGINDIALOG_PASSWORD_EMPTY"));
m_ptxtTip->SetText(csTip);
return;
}
module::TTConfig* pCfg = module::getSysConfigModule()->getSystemConfig();
pCfg->userName = userName;
if (m_bPassChanged)
{
std::string sPass = util::cStringToString(CString(password));
char* pOutData = 0;
uint32_t nOutLen = 0;
int retCode = EncryptPass(sPass.c_str(), sPass.length(), &pOutData, nOutLen);
if (retCode == 0 && nOutLen > 0 && pOutData != 0)
{
pCfg->password = std::string(pOutData, nOutLen);
Free(pOutData);
}
else
{
LOG__(ERR, _T("EncryptPass Failed!"));
CString csTip = util::getMultilingual()->getStringById(_T("STRID_LOGINDIALOG_LOGIN_ENCRYPT_PASE_FAIL"));
m_ptxtTip->SetText(csTip);
return;
}
}
pCfg->isRememberPWD = m_pChkRememberPWD->GetCheck();
module::getSysConfigModule()->saveData();
CString csTxt = util::getMultilingual()->getStringById(_T("STRID_LOGINDIALOG_BTN_DOLOGIN"));
m_pBtnLogin->SetText(csTxt);
m_pBtnLogin->SetEnabled(false);
//连接登陆服务器
DoLoginServerParam param;
DoLoginServerHttpOperation* pOper = new DoLoginServerHttpOperation(
BIND_CALLBACK_1(LoginDialog::OnHttpCallbackOperation), param);
module::getHttpPoolModule()->pushHttpOperation(pOper);
}
示例3: PaintText
void CComboUI::PaintText(HDC hDC)
{
if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
RECT rc = m_rcItem;
rc.left += m_rcTextPadding.left;
rc.right -= m_rcTextPadding.right;
rc.top += m_rcTextPadding.top;
rc.bottom -= m_rcTextPadding.bottom;
CDuiString sText = GetText();
if( sText.IsEmpty() ) return;
int nLinks = 0;
if( IsEnabled() ) {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwTextColor, \
NULL, NULL, nLinks, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwTextColor, \
m_iFont, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
else {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
NULL, NULL, nLinks, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
m_iFont, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
}
示例4: 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;
}
示例5: PaintText
void CTextUI::PaintText(HDC hDC)
{
CDuiString sText = GetText();
if( sText.IsEmpty() ) {
m_nLinks = 0;
return;
}
if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
m_nLinks = lengthof(m_rcLinks);
RECT rc = m_rcItem;
rc.left += m_rcTextPadding.left;
rc.right -= m_rcTextPadding.right;
rc.top += m_rcTextPadding.top;
rc.bottom -= m_rcTextPadding.bottom;
if( IsEnabled() ) {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwTextColor, \
m_rcLinks, m_sLinks, m_nLinks, m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwTextColor, \
m_iFont, m_uTextStyle);
}
else {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
m_rcLinks, m_sLinks, m_nLinks, m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
m_iFont, m_uTextStyle);
}
}
示例6: PaintText
void CLabelUI::PaintText(HDC hDC)
{
if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
RECT rc = m_rcItem;
RECT m_rcTextPadding = CLabelUI::m_rcTextPadding;
GetManager()->GetDPIObj()->Scale(&m_rcTextPadding);
rc.left += m_rcTextPadding.left;
rc.right -= m_rcTextPadding.right;
rc.top += m_rcTextPadding.top;
rc.bottom -= m_rcTextPadding.bottom;
CDuiString sText = GetText();
if( sText.IsEmpty() ) return;
int nLinks = 0;
if( IsEnabled() ) {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwTextColor, \
NULL, NULL, nLinks, m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwTextColor, \
m_iFont, m_uTextStyle);
}
else {
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
NULL, NULL, nLinks, m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
m_iFont, m_uTextStyle);
}
}
示例7: CreateControl
CControlUI* CDuiFrameWnd::CreateControl( LPCTSTR pstrClassName )
{
CDuiString strXML;
CDialogBuilder builder;
if (_tcsicmp(pstrClassName, _T("Caption")) == 0)
{
strXML = _T("Caption.xml");
}
else if (_tcsicmp(pstrClassName, _T("PlayPanel")) == 0)
{
strXML = _T("PlayPanel.xml");
}
else if (_tcsicmp(pstrClassName, _T("Playlist")) == 0)
{
strXML = _T("Playlist.xml");
}
else if (_tcsicmp(pstrClassName, _T("WndMediaDisplay")) == 0)
{
CWndUI *pUI = new CWndUI;
HWND hWnd = CreateWindow(_T("#32770"), _T("WndMediaDisplay"), WS_VISIBLE | WS_CHILD, 0, 0, 0, 0, m_PaintManager.GetPaintWindow(), (HMENU)0, NULL, NULL);
pUI->Attach(hWnd);
return pUI;
}
if (! strXML.IsEmpty())
{
CControlUI* pUI = builder.Create(strXML.GetData(), NULL, NULL, &m_PaintManager, NULL); // 这里必须传入m_PaintManager,不然子XML不能使用默认滚动条等信息。
return pUI;
}
return NULL;
}
示例8: DrawItemText
void CMenuElementUI::DrawItemText(HDC hDC, const RECT& rcItem)
{
CDuiString sText = GetText();
if( sText.IsEmpty() ) return;
if( m_pOwner == NULL ) return;
TListInfoUI* pInfo = m_pOwner->GetListInfo();
DWORD iTextColor = pInfo->dwTextColor;
if( (m_uButtonState & UISTATE_HOT) != 0 ) {
iTextColor = pInfo->dwHotTextColor;
}
if( IsSelected() ) {
iTextColor = pInfo->dwSelectedTextColor;
}
if( !IsEnabled() ) {
iTextColor = pInfo->dwDisabledTextColor;
}
int nLinks = 0;
RECT rcText = rcItem;
rcText.left += pInfo->rcTextPadding.left;
rcText.right -= pInfo->rcTextPadding.right;
rcText.top += pInfo->rcTextPadding.top;
rcText.bottom -= pInfo->rcTextPadding.bottom;
if( pInfo->bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rcText, sText, iTextColor, \
NULL, NULL, nLinks, DT_SINGLELINE | pInfo->uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rcText, sText, iTextColor, \
pInfo->nFont, DT_SINGLELINE | pInfo->uTextStyle);
}
示例9: PaintText
void COptionUI::PaintText(HDC hDC)
{
if( (m_uButtonState & UISTATE_SELECTED) != 0 )
{
DWORD oldTextColor = m_dwTextColor;
if( m_dwSelectedTextColor != 0 ) m_dwTextColor = m_dwSelectedTextColor;
if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
CDuiString sText = GetText();
if( sText.IsEmpty() ) return;
int nLinks = 0;
RECT rc = m_rcItem;
rc.left += m_rcTextPadding.left;
rc.right -= m_rcTextPadding.right;
rc.top += m_rcTextPadding.top;
rc.bottom -= m_rcTextPadding.bottom;
if( m_bShowHtml )
CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \
NULL, NULL, nLinks, m_uTextStyle);
else
CRenderEngine::DrawText(hDC, m_pManager, rc, sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \
m_iFont, m_uTextStyle);
m_dwTextColor = oldTextColor;
}
else
CButtonUI::PaintText(hDC);
}
示例10: FreshGroupMemberAvatar
void SessionLayout::FreshGroupMemberAvatar(IN const std::string& sID)
{
module::UserInfoEntity userInfo;
if (!module::getUserListModule()->getUserInfoBySId(sID, userInfo))
{
APP_LOG(LOG_ERROR, _T("SessionLayout::_updateGroupMembersList(),can't find the userInfo"));
return;
}
if (!m_pGroupMemberList)
{
return;
}
for (int n = 0; n < m_pGroupMemberList->GetCount(); n++)
{
CListContainerElementUI* pItem = (CListContainerElementUI*)m_pGroupMemberList->GetItemAt(n);
if (pItem)
{
CDuiString userData = pItem->GetUserData();
if (!userData.IsEmpty())
{
std::string sid = util::cStringToString(CString(userData));
if (sid == sID)
{
CButtonUI* btnAvatarInfo = (CButtonUI*)pItem->FindSubControl(_T("AvatarInfo"));
if (btnAvatarInfo)
{
btnAvatarInfo->SetBkImage(util::stringToCString(userInfo.getAvatarPath()));
}
}
}
}
}
m_pGroupMemberList->SortItems(GroupMemberListItemCompareFunc, 0);
}
示例11: FreshAllGroupMemberAvatar
void SessionLayout::FreshAllGroupMemberAvatar()
{
if (!m_pGroupMemberList)
{
return;
}
for (int n = 0; n < m_pGroupMemberList->GetCount(); n++)
{
CListContainerElementUI* pItem = (CListContainerElementUI*)m_pGroupMemberList->GetItemAt(n);
if (pItem)
{
CDuiString userData = pItem->GetUserData();
if (!userData.IsEmpty())
{
std::string sid = util::cStringToString(CString(userData));
module::UserInfoEntity userInfo;
if (!module::getUserListModule()->getUserInfoBySId(sid, userInfo))
{
LOG__(ERR, _T("can't find the userInfo:%s,GroupId:%s"),util::stringToCString(sid),util::stringToCString(m_sId));
continue;;
}
CButtonUI* btnAvatarInfo = (CButtonUI*)pItem->FindSubControl(_T("AvatarInfo"));
if (btnAvatarInfo)
{
btnAvatarInfo->SetBkImage(util::stringToCString(userInfo.getAvatarPath()));
}
}
}
}
m_pGroupMemberList->SortItems(GroupMemberListItemCompareFunc, 0);
}
示例12: SearchGo
void CMainWnd::SearchGo()
{
CDuiString sText = m_pSearchEdit->GetText();
if(!sText.IsEmpty()) {
CDuiString sUrl;
sUrl.Format(_T("https://www.baidu.com/s?ie=utf-8&wd=%s"), sText.GetData());
CreateNewTabAndGo(sUrl);
}
}
示例13: OnPriceAdd
void CStockBuyUI::OnPriceAdd(void)
{
CDuiString str = m_pBuyPriceEdt->GetText().GetData();
if (!str.IsEmpty())
{
if (str[0] == _T('.') && str[1] >= 48 && str[1] <= 97)
{
CDuiString zero = _T("0");
m_pBuyPriceEdt->SetText(zero+str);
}
else
{
double f = _tstof(str.GetData()) + 0.01f;
str.Format(_T("%.3f"), f);
m_pBuyPriceEdt->SetText(str);
}
}
}
示例14: OnCreate
LRESULT WindowImplBase::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// 调整窗口样式
LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
styleValue &= ~WS_CAPTION;
::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
// 调整窗口尺寸
RECT rcClient;
::GetClientRect(*this, &rcClient);
::SetWindowPos(*this, NULL, rcClient.left, rcClient.top, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, SWP_FRAMECHANGED);
// 关联UI管理器
m_pm.Init(m_hWnd, GetManagerName());
// 注册PreMessage回调
m_pm.AddPreMessageFilter(this);
// 创建主窗口
CControlUI* pRoot=NULL;
CDialogBuilder builder;
CDuiString sSkinType = GetSkinType();
if (!sSkinType.IsEmpty()) {
STRINGorID xml(_ttoi(GetSkinFile().GetData()));
pRoot = builder.Create(xml, sSkinType, this, &m_pm);
}
else {
pRoot = builder.Create(GetSkinFile().GetData(), (UINT)0, this, &m_pm);
}
if (pRoot == NULL) {
CDuiString sError = _T("加载资源文件失败:");
sError += GetSkinFile();
MessageBox(NULL, sError, _T("Duilib") ,MB_OK|MB_ICONERROR);
ExitProcess(1);
return 0;
}
m_pm.AttachDialog(pRoot);
// 添加Notify事件接口
m_pm.AddNotifier(this);
// 窗口初始化完毕
InitWindow();
return 0;
}
示例15: OnKillFocus
void CMainDialog::OnKillFocus( CControlUI* pSender )
{
if (pSender->GetName() == _T ("editSearch")) {
CControlUI* pbtnTip = static_cast <CControlUI*> (m_pm.FindControl(_T ("btnTip")));
CEditUI* peditSearch = static_cast <CEditUI*> (m_pm.FindControl(_T ("editSearch")));
if (pbtnTip && peditSearch) {
CDuiString strText = peditSearch->GetText();
if (strText.IsEmpty()) {
strText = "請輸入查找條件";
pbtnTip->SetAttribute(_T("textcolor"), _T("#00A0A0A4"));
} else {
pbtnTip->SetAttribute(_T("textcolor"), _T("#FF000000"));
}
pbtnTip->SetText(strText);
pbtnTip->SetVisible(true);
}
}
}