Create CvPcb's footprint viewer through Kiway().Player()
This allows it to participate in Kiway things such as updating language or common settings. Fixes: lp:1779558 * https://bugs.launchpad.net/kicad/+bug/1779558 (cherry picked from commit b3f8478)
This commit is contained in:
parent
df863e44e2
commit
34857d06c4
|
@ -121,14 +121,9 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
|
|||
m_mouseCaptureCallback = NULL;
|
||||
m_endMouseCaptureCallback = NULL;
|
||||
|
||||
wxConfigBase* cfg = Kiface().KifaceSettings();
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->Read( ENBL_MOUSEWHEEL_PAN_KEY, &m_enableMousewheelPan, false );
|
||||
cfg->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
|
||||
cfg->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true );
|
||||
}
|
||||
Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &m_enableMousewheelPan, false );
|
||||
Pgm().CommonSettings()->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
|
||||
Pgm().CommonSettings()->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true );
|
||||
|
||||
m_requestAutoPan = false;
|
||||
m_enableBlockCommands = false;
|
||||
|
|
|
@ -252,8 +252,11 @@ void EDA_BASE_FRAME::ReCreateMenuBar()
|
|||
|
||||
void EDA_BASE_FRAME::ShowChangedLanguage()
|
||||
{
|
||||
ReCreateMenuBar();
|
||||
GetMenuBar()->Refresh();
|
||||
if( GetMenuBar() )
|
||||
{
|
||||
ReCreateMenuBar();
|
||||
GetMenuBar()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -263,9 +266,12 @@ void EDA_BASE_FRAME::CommonSettingsChanged()
|
|||
Pgm().CommonSettings()->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
|
||||
SetAutoSaveInterval( autosaveInterval );
|
||||
|
||||
// For icons in menus & icon scaling
|
||||
ReCreateMenuBar();
|
||||
GetMenuBar()->Refresh();
|
||||
if( GetMenuBar() )
|
||||
{
|
||||
// For icons in menus & icon scaling
|
||||
ReCreateMenuBar();
|
||||
GetMenuBar()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <display_footprints_frame.h>
|
||||
#include <cvpcb_id.h>
|
||||
|
||||
#include <build_version.h>
|
||||
|
@ -65,11 +66,10 @@ static struct IFACE : public KIFACE_I
|
|||
switch( aClassId )
|
||||
{
|
||||
case FRAME_CVPCB:
|
||||
{
|
||||
CVPCB_MAINFRAME* frame = new CVPCB_MAINFRAME( aKiway, aParent );
|
||||
return frame;
|
||||
}
|
||||
break;
|
||||
return new CVPCB_MAINFRAME( aKiway, aParent );
|
||||
|
||||
case FRAME_CVPCB_DISPLAY:
|
||||
return new DISPLAY_FOOTPRINTS_FRAME( aKiway, aParent );
|
||||
|
||||
default:
|
||||
;
|
||||
|
|
|
@ -836,7 +836,7 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
|
|||
|
||||
if( !fpframe )
|
||||
{
|
||||
fpframe = new DISPLAY_FOOTPRINTS_FRAME( &Kiway(), this );
|
||||
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) Kiway().Player( FRAME_CVPCB_DISPLAY, true, this );
|
||||
fpframe->Show( true );
|
||||
}
|
||||
else
|
||||
|
|
|
@ -72,10 +72,10 @@ BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
|
|||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRAME* aParent ) :
|
||||
DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME )
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME )
|
||||
{
|
||||
m_showAxis = true; // true to draw axis.
|
||||
|
||||
|
@ -259,7 +259,6 @@ void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
|
|||
|
||||
aEvent.Check( displ_opts->m_DisplayModTextFill == SKETCH );
|
||||
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, msgTextsFill[i] );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ class CVPCB_MAINFRAME;
|
|||
class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
|
||||
{
|
||||
public:
|
||||
DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRAME* aParent );
|
||||
~DISPLAY_FOOTPRINTS_FRAME();
|
||||
DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
||||
~DISPLAY_FOOTPRINTS_FRAME() override;
|
||||
|
||||
void OnCloseWindow( wxCloseEvent& Event ) override;
|
||||
|
||||
|
@ -55,7 +55,6 @@ public:
|
|||
void ReCreateHToolbar() override;
|
||||
void ReCreateVToolbar() override;
|
||||
void ReCreateOptToolbar() override;
|
||||
void RecreateMenuBar();
|
||||
|
||||
void OnSelectOptionToolbar( wxCommandEvent& event );
|
||||
|
||||
|
@ -74,7 +73,7 @@ public:
|
|||
* Function IsGridVisible() , virtual
|
||||
* @return true if the grid must be shown
|
||||
*/
|
||||
virtual bool IsGridVisible() const override;
|
||||
bool IsGridVisible() const override;
|
||||
|
||||
/**
|
||||
* Function SetGridVisibility() , virtual
|
||||
|
@ -82,12 +81,12 @@ public:
|
|||
* if you want to store/retrieve the grid visibility in configuration.
|
||||
* @param aVisible = true if the grid must be shown
|
||||
*/
|
||||
virtual void SetGridVisibility( bool aVisible ) override;
|
||||
void SetGridVisibility( bool aVisible ) override;
|
||||
/**
|
||||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
*/
|
||||
virtual COLOR4D GetGridColor() override;
|
||||
COLOR4D GetGridColor() override;
|
||||
|
||||
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override;
|
||||
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) override;
|
||||
|
@ -99,8 +98,6 @@ public:
|
|||
///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription()
|
||||
EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override { return NULL; }
|
||||
|
||||
void Process_Settings( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Display 3D frame of current footprint selection.
|
||||
*/
|
||||
|
@ -110,9 +107,8 @@ public:
|
|||
* currently: do nothing in CvPcb.
|
||||
* but but be defined because it is a pure virtual in PCB_BASE_FRAME
|
||||
*/
|
||||
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
|
||||
UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
|
||||
void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -126,9 +122,8 @@ public:
|
|||
* @param aTransformPoint = the reference point of the transformation,
|
||||
* for commands like move
|
||||
*/
|
||||
virtual void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
||||
UNDO_REDO_T aTypeCommand,
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
|
||||
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO_T aTypeCommand,
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
|
||||
{
|
||||
// currently: do nothing in CvPcb.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue