Loading common/basicframe.cpp +14 −16 Original line number Original line Diff line number Diff line Loading @@ -99,6 +99,18 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, Connect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER, Connect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER, wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) ); wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) ); // hook wxEVT_CLOSE_WINDOW so we can call SaveSettings(). This function seems // to be called before any other hook for wxCloseEvent, which is necessary. Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) ); } void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event ) { SaveSettings(); // virtual, wxFrame specific event.Skip(); // we did not "handle" the event, only eavesdropped on it. } } Loading @@ -109,9 +121,8 @@ EDA_BASE_FRAME::~EDA_BASE_FRAME() delete m_autoSaveTimer; delete m_autoSaveTimer; /* This needed for OSX: avoids further OnDraw processing after this // This is needed for OSX: avoids further OnDraw processing after this * destructor and before the native window is destroyed // destructor and before the native window is destroyed */ this->Freeze(); this->Freeze(); } } Loading Loading @@ -141,19 +152,6 @@ bool EDA_BASE_FRAME::ProcessEvent( wxEvent& aEvent ) } } bool EDA_BASE_FRAME::Show( bool show ) { if( !show ) // closing { SaveSettings(); // virtual, wxFrame specific } int ret = wxFrame::Show( show ); return ret; } void EDA_BASE_FRAME::onAutoSaveTimer( wxTimerEvent& aEvent ) void EDA_BASE_FRAME::onAutoSaveTimer( wxTimerEvent& aEvent ) { { if( !doAutoSave() ) if( !doAutoSave() ) Loading cvpcb/cvframe.cpp +0 −3 Original line number Original line Diff line number Diff line Loading @@ -338,9 +338,6 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event ) m_modified = false; m_modified = false; // hide main frame, which also forces saving curr pos and size in config Show( false ); Destroy(); Destroy(); return; return; } } Loading eeschema/schframe.cpp +0 −2 Original line number Original line Diff line number Diff line Loading @@ -505,8 +505,6 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent ) // all sub sheets are deleted, only the main sheet is usable // all sub sheets are deleted, only the main sheet is usable m_CurrentSheet->Clear(); m_CurrentSheet->Clear(); // hide main frame, which also forces saving curr pos and size in config Show( false ); Destroy(); Destroy(); } } Loading gerbview/gerbview_frame.cpp +0 −3 Original line number Original line Diff line number Diff line Loading @@ -177,9 +177,6 @@ GERBVIEW_FRAME::~GERBVIEW_FRAME() void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ) void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ) { { // hide main frame, which also forces saving curr pos and size in config Show( false ); Destroy(); Destroy(); } } Loading include/wxstruct.h +17 −12 Original line number Original line Diff line number Diff line Loading @@ -107,10 +107,26 @@ extern const wxChar traceAutoSave[]; /** /** * Class EDA_BASE_FRAME * Class EDA_BASE_FRAME * is the base frame for deriving all KiCad main window classes. This class is not * is the base frame for deriving all KiCad main window classes. This class is not * intended to be used directly. * intended to be used directly. It provides support for automatic calls to * a virtual SaveSettings() function. SaveSettings() for a derived class can choose * to do nothing, or rely on basic SaveSettings() support in this base class to do * most of the work by calling it from the derived class's SaveSettings(). */ */ class EDA_BASE_FRAME : public wxFrame class EDA_BASE_FRAME : public wxFrame { { /** * Function windowClosing * (with its unexpected name so it does not collide with the real OnWindowClose() * function provided in derived classes) is called just before a window * closing, and is used to call a derivation specific * SaveSettings(). SaveSettings() is called for all derived wxFrames in this * base class overload. (Calling it from a destructor is deprecated since the * wxFrame's position is not available in the destructor on linux.) In other words, * you should not need to call call SaveSettings() anywhere, except in this * one function found only in this class. */ void windowClosing( wxCloseEvent& event ); protected: protected: ID_DRAWFRAME_TYPE m_Ident; ///< Id Type (pcb, schematic, library..) ID_DRAWFRAME_TYPE m_Ident; ///< Id Type (pcb, schematic, library..) wxPoint m_FramePos; wxPoint m_FramePos; Loading Loading @@ -177,17 +193,6 @@ public: */ */ bool ProcessEvent( wxEvent& aEvent ); // overload wxFrame::ProcessEvent() bool ProcessEvent( wxEvent& aEvent ); // overload wxFrame::ProcessEvent() /** * Function Show * hooks the wxFrame close scenario so we can grab the window size and position * in the wxFrame specific SaveSettings() function. SaveSettings() is * called for all derived wxFrames in this base class overload. Calling it * from a destructor is deprecated since the wxFrame's position is not available * in the destructor on linux. In other words, don't call SaveSettings() anywhere, * except in this one function. */ bool Show( bool show ); // overload wxFrame::Show() void SetAutoSaveInterval( int aInterval ) { m_autoSaveInterval = aInterval; } void SetAutoSaveInterval( int aInterval ) { m_autoSaveInterval = aInterval; } int GetAutoSaveInterval() const { return m_autoSaveInterval; } int GetAutoSaveInterval() const { return m_autoSaveInterval; } Loading Loading
common/basicframe.cpp +14 −16 Original line number Original line Diff line number Diff line Loading @@ -99,6 +99,18 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, Connect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER, Connect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER, wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) ); wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) ); // hook wxEVT_CLOSE_WINDOW so we can call SaveSettings(). This function seems // to be called before any other hook for wxCloseEvent, which is necessary. Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) ); } void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event ) { SaveSettings(); // virtual, wxFrame specific event.Skip(); // we did not "handle" the event, only eavesdropped on it. } } Loading @@ -109,9 +121,8 @@ EDA_BASE_FRAME::~EDA_BASE_FRAME() delete m_autoSaveTimer; delete m_autoSaveTimer; /* This needed for OSX: avoids further OnDraw processing after this // This is needed for OSX: avoids further OnDraw processing after this * destructor and before the native window is destroyed // destructor and before the native window is destroyed */ this->Freeze(); this->Freeze(); } } Loading Loading @@ -141,19 +152,6 @@ bool EDA_BASE_FRAME::ProcessEvent( wxEvent& aEvent ) } } bool EDA_BASE_FRAME::Show( bool show ) { if( !show ) // closing { SaveSettings(); // virtual, wxFrame specific } int ret = wxFrame::Show( show ); return ret; } void EDA_BASE_FRAME::onAutoSaveTimer( wxTimerEvent& aEvent ) void EDA_BASE_FRAME::onAutoSaveTimer( wxTimerEvent& aEvent ) { { if( !doAutoSave() ) if( !doAutoSave() ) Loading
cvpcb/cvframe.cpp +0 −3 Original line number Original line Diff line number Diff line Loading @@ -338,9 +338,6 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event ) m_modified = false; m_modified = false; // hide main frame, which also forces saving curr pos and size in config Show( false ); Destroy(); Destroy(); return; return; } } Loading
eeschema/schframe.cpp +0 −2 Original line number Original line Diff line number Diff line Loading @@ -505,8 +505,6 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent ) // all sub sheets are deleted, only the main sheet is usable // all sub sheets are deleted, only the main sheet is usable m_CurrentSheet->Clear(); m_CurrentSheet->Clear(); // hide main frame, which also forces saving curr pos and size in config Show( false ); Destroy(); Destroy(); } } Loading
gerbview/gerbview_frame.cpp +0 −3 Original line number Original line Diff line number Diff line Loading @@ -177,9 +177,6 @@ GERBVIEW_FRAME::~GERBVIEW_FRAME() void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ) void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ) { { // hide main frame, which also forces saving curr pos and size in config Show( false ); Destroy(); Destroy(); } } Loading
include/wxstruct.h +17 −12 Original line number Original line Diff line number Diff line Loading @@ -107,10 +107,26 @@ extern const wxChar traceAutoSave[]; /** /** * Class EDA_BASE_FRAME * Class EDA_BASE_FRAME * is the base frame for deriving all KiCad main window classes. This class is not * is the base frame for deriving all KiCad main window classes. This class is not * intended to be used directly. * intended to be used directly. It provides support for automatic calls to * a virtual SaveSettings() function. SaveSettings() for a derived class can choose * to do nothing, or rely on basic SaveSettings() support in this base class to do * most of the work by calling it from the derived class's SaveSettings(). */ */ class EDA_BASE_FRAME : public wxFrame class EDA_BASE_FRAME : public wxFrame { { /** * Function windowClosing * (with its unexpected name so it does not collide with the real OnWindowClose() * function provided in derived classes) is called just before a window * closing, and is used to call a derivation specific * SaveSettings(). SaveSettings() is called for all derived wxFrames in this * base class overload. (Calling it from a destructor is deprecated since the * wxFrame's position is not available in the destructor on linux.) In other words, * you should not need to call call SaveSettings() anywhere, except in this * one function found only in this class. */ void windowClosing( wxCloseEvent& event ); protected: protected: ID_DRAWFRAME_TYPE m_Ident; ///< Id Type (pcb, schematic, library..) ID_DRAWFRAME_TYPE m_Ident; ///< Id Type (pcb, schematic, library..) wxPoint m_FramePos; wxPoint m_FramePos; Loading Loading @@ -177,17 +193,6 @@ public: */ */ bool ProcessEvent( wxEvent& aEvent ); // overload wxFrame::ProcessEvent() bool ProcessEvent( wxEvent& aEvent ); // overload wxFrame::ProcessEvent() /** * Function Show * hooks the wxFrame close scenario so we can grab the window size and position * in the wxFrame specific SaveSettings() function. SaveSettings() is * called for all derived wxFrames in this base class overload. Calling it * from a destructor is deprecated since the wxFrame's position is not available * in the destructor on linux. In other words, don't call SaveSettings() anywhere, * except in this one function. */ bool Show( bool show ); // overload wxFrame::Show() void SetAutoSaveInterval( int aInterval ) { m_autoSaveInterval = aInterval; } void SetAutoSaveInterval( int aInterval ) { m_autoSaveInterval = aInterval; } int GetAutoSaveInterval() const { return m_autoSaveInterval; } int GetAutoSaveInterval() const { return m_autoSaveInterval; } Loading