mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 00:21:25 +00:00
Restore visibility editing for fields.
(It got accidentally thrown out with visibility for text items.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/20560
This commit is contained in:
parent
7a9db0f8c1
commit
ac616b8c19
@ -1371,6 +1371,21 @@ static struct EDA_TEXT_DESC
|
||||
propMgr.AddProperty( new PROPERTY<EDA_TEXT, bool>( _HKI( "Mirrored" ),
|
||||
&EDA_TEXT::SetMirrored, &EDA_TEXT::IsMirrored ),
|
||||
textProps );
|
||||
|
||||
auto isField =
|
||||
[]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
if( EDA_ITEM* item = dynamic_cast<EDA_ITEM*>( aItem ) )
|
||||
return item->Type() == SCH_FIELD_T || item->Type() == PCB_FIELD_T;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<EDA_TEXT, bool>( _HKI( "Visible" ),
|
||||
&EDA_TEXT::SetVisible, &EDA_TEXT::IsVisible ),
|
||||
textProps )
|
||||
.SetAvailableFunc( isField );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<EDA_TEXT, int>( _HKI( "Width" ),
|
||||
&EDA_TEXT::SetTextWidth, &EDA_TEXT::GetTextWidth,
|
||||
PROPERTY_DISPLAY::PT_SIZE ),
|
||||
|
@ -122,6 +122,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PC
|
||||
{
|
||||
title = _( "Footprint Text Properties" );
|
||||
m_TextLabel->SetLabel( _( "Text:" ) );
|
||||
m_Visible->Show( false );
|
||||
}
|
||||
|
||||
SetInitialFocus( m_SingleLineText );
|
||||
@ -136,6 +137,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PC
|
||||
m_SizeXCtrl,
|
||||
m_SizeYCtrl,
|
||||
m_ThicknessCtrl,
|
||||
m_Visible,
|
||||
m_cbKnockout,
|
||||
m_KeepUpright,
|
||||
m_PositionXCtrl,
|
||||
@ -152,6 +154,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PC
|
||||
SetInitialFocus( m_MultiLineText );
|
||||
m_SingleLineSizer->Show( false );
|
||||
|
||||
m_Visible->Show( false );
|
||||
m_KeepUpright->Show( false );
|
||||
m_statusLine->Show( false );
|
||||
|
||||
@ -327,7 +330,10 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
|
||||
m_posX.SetValue( m_item->GetFPRelativePosition().x );
|
||||
m_posY.SetValue( m_item->GetFPRelativePosition().y );
|
||||
|
||||
if( parentFP )
|
||||
if( m_Visible->IsShown() )
|
||||
m_Visible->SetValue( m_item->IsVisible() );
|
||||
|
||||
if( m_KeepUpright->IsShown() )
|
||||
m_KeepUpright->SetValue( m_item->IsKeepUpright() );
|
||||
|
||||
m_bold->Check( m_item->IsBold() );
|
||||
@ -519,6 +525,9 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
|
||||
|
||||
m_item->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
|
||||
|
||||
if( m_Visible->IsShown() )
|
||||
m_item->SetVisible( m_Visible->GetValue() );
|
||||
|
||||
if( m_KeepUpright->IsShown() )
|
||||
m_item->SetKeepUpright( m_KeepUpright->GetValue() );
|
||||
|
||||
|
@ -94,15 +94,24 @@ DIALOG_TEXT_PROPERTIES_BASE::DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWi
|
||||
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_cbKnockout = new wxCheckBox( this, wxID_ANY, _("Knockout"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer7->Add( m_cbKnockout, 1, wxTOP|wxBOTTOM|wxRIGHT, 15 );
|
||||
bSizer7->Add( m_cbKnockout, 0, wxALIGN_CENTER_VERTICAL, 10 );
|
||||
|
||||
|
||||
bSizer7->Add( 20, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_KeepUpright = new wxCheckBox( this, wxID_ANY, _("Keep upright"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_KeepUpright->SetToolTip( _("Keep text upright") );
|
||||
|
||||
bSizer7->Add( m_KeepUpright, 1, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizer7->Add( m_KeepUpright, 0, wxALIGN_CENTER_VERTICAL, 10 );
|
||||
|
||||
|
||||
gbSizer1->Add( bSizer7, wxGBPosition( 1, 4 ), wxGBSpan( 1, 3 ), wxEXPAND, 5 );
|
||||
bSizer7->Add( 20, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_Visible = new wxCheckBox( this, wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer7->Add( m_Visible, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 10 );
|
||||
|
||||
|
||||
gbSizer1->Add( bSizer7, wxGBPosition( 1, 4 ), wxGBSpan( 1, 3 ), wxEXPAND|wxTOP|wxBOTTOM, 10 );
|
||||
|
||||
m_fontLabel = new wxStaticText( this, wxID_ANY, _("Font:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fontLabel->Wrap( -1 );
|
||||
@ -254,7 +263,7 @@ DIALOG_TEXT_PROPERTIES_BASE::DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWi
|
||||
|
||||
m_statusLine = new wxStaticText( this, wxID_ANY, _("Parent footprint description"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_statusLine->Wrap( -1 );
|
||||
bMargins->Add( m_statusLine, 0, wxBOTTOM|wxRIGHT|wxLEFT, 3 );
|
||||
bMargins->Add( m_statusLine, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 3 );
|
||||
|
||||
|
||||
bMainSizer->Add( bMargins, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
|
||||
|
@ -565,10 +565,10 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="border">10</property>
|
||||
<property name="colspan">3</property>
|
||||
<property name="column">4</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
@ -577,9 +577,9 @@
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">15</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
@ -641,10 +641,20 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">20</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
@ -706,6 +716,81 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">20</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Show</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_Visible</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="true">
|
||||
@ -2904,7 +2989,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -56,6 +56,7 @@ class DIALOG_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
PCB_LAYER_BOX_SELECTOR* m_LayerSelectionCtrl;
|
||||
wxCheckBox* m_cbKnockout;
|
||||
wxCheckBox* m_KeepUpright;
|
||||
wxCheckBox* m_Visible;
|
||||
wxStaticText* m_fontLabel;
|
||||
FONT_CHOICE* m_fontCtrl;
|
||||
BITMAP_BUTTON* m_bold;
|
||||
|
Loading…
Reference in New Issue
Block a user