diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp
index 6d1d88ea7a..a05a5b621c 100644
--- a/common/dialog_shim.cpp
+++ b/common/dialog_shim.cpp
@@ -595,9 +595,11 @@ void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent )
// allowing a transfer, as there is no other way to indicate failure
// (i.e. the dialog can't refuse to close as it might with OK, because it
// isn't closing anyway)
-
if( Validate() )
- wxASSERT( TransferDataFromWindow() );
+ {
+ bool success = TransferDataFromWindow();
+ (void) success;
+ }
}
else if( id == GetEscapeId() ||
(id == wxID_CANCEL && GetEscapeId() == wxID_ANY) )
diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp
index 64fc156fa1..2c3725d5dd 100644
--- a/pcbnew/dialogs/dialog_drc.cpp
+++ b/pcbnew/dialogs/dialog_drc.cpp
@@ -51,6 +51,9 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ) :
InitValues();
+ FixOSXCancelButtonIssue();
+
+ // Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
}
diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp
index dccd85fb9b..9d38affffb 100644
--- a/pcbnew/dialogs/dialog_edit_module_text.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_text.cpp
@@ -81,13 +81,10 @@ DialogEditModuleText::DialogEditModuleText( PCB_BASE_FRAME* aParent,
if( m_currentText )
m_module = (MODULE*) m_currentText->GetParent();
- m_sdbSizer1OK->SetDefault();
-
- GetSizer()->Fit( this );
- GetSizer()->SetSizeHints( this );
-
- Centre();
+ m_sdbSizerOK->SetDefault();
SetFocus();
+
+ FixOSXCancelButtonIssue();
}
diff --git a/pcbnew/dialogs/dialog_edit_module_text.h b/pcbnew/dialogs/dialog_edit_module_text.h
index a9f1e79292..a619a993b6 100644
--- a/pcbnew/dialogs/dialog_edit_module_text.h
+++ b/pcbnew/dialogs/dialog_edit_module_text.h
@@ -54,6 +54,15 @@ protected:
private:
void ModuleOrientEvent( wxCommandEvent& event );
+
+ void OnInitDlg( wxInitDialogEvent& event )
+ {
+ // Call the default wxDialog handler of a wxInitDialogEvent
+ TransferDataToWindow();
+
+ // Now all widgets have the size fixed, call FinishDialogSettings
+ FinishDialogSettings();
+ }
};
#endif /* DIALOG_EDIT_MODULE_TEXT_H */
diff --git a/pcbnew/dialogs/dialog_edit_module_text_base.cpp b/pcbnew/dialogs/dialog_edit_module_text_base.cpp
index 3a96da49f5..73f98f978a 100644
--- a/pcbnew/dialogs/dialog_edit_module_text_base.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_text_base.cpp
@@ -119,11 +119,11 @@ DialogEditModuleText_base::DialogEditModuleText_base( wxWindow* parent, wxWindow
int m_OrientNChoices = sizeof( m_OrientChoices ) / sizeof( wxString );
m_Orient = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_OrientNChoices, m_OrientChoices, 1, wxRA_SPECIFY_COLS );
m_Orient->SetSelection( 2 );
- bSizer4->Add( m_Orient, 1, wxALL|wxEXPAND, 5 );
+ bSizer4->Add( m_Orient, 0, wxALL|wxEXPAND, 5 );
m_staticTextRotation = new wxStaticText( this, wxID_ANY, _("Rotation (-90.0 to 90.0)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRotation->Wrap( -1 );
- bSizer4->Add( m_staticTextRotation, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
+ bSizer4->Add( m_staticTextRotation, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
m_OrientValueCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_OrientValueCtrl, 0, wxALL|wxEXPAND, 5 );
@@ -137,40 +137,33 @@ DialogEditModuleText_base::DialogEditModuleText_base( wxWindow* parent, wxWindow
bMainSizer->Add( bSizer9, 1, wxALL|wxEXPAND, 5 );
-
- bMainSizer->Add( 0, 0, 0, wxEXPAND, 5 );
-
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
- bMainSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
-
-
- bMainSizer->Add( 0, 0, 0, wxEXPAND|wxTOP, 5 );
-
- m_sdbSizer1 = new wxStdDialogButtonSizer();
- m_sdbSizer1OK = new wxButton( this, wxID_OK );
- m_sdbSizer1->AddButton( m_sdbSizer1OK );
- m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
- m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
- m_sdbSizer1->Realize();
-
- bMainSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
+ bMainSizer->Add( m_staticline2, 0, wxEXPAND|wxALL, 5 );
+ m_sdbSizer = new wxStdDialogButtonSizer();
+ m_sdbSizerOK = new wxButton( this, wxID_OK );
+ m_sdbSizer->AddButton( m_sdbSizerOK );
+ m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
+ m_sdbSizer->AddButton( m_sdbSizerCancel );
+ m_sdbSizer->Realize();
- bMainSizer->Add( 0, 0, 0, wxBOTTOM|wxEXPAND, 5 );
+ bMainSizer->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
+ this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DialogEditModuleText_base::OnInitDlg ) );
m_Orient->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogEditModuleText_base::ModuleOrientEvent ), NULL, this );
- m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogEditModuleText_base::OnOkClick ), NULL, this );
+ m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogEditModuleText_base::OnOkClick ), NULL, this );
}
DialogEditModuleText_base::~DialogEditModuleText_base()
{
// Disconnect Events
+ this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DialogEditModuleText_base::OnInitDlg ) );
m_Orient->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogEditModuleText_base::ModuleOrientEvent ), NULL, this );
- m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogEditModuleText_base::OnOkClick ), NULL, this );
+ m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogEditModuleText_base::OnOkClick ), NULL, this );
}
diff --git a/pcbnew/dialogs/dialog_edit_module_text_base.fbp b/pcbnew/dialogs/dialog_edit_module_text_base.fbp
index a729136b69..46c09744fd 100644
--- a/pcbnew/dialogs/dialog_edit_module_text_base.fbp
+++ b/pcbnew/dialogs/dialog_edit_module_text_base.fbp
@@ -44,7 +44,7 @@
DialogEditModuleText_base
- 500,401
+ 589,351
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
DIALOG_SHIM; dialog_shim.h
Footprint Text Properties
@@ -67,7 +67,7 @@
-
+ OnInitDlg
@@ -267,20 +267,20 @@
-