本文整理汇总了C++中CControlUI::GetBkImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlUI::GetBkImage方法的具体用法?C++ CControlUI::GetBkImage怎么用?C++ CControlUI::GetBkImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlUI
的用法示例。
在下文中一共展示了CControlUI::GetBkImage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Receive
BOOL CLoginWindow::Receive(SkinChangedParam param)
{
try
{
if(!IsWindow()) return FALSE;
sLog("CLoginWindow::Receive");
CDuiString bgimage_ = param.bgimage;
DWORD bkcolor_ = param.bkcolor;
CControlUI* background = GetPaintMgr()->GetRoot();
if (background != NULL&&0!=bgimage_.Compare(background->GetBkImage()))
{
if (!param.bgimage.IsEmpty())
{
CDuiString sBkImage = bgimage_;
background->SetBkImage(sBkImage);
}
else
background->SetBkImage(_T(""));
background->SetBkColor(param.bkcolor);
}
return TRUE;
}
catch (...)
{
sLogError("CLoginWindow::Receive");
throw _T("CLoginWindow::Receive");
return FALSE;
}
}
示例2: GetBkImage
LPCTSTR CMessageDialog::GetBkImage()
{
CControlUI* background = m_pm.FindControl(kWndBackGround);
if (background != NULL)
return background->GetBkImage();
return _T("");
}
示例3: SetControlData
NSDUILIB_API void SetControlData(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
{
TCHAR controlName[MAX_PATH];
TCHAR controlData[MAX_PATH];
TCHAR dataType[MAX_PATH];
EXDLL_INIT();
ZeroMemory(controlName, MAX_PATH*sizeof(TCHAR));
ZeroMemory(controlData, MAX_PATH*sizeof(TCHAR));
ZeroMemory(dataType, MAX_PATH*sizeof(TCHAR));
popstring( controlName,sizeof(controlName));
popstring( controlData,sizeof(controlData));
popstring( dataType,sizeof(dataType));
CControlUI* pControl = static_cast<CControlUI*>(g_pFrame->GetPaintManager().FindControl( controlName ));
if( pControl == NULL )
return;
if( _tcsicmp( dataType, _T("text") ) == 0 )
{
if( _tcsicmp( controlData, _T("error")) == 0 || _tcsicmp( controlData, _T("")) == 0 )
pControl->SetText( pControl->GetText() );
else
pControl->SetText( controlData );
}
else if( _tcsicmp( dataType, _T("bkimage") ) == 0 )
{
if( _tcsicmp( controlData, _T("error")) == 0 || _tcsicmp( controlData, _T("")) == 0 )
pControl->SetBkImage( pControl->GetBkImage());
else
pControl->SetBkImage( controlData );
}
else if( _tcsicmp( dataType, _T("link") ) == 0 )
{
g_controlLinkInfoMap[controlName] = controlData;
}
else if( _tcsicmp( dataType, _T("enable") ) == 0 )
{
if( _tcsicmp( controlData, _T("true")) == 0 )
pControl->SetEnabled( true );
else if( _tcsicmp( controlData, _T("false")) == 0 )
pControl->SetEnabled( false );
}
else if( _tcsicmp( dataType, _T("visible") ) == 0 )
{
if( _tcsicmp( controlData, _T("true")) == 0 )
pControl->SetVisible( true );
else if( _tcsicmp( controlData, _T("false")) == 0 )
pControl->SetVisible( false );
}
}
示例4: SetBkColor
void MainFrame::SetBkColor(DWORD dwBackColor)
{
CControlUI* background = paint_manager_.FindControl(kBackgroundControlName);
if (background != NULL)
{
background->SetBkImage(_T(""));
background->SetBkColor(dwBackColor);
background->NeedUpdate();
SkinChangedParam param;
param.bkcolor = background->GetBkColor();
param.bgimage = background->GetBkImage();
skin_changed_observer_.Broadcast(param);
}
}
示例5: OnItemActivate
void MainFrame::OnItemActivate(TNotifyUI& msg)
{
CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kMainTabControlName));
if (pTabControl != NULL)
{
if (pTabControl->GetCurSel() == 0)
{
CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(m_PaintManager.FindControl(kFriendsListControlName));
if ((pFriendsList != NULL) && pFriendsList->GetItemIndex(msg.pSender) != -1)
{
if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
{
Node* node = (Node*)msg.pSender->GetTag();
CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
if (!pFriendsList->CanExpand(node) && (background != NULL))
{
FriendListItemInfo friend_info;
for (std::vector<FriendListItemInfo>::const_iterator citer = friends_.begin(); citer != friends_.end(); ++citer)
{
if (_tcsicmp(citer->id, node->data().value) == 0)
{
friend_info = *citer;
break;
}
}
TCHAR szBuf[MAX_PATH] = { 0 };
if (_tcslen(background->GetBkImage()) > 0)
{
_stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
}
ChatDialog* pChatDialog = new ChatDialog(szBuf, background->GetBkColor(), myself_info_, friend_info);
if (pChatDialog == NULL)
return;
pChatDialog->Create(NULL, _T("ChatDialog"), UI_WNDSTYLE_FRAME | WS_POPUP, NULL, 0, 0, 0, 0);
skin_changed_observer_.AddReceiver(pChatDialog);
pChatDialog->CenterWindow();
::ShowWindow(*pChatDialog, SW_SHOW);
}
}
}
}
}
}
示例6: OnItemActive
void CRichEditWnd::OnItemActive(TNotifyUI& msg)
{
CAnimationTabLayoutUI* pTabControl = static_cast<CAnimationTabLayoutUI*>(GetPaintMgr()->FindControl(_T("TAB_MAIN")));
if (pTabControl != NULL)
{
if (pTabControl->GetCurSel() == 1)
{
CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(GetPaintMgr()->FindControl(_T("LIST_FRIEND")));
if ((pFriendsList != NULL) && pFriendsList->GetItemIndex(msg.pSender) != -1)
{
if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
{
Node* node = (Node*)msg.pSender->GetTag();
CControlUI* background = GetPaintMgr()->FindControl(_T("bg"));
if (!pFriendsList->CanExpand(node) && (background != NULL))
{
FriendListItemInfo friend_info;
for (std::vector<FriendListItemInfo>::const_iterator citer = friends_.begin(); citer != friends_.end(); ++citer)
{
if (_tcsicmp(citer->id, node->data().value) == 0)
{
friend_info = *citer;
break;
}
}
ChatDialog* pChatDialog = new ChatDialog(background->GetBkImage(), background->GetBkColor(), myself_info_, friend_info);
if (pChatDialog == NULL)
return;
#if defined(WIN32) && !defined(UNDER_CE)
pChatDialog->Create(NULL, _T("ChatDialog"), UI_WNDSTYLE_FRAME | WS_POPUP, NULL, 0, 0, 0, 0);
#else
pChatDialog->Create(NULL, _T("ChatDialog"), UI_WNDSTYLE_FRAME | WS_POPUP, NULL, 0, 0, 0, 0);
#endif
pChatDialog->CenterWindow();
::ShowWindow(*pChatDialog, SW_SHOW);
}
}
}
}
}
}
示例7: Notify
//.........这里部分代码省略.........
}
else if (_tcsicmp(msg.pSender->GetName(), kSearchEditTipControlName) == 0)
{
msg.pSender->SetVisible(false);
CRichEditUI* search_edit = static_cast<CRichEditUI*>(paint_manager_.FindControl(kSearchEditControlName));
if (search_edit != NULL)
{
search_edit->SetText(msg.pSender->GetText());
search_edit->SetVisible(true);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kChangeBkSkinControlName) == 0)
{
CControlUI* background = paint_manager_.FindControl(kBackgroundControlName);
if (background != NULL)
{
TCHAR szBuf[MAX_PATH] = {0};
++bk_image_index_;
if (kBackgroundSkinImageCount < bk_image_index_)
bk_image_index_ = 0;
#if defined(UNDER_WINCE)
_stprintf(szBuf, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
#else
_stprintf_s(szBuf, MAX_PATH - 1, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
#endif
background->SetBkImage(szBuf);
SkinChangedParam param;
CControlUI* background = paint_manager_.FindControl(kBackgroundControlName);
if (background != NULL)
{
param.bkcolor = background->GetBkColor();
if (_tcslen(background->GetBkImage()) > 0)
{
#if defined(UNDER_WINCE)
_stprintf(szBuf, _T("bg%d.png"), bk_image_index_);
#else
_stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
#endif
}
param.bgimage = szBuf;
}
skin_changed_observer_.Broadcast(param);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kChangeColorSkinControlName) == 0)
{
CDuiRect rcWindow;
GetWindowRect(m_hWnd, &rcWindow);
rcWindow.top = rcWindow.top + msg.pSender->GetPos().bottom;
new ColorSkinWindow(this, rcWindow);
}
}
else if (_tcsicmp(msg.sType, _T("timer")) == 0)
{
return OnTimer(msg);
}
else if (_tcsicmp(msg.sType, _T("selectchanged")) == 0)
{
CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(paint_manager_.FindControl(kTabControlName));
if (_tcsicmp(msg.pSender->GetName(), kFriendButtonControlName) == 0)
{
if (pTabControl && pTabControl->GetCurSel() != 0)
{
示例8: OnClick
void MainFrame::OnClick(TNotifyUI& msg)
{
WindowImplBase::OnClick(msg);
if (_tcsicmp(msg.pSender->GetName(), kHideLeftMainPannelControlName) == 0)
{
CControlUI* left_main_pannel = m_PaintManager.FindControl(kLeftMainPannelControlName);
CControlUI* hide_left_main_pannel = m_PaintManager.FindControl(kHideLeftMainPannelControlName);
CControlUI* show_left_main_pannel = m_PaintManager.FindControl(kShowLeftMainPannelControlName);
if ((left_main_pannel != NULL) && (show_left_main_pannel != NULL) && (hide_left_main_pannel != NULL))
{
hide_left_main_pannel->SetVisible(false);
left_main_pannel->SetVisible(false);
show_left_main_pannel->SetVisible(true);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kShowLeftMainPannelControlName) == 0)
{
CControlUI* left_main_pannel = m_PaintManager.FindControl(kLeftMainPannelControlName);
CControlUI* hide_left_main_pannel = m_PaintManager.FindControl(kHideLeftMainPannelControlName);
CControlUI* show_left_main_pannel = m_PaintManager.FindControl(kShowLeftMainPannelControlName);
if ((left_main_pannel != NULL) && (show_left_main_pannel != NULL) && (hide_left_main_pannel != NULL))
{
hide_left_main_pannel->SetVisible(true);
left_main_pannel->SetVisible(true);
show_left_main_pannel->SetVisible(false);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kSignatureTipsControlName) == 0)
{
msg.pSender->SetVisible(false);
CEditUI* signature = static_cast<CEditUI*>(m_PaintManager.FindControl(kSignatureControlName));
if (signature != NULL)
{
signature->SetText(msg.pSender->GetText());
signature->SetVisible(true);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kSearchEditTipControlName) == 0)
{
msg.pSender->SetVisible(false);
CEditUI* search_edit = static_cast<CEditUI*>(m_PaintManager.FindControl(kSearchEditControlName));
if (search_edit != NULL)
{
search_edit->SetText(msg.pSender->GetText());
search_edit->SetVisible(true);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kChangeBkSkinControlName) == 0)
{
CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
if (background != NULL)
{
TCHAR szBuf[MAX_PATH] = { 0 };
++bk_image_index_;
if (kBackgroundSkinImageCount < bk_image_index_)
bk_image_index_ = 0;
_stprintf_s(szBuf, MAX_PATH - 1, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
background->SetBkImage(szBuf);
SkinChangedParam param;
CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
if (background != NULL)
{
param.bkcolor = background->GetBkColor();
if (_tcslen(background->GetBkImage()) > 0)
{
_stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
}
param.bgimage = szBuf;
}
skin_changed_observer_.Broadcast(param);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kChangeColorSkinControlName) == 0)
{
CDuiRect rcWindow;
GetWindowRect(m_hWnd, &rcWindow);
rcWindow.top = rcWindow.top + msg.pSender->GetPos().bottom;
new ColorSkinWindow(this, rcWindow);
}
else if (0 == _tcsicmp(msg.pSender->GetName(), _T("phone")))
{
logic::GetLogic()->asynNotifyObserver(module::KEY_LOGIN_USERID,10);
}
else if (0 == _tcsicmp(msg.pSender->GetName(), _T("QQpalycenter")))
{
logic::GetLogic()->removeObserver(this);
}
else if (0 == _tcsicmp(msg.pSender->GetName(), _T("MainMenu")))
{
CMenuWnd* pMenu = new CMenuWnd(m_hWnd);
DuiLib::CPoint point = msg.ptMouse;
ClientToScreen(m_hWnd, &point);
STRINGorID xml(_T("menutest.xml"));
pMenu->Init(NULL, xml, _T("xml"), point);
}
else if (0 == _tcsicmp(msg.pSender->GetName(), _T("ToolsBtn")))//设置按钮
//.........这里部分代码省略.........