From 1aadf4594728094a2ceb14f5cad487897abc57e3 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 24 Jul 2021 18:59:28 +0200 Subject: [PATCH] DIALOG_SHIM: fix not working initial size when creating a dialog. The first time a DIALOG_SHIM was created, with a given size, this size was not taken in account. This this is now forced. (when recreated during a session, this is the last dialog size that is used) --- common/dialog_shim.cpp | 3 +++ eeschema/tools/ee_inspection_tool.cpp | 8 ++++---- include/dialog_shim.h | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index 9aca18e13a..8c81d24522 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -87,6 +87,7 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl m_parentFrame( nullptr ) { KIWAY_HOLDER* kiwayHolder = nullptr; + m_initialSize = size; if( aParent ) { @@ -255,6 +256,8 @@ bool DIALOG_SHIM::Show( bool show ) 0 ); } } + else if( m_initialSize != wxDefaultSize ) + SetSize( m_initialSize ); // Be sure that the dialog appears in a visible area // (the dialog position might have been stored at the time when it was diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index 67cc173e98..3aaf79835d 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -210,14 +210,11 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) LIB_PINS pinList; symbol->GetPins( pinList ); + // Test for duplicates: // Sort pins by pin num, so 2 duplicate pins // (pins with the same number) will be consecutive in list sort( pinList.begin(), pinList.end(), sort_by_pin_number ); - // Test for duplicates: - DIALOG_DISPLAY_HTML_TEXT_BASE error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ), - wxDefaultPosition, wxSize( 750, 600 ) ); - // The minimal grid size allowed to place a pin is 25 mils // the best grid size is 50 mils, but 25 mils is still usable // this is because all symbols are using a 50 mils grid to place pins, and therefore @@ -451,6 +448,9 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) outmsg += ""; + DIALOG_DISPLAY_HTML_TEXT_BASE error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ), + wxDefaultPosition, wxSize( 700, 350 ) ); + error_display.m_htmlWindow->SetPage( outmsg ); error_display.ShowModal(); } diff --git a/include/dialog_shim.h b/include/dialog_shim.h index 68bb37eb43..d56b40464f 100644 --- a/include/dialog_shim.h +++ b/include/dialog_shim.h @@ -216,6 +216,9 @@ protected: EDA_BASE_FRAME* m_parentFrame; std::vector m_tabOrder; + + // The size asked by the caller, used the first time the dialog is created + wxSize m_initialSize; }; #endif // DIALOG_SHIM_