diff --git a/eeschema/dialogs/dialog_edit_symbols_libid.cpp b/eeschema/dialogs/dialog_edit_symbols_libid.cpp index dfb23d60ee..c32826fbfe 100644 --- a/eeschema/dialogs/dialog_edit_symbols_libid.cpp +++ b/eeschema/dialogs/dialog_edit_symbols_libid.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -332,7 +333,7 @@ private: // Automatically called when click on OK button bool TransferDataFromWindow() override; - void AdjustGridColumns( int aWidth ); + void AdjustGridColumns(); void OnSizeGrid( wxSizeEvent& event ) override; @@ -784,15 +785,15 @@ bool DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow() } -void DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns( int aWidth ) +void DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns() { // Account for scroll bars - aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); + int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; - int colWidth = aWidth / 3; + int colWidth = width / 3; m_grid->SetColSize( COL_REFS, colWidth ); - aWidth -= colWidth; + width -= colWidth; colWidth = 0; @@ -804,7 +805,7 @@ void DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns( int aWidth ) colWidth += 20; m_grid->SetColSize( COL_CURR_LIBID, colWidth ); - aWidth -= colWidth; + width -= colWidth; colWidth = 0; @@ -815,13 +816,13 @@ void DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns( int aWidth ) } colWidth += 20; - m_grid->SetColSize( COL_NEW_LIBID, std::max( colWidth, aWidth ) ); + m_grid->SetColSize( COL_NEW_LIBID, std::max( colWidth, width ) ); } void DIALOG_EDIT_SYMBOLS_LIBID::OnSizeGrid( wxSizeEvent& event ) { - AdjustGridColumns( event.GetSize().GetX() ); + AdjustGridColumns(); wxClientDC dc( this ); diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp index 985366fa47..ff81ff1167 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -687,16 +688,14 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnRebuildRows( wxCommandEvent& ) m_dataModel->RebuildRows( m_pins, m_cbGroup->GetValue() ); - adjustGridColumns( m_grid->GetRect().GetWidth() ); + adjustGridColumns(); } -void DIALOG_LIB_EDIT_PIN_TABLE::adjustGridColumns( int aWidth ) +void DIALOG_LIB_EDIT_PIN_TABLE::adjustGridColumns() { - m_width = aWidth; - // Account for scroll bars - aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); + int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; wxGridUpdateLocker deferRepaintsTillLeavingScope; @@ -717,12 +716,12 @@ void DIALOG_LIB_EDIT_PIN_TABLE::adjustGridColumns( int aWidth ) // to fit. for( int i = 0; i < COL_COUNT; ++i ) - aWidth -= m_grid->GetColSize( i ); + width -= m_grid->GetColSize( i ); - if( aWidth > 0 ) + if( width > 0 ) { - m_grid->SetColSize( COL_NUMBER, m_grid->GetColSize( COL_NUMBER ) + aWidth / 2 ); - m_grid->SetColSize( COL_NAME, m_grid->GetColSize( COL_NAME ) + aWidth / 2 ); + m_grid->SetColSize( COL_NUMBER, m_grid->GetColSize( COL_NUMBER ) + width / 2 ); + m_grid->SetColSize( COL_NAME, m_grid->GetColSize( COL_NAME ) + width / 2 ); } } @@ -733,7 +732,9 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnSize( wxSizeEvent& event ) if( m_initialized && m_width != new_size ) { - adjustGridColumns( new_size ); + m_width = new_size; + + adjustGridColumns(); } // Always propagate for a grid repaint (needed if the height changes, as well as width) @@ -750,7 +751,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnUpdateUI( wxUpdateUIEvent& event ) m_columnsShown = columnsShown; if( !m_grid->IsCellEditControlShown() ) - adjustGridColumns( m_grid->GetRect().GetWidth() ); + adjustGridColumns(); } } diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.h b/eeschema/dialogs/dialog_lib_edit_pin_table.h index 97fbb03884..be3d590d68 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.h +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.h @@ -70,7 +70,7 @@ public: protected: void updateSummary(); - void adjustGridColumns( int aWidth ); + void adjustGridColumns(); SYMBOL_EDIT_FRAME* m_editFrame; bool m_initialized = false; diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.cpp b/eeschema/dialogs/dialog_lib_symbol_properties.cpp index 54df3ea3c7..b001e55eca 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties.cpp @@ -29,6 +29,7 @@ #include #include // for KiROUND #include +#include #include #include #include @@ -163,7 +164,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow() // notify the grid wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->GetNumberRows() ); m_grid->ProcessTableMessage( msg ); - adjustGridColumns( m_grid->GetRect().GetWidth() ); + adjustGridColumns(); m_SymbolNameCtrl->ChangeValue( UnescapeString( m_libEntry->GetName() ) ); @@ -694,12 +695,10 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnEditFootprintFilter( wxCommandEvent& event } -void DIALOG_LIB_SYMBOL_PROPERTIES::adjustGridColumns( int aWidth ) +void DIALOG_LIB_SYMBOL_PROPERTIES::adjustGridColumns() { - m_width = aWidth; - // Account for scroll bars - aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); + int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; m_grid->AutoSizeColumn( FDC_NAME ); @@ -708,7 +707,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::adjustGridColumns( int aWidth ) for( int i = 2; i < m_grid->GetNumberCols(); i++ ) fixedColsWidth += m_grid->GetColSize( i ); - m_grid->SetColSize( FDC_VALUE, aWidth - fixedColsWidth ); + m_grid->SetColSize( FDC_VALUE, width - fixedColsWidth ); } @@ -738,7 +737,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) m_shownColumns = shownColumns; if( !m_grid->IsCellEditControlShown() ) - adjustGridColumns( m_grid->GetRect().GetWidth() ); + adjustGridColumns(); } // Handle a delayed focus. The delay allows us to: @@ -794,7 +793,9 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnSizeGrid( wxSizeEvent& event ) if( new_size != m_width ) { - adjustGridColumns( event.GetSize().GetX() ); + m_width = new_size; + + adjustGridColumns(); } // Always propagate a wxSizeEvent: diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.h b/eeschema/dialogs/dialog_lib_symbol_properties.h index b54dd2ba83..6a3e8da589 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.h +++ b/eeschema/dialogs/dialog_lib_symbol_properties.h @@ -71,7 +71,7 @@ private: void OnFilterDClick( wxMouseEvent& event ) override; void OnCancelButtonClick( wxCommandEvent& event ) override; - void adjustGridColumns( int aWidth ); + void adjustGridColumns(); void syncControlStates( bool aIsAlias ); public: diff --git a/eeschema/dialogs/dialog_pin_properties.cpp b/eeschema/dialogs/dialog_pin_properties.cpp index 17ca20ebd0..8b4d4db3f5 100644 --- a/eeschema/dialogs/dialog_pin_properties.cpp +++ b/eeschema/dialogs/dialog_pin_properties.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -455,20 +456,18 @@ void DIALOG_PIN_PROPERTIES::OnDeleteAlternate( wxCommandEvent& event ) } -void DIALOG_PIN_PROPERTIES::adjustGridColumns( int aWidth ) +void DIALOG_PIN_PROPERTIES::adjustGridColumns() { - m_width = aWidth; - - // Account for margins - aWidth -= 30; + // Account for scroll bars + int width = KIPLATFORM::UI::GetUnobscuredSize( m_alternatesGrid ).x; wxGridUpdateLocker deferRepaintsTillLeavingScope; - m_alternatesGrid->SetColSize( COL_TYPE, m_originalColWidths[ COL_TYPE ] ); - m_alternatesGrid->SetColSize( COL_SHAPE, m_originalColWidths[ COL_SHAPE ] ); + m_alternatesGrid->SetColSize( COL_TYPE, m_originalColWidths[COL_TYPE] ); + m_alternatesGrid->SetColSize( COL_SHAPE, m_originalColWidths[COL_SHAPE] ); - m_alternatesGrid->SetColSize( COL_NAME, aWidth - m_originalColWidths[ COL_TYPE ] - - m_originalColWidths[ COL_SHAPE ] ); + m_alternatesGrid->SetColSize( COL_NAME, width - m_originalColWidths[COL_TYPE] + - m_originalColWidths[COL_SHAPE] ); } @@ -477,7 +476,11 @@ void DIALOG_PIN_PROPERTIES::OnSize( wxSizeEvent& event ) auto new_size = event.GetSize().GetX(); if( m_initialized && m_width != new_size ) - adjustGridColumns( new_size ); + { + m_width = new_size; + + adjustGridColumns(); + } // Always propagate for a grid repaint (needed if the height changes, as well as width) event.Skip(); diff --git a/eeschema/dialogs/dialog_pin_properties.h b/eeschema/dialogs/dialog_pin_properties.h index d804efdaf4..3a9e930da7 100644 --- a/eeschema/dialogs/dialog_pin_properties.h +++ b/eeschema/dialogs/dialog_pin_properties.h @@ -68,7 +68,7 @@ public: void onUpdateUIInfo( wxUpdateUIEvent& event ) override; protected: - void adjustGridColumns( int aWidth ); + void adjustGridColumns(); private: SYMBOL_EDIT_FRAME* m_frame; diff --git a/eeschema/dialogs/dialog_sheet_properties.cpp b/eeschema/dialogs/dialog_sheet_properties.cpp index db23c7b8a3..1652701af5 100644 --- a/eeschema/dialogs/dialog_sheet_properties.cpp +++ b/eeschema/dialogs/dialog_sheet_properties.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,6 @@ DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_S { m_sheet = aSheet; m_fields = new FIELDS_GRID_TABLE( this, aParent, m_grid, m_sheet ); - m_width = 100; // Will be later set to a better value m_delayedFocusRow = SHEETNAME; m_delayedFocusColumn = FDC_VALUE; @@ -142,7 +142,7 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataToWindow() // notify the grid wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->size() ); m_grid->ProcessTableMessage( msg ); - AdjustGridColumns( m_grid->GetRect().GetWidth() ); + AdjustGridColumns(); // border width m_borderWidth.SetValue( m_sheet->GetBorderWidth() ); @@ -804,11 +804,10 @@ void DIALOG_SHEET_PROPERTIES::OnMoveDown( wxCommandEvent& event ) } -void DIALOG_SHEET_PROPERTIES::AdjustGridColumns( int aWidth ) +void DIALOG_SHEET_PROPERTIES::AdjustGridColumns() { - m_width = aWidth; // Account for scroll bars - aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); + int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; m_grid->AutoSizeColumn( 0 ); @@ -817,7 +816,7 @@ void DIALOG_SHEET_PROPERTIES::AdjustGridColumns( int aWidth ) for( int i = 2; i < m_grid->GetNumberCols(); i++ ) fixedColsWidth += m_grid->GetColSize( i ); - int colSize = std::max( aWidth - fixedColsWidth, -1 ); + int colSize = std::max( width - fixedColsWidth, -1 ); colSize = ( colSize == 0 ) ? -1 : colSize; // don't hide the column! m_grid->SetColSize( 1, colSize ); @@ -833,7 +832,7 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) m_shownColumns = shownColumns; if( !m_grid->IsCellEditControlShown() ) - AdjustGridColumns( m_grid->GetRect().GetWidth() ); + AdjustGridColumns(); } // Propagate changes in sheetname to displayed hierarchical path @@ -881,10 +880,14 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) void DIALOG_SHEET_PROPERTIES::OnSizeGrid( wxSizeEvent& event ) { - int new_size = event.GetSize().GetX(); + int new_size = event.GetSize(); - if( m_width != new_size ) - AdjustGridColumns( new_size ); + if( m_size != new_size ) + { + m_size = new_size; + + AdjustGridColumns(); + } // Always propagate for a grid repaint (needed if the height changes, as well as width) event.Skip(); diff --git a/eeschema/dialogs/dialog_sheet_properties.h b/eeschema/dialogs/dialog_sheet_properties.h index 441e3f6e34..cc6066082e 100644 --- a/eeschema/dialogs/dialog_sheet_properties.h +++ b/eeschema/dialogs/dialog_sheet_properties.h @@ -60,7 +60,7 @@ private: void OnUpdateUI( wxUpdateUIEvent& event ) override; void OnInitDlg( wxInitDialogEvent& event ) override; - void AdjustGridColumns( int aWidth ); + void AdjustGridColumns(); private: SCH_EDIT_FRAME* m_frame; diff --git a/eeschema/dialogs/dialog_symbol_properties.cpp b/eeschema/dialogs/dialog_symbol_properties.cpp index 67bc0684e2..cb713c638f 100644 --- a/eeschema/dialogs/dialog_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_symbol_properties.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -291,7 +292,8 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent, m_fields = new FIELDS_GRID_TABLE( this, aParent, m_fieldsGrid, m_part ); - m_width = 0; + m_widthFields = 0; + m_widthPins = 0; m_delayedFocusRow = REFERENCE_FIELD; m_delayedFocusColumn = FDC_VALUE; m_delayedSelection = true; @@ -441,7 +443,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow() // notify the grid wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->size() ); m_fieldsGrid->ProcessTableMessage( msg ); - AdjustGridColumns( m_fieldsGrid->GetRect().GetWidth() ); + AdjustFieldsGridColumns(); // If a multi-unit symbol, set up the unit selector and interchangeable checkbox. if( m_symbol->GetUnitCount() > 1 ) @@ -993,15 +995,12 @@ void DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort( wxGridEvent& aEvent ) } -void DIALOG_SYMBOL_PROPERTIES::AdjustGridColumns( int aWidth ) +void DIALOG_SYMBOL_PROPERTIES::AdjustFieldsGridColumns() { - wxGridUpdateLocker deferRepaintsTillLeavingScope; - - m_width = aWidth; + wxGridUpdateLocker deferRepaintsTillLeavingScope( m_fieldsGrid ); // Account for scroll bars - int fieldsWidth = aWidth - ( m_fieldsGrid->GetSize().x - m_fieldsGrid->GetClientSize().x ); - int pinTblWidth = aWidth - ( m_pinGrid->GetSize().x - m_pinGrid->GetClientSize().x ); + int fieldsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_fieldsGrid ).x; m_fieldsGrid->AutoSizeColumn( 0 ); @@ -1014,6 +1013,15 @@ void DIALOG_SYMBOL_PROPERTIES::AdjustGridColumns( int aWidth ) colSize = ( colSize == 0 ) ? -1 : colSize; // don't hide the column! m_fieldsGrid->SetColSize( 1, colSize ); +} + + +void DIALOG_SYMBOL_PROPERTIES::AdjustPinsGridColumns() +{ + wxGridUpdateLocker deferRepaintsTillLeavingScope( m_pinGrid ); + + // Account for scroll bars + int pinTblWidth = KIPLATFORM::UI::GetUnobscuredSize( m_pinGrid ).x; // Stretch the Base Name and Alternate Assignment columns to fit. for( int i = 0; i < COL_COUNT; ++i ) @@ -1022,9 +1030,6 @@ void DIALOG_SYMBOL_PROPERTIES::AdjustGridColumns( int aWidth ) pinTblWidth -= m_pinGrid->GetColSize( i ); } - // Why? I haven't a clue.... - pinTblWidth += 22; - m_pinGrid->SetColSize( COL_BASE_NAME, pinTblWidth / 2 ); m_pinGrid->SetColSize( COL_ALT_NAME, pinTblWidth / 2 ); } @@ -1039,7 +1044,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) m_shownColumns = shownColumns; if( !m_fieldsGrid->IsCellEditControlShown() ) - AdjustGridColumns( m_fieldsGrid->GetRect().GetWidth() ); + AdjustFieldsGridColumns(); } // Handle a delayed focus @@ -1071,14 +1076,31 @@ void DIALOG_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) } -void DIALOG_SYMBOL_PROPERTIES::OnSizeGrid( wxSizeEvent& event ) +void DIALOG_SYMBOL_PROPERTIES::OnSizeFieldsGrid( wxSizeEvent& event ) { int new_size = event.GetSize().GetX(); - if( m_width != new_size ) + if( m_widthFields != new_size ) { - AdjustGridColumns( new_size ); - Layout(); + m_widthFields = new_size; + + AdjustFieldsGridColumns(); + } + + // Always propagate for a grid repaint (needed if the height changes, as well as width) + event.Skip(); +} + + +void DIALOG_SYMBOL_PROPERTIES::OnSizePinsGrid( wxSizeEvent& event ) +{ + int new_size = event.GetSize().GetX(); + + if( m_widthPins != new_size ) + { + m_widthPins = new_size; + + AdjustPinsGridColumns(); } // Always propagate for a grid repaint (needed if the height changes, as well as width) diff --git a/eeschema/dialogs/dialog_symbol_properties.h b/eeschema/dialogs/dialog_symbol_properties.h index c2c182e68b..f093346341 100644 --- a/eeschema/dialogs/dialog_symbol_properties.h +++ b/eeschema/dialogs/dialog_symbol_properties.h @@ -74,7 +74,8 @@ private: void OnEditSpiceModel( wxCommandEvent& event ) override; void OnPinTableColSort( wxGridEvent& aEvent ); void OnPinTableCellEdited( wxGridEvent& event ) override; - void OnSizeGrid( wxSizeEvent& event ) override; + void OnSizeFieldsGrid( wxSizeEvent& event ) override; + void OnSizePinsGrid( wxSizeEvent& event ) override; void OnGridCellChanging( wxGridEvent& event ); void OnUpdateUI( wxUpdateUIEvent& event ) override; void OnCancelButtonClick( wxCommandEvent& event ) override; @@ -88,13 +89,15 @@ private: void OnUpdateSymbol( wxCommandEvent& ) override; void OnExchangeSymbol( wxCommandEvent& ) override; - void AdjustGridColumns( int aWidth ); + void AdjustFieldsGridColumns(); + void AdjustPinsGridColumns(); private: SCH_SYMBOL* m_symbol; LIB_SYMBOL* m_part; - int m_width; + int m_widthFields; + int m_widthPins; int m_delayedFocusRow; int m_delayedFocusColumn; bool m_delayedSelection; diff --git a/eeschema/dialogs/dialog_symbol_properties_base.cpp b/eeschema/dialogs/dialog_symbol_properties_base.cpp index f912d39749..6cd268d0ab 100644 --- a/eeschema/dialogs/dialog_symbol_properties_base.cpp +++ b/eeschema/dialogs/dialog_symbol_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -49,7 +49,6 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, m_fieldsGrid->SetColSize( 10, 84 ); m_fieldsGrid->EnableDragColMove( false ); m_fieldsGrid->EnableDragColSize( true ); - m_fieldsGrid->SetColLabelSize( 22 ); m_fieldsGrid->SetColLabelValue( 0, _("Name") ); m_fieldsGrid->SetColLabelValue( 1, _("Value") ); m_fieldsGrid->SetColLabelValue( 2, _("Show") ); @@ -61,6 +60,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, m_fieldsGrid->SetColLabelValue( 8, _("Orientation") ); m_fieldsGrid->SetColLabelValue( 9, _("X Position") ); m_fieldsGrid->SetColLabelValue( 10, _("Y Position") ); + m_fieldsGrid->SetColLabelSize( 22 ); m_fieldsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); // Rows @@ -260,12 +260,12 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, m_pinGrid->SetColSize( 4, 140 ); m_pinGrid->EnableDragColMove( false ); m_pinGrid->EnableDragColSize( true ); - m_pinGrid->SetColLabelSize( 24 ); m_pinGrid->SetColLabelValue( 0, _("Pin Number") ); m_pinGrid->SetColLabelValue( 1, _("Base Pin Name") ); m_pinGrid->SetColLabelValue( 2, _("Alternate Assignment") ); m_pinGrid->SetColLabelValue( 3, _("Electrical Type") ); m_pinGrid->SetColLabelValue( 4, _("Graphic Style") ); + m_pinGrid->SetColLabelSize( 24 ); m_pinGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); // Rows @@ -337,7 +337,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnInitDlg ) ); this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateUI ) ); m_fieldsGrid->Connect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnGridEditorShown ), NULL, this ); - m_fieldsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnSizeGrid ), NULL, this ); + m_fieldsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnSizeFieldsGrid ), NULL, this ); m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnAddField ), NULL, this ); m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnMoveUp ), NULL, this ); m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnMoveDown ), NULL, this ); @@ -355,6 +355,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, m_editSchematicSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSymbol ), NULL, this ); m_editLibrarySymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditLibrarySymbol ), NULL, this ); m_pinGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnPinTableCellEdited ), NULL, this ); + m_pinGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnSizePinsGrid ), NULL, this ); m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this ); m_stdDialogButtonSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); } @@ -365,7 +366,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::~DIALOG_SYMBOL_PROPERTIES_BASE() this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnInitDlg ) ); this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateUI ) ); m_fieldsGrid->Disconnect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnGridEditorShown ), NULL, this ); - m_fieldsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnSizeGrid ), NULL, this ); + m_fieldsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnSizeFieldsGrid ), NULL, this ); m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnAddField ), NULL, this ); m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnMoveUp ), NULL, this ); m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnMoveDown ), NULL, this ); @@ -383,6 +384,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::~DIALOG_SYMBOL_PROPERTIES_BASE() m_editSchematicSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSymbol ), NULL, this ); m_editLibrarySymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditLibrarySymbol ), NULL, this ); m_pinGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnPinTableCellEdited ), NULL, this ); + m_pinGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnSizePinsGrid ), NULL, this ); m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this ); m_stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); diff --git a/eeschema/dialogs/dialog_symbol_properties_base.fbp b/eeschema/dialogs/dialog_symbol_properties_base.fbp index 44689751f8..aac47ea52e 100644 --- a/eeschema/dialogs/dialog_symbol_properties_base.fbp +++ b/eeschema/dialogs/dialog_symbol_properties_base.fbp @@ -1,6 +1,6 @@ - + ; C++ @@ -14,6 +14,7 @@ dialog_symbol_properties_base 1000 none + 1 dialog_edit_component_in_schematic_base @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -50,6 +52,7 @@ DIALOG_SHIM; dialog_shim.h Symbol Properties + 0 @@ -276,7 +279,7 @@ OnGridEditorShown - OnSizeGrid + OnSizeFieldsGrid @@ -301,6 +304,7 @@ + 0 @@ -374,6 +378,7 @@ + 0 @@ -447,6 +452,7 @@ + 0 @@ -530,6 +536,7 @@ + 0 @@ -1429,6 +1436,7 @@ + 0 @@ -1502,6 +1510,7 @@ + 0 @@ -1575,6 +1584,7 @@ + 0 @@ -1658,6 +1668,7 @@ + 0 @@ -1881,6 +1892,7 @@ OnPinTableCellEdited + OnSizePinsGrid @@ -2058,6 +2070,7 @@ + 0 diff --git a/eeschema/dialogs/dialog_symbol_properties_base.h b/eeschema/dialogs/dialog_symbol_properties_base.h index f65af4b6b4..eee25ad597 100644 --- a/eeschema/dialogs/dialog_symbol_properties_base.h +++ b/eeschema/dialogs/dialog_symbol_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -77,11 +77,11 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM wxButton* m_stdDialogButtonSizerOK; wxButton* m_stdDialogButtonSizerCancel; - // Virtual event handlers, overide them in your derived class + // Virtual event handlers, override them in your derived class virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnGridEditorShown( wxGridEvent& event ) { event.Skip(); } - virtual void OnSizeGrid( wxSizeEvent& event ) { event.Skip(); } + virtual void OnSizeFieldsGrid( wxSizeEvent& event ) { event.Skip(); } virtual void OnAddField( wxCommandEvent& event ) { event.Skip(); } virtual void OnMoveUp( wxCommandEvent& event ) { event.Skip(); } virtual void OnMoveDown( wxCommandEvent& event ) { event.Skip(); } @@ -93,6 +93,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM virtual void OnEditSymbol( wxCommandEvent& event ) { event.Skip(); } virtual void OnEditLibrarySymbol( wxCommandEvent& event ) { event.Skip(); } virtual void OnPinTableCellEdited( wxGridEvent& event ) { event.Skip(); } + virtual void OnSizePinsGrid( wxSizeEvent& event ) { event.Skip(); } virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } @@ -100,6 +101,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM public: DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU ); + ~DIALOG_SYMBOL_PROPERTIES_BASE(); }; diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index f9bc88a792..e9d2eb3859 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -313,7 +314,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow() m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, false, true, true ) ); Layout(); - adjustGridColumns( m_itemsGrid->GetRect().GetWidth() ); + adjustGridColumns(); return true; } @@ -554,10 +555,10 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnDeleteField( wxCommandEvent& ) } -void DIALOG_FOOTPRINT_PROPERTIES::adjustGridColumns( int aWidth ) +void DIALOG_FOOTPRINT_PROPERTIES::adjustGridColumns() { // Account for scroll bars - int itemsWidth = aWidth - ( m_itemsGrid->GetSize().x - m_itemsGrid->GetClientSize().x ); + int itemsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_itemsGrid ).x; itemsWidth -= m_itemsGrid->GetRowLabelSize(); @@ -571,7 +572,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::adjustGridColumns( int aWidth ) } // Update the width of the 3D panel - m_3dPanel->AdjustGridColumnWidths( aWidth ); + m_3dPanel->AdjustGridColumnWidths(); } @@ -581,7 +582,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& ) return; if( !m_itemsGrid->IsCellEditControlShown() ) - adjustGridColumns( m_itemsGrid->GetRect().GetWidth() ); + adjustGridColumns(); // Handle a grid error. This is delayed to OnUpdateUI so that we can change focus // even when the original validation was triggered from a killFocus event, and so @@ -646,7 +647,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnGridSize( wxSizeEvent& aEvent ) m_itemsGrid->SetFocus(); } - adjustGridColumns( aEvent.GetSize().GetX() ); + adjustGridColumns(); aEvent.Skip(); } diff --git a/pcbnew/dialogs/dialog_footprint_properties.h b/pcbnew/dialogs/dialog_footprint_properties.h index a52bdf0449..7a6a99b37c 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.h +++ b/pcbnew/dialogs/dialog_footprint_properties.h @@ -74,7 +74,7 @@ private: void OnUpdateUI( wxUpdateUIEvent& ) override; void OnPageChange( wxNotebookEvent& event ) override; - void adjustGridColumns( int aWidth ); + void adjustGridColumns(); private: PCB_EDIT_FRAME* m_frame; diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp index f4b0b63014..7a501c4f65 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -327,7 +328,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow() m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, true, true, true ) ); Layout(); - adjustGridColumns( m_itemsGrid->GetRect().GetWidth() ); + adjustGridColumns(); return true; } @@ -666,10 +667,10 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnDeleteLayer( wxCommandEvent& event } -void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::adjustGridColumns( int aWidth ) +void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::adjustGridColumns() { // Account for scroll bars - int itemsWidth = aWidth - ( m_itemsGrid->GetSize().x - m_itemsGrid->GetClientSize().x ); + int itemsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_itemsGrid ).x; itemsWidth -= m_itemsGrid->GetRowLabelSize(); @@ -683,14 +684,14 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::adjustGridColumns( int aWidth ) } // Update the width of the 3D panel - m_3dPanel->AdjustGridColumnWidths( aWidth ); + m_3dPanel->AdjustGridColumnWidths(); } void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnUpdateUI( wxUpdateUIEvent& event ) { if( !m_itemsGrid->IsCellEditControlShown() ) - adjustGridColumns( m_itemsGrid->GetRect().GetWidth() ); + adjustGridColumns(); // Handle a delayed focus. The delay allows us to: // a) change focus when the error was triggered from within a killFocus handler @@ -743,7 +744,7 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnUpdateUI( wxUpdateUIEvent& event ) void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnGridSize( wxSizeEvent& event ) { - adjustGridColumns( event.GetSize().GetX() ); + adjustGridColumns(); event.Skip(); } diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.h b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.h index 48401501b1..b4c6ed1059 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.h +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.h @@ -92,7 +92,7 @@ private: bool checkFootprintName( const wxString& aFootprintName ); - void adjustGridColumns( int aWidth ); + void adjustGridColumns(); private: FOOTPRINT_EDIT_FRAME* m_frame; diff --git a/pcbnew/dialogs/dialog_net_inspector.cpp b/pcbnew/dialogs/dialog_net_inspector.cpp index a849d94efc..df6c9ddcfe 100644 --- a/pcbnew/dialogs/dialog_net_inspector.cpp +++ b/pcbnew/dialogs/dialog_net_inspector.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include #include +#include #include @@ -1708,6 +1710,7 @@ void DIALOG_NET_INSPECTOR::adjustListColumns() * That width must be enough to fit column header label and be not less than width of * four chars (0000). */ + wxWindowUpdateLocker locker( m_netsList ); wxClientDC dc( GetParent() ); @@ -1748,8 +1751,15 @@ void DIALOG_NET_INSPECTOR::adjustListColumns() assert( column_order.size() == 8 ); + // At resizing of the list the width of middle column (Net Names) changes only. + int width = KIPLATFORM::UI::GetUnobscuredSize( m_netsList ).x; + w1 = width - w0 - w2 - w3 - w4 - w5 - w6 - w7; + + if( w1 < minw_col1 ) + w1 = minw_col1; + m_netsList->GetColumn( column_order[0] )->SetWidth( w0 ); - m_netsList->GetColumn( column_order[1] )->SetMinWidth( minw_col1 ); + m_netsList->GetColumn( column_order[1] )->SetWidth( w1 ); m_netsList->GetColumn( column_order[2] )->SetWidth( w2 ); m_netsList->GetColumn( column_order[3] )->SetWidth( w3 ); m_netsList->GetColumn( column_order[4] )->SetWidth( w4 ); @@ -1757,21 +1767,28 @@ void DIALOG_NET_INSPECTOR::adjustListColumns() m_netsList->GetColumn( column_order[6] )->SetWidth( w6 ); m_netsList->GetColumn( column_order[7] )->SetWidth( w7 ); - // At resizing of the list the width of middle column (Net Names) changes only. - int width = m_netsList->GetClientSize().x - 24; - w1 = width - w0 - w2 - w3 - w4 - w5 - w6 - w7; - - if( w1 > minw_col1 ) - m_netsList->GetColumn( column_order[1] )->SetWidth( w1 ); - m_netsList->Refresh(); + + // Force refresh on GTK so that horizontal scroll bar won't appear +#ifdef __WXGTK__ + wxPoint pos = m_netsList->GetPosition(); + m_netsList->Move( pos.x, pos.y + 1 ); + m_netsList->Move( pos.x, pos.y ); +#endif } void DIALOG_NET_INSPECTOR::onListSize( wxSizeEvent& aEvent ) { + int width = aEvent.GetSize().x; + + if( width != m_width ) + { + m_width = width; + adjustListColumns(); + } + aEvent.Skip(); - adjustListColumns(); } diff --git a/pcbnew/dialogs/dialog_net_inspector.h b/pcbnew/dialogs/dialog_net_inspector.h index 00613ffa5f..662d67944d 100644 --- a/pcbnew/dialogs/dialog_net_inspector.h +++ b/pcbnew/dialogs/dialog_net_inspector.h @@ -125,6 +125,7 @@ private: PCB_EDIT_FRAME* m_frame; bool m_in_build_nets_list = false; bool m_filter_change_no_rebuild = false; + int m_width = 0; class DATA_MODEL; wxObjectDataPtr m_data_model; diff --git a/pcbnew/dialogs/dialog_swap_layers.cpp b/pcbnew/dialogs/dialog_swap_layers.cpp index 157a9b03ad..699d2eca67 100644 --- a/pcbnew/dialogs/dialog_swap_layers.cpp +++ b/pcbnew/dialogs/dialog_swap_layers.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include "dialog_swap_layers.h" @@ -140,19 +141,19 @@ bool DIALOG_SWAP_LAYERS::TransferDataFromWindow() } -void DIALOG_SWAP_LAYERS::adjustGridColumns( int aWidth ) +void DIALOG_SWAP_LAYERS::adjustGridColumns() { // Account for scroll bars - aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); + int width = KIPLATFORM::UI::GetUnobscuredSize( m_grid ).x; - m_grid->SetColSize( 0, aWidth / 2 ); - m_grid->SetColSize( 1, aWidth - m_grid->GetColSize( 0 ) ); + m_grid->SetColSize( 0, width / 2 ); + m_grid->SetColSize( 1, width - m_grid->GetColSize( 0 ) ); } void DIALOG_SWAP_LAYERS::OnSize( wxSizeEvent& event ) { - adjustGridColumns( event.GetSize().GetX() ); + adjustGridColumns(); event.Skip(); } diff --git a/pcbnew/dialogs/dialog_swap_layers.h b/pcbnew/dialogs/dialog_swap_layers.h index cc1a2edda6..f549b11ad6 100644 --- a/pcbnew/dialogs/dialog_swap_layers.h +++ b/pcbnew/dialogs/dialog_swap_layers.h @@ -42,7 +42,7 @@ private: void OnSize( wxSizeEvent& event ) override; - void adjustGridColumns( int aWidth ); + void adjustGridColumns(); PCB_BASE_EDIT_FRAME* m_parent; PCB_LAYER_ID* m_layerDestinations; diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model.cpp b/pcbnew/dialogs/panel_fp_properties_3d_model.cpp index 44c48bd82b..84d0012244 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model.cpp +++ b/pcbnew/dialogs/panel_fp_properties_3d_model.cpp @@ -39,6 +39,7 @@ #include #include "filename_resolver.h" #include +#include #include "dialogs/panel_preview_3d_model.h" #include "dialogs/3d_cache_dialogs.h" #include @@ -445,18 +446,26 @@ void PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath( wxCommandEvent& event ) } -void PANEL_FP_PROPERTIES_3D_MODEL::AdjustGridColumnWidths( int aWidth ) +void PANEL_FP_PROPERTIES_3D_MODEL::AdjustGridColumnWidths() { // Account for scroll bars - int modelsWidth = aWidth - ( m_modelsGrid->GetSize().x - m_modelsGrid->GetClientSize().x ); + int modelsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_modelsGrid ).x; int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN ) - - m_modelsGrid->GetColSize( COL_PROBLEM ) - 5; + - m_modelsGrid->GetColSize( COL_PROBLEM ); m_modelsGrid->SetColSize( COL_FILENAME, width ); } +void PANEL_FP_PROPERTIES_3D_MODEL::OnGridSize( wxSizeEvent& event ) +{ + AdjustGridColumnWidths(); + + event.Skip(); +} + + void PANEL_FP_PROPERTIES_3D_MODEL::OnUpdateUI( wxUpdateUIEvent& event ) { m_button3DShapeRemove->Enable( m_modelsGrid->GetNumberRows() > 0 ); diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model.h b/pcbnew/dialogs/panel_fp_properties_3d_model.h index 91adfd724a..b17e95fcc3 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model.h +++ b/pcbnew/dialogs/panel_fp_properties_3d_model.h @@ -62,7 +62,7 @@ public: void ReloadModelsFromFootprint(); - void AdjustGridColumnWidths( int aWidth ); + void AdjustGridColumnWidths(); std::vector& GetModelList() { @@ -78,6 +78,7 @@ private: void OnAdd3DRow( wxCommandEvent& event ) override; void Cfg3DPath( wxCommandEvent& event ) override; + void OnGridSize( wxSizeEvent& event ) override; void OnUpdateUI( wxUpdateUIEvent& event ) override; void updateValidateStatus( int aRow ); diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model_base.cpp b/pcbnew/dialogs/panel_fp_properties_3d_model_base.cpp index d918e939f2..097c29f2d9 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model_base.cpp +++ b/pcbnew/dialogs/panel_fp_properties_3d_model_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -33,10 +33,10 @@ PANEL_FP_PROPERTIES_3D_MODEL_BASE::PANEL_FP_PROPERTIES_3D_MODEL_BASE( wxWindow* m_modelsGrid->SetColSize( 2, 65 ); m_modelsGrid->EnableDragColMove( false ); m_modelsGrid->EnableDragColSize( false ); - m_modelsGrid->SetColLabelSize( 22 ); m_modelsGrid->SetColLabelValue( 0, wxEmptyString ); m_modelsGrid->SetColLabelValue( 1, _("3D Model(s)") ); m_modelsGrid->SetColLabelValue( 2, _("Show") ); + m_modelsGrid->SetColLabelSize( 22 ); m_modelsGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER ); // Rows @@ -91,6 +91,7 @@ PANEL_FP_PROPERTIES_3D_MODEL_BASE::PANEL_FP_PROPERTIES_3D_MODEL_BASE( wxWindow* this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnUpdateUI ) ); m_modelsGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::On3DModelCellChanged ), NULL, this ); m_modelsGrid->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::On3DModelSelected ), NULL, this ); + m_modelsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnGridSize ), NULL, this ); m_button3DShapeAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnAdd3DRow ), NULL, this ); m_button3DShapeBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnAdd3DModel ), NULL, this ); m_button3DShapeRemove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnRemove3DModel ), NULL, this ); @@ -103,6 +104,7 @@ PANEL_FP_PROPERTIES_3D_MODEL_BASE::~PANEL_FP_PROPERTIES_3D_MODEL_BASE() this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnUpdateUI ) ); m_modelsGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::On3DModelCellChanged ), NULL, this ); m_modelsGrid->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::On3DModelSelected ), NULL, this ); + m_modelsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnGridSize ), NULL, this ); m_button3DShapeAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnAdd3DRow ), NULL, this ); m_button3DShapeBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnAdd3DModel ), NULL, this ); m_button3DShapeRemove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_PROPERTIES_3D_MODEL_BASE::OnRemove3DModel ), NULL, this ); diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model_base.fbp b/pcbnew/dialogs/panel_fp_properties_3d_model_base.fbp index 7f05c5b7ee..c3c1896d8c 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model_base.fbp +++ b/pcbnew/dialogs/panel_fp_properties_3d_model_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ panel_fp_properties_3d_model_base 1000 none + 1 panel_fp_properties_3d_model @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -46,6 +48,7 @@ + 0 wxTAB_TRAVERSAL @@ -155,6 +158,7 @@ wxBORDER_SIMPLE On3DModelCellChanged On3DModelSelected + OnGridSize @@ -179,6 +183,7 @@ + 0 @@ -252,6 +257,7 @@ + 0 @@ -335,6 +341,7 @@ + 0 @@ -418,6 +425,7 @@ + 0 diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model_base.h b/pcbnew/dialogs/panel_fp_properties_3d_model_base.h index cd5b784f2b..98d365ca5c 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model_base.h +++ b/pcbnew/dialogs/panel_fp_properties_3d_model_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -46,10 +46,11 @@ class PANEL_FP_PROPERTIES_3D_MODEL_BASE : public wxPanel wxButton* m_buttonConfig3DPaths; wxBoxSizer* bLowerSizer3D; - // Virtual event handlers, overide them in your derived class + // Virtual event handlers, override them in your derived class virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void On3DModelCellChanged( wxGridEvent& event ) { event.Skip(); } virtual void On3DModelSelected( wxGridEvent& event ) { event.Skip(); } + virtual void OnGridSize( wxSizeEvent& event ) { event.Skip(); } virtual void OnAdd3DRow( wxCommandEvent& event ) { event.Skip(); } virtual void OnAdd3DModel( wxCommandEvent& event ) { event.Skip(); } virtual void OnRemove3DModel( wxCommandEvent& event ) { event.Skip(); } @@ -59,6 +60,7 @@ class PANEL_FP_PROPERTIES_3D_MODEL_BASE : public wxPanel public: PANEL_FP_PROPERTIES_3D_MODEL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + ~PANEL_FP_PROPERTIES_3D_MODEL_BASE(); };