本文整理汇总了C++中EDA_DRAW_PANEL_GAL::Refresh方法的典型用法代码示例。如果您正苦于以下问题:C++ EDA_DRAW_PANEL_GAL::Refresh方法的具体用法?C++ EDA_DRAW_PANEL_GAL::Refresh怎么用?C++ EDA_DRAW_PANEL_GAL::Refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDA_DRAW_PANEL_GAL
的用法示例。
在下文中一共展示了EDA_DRAW_PANEL_GAL::Refresh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRenderEnable
void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
{
BOARD* brd = myframe->GetBoard();
brd->SetElementVisibility( aId, isEnabled );
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas )
{
if( aId == GRID_VISIBLE )
{
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
}
else
galCanvas->GetView()->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled );
}
if( galCanvas && myframe->IsGalCanvasActive() )
galCanvas->Refresh();
else
myframe->GetCanvas()->Refresh();
}
示例2: OnRenderEnable
void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
{
BOARD* brd = myframe->GetBoard();
wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END );
if( myframe->IsType( FRAME_PCB ) )
{
// The layer visibility status is saved in the board file so set the board
// modified state so the user has the option to save the changes.
if( brd->IsElementVisible( static_cast<GAL_LAYER_ID>( aId ) ) != isEnabled )
myframe->OnModify();
}
brd->SetElementVisibility( static_cast<GAL_LAYER_ID>( aId ), isEnabled );
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas && myframe->IsGalCanvasActive() )
{
if( aId == LAYER_GRID )
{
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
}
else if( aId == LAYER_RATSNEST )
{
// don't touch the layers. ratsnest is enabled on per-item basis.
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
galCanvas->GetView()->SetLayerVisible( aId, true );
}
else
galCanvas->GetView()->SetLayerVisible( aId, isEnabled );
galCanvas->Refresh();
}
myframe->GetCanvas()->Refresh();
}