本文整理汇总了C++中CContainerUI::GetRowCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::GetRowCount方法的具体用法?C++ CContainerUI::GetRowCount怎么用?C++ CContainerUI::GetRowCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::GetRowCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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->GetRowCount(); 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, TRUE);
}
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;
}
}
示例2: OnLButtonDown
void CUIDesignerView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CClientDC dc(this);
OnPrepareDC(&dc);//Device coordinates to Logical coordinates
dc.SetWindowOrg(-FORM_OFFSET_X,-FORM_OFFSET_Y);//Logical coordinates to Form coordinates
CPoint ptLogical=point-m_ptDPtoLP;//Device coordinates to Logical coordinates
ptLogical.Offset(-FORM_OFFSET_X,-FORM_OFFSET_Y);//Logical coordinates to Form coordinates
CControlUI* pControl=m_LayoutManager.FindControl(ptLogical);
CTrackerElement* pTracker=NULL;
if(pControl==NULL)
pControl=m_LayoutManager.GetForm();
int nHit=m_MultiTracker.HitTest(ptLogical);
int nType=GetControlType(pControl);
if((nFlags&MK_CONTROL)==0&&nHit==hitNothing)
m_MultiTracker.RemoveAll();
if(nHit==hitNothing)
m_MultiTracker.Add(CreateTracker(pControl));
else
m_MultiTracker.SetFocus(ptLogical);
if(nHit>=0||nType==typeControl)
{
m_MultiTracker.Track(this, ptLogical, FALSE,&dc);
}
else
{
CUITracker tracker;
int nClass=g_pToolBoxWnd->GetCurSel()->GetClass();
CRect rect;
if (tracker.TrackRubberBand(this, point, TRUE))
{
rect=tracker.GetRect();
rect.NormalizeRect();
rect.OffsetRect(-FORM_OFFSET_X,-FORM_OFFSET_Y);
if(rect.Width()<10&&rect.Height()<10)
rect.SetRect(ptLogical.x,ptLogical.y,ptLogical.x+UI_DEFAULT_WIDTH,ptLogical.y+UI_DEFAULT_HEIGHT);
}
else
{
rect.SetRect(ptLogical.x,ptLogical.y,ptLogical.x+UI_DEFAULT_WIDTH,ptLogical.y+UI_DEFAULT_HEIGHT);
}
if(nClass>classPointer)
{
CControlUI* pNewControl=m_LayoutManager.NewUI(nClass,rect,pControl);
CArray<CControlUI*,CControlUI*> arrSelected;
arrSelected.Add(pNewControl);
m_UICommandHistory.Begin(arrSelected, actionAdd);
m_UICommandHistory.End();
g_pClassView->InsertUITreeItem(pNewControl);
CContainerUI *pContainer = (CContainerUI *)pNewControl->GetInterface(_T("Container"));
if (pContainer != NULL)
{
for (int it = 0; it < pContainer->GetRowCount(); it++)
{
g_pClassView->InsertUITreeItem(pContainer->GetItemAt(it));
}
}
g_pToolBoxWnd->SetCurSel(classPointer);
m_MultiTracker.RemoveAll();
m_MultiTracker.Add(CreateTracker(pNewControl));
}
}
g_pClassView->SelectUITreeItem(m_MultiTracker.GetFocused());
if(m_MultiTracker.GetSize()==1)
g_pPropertiesWnd->ShowProperty(m_MultiTracker.GetFocused());
else
g_pPropertiesWnd->HideAllProperties(TRUE,TRUE);
this->Invalidate(FALSE);
// __super::OnLButtonDown(nFlags, point);
}