From 0975e3e5bd5fb40ccfcfe033d8ac7c6aadfcfce0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 22 Feb 2015 15:43:44 +0100 Subject: [PATCH] Move exact dialog: make all messages translatable. Fix minor issues (some can be Windows specific). Remove useless declarations. Fix coding style issues Fix minor warnings from cppcheck. --- common/common.cpp | 6 +- pcbnew/block_module_editor.cpp | 2 +- pcbnew/dialogs/dialog_move_exact.cpp | 63 +++++++-------- pcbnew/dialogs/dialog_move_exact.fbp | 99 ++++++++++++++++++++--- pcbnew/dialogs/dialog_move_exact.h | 27 +++++-- pcbnew/dialogs/dialog_move_exact_base.cpp | 22 ++--- pcbnew/dialogs/dialog_move_exact_base.h | 6 +- pcbnew/eagle_plugin.cpp | 4 +- pcbnew/edit.cpp | 2 +- pcbnew/exporters/export_gencad.cpp | 8 +- pcbnew/modedit.cpp | 4 +- pcbnew/tools/edit_tool.cpp | 2 +- 12 files changed, 173 insertions(+), 72 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 10fa7f0d00..3de52b990f 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -206,7 +206,11 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS_T aUnit ) break; case DEGREES: - wxASSERT( false ); + label = _( "deg" ); + break; + + default: + label = wxT( "??" ); break; } diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp index 4a9f1ea0ec..0eacf9f45d 100644 --- a/pcbnew/block_module_editor.cpp +++ b/pcbnew/block_module_editor.cpp @@ -182,7 +182,7 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) DIALOG_MOVE_EXACT dialog( this, translation, rotation ); int ret = dialog.ShowModal(); - if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + if( ret == wxID_OK ) { SaveCopyInUndoList( currentModule, UR_MODEDIT ); const wxPoint blockCentre = GetScreen()->m_BlockLocate.Centre(); diff --git a/pcbnew/dialogs/dialog_move_exact.cpp b/pcbnew/dialogs/dialog_move_exact.cpp index 71efbb6257..8f124c4c00 100644 --- a/pcbnew/dialogs/dialog_move_exact.cpp +++ b/pcbnew/dialogs/dialog_move_exact.cpp @@ -24,6 +24,7 @@ #include #include +#include #include @@ -42,8 +43,6 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, // set the unit labels m_xUnit->SetLabelText( GetAbbreviatedUnitsLabel( g_UserUnit ) ); m_yUnit->SetLabelText( GetAbbreviatedUnitsLabel( g_UserUnit ) ); - // rotation is always degrees - m_rotUnit->SetLabelText( _( "deg" ) ); // tabbing goes through the entries in sequence m_yEntry->MoveAfterInTabOrder( m_xEntry ); @@ -54,8 +53,11 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, m_xEntry->SetValue( wxString::FromDouble( m_options.entry1 ) ); m_yEntry->SetValue( wxString::FromDouble( m_options.entry2 ) ); m_rotEntry->SetValue( wxString::FromDouble( m_options.entryRotation ) ); + updateDlgTexts( m_polarCoords->IsChecked() ); - Fit(); + m_stdButtonsOK->SetDefault(); + + GetSizer()->SetSizeHints(this); } @@ -64,12 +66,6 @@ DIALOG_MOVE_EXACT::~DIALOG_MOVE_EXACT() } -/*! - * Convert a given Cartesian point into a polar representation. - * - * Linear units are not considered, the answer is in the same units as given - * Angle is returned in degrees - */ void DIALOG_MOVE_EXACT::ToPolarDeg( double x, double y, double& r, double& q ) { // convert to polar coordinates @@ -79,12 +75,6 @@ void DIALOG_MOVE_EXACT::ToPolarDeg( double x, double y, double& r, double& q ) } -/*! - * Get the (Cartesian) translation described by the text entries - * @param val output translation vector - * @param polar interpret as polar coords - * @return false if error (though the text conversion functions don't report errors) - */ bool DIALOG_MOVE_EXACT::GetTranslationInIU ( wxPoint& val, bool polar ) { if( polar ) @@ -110,6 +100,7 @@ bool DIALOG_MOVE_EXACT::GetTranslationInIU ( wxPoint& val, bool polar ) void DIALOG_MOVE_EXACT::OnPolarChanged( wxCommandEvent& event ) { bool newPolar = m_polarCoords->IsChecked(); + updateDlgTexts( newPolar ); wxPoint val; // get the value as previously stored @@ -122,25 +113,34 @@ void DIALOG_MOVE_EXACT::OnPolarChanged( wxCommandEvent& event ) ToPolarDeg( val.x, val.y, r, q); PutValueInLocalUnits( *m_xEntry, round( r / 10.0) * 10 ); - m_xLabel->SetLabelText( wxT( "r:" ) ); - m_yEntry->SetValue( wxString::FromDouble( q ) ); - m_yLabel->SetLabelText( wxT( "\u03b8:" ) ); // theta + } + else + { + // vector is already in Cartesian, so just render out + // note - round off the last decimal place (10nm) to prevent + // (some) rounding causing errors when round-tripping + // you can never eliminate entirely, however + PutValueInLocalUnits( *m_xEntry, KiROUND( val.x / 10.0) * 10 ); + PutValueInLocalUnits( *m_yEntry, KiROUND( val.y / 10.0) * 10 ); + } + Layout(); +} + + +void DIALOG_MOVE_EXACT::updateDlgTexts( bool aPolar ) +{ + if( aPolar ) + { + m_xLabel->SetLabelText( _( "Distance:" ) ); // Polar radius + m_yLabel->SetLabelText( _( "Angle:" ) ); // Polar theta or angle m_yUnit->SetLabelText( GetAbbreviatedUnitsLabel( DEGREES ) ); } else { - // vector is already in Cartesian, so just render out - - // note - round off the last decimal place (10nm) to prevent - // (some) rounding causing errors when round-tripping - // you can never eliminate entirely, however - PutValueInLocalUnits( *m_xEntry, round( val.x / 10.0) * 10 ); - m_xLabel->SetLabelText( wxT( "x:" ) ); - - PutValueInLocalUnits( *m_yEntry, round( val.y / 10.0) * 10 ); - m_yLabel->SetLabelText( wxT( "y:" ) ); + m_xLabel->SetLabelText( _( "Move vector X:" ) ); + m_yLabel->SetLabelText( _( "Move vector Y:" ) ); m_yUnit->SetLabelText( GetAbbreviatedUnitsLabel( g_UserUnit ) ); } @@ -172,7 +172,7 @@ void DIALOG_MOVE_EXACT::OnClear( wxCommandEvent& event ) void DIALOG_MOVE_EXACT::OnCancelClick( wxCommandEvent& event ) { - EndModal( MOVE_ABORT ); + EndModal( wxID_ABORT ); } @@ -191,14 +191,11 @@ void DIALOG_MOVE_EXACT::OnOkClick( wxCommandEvent& event ) m_yEntry->GetValue().ToDouble( &m_options.entry2 ); m_rotEntry->GetValue().ToDouble( &m_options.entryRotation ); - EndModal( MOVE_OK ); + EndModal( wxID_OK); } } -/*! - * Reset a text field to be 0 if it was exited while blank - */ void DIALOG_MOVE_EXACT::OnTextFocusLost( wxFocusEvent& event ) { wxTextCtrl* obj = static_cast( event.GetEventObject() ); diff --git a/pcbnew/dialogs/dialog_move_exact.fbp b/pcbnew/dialogs/dialog_move_exact.fbp index db4223f270..746512baf6 100644 --- a/pcbnew/dialogs/dialog_move_exact.fbp +++ b/pcbnew/dialogs/dialog_move_exact.fbp @@ -44,7 +44,7 @@ -1,-1 DIALOG_MOVE_EXACT_BASE - -1,-1 + 331,200 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Move item @@ -126,7 +126,7 @@ 0 0 wxID_ANY - Polar coordinates + Use polar coordinates 0 @@ -282,7 +282,7 @@ 5 - wxALL|wxEXPAND + wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL 0 1 @@ -456,7 +456,7 @@ 5 - wxALL + wxALL|wxALIGN_CENTER_VERTICAL 0 1 @@ -632,7 +632,7 @@ 5 - wxALL|wxEXPAND + wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL 0 1 @@ -806,7 +806,7 @@ 5 - wxALL + wxALL|wxALIGN_CENTER_VERTICAL 0 1 @@ -929,7 +929,7 @@ 0 0 wxID_ANY - Rotate: + Item rotation: 0 @@ -982,7 +982,7 @@ 5 - wxALL|wxEXPAND + wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL 0 1 @@ -1156,7 +1156,7 @@ 5 - wxALL + wxALL|wxALIGN_CENTER_VERTICAL 0 1 @@ -1249,6 +1249,87 @@ + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALL|wxEXPAND diff --git a/pcbnew/dialogs/dialog_move_exact.h b/pcbnew/dialogs/dialog_move_exact.h index b71f871551..812e0d3187 100644 --- a/pcbnew/dialogs/dialog_move_exact.h +++ b/pcbnew/dialogs/dialog_move_exact.h @@ -37,13 +37,6 @@ private: double& m_rotation; public: - - enum MOVE_EDIT_T - { - MOVE_ABORT, ///< if not changed or error - MOVE_OK, ///< if successfully changed - }; - // Constructor and destructor DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, wxPoint& translation, double& rotation ); @@ -51,16 +44,36 @@ public: private: + /*! + * Reset a text field to be 0 if it was exited while blank + */ void OnTextFocusLost( wxFocusEvent& event ); + void OnPolarChanged( wxCommandEvent& event ); void OnClear( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event ); + /** + * Convert a given Cartesian point into a polar representation. + * + * Linear units are not considered, the answer is in the same units as given + * Angle is returned in degrees + */ void ToPolarDeg( double x, double y, double& r, double& q ); + + /** + * Get the (Cartesian) translation described by the text entries + * @param val output translation vector + * @param polar interpret as polar coords + * @return false if error (though the text conversion functions don't report errors) + */ bool GetTranslationInIU ( wxPoint& val, bool polar ); + // Update texts (comments) after changing the coordinates type (polar/cartesian) + void updateDlgTexts( bool aPolar ); + /** * Persistent dialog options */ diff --git a/pcbnew/dialogs/dialog_move_exact_base.cpp b/pcbnew/dialogs/dialog_move_exact_base.cpp index 4f2644ac27..ef4a8bfc1d 100644 --- a/pcbnew/dialogs/dialog_move_exact_base.cpp +++ b/pcbnew/dialogs/dialog_move_exact_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 6 2014) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -16,7 +16,7 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id, wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 ); + m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Use polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 ); bMainSizer->Add( m_polarCoords, 0, wxALL|wxEXPAND, 5 ); wxFlexGridSizer* fgSizer2; @@ -30,46 +30,49 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id, fgSizer2->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); m_xEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_xEntry, 0, wxALL|wxEXPAND, 5 ); + fgSizer2->Add( m_xEntry, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_xUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_xUnit->Wrap( -1 ); fgSizer2->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 ); m_clearX = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - fgSizer2->Add( m_clearX, 0, wxALL, 5 ); + fgSizer2->Add( m_clearX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_yLabel = new wxStaticText( this, wxID_ANY, _("y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_yLabel->Wrap( -1 ); fgSizer2->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); m_yEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_yEntry, 0, wxALL|wxEXPAND, 5 ); + fgSizer2->Add( m_yEntry, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_yUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); m_yUnit->Wrap( -1 ); fgSizer2->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_clearY = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - fgSizer2->Add( m_clearY, 0, wxALL, 5 ); + fgSizer2->Add( m_clearY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_rotLabel = new wxStaticText( this, wxID_ANY, _("Rotate:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rotLabel = new wxStaticText( this, wxID_ANY, _("Item rotation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_rotLabel->Wrap( -1 ); fgSizer2->Add( m_rotLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); m_rotEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_rotEntry, 0, wxALL|wxEXPAND, 5 ); + fgSizer2->Add( m_rotEntry, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_rotUnit = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_rotUnit->Wrap( -1 ); fgSizer2->Add( m_rotUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_clearRot = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - fgSizer2->Add( m_clearRot, 0, wxALL, 5 ); + fgSizer2->Add( m_clearRot, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); bMainSizer->Add( fgSizer2, 1, wxEXPAND, 5 ); + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + m_stdButtons = new wxStdDialogButtonSizer(); m_stdButtonsOK = new wxButton( this, wxID_OK ); m_stdButtons->AddButton( m_stdButtonsOK ); @@ -82,7 +85,6 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id, this->SetSizer( bMainSizer ); this->Layout(); - bMainSizer->Fit( this ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_MOVE_EXACT_BASE::OnClose ) ); diff --git a/pcbnew/dialogs/dialog_move_exact_base.h b/pcbnew/dialogs/dialog_move_exact_base.h index e8072f8848..cb20c1aaca 100644 --- a/pcbnew/dialogs/dialog_move_exact_base.h +++ b/pcbnew/dialogs/dialog_move_exact_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 6 2014) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -28,6 +28,7 @@ class DIALOG_SHIM; #include #include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -54,6 +55,7 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM wxTextCtrl* m_rotEntry; wxStaticText* m_rotUnit; wxBitmapButton* m_clearRot; + wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; wxButton* m_stdButtonsCancel; @@ -69,7 +71,7 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM public: - DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 331,200 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_MOVE_EXACT_BASE(); }; diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 6038e3164c..c687a07379 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -372,7 +372,7 @@ EVIA::EVIA( CPTREE& aVia ) string ext = attribs.get( "extent" ); - sscanf( ext.c_str(), "%u-%u", &layer_front_most, &layer_back_most ); + sscanf( ext.c_str(), "%d-%d", &layer_front_most, &layer_back_most ); drill = attribs.get( "drill" ); diam = attribs.get_optional( "diameter" ); @@ -951,6 +951,7 @@ ELAYER::ELAYER( CPTREE& aLayer ) number = attribs.get( "number" ); name = attribs.get( "name" ); color = attribs.get( "color" ); + fill = 1; // Temporary value. visible = parseOptionalBool( attribs, "visible" ); active = parseOptionalBool( attribs, "active" ); } @@ -992,6 +993,7 @@ struct ERULES ERULES() : psElongationLong ( 100 ), + psElongationOffset ( 0 ), rvPadTop ( 0.25 ), // rvPadBottom ( 0.25 ), rlMinPadTop ( Mils2iu( 10 ) ), diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index c09049d7a2..10bd717f79 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -1512,7 +1512,7 @@ void PCB_EDIT_FRAME::moveExact() DIALOG_MOVE_EXACT dialog( this, translation, rotation ); int ret = dialog.ShowModal(); - if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + if( ret == wxID_OK ) { BOARD_ITEM* item = GetScreen()->GetCurItem(); diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 6056d11ae9..2831d87338 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -595,7 +595,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb ) D_PAD* pad = padstacks[i]; // Straight padstack - fprintf( aFile, "PADSTACK PAD%d %g\n", i, pad->GetDrillSize().x / SCALE_FACTOR ); + fprintf( aFile, "PADSTACK PAD%u %g\n", i, pad->GetDrillSize().x / SCALE_FACTOR ); LSET pad_set = pad->GetLayerSet() & master_layermask; @@ -604,18 +604,18 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb ) { LAYER_ID layer = *seq; - fprintf( aFile, "PAD P%d %s 0 0\n", i, GenCADLayerName( cu_count, layer ).c_str() ); + fprintf( aFile, "PAD P%u %s 0 0\n", i, GenCADLayerName( cu_count, layer ).c_str() ); } // Flipped padstack - fprintf( aFile, "PADSTACK PAD%dF %g\n", i, pad->GetDrillSize().x / SCALE_FACTOR ); + fprintf( aFile, "PADSTACK PAD%uF %g\n", i, pad->GetDrillSize().x / SCALE_FACTOR ); // the normal LAYER_ID sequence is inverted from gc_seq[] for( LSEQ seq = pad_set.Seq(); seq; ++seq ) { LAYER_ID layer = *seq; - fprintf( aFile, "PAD P%d %s 0 0\n", i, GenCADLayerNameFlipped( cu_count, layer ).c_str() ); + fprintf( aFile, "PAD P%u %s 0 0\n", i, GenCADLayerNameFlipped( cu_count, layer ).c_str() ); } } diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index d135cf880e..f685c3f858 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -848,7 +848,7 @@ void FOOTPRINT_EDIT_FRAME::moveExact() DIALOG_MOVE_EXACT dialog( this, translation, rotation ); int ret = dialog.ShowModal(); - if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + if( ret == wxID_OK ) { SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); @@ -926,7 +926,7 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform ) DIALOG_MOVE_EXACT dialog( this, translation, rotation ); int ret = dialog.ShowModal(); - if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + if( ret == wxID_OK ) { MoveMarkedItemsExactly( module, wxPoint(0, 0), translation, rotation, true ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index b602104af6..bbaf2b0e6b 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -610,7 +610,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) DIALOG_MOVE_EXACT dialog( editFrame, translation, rotation ); int ret = dialog.ShowModal(); - if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + if( ret == wxID_OK ) { if( !isUndoInhibited() ) {