本文整理汇总了C++中CControlUI::GetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlUI::GetParent方法的具体用法?C++ CControlUI::GetParent怎么用?C++ CControlUI::GetParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlUI
的用法示例。
在下文中一共展示了CControlUI::GetParent方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalPos
RECT CEditWnd::CalPos()
{
CDuiRect rcPos = m_pOwner->GetPos();
RECT rcInset = m_pOwner->GetTextPadding();
rcPos.left += rcInset.left;
rcPos.top += rcInset.top;
rcPos.right -= rcInset.right;
rcPos.bottom -= rcInset.bottom;
LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
if( lEditHeight < rcPos.GetHeight() ) {
rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
rcPos.bottom = rcPos.top + lEditHeight;
}
CControlUI* pParent = m_pOwner;
RECT rcParent;
while( pParent = pParent->GetParent() ) {
if( !pParent->IsVisible() ) {
rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
break;
}
rcParent = pParent->GetClientPos();
if( !::IntersectRect(&rcPos, &rcPos, &rcParent) ) {
rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
break;
}
}
return rcPos;
}
示例2: UIModify
void CALLBACK CUICommandHistory::UIModify(TiXmlNode* pNode)
{
TiXmlElement* pElement = pNode->ToElement();
CStringA strName = pElement->Attribute("myname");
pElement->RemoveAttribute("myname");
if(strName.IsEmpty())
return;
CPaintManagerUI* pManager = g_pMainFrame->GetActiveUIView()->GetPaintManager();
CControlUI* pControl = pManager->FindControl(StringConvertor::Utf8ToWide(strName));
TiXmlAttribute* pAttrib = pElement->FirstAttribute();
if(pControl == NULL)
return;
while(pAttrib)
{
if(strcmp(pAttrib->Name(), "name") == 0)
{
pManager->ReapObjects(pControl);
g_pClassView->RenameUITreeItem(pControl, StringConvertor::Utf8ToWide(pAttrib->Value()));
pControl->SetAttribute(StringConvertor::Utf8ToWide(pAttrib->Name())
, StringConvertor::Utf8ToWide(pAttrib->Value()));
pManager->InitControls(pControl);
}
else
pControl->SetAttribute(StringConvertor::Utf8ToWide(pAttrib->Name())
, StringConvertor::Utf8ToWide(pAttrib->Value()));
pAttrib = pAttrib->Next();
}
CControlUI* pParent = pControl->GetParent();
if(pParent == NULL)
pParent = pControl;
pParent->SetPos(pParent->GetPos());
}
示例3: OnRemoveUI
void CUIDesignerView::OnRemoveUI()
{
CArray<CControlUI*,CControlUI*> arrSelected;
m_MultiTracker.GetSelected(arrSelected);
//remove form
for (int i=0; i<arrSelected.GetSize(); i++)
{
CControlUI* pControl = arrSelected[i];
if(pControl == m_LayoutManager.GetForm())
{
arrSelected.RemoveAt(i);
break;;
}
}
m_UICommandHistory.Begin(arrSelected, actionDelete);
for(int i=0; i<arrSelected.GetSize(); i++)
{
CControlUI* pControl = arrSelected[i];
CControlUI* pParent=pControl->GetParent();
HTREEITEM hDelete=(HTREEITEM)(((ExtendedAttributes*)pControl->GetTag())->hItem);
g_pClassView->RemoveUITreeItem(hDelete);
RemoveUI(pControl);
if(pParent)
pParent->NeedUpdate();
}
m_UICommandHistory.End();
g_pPropertiesWnd->HideAllProperties(TRUE,TRUE);
m_MultiTracker.RemoveAll();
}
示例4: OnDeleteUI
void CUIDesignerView::OnDeleteUI()
{
CArray<CControlUI*,CControlUI*> arrSelected;
m_MultiTracker.GetSelected(arrSelected);
RemoveForm(arrSelected);
if(arrSelected.IsEmpty())
return;
m_UICommandHistory.Begin(arrSelected, actionDelete);
for(int i=0; i<arrSelected.GetSize(); i++)
{
CControlUI* pControl = arrSelected[i];
CControlUI* pParent=pControl->GetParent();
HTREEITEM hDelete=(HTREEITEM)(((ExtendedAttributes*)pControl->GetTag())->hItem);
g_pClassView->RemoveUITreeItem(hDelete);
DeleteUI(pControl);
if(pParent)
pParent->NeedUpdate();
}
m_UICommandHistory.End();
g_pPropertiesWnd->ShowProperty(NULL);
m_MultiTracker.RemoveAll();
this->GetDocument()->SetModifiedFlag();
}
示例5: SetPos
void CControlUI::SetPos(RECT rc, bool bNeedInvalidate)
{
if( rc.right < rc.left ) rc.right = rc.left;
if( rc.bottom < rc.top ) rc.bottom = rc.top;
CDuiRect invalidateRc = m_rcItem;
if( ::IsRectEmpty(&invalidateRc) ) invalidateRc = rc;
if( m_bFloat ) {
CControlUI* pParent = GetParent();
/*if( pParent != NULL ) {
RECT rcParentPos = pParent->GetPos();
RECT rcCtrl = {rcParentPos.left + rc.left, rcParentPos.top + rc.top,
rcParentPos.left + rc.right, rcParentPos.top + rc.bottom};
m_rcItem = rcCtrl;
LONG width = rcParentPos.right - rcParentPos.left;
LONG height = rcParentPos.bottom - rcParentPos.top;
RECT rcPercent = {(LONG)(width*m_piFloatPercent.left), (LONG)(height*m_piFloatPercent.top),
(LONG)(width*m_piFloatPercent.right), (LONG)(height*m_piFloatPercent.bottom)};
m_cXY.cx = rc.left - rcPercent.left;
m_cXY.cy = rc.top - rcPercent.top;
m_cxyFixed.cx = rc.right - rcPercent.right - m_cXY.cx;
m_cxyFixed.cy = rc.bottom - rcPercent.bottom - m_cXY.cy;
}*/
}
else {
m_rcItem = rc;
}
m_rcItem = rc;
if( m_pManager == NULL ) return;
if( !m_bSetPos ) {
m_bSetPos = true;
if( OnSize ) OnSize(this);
m_bSetPos = false;
}
m_bUpdateNeeded = false;
if( bNeedInvalidate && IsVisible() ) {
invalidateRc.Join(m_rcItem);
CControlUI* pParent = this;
RECT rcTemp;
RECT rcParent;
while( pParent = pParent->GetParent() ) {
if( !pParent->IsVisible() ) return;
rcTemp = invalidateRc;
rcParent = pParent->GetPos();
if( !::IntersectRect(&invalidateRc, &rcTemp, &rcParent) ) return;
}
m_pManager->Invalidate(invalidateRc);
}
}
示例6: IsInStaticControl
BOOL WindowImplBase::IsInStaticControl(CControlUI *pControl)
{
BOOL bRet = FALSE;
if (!pControl)
{
return bRet;
}
CDuiString strClassName;
std::vector<CDuiString> vctStaticName;
strClassName = pControl->GetClass();
strClassName.MakeLower();
vctStaticName.push_back(_T("controlui"));
vctStaticName.push_back(_T("textui"));
vctStaticName.push_back(_T("labelui"));
vctStaticName.push_back(_T("containerui"));
vctStaticName.push_back(_T("horizontallayoutui"));
vctStaticName.push_back(_T("verticallayoutui"));
vctStaticName.push_back(_T("tablayoutui"));
vctStaticName.push_back(_T("childlayoutui"));
vctStaticName.push_back(_T("dialoglayoutui"));
vctStaticName.push_back(_T("progresscontainerui"));
std::vector<CDuiString>::iterator it = std::find(vctStaticName.begin(), vctStaticName.end(), strClassName);
if (vctStaticName.end() != it)
{
CControlUI* pParent = pControl->GetParent();
while (pParent)
{
strClassName = pParent->GetClass();
strClassName.MakeLower();
it = std::find(vctStaticName.begin(), vctStaticName.end(), strClassName);
if (vctStaticName.end() == it)
{
return bRet;
}
pParent = pParent->GetParent();
}
bRet = TRUE;
}
return bRet;
}
示例7: ViCbGetParent
// VApiHandle ViCbGetParent(VApiHandle hWnd)
SQInteger ViCbGetParent(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger Handle = 0;
CControlUI* pCtrl = NULL;
CControlUI* pParent = NULL;
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &Handle);
pCtrl = QiHwHandleToCtrl(Handle);
if (!pCtrl) {goto _Exit_;}
pParent = pCtrl->GetParent();
_Exit_:
sq_pushinteger(v, (SQInteger)QiHwCtrlToHandle(pParent));
return 1;
}
示例8: 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();
}
}
示例9: UIDelete
void CALLBACK CUICommandHistory::UIDelete(TiXmlNode* pNode)
{
TiXmlElement* pElement = pNode->ToElement();
CStringA strName = pElement->Attribute("myname");
if(strName.IsEmpty())
return;
CUIDesignerView* pUIView = g_pMainFrame->GetActiveUIView();
CPaintManagerUI* pManager = pUIView->GetPaintManager();
CControlUI* pControl = pManager->FindControl(StringConvertor::Utf8ToWide(strName));
if(pControl == NULL)
return;
CControlUI* pParent=pControl->GetParent();
HTREEITEM hDelete=(HTREEITEM)(((ExtendedAttributes*)pControl->GetTag())->hItem);
g_pClassView->RemoveUITreeItem(hDelete);
pUIView->DeleteUI(pControl);
if(pParent)
pParent->NeedUpdate();
}
示例10: 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();
}
}
示例11: CalPos
RECT CDateTimeWnd::CalPos()
{
CDuiRect rcPos = m_pOwner->GetPos();
CControlUI* pParent = m_pOwner;
RECT rcParent;
while( pParent = pParent->GetParent() ) {
if( !pParent->IsVisible() ) {
rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
break;
}
rcParent = pParent->GetClientPos();
if( !::IntersectRect(&rcPos, &rcPos, &rcParent) ) {
rcPos.left = rcPos.top = rcPos.right = rcPos.bottom = 0;
break;
}
}
return rcPos;
}
示例12: Invalidate
void CControlUI::Invalidate()
{
if( !IsVisible() ) return;
RECT invalidateRc = m_rcItem;
CControlUI* pParent = this;
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);
}
示例13: SetUIValue
//.........这里部分代码省略.........
}
else
pManager->ReapObjects(pControl);
g_pClassView->RenameUITreeItem(pControl, strNewVal);
break;
}
case tagPos:
case tagPadding:
SetPropValue(pControl,tagSize);
nUpdate=UPDATE_POS;
break;
case tagSize:
case tagMinSize:
case tagMaxSize:
case tagMinMax:
SetUIValue(pProp->GetSubItem(0),-1);
SetUIValue(pProp->GetSubItem(1),-1);
SetPropValue(pControl,tagPos);
nUpdate=UPDATE_POS;
break;
case tagFloat:
case tagColumns:
nUpdate=UPDATE_POS;
break;
case tagVisible:
nUpdate=UPDATE_REDRAW_PARENT;
break;
case tagListHeader:
if (strNewVal.Compare(_T("false"))==0)
{
strNewVal = _T("hidden");
}
break;
case tagAlpha:
{
int alpha=_ttoi(strNewVal);
if (alpha<0)
{
strNewVal=_T("0");
pProp->SetValue((_variant_t)(LONG)0);
}
else
{
strNewVal=_T("255");
pProp->SetValue((_variant_t)(LONG)255);
}
break;
}
}
CUIDesignerView* pUIView=g_pMainFrame->GetActiveUIView();
ASSERT(pUIView);
TNotifyUI Msg;
UIAttribute oldAttrib = {strName, strOldVal};
Msg.pSender=pControl;
Msg.sType=_T("PropertyBeginChanged");
Msg.wParam=0;
Msg.lParam=(LPARAM)&oldAttrib;
pUIView->Notify(Msg);
pControl->SetAttribute(strName,strNewVal);
pProp->SetOriginalValue(pProp->GetValue());
UIAttribute newAttrib = {strName, strNewVal};
Msg.sType = _T("PropertyEndChanged");
Msg.lParam = (LPARAM)&newAttrib;
pUIView->Notify(Msg);
if(nTag==tagWindowSize)
{
Msg.sType=_T("formsize");
Msg.lParam = NULL;
pUIView->Notify(Msg);
}
else if(nTag == tagName)
{
CPaintManagerUI* pManager = pUIView->GetPaintManager();
pManager->InitControls(pControl);
}
CControlUI* pParent=pControl->GetParent();
if(pParent==NULL)
pParent=pControl;
switch(nUpdate)
{
case UPDATE_POS:
pParent->SetPos(pParent->GetPos());
break;
case UPDATE_REDRAW_CONTROL:
pControl->NeedUpdate();
break;
case UPDATE_REDRAW_PARENT:
pParent->NeedUpdate();
}
}