diff --git a/common/dialogs/dialog_unit_entry.cpp b/common/dialogs/dialog_unit_entry.cpp
index 0bb4fbfaa8..2f55d3b914 100644
--- a/common/dialogs/dialog_unit_entry.cpp
+++ b/common/dialogs/dialog_unit_entry.cpp
@@ -50,11 +50,13 @@ int WX_UNIT_ENTRY_DIALOG::GetValue()
WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption,
const wxString& aLabelX, const wxString& aLabelY,
- const VECTOR2I& aDefaultValue ) :
+ const VECTOR2I& aDefaultValue, bool aShowResetButt ) :
WX_PT_ENTRY_DIALOG_BASE( ( wxWindow* ) aParent, wxID_ANY, aCaption ),
m_unit_binder_x( aParent, m_labelX, m_textCtrlX, m_unitsX, true ),
m_unit_binder_y( aParent, m_labelY, m_textCtrlY, m_unitsY, true )
{
+ m_ButtonReset->Show( aShowResetButt );
+
m_labelX->SetLabel( aLabelX );
m_labelY->SetLabel( aLabelY );
@@ -67,8 +69,7 @@ WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString&
SetInitialFocus( m_textCtrlX );
SetupStandardButtons();
- Layout();
- bSizerMain->Fit( this );
+ finishDialogSettings();
}
@@ -76,3 +77,9 @@ VECTOR2I WX_PT_ENTRY_DIALOG::GetValue()
{
return VECTOR2I( m_unit_binder_x.GetIntValue(), m_unit_binder_y.GetIntValue() );
}
+
+void WX_PT_ENTRY_DIALOG::ResetValues( wxCommandEvent& event )
+{
+ m_unit_binder_x.SetValue( 0 );
+ m_unit_binder_y.SetValue( 0 );
+}
diff --git a/common/dialogs/dialog_unit_entry_base.cpp b/common/dialogs/dialog_unit_entry_base.cpp
index dcf61f1c0b..54e2444678 100644
--- a/common/dialogs/dialog_unit_entry_base.cpp
+++ b/common/dialogs/dialog_unit_entry_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
+// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -102,8 +102,11 @@ WX_PT_ENTRY_DIALOG_BASE::WX_PT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
+ m_ButtonReset = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
+ bSizerButtons->Add( m_ButtonReset, 0, wxALL|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
- bSizerButtons->Add( 100, 0, 1, wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizerButtons->Add( 30, 0, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
@@ -123,8 +126,14 @@ WX_PT_ENTRY_DIALOG_BASE::WX_PT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID i
bSizerMain->Fit( this );
this->Centre( wxBOTH );
+
+ // Connect Events
+ m_ButtonReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WX_PT_ENTRY_DIALOG_BASE::ResetValues ), NULL, this );
}
WX_PT_ENTRY_DIALOG_BASE::~WX_PT_ENTRY_DIALOG_BASE()
{
+ // Disconnect Events
+ m_ButtonReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WX_PT_ENTRY_DIALOG_BASE::ResetValues ), NULL, this );
+
}
diff --git a/common/dialogs/dialog_unit_entry_base.fbp b/common/dialogs/dialog_unit_entry_base.fbp
index 4dd4395dd5..0cdcba713a 100644
--- a/common/dialogs/dialog_unit_entry_base.fbp
+++ b/common/dialogs/dialog_unit_entry_base.fbp
@@ -1,766 +1,854 @@
-
+
-
-
diff --git a/common/dialogs/dialog_unit_entry_base.h b/common/dialogs/dialog_unit_entry_base.h
index 257a7079ff..fd2a962712 100644
--- a/common/dialogs/dialog_unit_entry_base.h
+++ b/common/dialogs/dialog_unit_entry_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
+// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -21,10 +21,12 @@
#include
#include
#include
+#include
+#include
+#include
///////////////////////////////////////////////////////////////////////////
-
///////////////////////////////////////////////////////////////////////////////
/// Class WX_UNIT_ENTRY_DIALOG_BASE
///////////////////////////////////////////////////////////////////////////////
@@ -64,10 +66,15 @@ class WX_PT_ENTRY_DIALOG_BASE : public DIALOG_SHIM
wxStaticText* m_labelY;
wxTextCtrl* m_textCtrlY;
wxStaticText* m_unitsY;
+ wxButton* m_ButtonReset;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
+ // Virtual event handlers, override them in your derived class
+ virtual void ResetValues( wxCommandEvent& event ) { event.Skip(); }
+
+
public:
WX_PT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move Point to Location"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp
index 6c26973c64..aa8f9cb8bf 100644
--- a/common/tool/actions.cpp
+++ b/common/tool/actions.cpp
@@ -1051,7 +1051,8 @@ TOOL_ACTION ACTIONS::gridOrigin( TOOL_ACTION_ARGS()
.Name( "common.Control.editGridOrigin" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Grid Origin..." ) )
- .Tooltip( _( "Set the grid origin point" ) ) );
+ .Tooltip( _( "Set the grid origin point" ) )
+ .Icon( BITMAPS::grid_select_axis ) );
TOOL_ACTION ACTIONS::inchesUnits( TOOL_ACTION_ARGS()
.Name( "common.Control.imperialUnits" )
diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp
index 65e5c944dc..9e1f4c0fca 100644
--- a/common/tool/common_tools.cpp
+++ b/common/tool/common_tools.cpp
@@ -627,7 +627,7 @@ int COMMON_TOOLS::GridProperties( const TOOL_EVENT& aEvent )
int COMMON_TOOLS::GridOrigin( const TOOL_EVENT& aEvent )
{
VECTOR2I origin = m_frame->GetGridOrigin();
- WX_PT_ENTRY_DIALOG dlg( m_frame, _( "Grid Origin" ), _( "X:" ), _( "Y:" ), origin );
+ WX_PT_ENTRY_DIALOG dlg( m_frame, _( "Grid Origin" ), _( "X:" ), _( "Y:" ), origin, true );
if( dlg.ShowModal() == wxID_OK )
{
diff --git a/include/dialogs/dialog_unit_entry.h b/include/dialogs/dialog_unit_entry.h
index 22da240b58..656fa16c07 100644
--- a/include/dialogs/dialog_unit_entry.h
+++ b/include/dialogs/dialog_unit_entry.h
@@ -52,13 +52,15 @@ class WX_PT_ENTRY_DIALOG : public WX_PT_ENTRY_DIALOG_BASE
{
public:
WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption, const wxString& aLabelX,
- const wxString& aLabelY, const VECTOR2I& aDefaultValue );
+ const wxString& aLabelY, const VECTOR2I& aDefaultValue, bool aShowResetButt );
/**
* Return the value in internal units.
*/
VECTOR2I GetValue();
+ void ResetValues( wxCommandEvent& event ) override;
+
private:
UNIT_BINDER m_unit_binder_x;
UNIT_BINDER m_unit_binder_y;
diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp
index e638e9f018..c78b137132 100644
--- a/pcbnew/tools/pcb_point_editor.cpp
+++ b/pcbnew/tools/pcb_point_editor.cpp
@@ -2457,7 +2457,7 @@ int PCB_POINT_EDITOR::movePoint( const TOOL_EVENT& aEvent )
msg = _( "Move Corner" );
}
- WX_PT_ENTRY_DIALOG dlg( editFrame, title, _( "X:" ), _( "Y:" ), pt );
+ WX_PT_ENTRY_DIALOG dlg( editFrame, title, _( "X:" ), _( "Y:" ), pt, false );
if( dlg.ShowModal() == wxID_OK )
{