dialog_edit_module_for_BoardEditor.*: fix questionable code.

This commit is contained in:
jean-pierre charras 2017-04-16 20:52:41 +02:00
parent e97c91b025
commit 4b916b42ed
4 changed files with 5 additions and 26 deletions

View File

@ -58,11 +58,6 @@
size_t DIALOG_MODULE_BOARD_EDITOR::m_page = 0; // remember the last open page during session size_t DIALOG_MODULE_BOARD_EDITOR::m_page = 0; // remember the last open page during session
wxBEGIN_EVENT_TABLE( DIALOG_MODULE_BOARD_EDITOR, wxDialog )
EVT_CLOSE( DIALOG_MODULE_BOARD_EDITOR::OnCloseWindow )
wxEND_EVENT_TABLE()
DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent, DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent,
MODULE* aModule, MODULE* aModule,
wxDC* aDC ) : wxDC* aDC ) :
@ -137,14 +132,6 @@ DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR()
} }
void DIALOG_MODULE_BOARD_EDITOR::OnCloseWindow( wxCloseEvent &event )
{
m_PreviewPane->Close();
event.Skip();
}
// Creation of the panel properties of the module editor. // Creation of the panel properties of the module editor.
void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties() void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties()
{ {
@ -616,9 +603,6 @@ bool DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow()
wxPoint modpos; wxPoint modpos;
wxString msg; wxString msg;
BOARD_COMMIT commit( m_Parent );
commit.Modify( m_CurrentModule );
if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() || if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() ||
!m_PanelProperties->TransferDataFromWindow() ) !m_PanelProperties->TransferDataFromWindow() )
{ {
@ -638,6 +622,9 @@ bool DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow()
m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR ); m_CurrentModule->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR );
} }
BOARD_COMMIT commit( m_Parent );
commit.Modify( m_CurrentModule );
// Init Fields (should be first, because they can be moved or/and flipped later): // Init Fields (should be first, because they can be moved or/and flipped later):
TEXTE_MODULE& reference = m_CurrentModule->Reference(); TEXTE_MODULE& reference = m_CurrentModule->Reference();
reference = *m_ReferenceCopy; reference = *m_ReferenceCopy;

View File

@ -101,14 +101,6 @@ private:
bool TransferDataToWindow() override; bool TransferDataToWindow() override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;
/**
* @brief OnCloseWindow - called when the frame is closed
* @param event
*/
void OnCloseWindow( wxCloseEvent &event );
DECLARE_EVENT_TABLE();
}; };

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 14 2016) // C++ code generated with wxFormBuilder (version Feb 19 2017)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 14 2016) // C++ code generated with wxFormBuilder (version Feb 19 2017)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!