本文整理汇总了C++中CPaintManagerUI::InitControls方法的典型用法代码示例。如果您正苦于以下问题:C++ CPaintManagerUI::InitControls方法的具体用法?C++ CPaintManagerUI::InitControls怎么用?C++ CPaintManagerUI::InitControls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPaintManagerUI
的用法示例。
在下文中一共展示了CPaintManagerUI::InitControls方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
示例2: 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();
}
}