mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
ADDED: row height and column width property inspector properties.
(This time for SCH tables.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/21224
This commit is contained in:
parent
0375985d58
commit
ee097a7073
@ -95,6 +95,36 @@ wxString SCH_TABLECELL::GetAddr() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_TABLECELL::GetColumnWidth() const
|
||||||
|
{
|
||||||
|
return static_cast<SCH_TABLE*>( GetParent() )->GetColWidth( GetColumn() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_TABLECELL::SetColumnWidth( int aWidth )
|
||||||
|
{
|
||||||
|
SCH_TABLE* table = static_cast<SCH_TABLE*>( GetParent() );
|
||||||
|
|
||||||
|
table->SetColWidth( GetColumn(), aWidth );
|
||||||
|
table->Normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SCH_TABLECELL::GetRowHeight() const
|
||||||
|
{
|
||||||
|
return static_cast<SCH_TABLE*>( GetParent() )->GetRowHeight( GetRow() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_TABLECELL::SetRowHeight( int aHeight )
|
||||||
|
{
|
||||||
|
SCH_TABLE* table = static_cast<SCH_TABLE*>( GetParent() );
|
||||||
|
|
||||||
|
table->SetRowHeight( GetRow(), aHeight );
|
||||||
|
table->Normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_TABLECELL::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
void SCH_TABLECELL::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||||
{
|
{
|
||||||
@ -198,5 +228,17 @@ static struct SCH_TABLECELL_DESC
|
|||||||
propMgr.Mask( TYPE_HASH( SCH_TABLECELL ), TYPE_HASH( EDA_TEXT ), _HKI( "Mirrored" ) );
|
propMgr.Mask( TYPE_HASH( SCH_TABLECELL ), TYPE_HASH( EDA_TEXT ), _HKI( "Mirrored" ) );
|
||||||
propMgr.Mask( TYPE_HASH( SCH_TABLECELL ), TYPE_HASH( EDA_TEXT ), _HKI( "Visible" ) );
|
propMgr.Mask( TYPE_HASH( SCH_TABLECELL ), TYPE_HASH( EDA_TEXT ), _HKI( "Visible" ) );
|
||||||
propMgr.Mask( TYPE_HASH( SCH_TABLECELL ), TYPE_HASH( EDA_TEXT ), _HKI( "Hyperlink" ) );
|
propMgr.Mask( TYPE_HASH( SCH_TABLECELL ), TYPE_HASH( EDA_TEXT ), _HKI( "Hyperlink" ) );
|
||||||
|
|
||||||
|
const wxString tableProps = _( "Table" );
|
||||||
|
|
||||||
|
propMgr.AddProperty( new PROPERTY<SCH_TABLECELL, int>( _HKI( "Column Width" ),
|
||||||
|
&SCH_TABLECELL::SetColumnWidth, &SCH_TABLECELL::GetColumnWidth,
|
||||||
|
PROPERTY_DISPLAY::PT_SIZE ),
|
||||||
|
tableProps );
|
||||||
|
|
||||||
|
propMgr.AddProperty( new PROPERTY<SCH_TABLECELL, int>( _HKI( "Row Height" ),
|
||||||
|
&SCH_TABLECELL::SetRowHeight, &SCH_TABLECELL::GetRowHeight,
|
||||||
|
PROPERTY_DISPLAY::PT_SIZE ),
|
||||||
|
tableProps );
|
||||||
}
|
}
|
||||||
} _SCH_TABLECELL_DESC;
|
} _SCH_TABLECELL_DESC;
|
||||||
|
@ -67,6 +67,12 @@ public:
|
|||||||
int GetRowSpan() const { return m_rowSpan; }
|
int GetRowSpan() const { return m_rowSpan; }
|
||||||
void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
|
void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
|
||||||
|
|
||||||
|
int GetRowHeight() const;
|
||||||
|
void SetRowHeight( int aHeight );
|
||||||
|
|
||||||
|
int GetColumnWidth() const;
|
||||||
|
void SetColumnWidth( int aWidth );
|
||||||
|
|
||||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||||
|
|
||||||
|
@ -202,7 +202,12 @@ void SCH_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
SCH_ITEM* item = static_cast<SCH_ITEM*>( edaItem );
|
SCH_ITEM* item = static_cast<SCH_ITEM*>( edaItem );
|
||||||
|
|
||||||
|
if( item->Type() == SCH_TABLECELL_T )
|
||||||
|
changes.Modify( item->GetParent(), screen, RECURSE_MODE::NO_RECURSE );
|
||||||
|
else
|
||||||
changes.Modify( item, screen, RECURSE_MODE::NO_RECURSE );
|
changes.Modify( item, screen, RECURSE_MODE::NO_RECURSE );
|
||||||
|
|
||||||
item->Set( property, newValue );
|
item->Set( property, newValue );
|
||||||
|
|
||||||
if( SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( item ) )
|
if( SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( item ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user