From 02f7e9c800221b247a40ca09aa3cb3fae2903a90 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 6 Sep 2013 17:53:01 +0200 Subject: [PATCH] Changed focus owner of LayerWidget to EDA_DRAW_PANEL_GAL to make keyboard events work (apparently everything works fine, to be tested more extensively). Removed unnecessary event hook from EDA_DRAW_PANEL_GAL. --- common/drawpanel_gal.cpp | 8 -------- include/class_drawpanel_gal.h | 1 - pcbnew/pcbframe.cpp | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/common/drawpanel_gal.cpp b/common/drawpanel_gal.cpp index 6df67bb3a0..3b354506bf 100644 --- a/common/drawpanel_gal.cpp +++ b/common/drawpanel_gal.cpp @@ -87,7 +87,6 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin Connect( wxEVT_MIDDLE_UP, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_MIDDLE_DOWN, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_MOUSEWHEEL, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); - Connect( wxEVT_CHAR_HOOK, wxEventHandler( EDA_DRAW_PANEL_GAL::skipEvent ), NULL, this ); Connect( wxEVT_KEY_UP, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_KEY_DOWN, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); } @@ -208,10 +207,3 @@ void EDA_DRAW_PANEL_GAL::onEvent( wxEvent& aEvent ) Refresh(); } - - -void EDA_DRAW_PANEL_GAL::skipEvent( wxEvent& aEvent ) -{ - // This is necessary for CHAR_HOOK event to generate KEY_UP and KEY_DOWN events - aEvent.Skip(); -} diff --git a/include/class_drawpanel_gal.h b/include/class_drawpanel_gal.h index 542787fd0d..9206c69338 100644 --- a/include/class_drawpanel_gal.h +++ b/include/class_drawpanel_gal.h @@ -115,7 +115,6 @@ protected: void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ); void onSize( wxSizeEvent& aEvent ); void onEvent( wxEvent& aEvent ); - void skipEvent( wxEvent& aEvent ); KiGfx::GAL* m_gal; ///< Interface for drawing objects on a 2D-surface KiGfx::VIEW* m_view; ///< Stores view settings (scale, center, etc.) diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 7e29efb5ed..7a7a6f6e4e 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -333,7 +333,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title, if( screenHeight <= 900 ) pointSize = (pointSize * 8) / 10; - m_Layers = new PCB_LAYER_WIDGET( this, m_canvas, pointSize ); + m_Layers = new PCB_LAYER_WIDGET( this, m_galCanvas, pointSize ); m_drc = new DRC( this ); // these 2 objects point to each other