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


C++ PProperty::GetChildFromParent方法代码示例

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


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

示例1: ParseProperty

bool TemplateParser::ParseProperty()
{
	wxString childName;
	wxString propname = ParsePropertyName( &childName );

	PProperty property = m_obj->GetProperty(propname);
	if ( NULL == property.get() )
	{
		wxLogError( wxT("The property '%s' does not exist for objects of class '%s'"), propname.c_str(), m_obj->GetClassName().c_str() );
		return true;
	}

	if ( childName.empty() )
	{
		wxString code = PropertyToCode(property);
		m_out << code;
	}
	else
	{
		m_out << property->GetChildFromParent( childName );
	}

	//  LogDebug("parsing property %s",propname.c_str());

	return true;
}
开发者ID:joro75,项目名称:wxFormBuilder,代码行数:26,代码来源:codegen.cpp

示例2: GetChildFromParentProperty

wxString ObjectBase::GetChildFromParentProperty( const wxString& parentName, const wxString& childName )
{
	PProperty property = GetProperty( parentName );
	if (property)
		return property->GetChildFromParent( childName );
	else
		return wxEmptyString;
}
开发者ID:heyuqi,项目名称:wxFormBuilder,代码行数:8,代码来源:objectbase.cpp

示例3: GenEvents

void PHPCodeGenerator::GenEvents( PObjectBase class_obj, const EventVector &events, bool disconnect )
{
	if ( events.empty() )
	{
		return;
	}

	if( disconnect )
	{
		m_source->WriteLn( wxT("// Disconnect Events") );
	}
	else
	{
		m_source->WriteLn();
		m_source->WriteLn( wxT("// Connect Events") );
	}

	PProperty propName = class_obj->GetProperty( wxT("name") );
	if ( !propName )
	{
		wxLogError(wxT("Missing \"name\" property on \"%s\" class. Review your XML object description"),
			class_obj->GetClassName().c_str());
		return;
	}

	wxString class_name = propName->GetValue();
	if ( class_name.empty() )
	{
		wxLogError( wxT("Object name cannot be null") );
		return;
	}

	wxString base_class;
	wxString handlerName;

	PProperty propSubclass = class_obj->GetProperty( wxT("subclass") );
	if ( propSubclass )
	{
		wxString subclass = propSubclass->GetChildFromParent( wxT("name") );
		if ( !subclass.empty() )
		{
			base_class = subclass;
		}
	}

	if ( base_class.empty() )
		base_class = wxT("wx") + class_obj->GetClassName();

	if ( events.size() > 0 )
	{
		for ( size_t i = 0; i < events.size(); i++ )
		{
			PEvent event = events[i];

			handlerName = event->GetValue();

			wxString templateName = wxString::Format( wxT("connect_%s"), event->GetName().c_str() );

			PObjectBase obj = event->GetObject();
			if ( !GenEventEntry( obj, obj->GetObjectInfo(), templateName, handlerName, disconnect ) )
			{
				wxLogError( wxT("Missing \"evt_%s\" template for \"%s\" class. Review your XML object description"),
					templateName.c_str(), class_name.c_str() );
			}
		}
	}
}
开发者ID:heyuqi,项目名称:wxFormBuilder,代码行数:67,代码来源:phpcg.cpp


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