本文整理汇总了C++中CContainerUI::GetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::GetPos方法的具体用法?C++ CContainerUI::GetPos怎么用?C++ CContainerUI::GetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::GetPos方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RedoUI
void CUIDesignerView::RedoUI(CControlUI* pControl, CControlUI* pParent)
{
ASSERT(pControl && pParent);
if(!pControl || !pParent)
return;
CContainerUI* pContainer = static_cast<CContainerUI*>(pParent->GetInterface(_T("Container")));
ExtendedAttributes* pExtended = (ExtendedAttributes*)pContainer->GetTag();
pContainer->Add(pControl);
m_MultiTracker.Add(CreateTracker(pControl));
InitUI(pControl, pExtended->nDepth + 1, TRUE);
pContainer->SetPos(pContainer->GetPos());
}
示例2: Invalidate
//************************************
// 函数名称: Invalidate
// 返回类型: void
// 函数说明:
//************************************
void CTreeNodeUI::Invalidate()
{
if( !IsVisible() )
return;
if( GetParent() ) {
CContainerUI* pParentContainer = static_cast<CContainerUI*>(GetParent()->GetInterface(_T("Container")));
if( pParentContainer ) {
RECT rc = pParentContainer->GetPos();
RECT rcInset = pParentContainer->GetInset();
rc.left += rcInset.left;
rc.top += rcInset.top;
rc.right -= rcInset.right;
rc.bottom -= rcInset.bottom;
CScrollBarUI* pVerticalScrollBar = pParentContainer->GetVerticalScrollBar();
if( pVerticalScrollBar && pVerticalScrollBar->IsVisible() ) rc.right -= pVerticalScrollBar->GetFixedWidth();
CScrollBarUI* pHorizontalScrollBar = pParentContainer->GetHorizontalScrollBar();
if( pHorizontalScrollBar && pHorizontalScrollBar->IsVisible() ) rc.bottom -= pHorizontalScrollBar->GetFixedHeight();
RECT invalidateRc = m_rcItem;
if( !::IntersectRect(&invalidateRc, &m_rcItem, &rc) )
return;
CControlUI* pParent = GetParent();
RECT rcTemp;
RECT rcParent;
while( pParent = pParent->GetParent() )
{
rcTemp = invalidateRc;
rcParent = pParent->GetPos();
if( !::IntersectRect(&invalidateRc, &rcTemp, &rcParent) )
return;
}
if( m_pManager != NULL ) m_pManager->Invalidate(invalidateRc);
}
else {
CContainerUI::Invalidate();
}
}
else {
CContainerUI::Invalidate();
}
}
示例3: PasteUI
void CUIDesignerView::PasteUI(LPCTSTR xml)
{
CDialogBuilder builder;
CControlUI* pRoot=builder.Create(xml, (UINT)0, NULL, m_LayoutManager.GetManager());
if(pRoot)
{
CControlUI* pParent = m_MultiTracker.GetFocused();
if(pParent->GetInterface(_T("Container")) == NULL)
pParent = pParent->GetParent();
if(pParent == NULL)
pParent = m_LayoutManager.GetForm();
m_MultiTracker.RemoveAll();
CContainerUI* pContainer = static_cast<CContainerUI*>(pParent->GetInterface(_T("Container")));
CContainerUI* pRootContainer = static_cast<CContainerUI*>(pRoot->GetInterface(_T("Container")));
ExtendedAttributes* pExtended = (ExtendedAttributes*)pContainer->GetTag();
for(int i=0; i<pRootContainer->GetCount(); i++)
{
CControlUI* pControl = pRootContainer->GetItemAt(i);
if(pControl->IsFloat())
{
SIZE sz = pControl->GetFixedXY();
sz.cx += COPY_OFFSET_XY;
sz.cy += COPY_OFFSET_XY;
pControl->SetFixedXY(sz);
}
pContainer->Add(pControl);
m_MultiTracker.Add(CreateTracker(pControl));
InitUI(pControl, pExtended->nDepth + 1);
}
CArray<CControlUI*,CControlUI*> arrSelected;
m_MultiTracker.GetSelected(arrSelected);
m_UICommandHistory.Begin(arrSelected, actionAdd);
m_UICommandHistory.End();
pContainer->SetPos(pContainer->GetPos());
pRootContainer->SetAutoDestroy(false);
delete pRootContainer;
this->GetDocument()->SetModifiedFlag();
}
}
示例4: 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)
//.........这里部分代码省略.........
示例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)
{
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));
//.........这里部分代码省略.........