From b934b11a6022861cda6eb8ab1a0b91848ede7a65 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 10:57:32 +0200 Subject: [PATCH] Minor changes (removed an unnecessary event handler and two function calls that had no real influence). --- common/draw_panel_gal.cpp | 10 +--------- include/class_draw_panel_gal.h | 3 +-- pcbnew/pcbframe.cpp | 6 ------ 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 975d17c513..3b96ef58cf 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -81,7 +81,6 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin Connect( wxEVT_MIDDLE_DOWN, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_MIDDLE_DCLICK, 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 ) ); Connect( wxEVT_CHAR, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_ENTER_WINDOW, wxEventHandler( EDA_DRAW_PANEL_GAL::onEnter ), NULL, this ); Connect( KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE, @@ -158,7 +157,7 @@ void EDA_DRAW_PANEL_GAL::onRefreshTimer( wxTimerEvent& aEvent ) } -void EDA_DRAW_PANEL_GAL::Refresh( bool eraseBackground, const wxRect* rect ) +void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect ) { if( m_pendingRefresh ) return; @@ -279,10 +278,3 @@ void EDA_DRAW_PANEL_GAL::onEnter( wxEvent& aEvent ) // Getting focus is necessary in order to receive key events properly SetFocus(); } - - -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_draw_panel_gal.h b/include/class_draw_panel_gal.h index b698c91e1e..bed6af0890 100644 --- a/include/class_draw_panel_gal.h +++ b/include/class_draw_panel_gal.h @@ -108,7 +108,7 @@ public: } /// @copydoc wxWindow::Refresh() - void Refresh( bool eraseBackground = true, const wxRect* rect = NULL ); + void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ); /** * Function SetEventDispatcher() @@ -151,7 +151,6 @@ protected: void onEvent( wxEvent& aEvent ); void onEnter( wxEvent& aEvent ); void onRefreshTimer ( wxTimerEvent& aEvent ); - void skipEvent( wxEvent& aEvent ); static const int MinRefreshPeriod = 17; ///< 60 FPS. diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 272d951675..4b61ec562a 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -334,12 +334,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : SetGalCanvas( new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, PCB_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) ); - // GAL should not be active yet - GetGalCanvas()->StopDrawing(); - - // Hide by default, it has to be explicitly shown - GetGalCanvas()->Hide(); - SetBoard( new BOARD() ); // Create the PCB_LAYER_WIDGET *after* SetBoard():