本文整理汇总了C++中CControlBase::SetRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBase::SetRect方法的具体用法?C++ CControlBase::SetRect怎么用?C++ CControlBase::SetRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBase
的用法示例。
在下文中一共展示了CControlBase::SetRect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetControlRect
void CDuiText::SetControlRect(CRect rc)
{
m_rc = rc;
CRect rcTemp;
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase)
{
UINT uControlID = pControlBase->GetControlID();
if((SCROLL_V == uControlID) && m_bScrollV)
{
rcTemp = m_rc;
rcTemp.left = rcTemp.right - m_nScrollWidth;
}else
if(LISTBK_AREA == uControlID)
{
rcTemp = m_rc;
rcTemp.right -= m_nScrollWidth;
}else
{
continue;
}
pControlBase->SetRect(rcTemp);
}
}
}
示例2: SetControlRect
void CScrollV::SetControlRect(CRect rc)
{
m_rc = rc;
SetRange();
CRect rcTemp;
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase)
{
pControlBase->SetVisible(m_bShowScroll);
UINT uControlID = pControlBase->GetControlID();
if (BT_UP == uControlID)
{
rcTemp = m_rc;
rcTemp.bottom = m_rc.top + 20;
}
else if(BT_DOWN == uControlID)
{
rcTemp = m_rc;
rcTemp.top = m_rc.bottom - 20;
}
else
{
continue;
}
pControlBase->SetRect(rcTemp);
}
}
}
示例3: GetControl
// 移动控件
CControlBase * CDlgPopup::SetControlRect(UINT uControlID, CRect rc)
{
CControlBase *pControlBase = GetControl(uControlID);
if(pControlBase)
{
pControlBase->SetRect(rc);
UpdateHover();
}
return pControlBase;
}
示例4: SetControlRect
// 设置控件的位置
void CDuiPanel::SetControlRect(CRect rc)
{
m_rc = rc;
if(m_pDuiPluginObject)
{
m_pDuiPluginObject->SetRect(rc);
}
CRect rcTemp;
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase)
{
UINT uControlID = pControlBase->GetControlID();
if(SCROLL_V == uControlID)
{
rcTemp = m_rc;
rcTemp.left = rcTemp.right - m_nScrollWidth;
}else
if(SCROLL_H == uControlID)
{
rcTemp = m_rc;
rcTemp.top = rcTemp.bottom - m_nScrollWidth;
}else
{
rcTemp = pControlBase->GetRect();
if(rcTemp.bottom > m_nVirtualHeight)
{
// 刷新Panel的虚拟高度
m_nVirtualHeight = rcTemp.bottom - m_rc.top;
}
if(rcTemp.right > m_nVirtualWidth)
{
// 刷新Panel的虚拟宽度
m_nVirtualWidth = rcTemp.right - m_rc.left;
}
continue;
}
pControlBase->SetRect(rcTemp);
}
}
// 需要的总高度大于显示区高度才会显示滚动条
m_pControScrollV->SetVisible(m_nVirtualHeight > m_rc.Height());
((CDuiScrollVertical*)m_pControScrollV)->SetScrollMaxRange(m_nVirtualHeight);
// 需要的总宽度大于显示区宽度才会显示垂直滚动条
m_pControScrollH->SetVisible(m_nVirtualWidth > m_rc.Width());
((CDuiScrollHorizontal*)m_pControScrollH)->SetScrollMaxRange(m_nVirtualWidth);
}
示例5: SetControlRect
void CDuiListCtrl::SetControlRect(CRect rc)
{
m_rc = rc;
CRect rcTemp;
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase)
{
UINT uControlID = pControlBase->GetControlID();
if(SCROLL_V == uControlID)
{
rcTemp = m_rc;
rcTemp.left = rcTemp.right - m_nScrollWidth;
}else
if(LISTBK_AREA == uControlID)
{
rcTemp = m_rc;
rcTemp.right -= m_nScrollWidth;
}else
{
continue;
}
pControlBase->SetRect(rcTemp);
}
}
// 重新计算所有行的位置
int nXPos = 0;
int nYPos = 0;
for(size_t i = 0; i < m_vecRowInfo.size(); i++)
{
ListRowInfo &rowInfoTemp = m_vecRowInfo.at(i);
int nItemWidth = m_rc.Width() - m_nScrollWidth;
rowInfoTemp.rcRow.SetRect(nXPos, nYPos, nXPos + nItemWidth, nYPos + m_nRowHeight);
nYPos += m_nRowHeight;
}
// 需要的总高度大于显示区高度才会显示滚动条
m_pControScrollV->SetVisible(((int)m_vecRowInfo.size() * m_nRowHeight) > m_rc.Height());
((CScrollV*)m_pControScrollV)->SetScrollMaxRange((int)m_vecRowInfo.size() * m_nRowHeight);
}
示例6: SetControlRect
void CDuiGridCtrl::SetControlRect(CRect rc)
{
int nTotalColumnWidth = GetTotalColumnWidth();
m_rc = rc;
CRect rcTemp;
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase)
{
UINT uControlID = pControlBase->GetControlID();
if(SCROLL_V == uControlID)
{
rcTemp = m_rc;
rcTemp.top += m_nHeaderHeight;
rcTemp.left = rcTemp.right - m_nScrollWidth;
}else
if((SCROLL_H == uControlID) && (nTotalColumnWidth > m_rc.Width()))
{
rcTemp = m_rc;
rcTemp.top = rcTemp.bottom - m_nScrollWidth;
rcTemp.right = rcTemp.right - m_nScrollWidth;
}else
if(LISTBK_AREA == uControlID)
{
rcTemp = m_rc;
rcTemp.top += m_nHeaderHeight;
rcTemp.right -= m_nScrollWidth;
}else
{
continue;
}
pControlBase->SetRect(rcTemp);
}
}
// 计算横向滚动条
CalcColumnsPos();
// 重新计算所有行的位置
CalcRowsPos();
}