本文整理汇总了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;
}
示例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 ) );
}
示例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();
}