Use GetUnobscuredSize in dialogs/panels
This commit is contained in:
parent
c4a4862e8f
commit
45c50535c5
|
@ -43,6 +43,7 @@
|
|||
#include <wx/dcclient.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <confirm.h>
|
||||
#include <symbol_edit_frame.h>
|
||||
#include <symbol_editor_settings.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/grid_icon_text_helpers.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
protected:
|
||||
|
||||
void updateSummary();
|
||||
void adjustGridColumns( int aWidth );
|
||||
void adjustGridColumns();
|
||||
|
||||
SYMBOL_EDIT_FRAME* m_editFrame;
|
||||
bool m_initialized = false;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <symbol_library_manager.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <sch_symbol.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <string_utils.h>
|
||||
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <lib_pin.h>
|
||||
#include <dialog_pin_properties.h>
|
||||
#include <confirm.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/tab_traversal.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <grid_tricks.h>
|
||||
|
@ -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();
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
void onUpdateUIInfo( wxUpdateUIEvent& event ) override;
|
||||
|
||||
protected:
|
||||
void adjustGridColumns( int aWidth );
|
||||
void adjustGridColumns();
|
||||
|
||||
private:
|
||||
SYMBOL_EDIT_FRAME* m_frame;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <validators.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <widgets/tab_traversal.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sch_sheet.h>
|
||||
#include <schematic.h>
|
||||
|
@ -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<SCH_FIELD>( 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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <pin_numbers.h>
|
||||
#include <string_utils.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/grid_icon_text_helpers.h>
|
||||
#include <widgets/grid_combobox.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
|
@ -291,7 +292,8 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
|||
|
||||
m_fields = new FIELDS_GRID_TABLE<SCH_FIELD>( 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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="15" />
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration">; </property>
|
||||
<property name="code_generation">C++</property>
|
||||
|
@ -14,6 +14,7 @@
|
|||
<property name="file">dialog_symbol_properties_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_edit_component_in_schematic_base</property>
|
||||
|
@ -25,6 +26,7 @@
|
|||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
|
@ -50,6 +52,7 @@
|
|||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Symbol Properties</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="two_step_creation">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
|
@ -276,7 +279,7 @@
|
|||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnGridEditorShown">OnGridEditorShown</event>
|
||||
<event name="OnSize">OnSizeGrid</event>
|
||||
<event name="OnSize">OnSizeFieldsGrid</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -301,6 +304,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -374,6 +378,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -447,6 +452,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -530,6 +536,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -1429,6 +1436,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -1502,6 +1510,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -1575,6 +1584,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -1658,6 +1668,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -1881,6 +1892,7 @@
|
|||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnGridCellChange">OnPinTableCellEdited</event>
|
||||
<event name="OnSize">OnSizePinsGrid</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -2058,6 +2070,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
|
|
@ -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();
|
||||
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <pcbnew_settings.h>
|
||||
#include <pgm_base.h>
|
||||
#include <validators.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <widgets/text_ctrl_eval.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <board_design_settings.h>
|
||||
#include <board_commit.h>
|
||||
#include <bitmaps.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <widgets/text_ctrl_eval.h>
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ private:
|
|||
|
||||
bool checkFootprintName( const wxString& aFootprintName );
|
||||
|
||||
void adjustGridColumns( int aWidth );
|
||||
void adjustGridColumns();
|
||||
|
||||
private:
|
||||
FOOTPRINT_EDIT_FRAME* m_frame;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <view/view.h>
|
||||
#include <view/view_controls.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <connectivity/connectivity_data.h>
|
||||
#include <connectivity/connectivity_algo.h>
|
||||
#include <dialogs/dialog_text_entry.h>
|
||||
|
@ -44,6 +45,7 @@
|
|||
#include <wx/tokenzr.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
#include <bitset>
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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<DATA_MODEL> m_data_model;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <pcb_base_edit_frame.h>
|
||||
#include <grid_layer_box_helpers.h>
|
||||
#include <view/view.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <board.h>
|
||||
#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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <dialog_footprint_properties_fp_editor.h>
|
||||
#include "filename_resolver.h"
|
||||
#include <pgm_base.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include "dialogs/panel_preview_3d_model.h"
|
||||
#include "dialogs/3d_cache_dialogs.h"
|
||||
#include <settings/settings_manager.h>
|
||||
|
@ -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 );
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
|
||||
void ReloadModelsFromFootprint();
|
||||
|
||||
void AdjustGridColumnWidths( int aWidth );
|
||||
void AdjustGridColumnWidths();
|
||||
|
||||
std::vector<FP_3DMODEL>& 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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="15" />
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
|
@ -14,6 +14,7 @@
|
|||
<property name="file">panel_fp_properties_3d_model_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">panel_fp_properties_3d_model</property>
|
||||
|
@ -25,6 +26,7 @@
|
|||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Panel" expanded="1">
|
||||
|
@ -46,6 +48,7 @@
|
|||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="two_step_creation">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
|
@ -155,6 +158,7 @@
|
|||
<property name="window_style">wxBORDER_SIMPLE</property>
|
||||
<event name="OnGridCellChange">On3DModelCellChanged</event>
|
||||
<event name="OnGridSelectCell">On3DModelSelected</event>
|
||||
<event name="OnSize">OnGridSize</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -179,6 +183,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -252,6 +257,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -335,6 +341,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -418,6 +425,7 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
|
|
@ -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();
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue