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


C++ Allocation::getAllotment方法代码示例

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


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

示例1:

void SpecRuler2D::allocateBody( Glyph* body, Allocation& interior ) 
{
	// Dies funktioniert minimal, d.h. wenn Request nicht vorhanden.
    Allotment& x = interior.getAllotment( DimensionX );
	x.setSpan( x.getSpan() - d_width );
	x.setOrigin( x.getOrigin() );
    Allotment& y = interior.getAllotment( DimensionY );
	y.setSpan( y.getSpan() - d_height );
	y.setOrigin( y.getOrigin() );
	return;

}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:12,代码来源:SpecRuler2D.cpp

示例2: allocateBody

void Border::allocateBody( Glyph* body, Twips thickness, Allocation& interior ) 
{
	// Dies funktioniert minimal, d.h. wenn Request nicht vorhanden.
    Allotment& x = interior.getAllotment( DimensionX );
	x.setSpan( x.getSpan() - 2 * thickness );
	x.setOrigin( x.getOrigin() + thickness );
    Allotment& y = interior.getAllotment( DimensionY );
	y.setSpan( y.getSpan() - 2 * thickness );
	y.setOrigin( y.getOrigin() + thickness );
	return;

	// Stammt aus BevelFrame: wozu das ganze? Scheint zu funktionieren.
    Requisition reqest;
    body->request( reqest );
    Allotment& ax = interior.getAllotment( DimensionX );
    Twips x_span = ax.getSpan() - 2 * thickness;
    Twips x_offset = thickness;
    Twips x_align = ax.getAlignment();


    const Requirement& rx = reqest.getRequirement( DimensionX );
    if( rx.isDefined() ) 
	{
		Twips x_usable = rx.getNatural() + rx.getStretch();
		if( x_span > x_usable ) 
		{
			x_offset += 0 * ( x_span - x_usable );	// d_alignX
			x_span = x_usable;
		}
    }
    ax.setSpan( x_span );
    ax.move( x_offset * ( AlignmentMax - 2 * x_align ) );

    Allotment& ay = interior.getAllotment( DimensionY );
    Twips y_span = ay.getSpan() - 2 * thickness;
    Twips y_offset = thickness;
    Twips y_align = ay.getAlignment();


    const Requirement& ry = reqest.getRequirement( DimensionY );
    if( ry.isDefined() ) 
	{
		Twips y_usable = ry.getNatural() + ry.getStretch();
		if( y_span > y_usable ) 
		{
			y_offset += 0 * ( y_span - y_usable );	// d_alignY
			y_span = y_usable;
		}
    }
    ay.setSpan( y_span );
    ay.move( y_offset * ( AlignmentMax - 2 * y_align ) );
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:52,代码来源:Border.cpp

示例3: execute

	void execute()
	{
		Allocation r;
		getAllocation( r );
		ViewAreaMdl* mdl = d_view->getViewArea();
		Allocation a = mdl->getAllocation();
		PpmCube c;
		c.assign( 1, PpmRange() );
		Dimension dim = d_view->getDir();
		c[ DimX ].first = mdl->toPpm( r.getAllotment( dim ).getBegin(), 
			a.getAllotment( dim ).getBegin(), dim );
		c[ DimX ].second = mdl->toPpm( r.getAllotment( dim ).getEnd(), 
			a.getAllotment( dim ).getBegin(), dim );
		d_view->selectPeak( c );
		Command::execute();
	}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:16,代码来源:PointSelectCtrl.cpp


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