From 98296334fd8009718fdc82261eebb3ad56d15b4b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 8 Sep 2018 17:44:51 +0100 Subject: [PATCH] Hook up panning options to GAL canvas. --- eeschema/sch_draw_panel.cpp | 26 ++++++++++++++++++++++++++ eeschema/sch_draw_panel.h | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index ec7acb4d1d..a71a538187 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -185,6 +185,32 @@ bool SCH_DRAW_PANEL::SwitchBackend( GAL_TYPE aGalType ) } +void SCH_DRAW_PANEL::SetEnableMousewheelPan( bool aEnable ) +{ + m_enableMousewheelPan = aEnable; + + if( GetParent()->IsGalCanvasActive() ) + GetParent()->GetGalCanvas()->GetViewControls()->EnableMousewheelPan( aEnable ); +} + + +void SCH_DRAW_PANEL::SetEnableAutoPan( bool aEnable ) +{ + m_enableAutoPan = aEnable; + + if( GetParent()->IsGalCanvasActive() ) + GetParent()->GetGalCanvas()->GetViewControls()->EnableAutoPan( aEnable ); +} + + +void SCH_DRAW_PANEL::SetEnableZoomNoCenter( bool aEnable ) +{ + m_enableZoomNoCenter = aEnable; + + if( GetParent()->IsGalCanvasActive() ) + GetParent()->GetGalCanvas()->GetViewControls()->EnableCursorWarping( !aEnable ); +} + void SCH_DRAW_PANEL::setDefaultLayerDeps() { diff --git a/eeschema/sch_draw_panel.h b/eeschema/sch_draw_panel.h index 9cb6a1d002..2aa0f1d6e1 100644 --- a/eeschema/sch_draw_panel.h +++ b/eeschema/sch_draw_panel.h @@ -62,6 +62,10 @@ public: void OnKeyEvent( wxKeyEvent& event ); void OnCharHook( wxKeyEvent& event ); + void SetEnableMousewheelPan( bool aEnable ) override; + void SetEnableZoomNoCenter( bool aEnable ) override; + void SetEnableAutoPan( bool aEnable ) override; + BASE_SCREEN* GetScreen() override; virtual EDA_DRAW_FRAME* GetParent() const override;