本文整理汇总了C++中CContainerUI::SetVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::SetVisible方法的具体用法?C++ CContainerUI::SetVisible怎么用?C++ CContainerUI::SetVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::SetVisible方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectItem
bool CFriendsUI::SelectItem(int iIndex, bool bTakeFocus)
{
if( iIndex == m_iCurSel ) return true;
// We should first unselect the currently selected item
if( m_iCurSel >= 0 ) {
CControlUI* pControl = GetItemAt(m_iCurSel);
if( pControl != NULL) {
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem != NULL )
{
CListContainerElementUI* pFriendListItem = static_cast<CListContainerElementUI*>(pControl);
Node* node = (Node*)pControl->GetTag();
if ((pFriendListItem != NULL) && (node != NULL) && !node->folder())
{
pFriendListItem->SetFixedHeight(kFriendListItemNormalHeight);
CContainerUI* pOperatorPannel = static_cast<CContainerUI*>(paint_manager_.FindSubControlByName(pFriendListItem, kOperatorPannelControlName));
if (pOperatorPannel != NULL)
{
pOperatorPannel->SetVisible(false);
}
}
pListItem->Select(false);
}
}
m_iCurSel = -1;
}
if( iIndex < 0 )
return false;
if (!__super::SelectItem(iIndex, bTakeFocus))
return false;
CControlUI* pControl = GetItemAt(m_iCurSel);
if( pControl != NULL) {
CListContainerElementUI* pFriendListItem = static_cast<CListContainerElementUI*>(pControl);
Node* node = (Node*)pControl->GetTag();
if ((pFriendListItem != NULL) && (node != NULL) && !node->folder())
{
pFriendListItem->SetFixedHeight(kFriendListItemSelectedHeight);
CContainerUI* pOperatorPannel = static_cast<CContainerUI*>(paint_manager_.FindSubControlByName(pFriendListItem, kOperatorPannelControlName));
if (pOperatorPannel != NULL)
{
pOperatorPannel->SetVisible(true);
}
}
}
return true;
}
示例2: InEdit
void CBookClient::InEdit()
{
m_bEdit = !m_bEdit;
int num = this->GetCount();
CContainerUI* pCtrl = NULL;
for (int i = 0; i < num; ++i)
{
pCtrl = static_cast<CContainerUI*>(this->GetItemAt(i));
pCtrl = static_cast<CContainerUI*>(pCtrl->FindSubControl(_T("btnbookdel")));
ASSERT(pCtrl != NULL);
pCtrl->SetVisible(m_bEdit);
}
}
示例3: OnPrepare
void ChatDialog::OnPrepare(TNotifyUI& msg)
{
TCHAR szBuf[MAX_PATH] = {0};
CControlUI* background = paint_manager_.FindControl(kBackgroundControlName);
if (background != NULL)
{
#if defined(UNDER_WINCE)
_stprintf(szBuf, _T("file='%s' corner='600,200,1,1'"), bgimage_.c_str());
#else
_stprintf_s(szBuf, MAX_PATH - 1, _T("file='%s' corner='600,200,1,1'"), bgimage_.c_str());
#endif
background->SetBkImage(szBuf);
background->SetBkColor(bkcolor_);
}
CButtonUI* log_button = static_cast<CButtonUI*>(paint_manager_.FindControl(kLogoButtonControlName));
if (log_button != NULL)
{
#if defined(UNDER_WINCE)
_stprintf(szBuf, _T("%s"), friend_.logo.c_str());
#else
_stprintf_s(szBuf, MAX_PATH - 1, _T("%s"), friend_.logo.c_str());
#endif
log_button->SetNormalImage(szBuf);
}
CControlUI* nick_name = paint_manager_.FindControl(kNickNameControlName);
if (nick_name != NULL)
nick_name->SetText(friend_.nick_name.c_str());
CControlUI* desciption = paint_manager_.FindControl(kDescriptionControlName);
if (desciption != NULL)
desciption->SetText(friend_.description.c_str());
CContainerUI* pFontbar = static_cast<CContainerUI*>(paint_manager_.FindControl(kFontbarControlName));
if (pFontbar != NULL)
pFontbar->SetVisible(!pFontbar->IsVisible());
}
示例4: OnBtn_Font
void CMainWindow::OnBtn_Font(TNotifyUI& msg)
{
CContainerUI* pFontbar = static_cast<CContainerUI*>(paint_manager_.FindControl(_T("FontBar")));
if (pFontbar != NULL)
pFontbar->SetVisible(!pFontbar->IsVisible());
}
示例5: Notify
void ChatDialog::Notify(TNotifyUI& msg)
{
if (_tcsicmp(msg.sType, _T("windowinit")) == 0)
{
OnPrepare(msg);
}
else if (_tcsicmp(msg.sType, _T("killfocus")) == 0)
{
}
else if (_tcsicmp(msg.sType, _T("click")) == 0)
{
if (_tcsicmp(msg.pSender->GetName(), kCloseButtonControlName) == 0)
{
OnExit(msg);
}
else if (_tcsicmp(msg.pSender->GetName(), kMinButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_MINIMIZE);
#else
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kMaxButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_MAXIMIZE);
CControlUI* pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kMaxButtonControlName));
if( pControl ) pControl->SetVisible(false);
pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kRestoreButtonControlName));
if( pControl ) pControl->SetVisible(true);
#else
SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kRestoreButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_RESTORE);
CControlUI* pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kMaxButtonControlName));
if( pControl ) pControl->SetVisible(true);
pControl = static_cast<CControlUI*>(paint_manager_.FindControl(kRestoreButtonControlName));
if( pControl ) pControl->SetVisible(false);
#else
SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kFontButtonControlName) == 0)
{
CContainerUI* pFontbar = static_cast<CContainerUI*>(paint_manager_.FindControl(kFontbarControlName));
if (pFontbar != NULL)
pFontbar->SetVisible(!pFontbar->IsVisible());
}
else if (_tcsicmp(msg.pSender->GetName(), kEmotionButtonControlName) == 0)
{
POINT pt = {0};
CRect rcEmotionBtn = msg.pSender->GetPos();
CRect rcWindow;
GetWindowRect(m_hWnd, &rcWindow);
pt.y = rcWindow.top + rcEmotionBtn.top;
pt.x = rcWindow.left + rcEmotionBtn.left;
//emotion_list_window_.SelectEmotion(pt);
}
else if (_tcsicmp(msg.pSender->GetName(), kSendButtonControlName) == 0)
{
}
}
else if (_tcsicmp(msg.sType, _T("timer")) == 0)
{
return OnTimer(msg);
}
else if (_tcsicmp(msg.sType, _T("selectchanged")) == 0)
{
if (_tcsicmp(msg.pSender->GetName(), kColorButtonControlName) == 0)
{
CContainerUI* pFontbar = static_cast<CContainerUI*>(paint_manager_.FindControl(kFontbarControlName));
if (pFontbar != NULL)
{
POINT pt = {0};
CRect rcFontbar = pFontbar->GetPos();
CRect rcColorBtn = msg.pSender->GetPos();
CRect rcWindow;
GetWindowRect(m_hWnd, &rcWindow);
pt.y = rcWindow.top + rcFontbar.top;
pt.x = rcWindow.left + rcColorBtn.left + static_cast<LONG>(rcColorBtn.right - rcColorBtn.left / 2);
new CColorPicker(this, pt);
}
}
else if (_tcsicmp(msg.pSender->GetName(), kBoldButtonControlName) == 0)
{
COptionUI* bold_button = static_cast<COptionUI*>(msg.pSender);
if (bold_button != NULL)
{
bold_ = bold_button->IsSelected();
FontStyleChanged();
}
}
else if (_tcsicmp(msg.pSender->GetName(), kItalicButtonControlName) == 0)
//.........这里部分代码省略.........
示例6: Notify
void ChatDialog::Notify(TNotifyUI& msg)
{
if (_tcsicmp(msg.sType, _T("windowinit")) == 0)
{
OnPrepare(msg);
InitWindow();
}
else if (_tcsicmp(msg.sType, _T("killfocus")) == 0)
{
}
else if (_tcsicmp(msg.sType, _T("click")) == 0)
{
if (_tcsicmp(msg.pSender->GetName(), _T("shockbtn"))==0)
{
theApp->ShakeToWho(friend_);
}
else if (_tcsicmp(msg.pSender->GetName(), _T("trans_file"))==0)
{
OnTransFile(msg);
}
else if (_tcsicmp(msg.pSender->GetName(), _T("empty_richedit")) == 0)
{
int lSelBegin,lSelEnd;
lSelEnd = lSelBegin = m_pMsgView->GetTextLength();
m_pMsgView->SetSel(0, lSelEnd);//选择全部
m_pMsgView->ReplaceSel(_T(""), false);
}
else if (_tcsicmp(msg.pSender->GetName(), kCloseButtonControlName) == 0)
{
OnExit(msg);
}
else if (_tcsicmp(msg.pSender->GetName(), kMinButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_MINIMIZE);
#else
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kMaxButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_MAXIMIZE);
CControlUI* pControl = static_cast<CControlUI*>(GetPaintMgr()->FindControl(kMaxButtonControlName));
if( pControl ) pControl->SetVisible(false);
pControl = static_cast<CControlUI*>(GetPaintMgr()->FindControl(kRestoreButtonControlName));
if( pControl ) pControl->SetVisible(true);
#else
SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kRestoreButtonControlName) == 0)
{
#if defined(UNDER_CE)
::ShowWindow(m_hWnd, SW_RESTORE);
CControlUI* pControl = static_cast<CControlUI*>(GetPaintMgr()->FindControl(kMaxButtonControlName));
if( pControl ) pControl->SetVisible(true);
pControl = static_cast<CControlUI*>(GetPaintMgr()->FindControl(kRestoreButtonControlName));
if( pControl ) pControl->SetVisible(false);
#else
SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
#endif
}
else if (_tcsicmp(msg.pSender->GetName(), kFontButtonControlName) == 0)
{
CContainerUI* pFontbar = static_cast<CContainerUI*>(GetPaintMgr()->FindControl(kFontbarControlName));
if (pFontbar != NULL)
pFontbar->SetVisible(!pFontbar->IsVisible());
}
else if (_tcsicmp(msg.pSender->GetName(), kEmotionButtonControlName) == 0)
{
POINT pt = {0};
CDuiRect rcEmotionBtn = msg.pSender->GetPos();
RECT rcWindow;
GetWindowRect( &rcWindow );
pt.y = rcWindow.top + rcEmotionBtn.top;
pt.x = rcWindow.left + rcEmotionBtn.left;
//emotion_list_window_.SelectEmotion(pt);
}
else if (_tcsicmp(msg.pSender->GetName(), kSendButtonControlName) == 0)
{
SendMsg();
}
}
else if( _tcsicmp(msg.sType, _T("return")) == 0 )
{
if (_tcsicmp(msg.pSender->GetName(), kInputRichEditControlName) == 0)
{
SendMsg();
}
}
else if (_tcsicmp(msg.sType, _T("timer")) == 0)
{
return OnTimer(msg);
}
else if (_tcsicmp(msg.sType, _T("selectchanged")) == 0)
{
if (_tcsicmp(msg.pSender->GetName(), kColorButtonControlName) == 0)
{
//.........这里部分代码省略.........
示例7: Notify
void ChatDialog::Notify(TNotifyUI& msg)
{
if (_tcsicmp(msg.sType, _T("windowinit")) == 0)
{
OnPrepare(msg);
}
else if (_tcsicmp(msg.sType, _T("killfocus")) == 0)
{
}
else if (_tcsicmp(msg.sType, _T("click")) == 0)
{
if (_tcsicmp(msg.pSender->GetName(), kCloseButtonControlName) == 0)
{
OnExit(msg);
}
else if (_tcsicmp(msg.pSender->GetName(), kMinButtonControlName) == 0)
{
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
}
else if (_tcsicmp(msg.pSender->GetName(), kMaxButtonControlName) == 0)
{
SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
}
else if (_tcsicmp(msg.pSender->GetName(), kRestoreButtonControlName) == 0)
{
SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
}
else if (_tcsicmp(msg.pSender->GetName(), kFontButtonControlName) == 0)
{
CContainerUI* pFontbar = static_cast<CContainerUI*>(paint_manager_.FindControl(kFontbarControlName));
if (pFontbar != NULL)
pFontbar->SetVisible(!pFontbar->IsVisible());
}
else if (_tcsicmp(msg.pSender->GetName(), kEmotionButtonControlName) == 0)
{
POINT pt = {0};
CDuiRect rcEmotionBtn = msg.pSender->GetPos();
CDuiRect rcWindow;
GetWindowRect(m_hWnd, &rcWindow);
pt.y = rcWindow.top + rcEmotionBtn.top;
pt.x = rcWindow.left + rcEmotionBtn.left;
//emotion_list_window_.SelectEmotion(pt);
new CEmotion(this,pt);
}
else if (_tcsicmp(msg.pSender->GetName(), kSendButtonControlName) == 0)
{
CRichEditUI* pRichEdit = static_cast<CRichEditUI*>(paint_manager_.FindControl(kInputRichEditControlName));
CRichEditUI* pViewEdit = static_cast<CRichEditUI*>(paint_manager_.FindControl(kViewRichEditControlName));
if( pRichEdit == NULL ) return;
pRichEdit->SetFocus();
CDuiString sText = pRichEdit->GetTextRange(0, pRichEdit->GetTextLength());
//CDuiString sText=pRichEdit->GetEditGifStr();
if( sText.IsEmpty() )
return;
int textlen = sText.GetLength();
if (textlen > 512)
{
pViewEdit->SetTextColor(RGB(255,0,0));
pViewEdit->SetText(_T("错误!发送数据的长度不能超过512字节。"));
}
else
{
int imNum = friend_.id;
TCHAR sendmesg[513] = {0};
_stprintf_s(sendmesg,512,_T("%s"),sText.GetData());
int len = strlen(sendmesg);
if (len !=textlen)
{
pViewEdit->SetTextColor(RGB(255,0,0));
pViewEdit->SetText(_T("警告!发送数据的长度和计算的不同。"));
}
frame_wnd_->m_pTcpCommunication->SendMsg(MSG_TYPE_FRIEND,imNum,sendmesg,textlen);
//显示在
SendMsg(g_myself_info.nick_name,sText);
pRichEdit->SetText(_T(""));
//test
//CDuiString strbmp;
//strbmp.Format("c:\\1.gif");
//pRichEdit->InsertGif(strbmp);
}
}
}
else if( _tcsicmp(msg.sType, _T("return")) == 0 )
{
if (_tcsicmp(msg.pSender->GetName(), kInputRichEditControlName) == 0)
{
CRichEditUI* pRichEdit = static_cast<CRichEditUI*>(paint_manager_.FindControl(kInputRichEditControlName));
//.........这里部分代码省略.........