Commit cb3e36f0 authored by jean-pierre charras's avatar jean-pierre charras

fix bug 765355

parents 86b6feb9 320d01f6
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_SelectedRow; int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_SelectedRow;
wxSize DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = wxDefaultSize; wxSize DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = wxDefaultSize;
...@@ -36,37 +34,38 @@ void InstallCmpeditFrame( SCH_EDIT_FRAME* aParent, SCH_COMPONENT* aComponent ) ...@@ -36,37 +34,38 @@ void InstallCmpeditFrame( SCH_EDIT_FRAME* aParent, SCH_COMPONENT* aComponent )
if( aComponent->Type() != SCH_COMPONENT_T ) if( aComponent->Type() != SCH_COMPONENT_T )
{ {
DisplayError( aParent, wxMessageBox( wxT( "InstallCmpeditFrame() error: This item is not a component" ) );
wxT( "InstallCmpeditFrame() error: This item is not a component" ) );
return; 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. // this relies on wxDefaultSize being -1,-1, be careful here.
if( sizeNow.GetWidth() < DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize.GetWidth() if( sizeNow.GetWidth() < DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize.GetWidth()
|| sizeNow.GetHeight() < DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize.GetHeight() ) || 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 // make sure the chipnameTextCtrl is wide enough to hold any
// unusually long chip names: // 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 // 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 // window comes up too narrow. Remember user's manual window resizing efforts here
// so it comes up wide enough next time. // 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->MoveCursorToCrossHair();
aParent->DrawPanel->m_IgnoreMouseEvents = false; aParent->DrawPanel->m_IgnoreMouseEvents = false;
dlg->Destroy();
} }
...@@ -153,15 +152,15 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions() ...@@ -153,15 +152,15 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
newname.Replace( wxT( " " ), wxT( "_" ) ); newname.Replace( wxT( " " ), wxT( "_" ) );
if( newname.IsEmpty() ) if( newname.IsEmpty() )
DisplayError( this, _( "No Component Name!" ) ); DisplayError( NULL, _( "No Component Name!" ) );
else if( newname.CmpNoCase( m_Cmp->m_ChipName ) ) else if( newname.CmpNoCase( m_Cmp->m_ChipName ) )
{ {
if( CMP_LIBRARY::FindLibraryEntry( newname ) == NULL ) if( CMP_LIBRARY::FindLibraryEntry( newname ) == NULL )
{ {
wxString message; wxString message;
message.Printf( _( "Component [%s] not found!" ), newname.GetData() ); message.Printf( _( "Component [%s] not found!" ), GetChars( newname ) );
DisplayError( this, message ); DisplayError( NULL, message );
} }
else // Change component from lib! else // Change component from lib!
{ {
......
...@@ -135,6 +135,9 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( ...@@ -135,6 +135,9 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB(
{ {
m_Parent = aParent; m_Parent = aParent;
m_LibEntry = aLibEntry; m_LibEntry = aLibEntry;
GetSizer()->SetSizeHints( this );
Centre();
} }
...@@ -176,11 +179,6 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnInitDialog( wxInitDialogEvent& event ...@@ -176,11 +179,6 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnInitDialog( wxInitDialogEvent& event
InitBuffers(); InitBuffers();
copySelectedFieldToPanel(); copySelectedFieldToPanel();
if( GetSizer() )
{
GetSizer()->SetSizeHints( this );
}
stdDialogButtonSizerOK->SetDefault(); stdDialogButtonSizerOK->SetDefault();
} }
......
...@@ -102,12 +102,11 @@ void DIALOG_LIB_EDIT_TEXT::InitDialog( ) ...@@ -102,12 +102,11 @@ void DIALOG_LIB_EDIT_TEXT::InitDialog( )
msg = m_TextSizeText->GetLabel() + ReturnUnitSymbol(); msg = m_TextSizeText->GetLabel() + ReturnUnitSymbol();
m_TextSizeText->SetLabel( msg ); m_TextSizeText->SetLabel( msg );
if (GetSizer())
{
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints(this);
}
m_sdbSizer1OK->SetDefault(); Centre();
m_sdbSizerButtonsOK->SetDefault();
} }
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Nov 17 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -97,27 +97,27 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow ...@@ -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 ); bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 6 );
m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizerButtons = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK ); m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
m_sdbSizer1->Realize(); m_sdbSizerButtons->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 12 ); bMainSizer->Add( m_sdbSizerButtons, 0, wxALL|wxEXPAND, 12 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
bMainSizer->Fit( this ); bMainSizer->Fit( this );
// Connect Events // Connect Events
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this ); m_sdbSizerButtonsCancel->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_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() DIALOG_LIB_EDIT_TEXT_BASE::~DIALOG_LIB_EDIT_TEXT_BASE()
{ {
// Disconnect Events // Disconnect Events
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this ); m_sdbSizerButtonsCancel->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_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Nov 17 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -46,9 +46,9 @@ class DIALOG_LIB_EDIT_TEXT_BASE : public wxDialog ...@@ -46,9 +46,9 @@ class DIALOG_LIB_EDIT_TEXT_BASE : public wxDialog
wxRadioBox* m_TextShapeOpt; wxRadioBox* m_TextShapeOpt;
wxRadioBox* m_TextHJustificationOpt; wxRadioBox* m_TextHJustificationOpt;
wxRadioBox* m_TextVJustificationOpt; wxRadioBox* m_TextVJustificationOpt;
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment