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


C++ EDA_DRAW_PANEL_GAL::SetEventDispatcher方法代码示例

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


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

示例1: UseGalCanvas

void PCB_BASE_FRAME::UseGalCanvas( bool aEnable )
{
    EDA_DRAW_FRAME::UseGalCanvas( aEnable );

    EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();

    if( m_toolManager )
        m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
                                    GetGalCanvas()->GetViewControls(), this );

    if( aEnable )
    {
        SetBoard( m_Pcb );

        if( m_toolManager )
            m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );

        galCanvas->GetView()->RecacheAllItems();
        galCanvas->SetEventDispatcher( m_toolDispatcher );
        galCanvas->StartDrawing();
    }
    else
    {
        if( m_toolManager )
            m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );

        // Redirect all events to the legacy canvas
        galCanvas->SetEventDispatcher( NULL );
    }
}
开发者ID:ejs-ejs,项目名称:kicad-source-mirror,代码行数:30,代码来源:basepcbframe.cpp

示例2: UseGalCanvas

void PCB_BASE_FRAME::UseGalCanvas()
{
    EDA_DRAW_FRAME::UseGalCanvas();

    EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();

    if( m_toolManager )
    {
        m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
                                       GetGalCanvas()->GetViewControls(), this );
    }

    SetBoard( m_Pcb );

    if( m_toolManager )
        m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );

    // Transfer latest current display options from legacy to GAL canvas:
    auto painter = static_cast<KIGFX::PCB_PAINTER*>( galCanvas->GetView()->GetPainter() );
    auto settings = painter->GetSettings();
    auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
    settings->LoadDisplayOptions( displ_opts, ShowPageLimits() );

    galCanvas->GetView()->RecacheAllItems();
    galCanvas->SetEventDispatcher( m_toolDispatcher );
    galCanvas->StartDrawing();
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:27,代码来源:pcb_base_frame.cpp


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