Delegation of keyEvents from 3D toolbar to 3D canvas.
Fixes: lp:1759803 * https://bugs.launchpad.net/kicad/+bug/1759803
This commit is contained in:
parent
68e69fe95d
commit
09a6bada03
|
@ -123,6 +123,8 @@ class EDA_3D_CANVAS : public HIDPI_GL_CANVAS
|
||||||
*/
|
*/
|
||||||
void Request_refresh( bool aRedrawImmediately = true );
|
void Request_refresh( bool aRedrawImmediately = true );
|
||||||
|
|
||||||
|
void OnKeyEvent( wxKeyEvent& event );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnPaint( wxPaintEvent &event );
|
void OnPaint( wxPaintEvent &event );
|
||||||
|
@ -151,8 +153,6 @@ class EDA_3D_CANVAS : public HIDPI_GL_CANVAS
|
||||||
|
|
||||||
void OnCharHook( wxKeyEvent& event );
|
void OnCharHook( wxKeyEvent& event );
|
||||||
|
|
||||||
void OnKeyEvent( wxKeyEvent& event );
|
|
||||||
|
|
||||||
void OnTimerTimeout_Editing( wxTimerEvent& event );
|
void OnTimerTimeout_Editing( wxTimerEvent& event );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -203,6 +203,8 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway,
|
||||||
m_mainToolBar->EnableTool( ID_RENDER_CURRENT_VIEW,
|
m_mainToolBar->EnableTool( ID_RENDER_CURRENT_VIEW,
|
||||||
(m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY) );
|
(m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY) );
|
||||||
|
|
||||||
|
m_mainToolBar->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( EDA_3D_VIEWER::OnKeyEvent ), NULL, this );
|
||||||
|
|
||||||
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
||||||
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
||||||
// the canvas before it will respond to mouse wheel events.
|
// the canvas before it will respond to mouse wheel events.
|
||||||
|
@ -213,6 +215,8 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway,
|
||||||
|
|
||||||
EDA_3D_VIEWER::~EDA_3D_VIEWER()
|
EDA_3D_VIEWER::~EDA_3D_VIEWER()
|
||||||
{
|
{
|
||||||
|
m_mainToolBar->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( EDA_3D_VIEWER::OnKeyEvent ), NULL, this );
|
||||||
|
|
||||||
m_auimgr.UnInit();
|
m_auimgr.UnInit();
|
||||||
|
|
||||||
// m_canvas delete will be called by wxWidget manager
|
// m_canvas delete will be called by wxWidget manager
|
||||||
|
@ -904,6 +908,15 @@ void EDA_3D_VIEWER::OnRightClick( const wxPoint &MousePos, wxMenu *PopMenu )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void EDA_3D_VIEWER::OnKeyEvent( wxKeyEvent& event )
|
||||||
|
{
|
||||||
|
if( m_canvas )
|
||||||
|
return m_canvas->OnKeyEvent( event );
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDA_3D_VIEWER::RedrawActiveWindow( wxDC *DC, bool EraseBg )
|
void EDA_3D_VIEWER::RedrawActiveWindow( wxDC *DC, bool EraseBg )
|
||||||
{
|
{
|
||||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::RedrawActiveWindow" ) );
|
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::RedrawActiveWindow" ) );
|
||||||
|
|
|
@ -202,8 +202,8 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER
|
||||||
void LoadSettings( wxConfigBase *aCfg ) override;
|
void LoadSettings( wxConfigBase *aCfg ) override;
|
||||||
|
|
||||||
void OnLeftClick( wxDC *DC, const wxPoint &MousePos );
|
void OnLeftClick( wxDC *DC, const wxPoint &MousePos );
|
||||||
|
|
||||||
void OnRightClick( const wxPoint &MousePos, wxMenu *PopMenu );
|
void OnRightClick( const wxPoint &MousePos, wxMenu *PopMenu );
|
||||||
|
void OnKeyEvent( wxKeyEvent& event );
|
||||||
|
|
||||||
void RedrawActiveWindow( wxDC *DC, bool EraseBg );
|
void RedrawActiveWindow( wxDC *DC, bool EraseBg );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue