当前位置: 首页>>代码示例>>C++>>正文


C++ UIControl::GetName方法代码示例

本文整理汇总了C++中UIControl::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ UIControl::GetName方法的具体用法?C++ UIControl::GetName怎么用?C++ UIControl::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIControl的用法示例。


在下文中一共展示了UIControl::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ButtonPressed

void UIScrollViewTest::ButtonPressed(BaseObject *obj, void *data, void *callerData)
{
	UIControl *control = dynamic_cast<UIControl*>(obj);
	if (control)
	{
		String msg = Format("Tap on control - %s", control->GetName().c_str());
		testMessageText->SetText(StringToWString(msg));
	}
	else
	{
		testMessageText->SetText(L"");
	}

	if (obj == finishTestBtn)
	{
		testFinished = true;
	}
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例2: BuildHierarchyTree

void HierarchyTreeScreenNode::BuildHierarchyTree(HierarchyTreeNode* parent, List<UIControl*> child)
{
	for (List<UIControl*>::const_iterator iter = child.begin();
		 iter != child.end();
		 ++iter)
	{
		UIControl* uiControl = (*iter);
		
		HierarchyTreeControlNode* node = NULL;
		if (dynamic_cast<UIAggregatorControl*>(uiControl))
			node = new HierarchyTreeAggregatorControlNode(NULL, parent, uiControl, QString::fromStdString(uiControl->GetName()));
		else
			node = new HierarchyTreeControlNode(parent, uiControl, QString::fromStdString(uiControl->GetName()));

		// Build hierarchy tree for all control's children. Subcontrols are loaded separately
        InitializeControlBeforeAddingToTree(uiControl);
		BuildHierarchyTree(node, uiControl->GetRealChildren());
		parent->AddTreeNode(node);
	}
}
开发者ID:galek,项目名称:dava.framework,代码行数:20,代码来源:HierarchyTreeScreenNode.cpp

示例3: CreateNewControl

HierarchyTreeControlNode* LibraryController::CreateNewControl(HierarchyTreeNode* parentNode, const QString& strType, const QString& name, const Vector2& position)
{
	String type = strType.toStdString();

	HierarchyTreeControlNode* controlNode = NULL;
	UIControl* control = NULL;
	CONTROLS::iterator iter;
	
	for (iter = controls.begin(); iter != controls.end(); ++iter)
	{
		HierarchyTreeNode* node = iter->first;
		if (strType == node->GetName())
			break;
	}
	
	if (iter == controls.end() ||
		dynamic_cast<HierarchyTreeControlNode*>(iter->first))
	{
		//create standart control
		BaseObject* object = ObjectFactory::Instance()->New(type);
		control = dynamic_cast<UIControl*>(object);
		if (!control)
		{
			SafeRelease(object);
			return NULL;
		}
		 
		controlNode = new HierarchyTreeControlNode(parentNode, control, name);
	}
	else
	{
		//create aggregator
		HierarchyTreeAggregatorNode* aggregator = dynamic_cast<HierarchyTreeAggregatorNode*>(iter->first);
		if (aggregator)
		{
			controlNode = aggregator->CreateChild(parentNode, name);
			control = controlNode->GetUIObject();
		}
	}
	
	parentNode->AddTreeNode(controlNode);
	
	// In case the control has subcontrols - they should be added to the control node too.
	if (control && !control->GetSubcontrols().empty())
	{
		List<UIControl*> subControls = control->GetSubcontrols();
		for (List<UIControl*>::iterator iter = subControls.begin(); iter != subControls.end(); iter ++)
		{
			UIControl* subControl = (*iter);
			if (!subControl)
			{
				continue;
			}

			HierarchyTreeControlNode* subControlNode =
				new HierarchyTreeControlNode(controlNode, subControl,
											 QString::fromStdString(subControl->GetName()));
			controlNode->AddTreeNode(subControlNode);
		}
	}

	// Initialize a control through its metadata.
	BaseMetadata* newControlMetadata = MetadataFactory::Instance()->GetMetadataForUIControl(control);

	METADATAPARAMSVECT params;
	params.push_back(BaseMetadataParams(controlNode->GetId(), control));
	newControlMetadata->SetupParams(params);

	// Ready to do initialization!
	newControlMetadata->InitializeControl(name.toStdString(), position);

	SAFE_DELETE(newControlMetadata);

	SafeRelease(control);
	return controlNode;
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:76,代码来源:LibraryController.cpp


注:本文中的UIControl::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。