本文整理汇总了C++中LSET::UIOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ LSET::UIOrder方法的具体用法?C++ LSET::UIOrder怎么用?C++ LSET::UIOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LSET
的用法示例。
在下文中一共展示了LSET::UIOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPrintPage
bool BOARD_PRINTOUT_CONTROLLER::OnPrintPage( int aPage )
{
LSET lset = m_PrintParams.m_PrintMaskLayer;
// compute layer mask from page number if we want one page per layer
if( m_PrintParams.m_OptionPrintPage == 0 ) // One page per layer
{
// This sequence is TBD, call a different
// sequencer if needed, such as Seq(). Could not find documentation on
// page order.
LSEQ seq = lset.UIOrder();
// aPage starts at 1, not 0
if( unsigned( aPage-1 ) < seq.size() )
m_PrintParams.m_PrintMaskLayer = LSET( seq[aPage-1] );
}
if( !m_PrintParams.m_PrintMaskLayer.any() )
return false;
// In Pcbnew we can want the layer EDGE always printed
if( m_PrintParams.m_Flags == 1 )
m_PrintParams.m_PrintMaskLayer.set( Edge_Cuts );
DrawPage();
m_PrintParams.m_PrintMaskLayer = lset;
return true;
}
示例2: Resync
// Reload the Layers
void PCB_LAYER_BOX_SELECTOR::Resync()
{
Clear();
// Tray to fix a minimum width fot the BitmapComboBox
int minwidth = 80;
wxClientDC dc( GetParent() ); // The DC for "this" is not always initialized
const int BM_SIZE = 14;
LSET show = LSET::AllLayersMask() & ~m_layerMaskDisable;
LSET activated = getEnabledLayers() & ~m_layerMaskDisable;
wxString layerstatus;
for( LSEQ seq = show.UIOrder(); seq; ++seq )
{
LAYER_ID layerid = *seq;
if( !m_showNotEnabledBrdlayers && !activated[layerid] )
continue;
else if( !activated[layerid] )
layerstatus = wxT( " " ) + _( "(not activated)" );
else
layerstatus.Empty();
wxBitmap layerbmp( BM_SIZE, BM_SIZE );
SetBitmapLayer( layerbmp, layerid );
wxString layername = GetLayerName( layerid ) + layerstatus;
if( m_layerhotkeys && m_hotkeys )
{
int id = layer2hotkey_id( layerid );
if( id != -1 )
layername = AddHotkeyName( layername, m_hotkeys, id, IS_COMMENT );
}
Append( layername, layerbmp, (void*)(intptr_t) layerid );
int w, h;
dc.GetTextExtent ( layername, &w, &h );
minwidth = std::max( minwidth, w );
}
minwidth += BM_SIZE + 35; // Take in account the bitmap size and margins
SetMinSize( wxSize( minwidth, -1 ) );
}
示例3: OnPrintPage
bool BOARD_PRINTOUT_CONTROLLER::OnPrintPage( int aPage )
{
LSET lset = m_PrintParams.m_PrintMaskLayer;
int pageCount = lset.count();
wxString layer;
LAYER_ID extractLayer;
// compute layer mask from page number if we want one page per layer
if( m_PrintParams.m_OptionPrintPage == 0 ) // One page per layer
{
// This sequence is TBD, call a different
// sequencer if needed, such as Seq(). Could not find documentation on
// page order.
LSEQ seq = lset.UIOrder();
// aPage starts at 1, not 0
if( unsigned( aPage-1 ) < seq.size() )
m_PrintParams.m_PrintMaskLayer = LSET( seq[aPage-1] );
}
if( !m_PrintParams.m_PrintMaskLayer.any() )
return false;
extractLayer = m_PrintParams.m_PrintMaskLayer.ExtractLayer();
if( extractLayer == UNDEFINED_LAYER )
layer = _( "Multiple Layers" );
else
layer = LSET::Name( extractLayer );
// In Pcbnew we can want the layer EDGE always printed
if( m_PrintParams.m_Flags == 1 )
m_PrintParams.m_PrintMaskLayer.set( Edge_Cuts );
DrawPage( layer, aPage, pageCount );
m_PrintParams.m_PrintMaskLayer = lset;
return true;
}