本文整理汇总了C++中CContainerUI::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::Add方法的具体用法?C++ CContainerUI::Add怎么用?C++ CContainerUI::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::Add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ViCbAddCtrl
// BOOL ViCbAddCtrl(HANDLE hCtrl, HANDLE hParent)
SQInteger ViCbAddCtrl(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger hCtrl = 0;
SQInteger hParent = 0;
CContainerUI* pParentCtrl = NULL;
CScriptMgr* pMgr = NULL;
CPaintManagerUI* pPM = NULL;
CControlUI* pCtrl = NULL;
SQBool bRet = FALSE;
if (!v || 2 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 3)) {goto _Exit_;}
sq_getinteger(v, 2, &hCtrl);
sq_getinteger(v, 3, &hParent);
pCtrl = QiHwHandleToCtrl(hCtrl);
pParentCtrl = (CContainerUI*)QiHwHandleToCtrl(hParent);
if (!pCtrl) {goto _Exit_;}
if (NULL == pParentCtrl) {
pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
pParentCtrl = (CContainerUI*)pPM->GetRoot();
}
if (!pParentCtrl || !pParentCtrl->IsContainer()) {goto _Exit_;}
bRet = (SQBool)pParentCtrl->Add(pCtrl);
_Exit_:
sq_pushbool(v, bRet);
return 1;
}
示例2: InitProp
//初始化道具栏
void CRightFrame::InitProp()
{
CContainerUI* pPropMainCtn = static_cast<CContainerUI*>(m_pm.FindControl("Prop_Ctn_Main"));
if (!pPropMainCtn)
{
return;
}
RECT rc = {0,20,1,0};
char szBuf[32] = {0};
for (int i = 0; i < MAX_PROP_NUMS; ++i)
{
m_pPropBtn[i] = new CButtonUI();
_stprintf(szBuf,"Prop_Btn_%d",i);
m_pPropBtn[i]->SetName(szBuf);
m_pPropBtn[i]->SetText("");
m_pPropBtn[i]->SetTextColor(0xFFFFFFFF);
m_pPropBtn[i]->SetAttribute("align","right");
m_pPropBtn[i]->SetTextPadding(rc);
m_pPropBtn[i]->SetFixedHeight(34);
m_pPropBtn[i]->SetFixedWidth(34);
m_pPropBtn[i]->SetFloat(true);
m_pPropBtn[i]->SetTag(0);
pPropMainCtn->Add(m_pPropBtn[i]);
}
return;
}
示例3: 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());
}
示例4: 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();
}
}
示例5: EnumInstalledDriver
void MainFrame::EnumInstalledDriver()
{
// 清空界面中list中显示的打印机列表
CContainerUI* pDriverList = static_cast<CContainerUI*>(paint_manager_.FindControl(_T("driver_list")));
if (pDriverList != NULL)
pDriverList->RemoveAll();
// 枚举本地计算机上所有安装的打印机驱动(实际使用时可以只枚举自家的打印机驱动)
LPBYTE lpBuffer = NULL;
DWORD dwNeeded = 0,dwReturned = 0;
EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 1, NULL, 0, &dwNeeded, &dwReturned);
if (dwNeeded == 0)
return;
lpBuffer = (LPBYTE)malloc(dwNeeded);
if (lpBuffer == NULL)
return;
EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 1, lpBuffer, dwNeeded, &dwNeeded, &dwReturned);
for (DWORD dwIndex = 0; (dwIndex < dwReturned) && (pDriverList != NULL); dwIndex++)
{
COptionUI* pDriver = new COptionUI();
if (pDriver != NULL)
{
pDriver->ApplyAttributeList(_T("padding=\"15,0,0,0\" height=\"35\" textpadding=\"20,0,0,0\" align=\"left\" normalimage=\"res='124' restype='png' dest='0,10,15,25'\" hotimage=\"res='125' restype='png' dest='0,10,15,25'\" selectedimage=\"res='126' restype='png' dest='0,10,15,25'\""));
pDriver->SetText(((PRINTER_INFO_1*)lpBuffer + dwIndex)->pName);
pDriverList->Add(pDriver);
}
}
LPTSTR lpDefaultPrinter;
GetDefaultPrinter(NULL, &dwNeeded);
lpDefaultPrinter = (LPTSTR)malloc(dwNeeded * sizeof(TCHAR));
GetDefaultPrinter((LPTSTR)lpDefaultPrinter, &dwNeeded);
free(lpDefaultPrinter);
free(lpBuffer);
}
示例6:
CContainerUI * CScalableLayout::CreateLayout( CScalableNode::Ptr pNode,int nLevel )
{
CContainerUI *pLayout = pNode->IsHor ?
static_cast<CContainerUI*>(new CHorizontalLayoutUI) :
static_cast<CContainerUI*>(new CVerticalLayoutUI);
pLayout->SetBkColor(pNode->BkColor);
for (CScalableNode::Iter i = pNode->ChildBegin();
i != pNode->ChildEnd();
i++)
{
bool bLeaf = true;
for (CScalableNode::Iter j = (*i)->ChildBegin();
j != (*i)->ChildEnd();
j++)
{
if ((*j)->Level == nLevel)
{
bLeaf = false;
break;
}
}
if (bLeaf)
{
CContainerUI *pItemContainer = new CContainerUI;
CButtonUI *pItem = new CButtonUI;
pItem->SetName((*i)->Name);
pItem->SetBkColor((*i)->BkColor);
pItem->SetShowHtml();
pItem->SetTextStyle(DT_CENTER|DT_VCENTER);
CDuiString sText;
if ((*i)->Text.IsEmpty())
{
sText.Format(_T("{p}{c #FFCCCCCC}%s{/c}{/p}"),
(LPCTSTR)(*i)->Description);
}
else
{
sText.Format(_T("{p}%s{n}{c #FFCCCCCC}%s{/c}{/p}"),
(LPCTSTR)(*i)->Text,(LPCTSTR)(*i)->Description);
}
pItem->SetText(sText);
pItemContainer->Add(pItem);
pLayout->Add(pItemContainer);
}
else
{
pLayout->Add(CreateLayout(*i,nLevel));
}
}
if (!pNode->Description.IsEmpty())
{
CVerticalLayoutUI *pWrapper = new CVerticalLayoutUI;
pWrapper->Add(pLayout);
pLayout->SetInset(CDuiRect(5,5,5,0));
CLabelUI *pDescription = new CLabelUI;
pDescription->SetFixedHeight(20);
pDescription->SetTextStyle(DT_CENTER);
pDescription->SetBkColor(pNode->BkColor);
pDescription->SetText(pNode->Description);
pWrapper->Add(pDescription);
return pWrapper;
}
return pLayout;
}