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


C++ IObject::GetClassName方法代码示例

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


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

示例1: OnCreated

	void OnCreated( wxObject* wxobject, wxWindow* /*wxparent*/ )
	{
		// Get parent sizer
		wxObject* parent = GetManager()->GetParent( wxobject );
		wxSizer* sizer = wxDynamicCast( parent, wxSizer );

		if ( NULL == sizer )
		{
			wxLogError( wxT("The parent of a SizerItem is either missing or not a wxSizer - this should not be possible!") );
			return;
		}

		// Get child window
		wxObject* child = GetManager()->GetChild( wxobject, 0 );
		if ( NULL == child )
		{
			wxLogError( wxT("The SizerItem component has no child - this should not be possible!") );
			return;
		}

		// Get IObject for property access
		IObject* obj = GetManager()->GetIObject( wxobject );
		IObject* childObj = GetManager()->GetIObject( child );

		// Add the spacer
		if ( _("spacer") == childObj->GetClassName() )
		{
			sizer->Add(	childObj->GetPropertyAsInteger( _("width") ),
						childObj->GetPropertyAsInteger( _("height") ),
						obj->GetPropertyAsInteger(_("proportion")),
						obj->GetPropertyAsInteger(_("flag")),
						obj->GetPropertyAsInteger(_("border"))
						);
			return;
		}

		// Add the child ( window or sizer ) to the sizer
		wxWindow* windowChild = wxDynamicCast( child, wxWindow );
		wxSizer* sizerChild = wxDynamicCast( child, wxSizer );

		if ( windowChild != NULL )
		{
			sizer->Add( windowChild,
				obj->GetPropertyAsInteger(_("proportion")),
				obj->GetPropertyAsInteger(_("flag")),
				obj->GetPropertyAsInteger(_("border")));
		}
		else if ( sizerChild != NULL )
		{
			sizer->Add( sizerChild,
				obj->GetPropertyAsInteger(_("proportion")),
				obj->GetPropertyAsInteger(_("flag")),
				obj->GetPropertyAsInteger(_("border")));
		}
		else
		{
			wxLogError( wxT("The SizerItem component's child is not a wxWindow or a wxSizer or a spacer - this should not be possible!") );
		}
	}
开发者ID:noriter,项目名称:wxfb,代码行数:59,代码来源:layout.cpp

示例2: GetGBSizerItem

	wxGBSizerItem* GetGBSizerItem( IObject* sizeritem, const wxGBPosition& position, const wxGBSpan& span, wxObject* child )
	{
		IObject* childObj = GetManager()->GetIObject( child );

		if ( _("spacer") == childObj->GetClassName() )
		{
			return new wxGBSizerItem(	childObj->GetPropertyAsInteger( _("width") ),
										childObj->GetPropertyAsInteger( _("height") ),
										position,
										span,
										sizeritem->GetPropertyAsInteger(_("flag")),
										sizeritem->GetPropertyAsInteger(_("border")),
										NULL
										);
		}

		// Add the child ( window or sizer ) to the sizer
		wxWindow* windowChild = wxDynamicCast( child, wxWindow );
		wxSizer* sizerChild = wxDynamicCast( child, wxSizer );

		if ( windowChild != NULL )
		{
			return new wxGBSizerItem( 	windowChild,
										position,
										span,
										sizeritem->GetPropertyAsInteger(_("flag")),
										sizeritem->GetPropertyAsInteger(_("border")),
										NULL
										);
		}
		else if ( sizerChild != NULL )
		{
			return new wxGBSizerItem( 	sizerChild,
										position,
										span,
										sizeritem->GetPropertyAsInteger(_("flag")),
										sizeritem->GetPropertyAsInteger(_("border")),
										NULL
										);
		}
		else
		{
			wxLogError( wxT("The GBSizerItem component's child is not a wxWindow or a wxSizer or a Spacer - this should not be possible!") );
			return NULL;
		}
	}
开发者ID:noriter,项目名称:wxfb,代码行数:46,代码来源:layout.cpp


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