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.
This commit is contained in:
Maciej Suminski 2013-09-06 17:53:01 +02:00
parent c012554daa
commit f1b0ffd3d7
3 changed files with 1 additions and 10 deletions

View File

@ -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();
}

View File

@ -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.)

View File

@ -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