本文整理汇总了C++中ChatDialog::CenterWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ ChatDialog::CenterWindow方法的具体用法?C++ ChatDialog::CenterWindow怎么用?C++ ChatDialog::CenterWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChatDialog
的用法示例。
在下文中一共展示了ChatDialog::CenterWindow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
}
}
}
示例2: 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);
}
}
}
}
}
}
示例3: Notify
//.........这里部分代码省略.........
UpdateMicroBlogList();
}
}
}
else if (_tcsicmp(msg.sType, _T("itemactivate")) == 0)
{
CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(paint_manager_.FindControl(kTabControlName));
if (pTabControl != NULL)
{
if (pTabControl->GetCurSel() == 0)
{
CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(paint_manager_.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 = paint_manager_.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.c_str(), node->data().value.c_str()) == 0)
{
friend_info = *citer;
break;
}
}
TCHAR szBuf[MAX_PATH] = {0};
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
}
ChatDialog* pChatDialog = new ChatDialog(szBuf, 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
skin_changed_observer_.AddReceiver(pChatDialog);
pChatDialog->CenterWindow();
::ShowWindow(*pChatDialog, SW_SHOW);
}
}
}
}
}
}
else if (_tcsicmp(msg.sType, _T("itemclick")) == 0)
{
CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(paint_manager_.FindControl(kTabControlName));
if (pTabControl != NULL)
{
if (pTabControl->GetCurSel() == 0)
{
CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(paint_manager_.FindControl(kFriendsListControlName));
if ((pFriendsList != NULL) && pFriendsList->GetItemIndex(msg.pSender) != -1)
{
if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
{
Node* node = (Node*)msg.pSender->GetTag();
if (pFriendsList->CanExpand(node))
{
pFriendsList->SetChildVisible(node, !node->data().child_visible_);
}
}
}
}
else if (pTabControl->GetCurSel() == 1)
{
CGroupsUI* pGroupsList = static_cast<CGroupsUI*>(paint_manager_.FindControl(kGroupsListControlName));
if ((pGroupsList != NULL) && pGroupsList->GetItemIndex(msg.pSender) != -1)
{
if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
{
Node* node = (Node*)msg.pSender->GetTag();
if (pGroupsList->CanExpand(node))
{
pGroupsList->SetChildVisible(node, !node->data().child_visible_);
}
}
}
}
}
}
}
示例4: TypeClick
void CNotice::TypeClick(TNotifyUI& msg)
{
if(msg.pSender->IsName(noticeView::kClose)){
GetPaintMgr()->KillTimer(GetPaintMgr()->GetRoot(),100);
Close(IDOK);
}
else if (msg.pSender->IsName(noticeView::kLogo))
{
if(EMT_GROUP_MSG == m_NoticeType||EMT_SYS_MSG==m_NoticeType)
{
if(theApp->IsIconic())
theApp->ShowWindow(true);
theApp->SetPage(3);//转到群聊窗口
}
else if(EMT_FRIEND_MSG==m_NoticeType||EMT_FRIEND_LOAD==m_NoticeType||EMT_FRIEND_SHAKE==m_NoticeType)
{
if (theApp->FindChatBox(m_sWho))
{
ChatDialog* pDlg = NULL;
if ((pDlg=theApp->FindChatBox(m_sWho))!=NULL)
{
pDlg->ShowWindow(true);
pDlg->BringWindowToTop();
}
}
else
{
User friend_;
theApp->FindUserFromList(m_sWho,friend_);
ChatDialog* pChatDialog = new ChatDialog(_T(""), 0, theUser, friend_);
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->SetWindowText(friend_.m_loadName);
//skin_changed_observer_.AddReceiver(pChatDialog);
pChatDialog->CenterWindow();
::ShowWindow(*pChatDialog, SW_SHOW);
//装入链表
thelockChatDlgList.Lock();
theChatDialogList.AddTail(pChatDialog);
thelockChatDlgList.UnLock();
}
}
Close(IDOK);
}
else if (msg.pSender->IsName(noticeView::kNoNotice))
{
if(EMT_GROUP_MSG==m_NoticeType)
bGroupMsgTip = false;
if(EMT_FRIEND_MSG==m_NoticeType)
bFriednMsgTip = false;
if(EMT_FRIEND_LOAD==m_NoticeType)
bFriednLoadTip = false;
if(EMT_FRIEND_SHAKE==m_NoticeType)
bFriednShakeTip = false;
Close(IDOK);
}
}