本文整理汇总了C++中kigfx::VIEW::UpdateLayerColor方法的典型用法代码示例。如果您正苦于以下问题:C++ VIEW::UpdateLayerColor方法的具体用法?C++ VIEW::UpdateLayerColor怎么用?C++ VIEW::UpdateLayerColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kigfx::VIEW
的用法示例。
在下文中一共展示了VIEW::UpdateLayerColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRenderColorChange
void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
{
wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END );
myframe->Settings().Colors().SetItemColor( static_cast<GAL_LAYER_ID>( aId ), aColor );
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas && myframe->IsGalCanvasActive() )
{
if( aId == LAYER_GRID )
galCanvas->GetGAL()->SetGridColor( aColor );
KIGFX::VIEW* view = galCanvas->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); // useful to update rastnest
view->UpdateLayerColor( aId );
// plated-through-holes don't have their own color; they use the background color
if( aId == LAYER_PCB_BACKGROUND )
view->UpdateLayerColor( LAYER_PADS_PLATEDHOLES );
galCanvas->ForceRefresh();
}
myframe->ReCreateHToolbar();
myframe->GetCanvas()->Refresh();
}
示例2: OnLayerColorChange
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{
// Avoid setting the alpha channel, when we are in legacy mode,
// because in legacy mode the alpha channel is not used, but changing it
// destroys the GAL color setup
if( !myframe->IsGalCanvasActive() )
{
COLOR4D oldColor = myframe->Settings().Colors().GetLayerColor( aLayer );
aColor.a = oldColor.a;
}
myframe->Settings().Colors().SetLayerColor( aLayer, aColor );
if( myframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
view->UpdateLayerColor( aLayer );
view->UpdateLayerColor( GetNetnameLayer( aLayer ) );
}
myframe->ReCreateHToolbar();
myframe->GetCanvas()->Refresh();
if( aLayer == LAYER_PCB_BACKGROUND )
myframe->SetDrawBgColor( aColor );
}
示例3: OnLayerColorChange
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, EDA_COLOR_T aColor )
{
myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor );
if( myframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->GetBoard()->GetColorsSettings() );
view->UpdateLayerColor( aLayer );
}
myframe->GetCanvas()->Refresh();
}
示例4: OnLayerColorChange
void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{
// NOTE: Active layer in GerbView is stored as 0-indexed, but layer color is
// stored according to the GERBER_DRAW_LAYER() offset.
myframe->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor );
myframe->m_SelLayerBox->ResyncBitmapOnly();
if( myframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) );
}
myframe->GetCanvas()->Refresh();
}