diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp
index 95b38df561..7018f73313 100644
--- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp
+++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp
@@ -22,8 +22,6 @@
int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_SelectedRow;
-
-
wxSize DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = wxDefaultSize;
@@ -36,37 +34,38 @@ void InstallCmpeditFrame( SCH_EDIT_FRAME* aParent, SCH_COMPONENT* aComponent )
if( aComponent->Type() != SCH_COMPONENT_T )
{
- DisplayError( aParent,
- wxT( "InstallCmpeditFrame() error: This item is not a component" ) );
+ wxMessageBox( wxT( "InstallCmpeditFrame() error: This item is not a component" ) );
return;
}
- DIALOG_EDIT_COMPONENT_IN_SCHEMATIC dialog( aParent );
+ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC * dlg =
+ new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( aParent );
- dialog.InitBuffers( aComponent );
+ dlg->InitBuffers( aComponent );
- wxSize sizeNow = dialog.GetSize();
+ wxSize sizeNow = dlg->GetSize();
// this relies on wxDefaultSize being -1,-1, be careful here.
if( sizeNow.GetWidth() < DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize.GetWidth()
|| sizeNow.GetHeight() < DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize.GetHeight() )
{
- dialog.SetSize( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize );
+ dlg->SetSize( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize );
}
// make sure the chipnameTextCtrl is wide enough to hold any
// unusually long chip names:
- EnsureTextCtrlWidth( dialog.chipnameTextCtrl );
+ EnsureTextCtrlWidth( dlg->chipnameTextCtrl );
- dialog.ShowModal();
+ dlg->ShowModal();
// Some of the field values are long and are not always fully visible because the
// window comes up too narrow. Remember user's manual window resizing efforts here
// so it comes up wide enough next time.
- DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dialog.GetSize();
+ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
aParent->DrawPanel->MoveCursorToCrossHair();
aParent->DrawPanel->m_IgnoreMouseEvents = false;
+ dlg->Destroy();
}
@@ -153,15 +152,15 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
newname.Replace( wxT( " " ), wxT( "_" ) );
if( newname.IsEmpty() )
- DisplayError( this, _( "No Component Name!" ) );
+ DisplayError( NULL, _( "No Component Name!" ) );
else if( newname.CmpNoCase( m_Cmp->m_ChipName ) )
{
if( CMP_LIBRARY::FindLibraryEntry( newname ) == NULL )
{
wxString message;
- message.Printf( _( "Component [%s] not found!" ), newname.GetData() );
- DisplayError( this, message );
+ message.Printf( _( "Component [%s] not found!" ), GetChars( newname ) );
+ DisplayError( NULL, message );
}
else // Change component from lib!
{
diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp
index 639bce5a62..6a359c27c7 100644
--- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp
+++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp
@@ -135,6 +135,9 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB(
{
m_Parent = aParent;
m_LibEntry = aLibEntry;
+
+ GetSizer()->SetSizeHints( this );
+ Centre();
}
@@ -176,11 +179,6 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnInitDialog( wxInitDialogEvent& event
InitBuffers();
copySelectedFieldToPanel();
- if( GetSizer() )
- {
- GetSizer()->SetSizeHints( this );
- }
-
stdDialogButtonSizerOK->SetDefault();
}
diff --git a/eeschema/dialogs/dialog_lib_edit_text.cpp b/eeschema/dialogs/dialog_lib_edit_text.cpp
index f8555b83ee..9fbc0ea901 100644
--- a/eeschema/dialogs/dialog_lib_edit_text.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_text.cpp
@@ -102,12 +102,11 @@ void DIALOG_LIB_EDIT_TEXT::InitDialog( )
msg = m_TextSizeText->GetLabel() + ReturnUnitSymbol();
m_TextSizeText->SetLabel( msg );
- if (GetSizer())
- {
- GetSizer()->SetSizeHints(this);
- }
+ GetSizer()->SetSizeHints(this);
- m_sdbSizer1OK->SetDefault();
+ Centre();
+
+ m_sdbSizerButtonsOK->SetDefault();
}
diff --git a/eeschema/dialogs/dialog_lib_edit_text_base.cpp b/eeschema/dialogs/dialog_lib_edit_text_base.cpp
index 34b28694f4..e412e96a40 100644
--- a/eeschema/dialogs/dialog_lib_edit_text_base.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_text_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Sep 8 2010)
+// C++ code generated with wxFormBuilder (version Nov 17 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -97,27 +97,27 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 6 );
- 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, wxALL|wxEXPAND, 12 );
+ m_sdbSizerButtons = new wxStdDialogButtonSizer();
+ m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
+ m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
+ m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
+ m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
+ m_sdbSizerButtons->Realize();
+ bMainSizer->Add( m_sdbSizerButtons, 0, wxALL|wxEXPAND, 12 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
- m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this );
- m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
+ m_sdbSizerButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this );
+ m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
}
DIALOG_LIB_EDIT_TEXT_BASE::~DIALOG_LIB_EDIT_TEXT_BASE()
{
// Disconnect Events
- m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this );
- m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
+ m_sdbSizerButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this );
+ m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
}
diff --git a/eeschema/dialogs/dialog_lib_edit_text_base.fbp b/eeschema/dialogs/dialog_lib_edit_text_base.fbp
index 71aefbe7d6..f89979b0dc 100644
--- a/eeschema/dialogs/dialog_lib_edit_text_base.fbp
+++ b/eeschema/dialogs/dialog_lib_edit_text_base.fbp
@@ -22,25 +22,54 @@
1
0