Fix a few bugs with Sheet field dragging and rotating.

Fixes https://gitlab.com/kicad/code/kicad/issues/4046
This commit is contained in:
Jeff Young 2020-03-12 13:56:44 +00:00
parent 78a7c7dfe0
commit dc9882c3b9
9 changed files with 223 additions and 606 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017) // C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -89,10 +89,10 @@ DIALOG_SCH_FIND_BASE::DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id, con
m_checkWildcardMatch = new wxCheckBox( this, wxID_ANY, _("Wildcards"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkWildcardMatch = new wxCheckBox( this, wxID_ANY, _("Wildcards"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_checkWildcardMatch, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); gbSizer2->Add( m_checkWildcardMatch, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_checkAllFields = new wxCheckBox( this, wxID_ANY, _("Search all com&ponent fields"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkAllFields = new wxCheckBox( this, wxID_ANY, _("Search user-defined fields"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_checkAllFields, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_checkAllFields, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkAllPins = new wxCheckBox( this, wxID_ANY, _("Search all pin &names and numbers"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkAllPins = new wxCheckBox( this, wxID_ANY, _("Search pin &names and numbers"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_checkAllPins, wxGBPosition( 2, 0 ), wxGBSpan( 1, 3 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_checkAllPins, wxGBPosition( 2, 0 ), wxGBSpan( 1, 3 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkCurrentSheetOnly = new wxCheckBox( this, wxID_ANY, _("Search the current &sheet only"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCurrentSheetOnly = new wxCheckBox( this, wxID_ANY, _("Search the current &sheet only"), wxDefaultPosition, wxDefaultSize, 0 );
@ -113,6 +113,7 @@ DIALOG_SCH_FIND_BASE::DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id, con
rightSizer = new wxBoxSizer( wxVERTICAL ); rightSizer = new wxBoxSizer( wxVERTICAL );
m_buttonFind = new wxButton( this, wxID_FIND, _("&Find"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonFind = new wxButton( this, wxID_FIND, _("&Find"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonFind->SetDefault(); m_buttonFind->SetDefault();
rightSizer->Add( m_buttonFind, 0, wxALL|wxEXPAND, 6 ); rightSizer->Add( m_buttonFind, 0, wxALL|wxEXPAND, 6 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="13" /> <FileVersion major="1" minor="15" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">dialog_schematic_find_base</property> <property name="file">dialog_schematic_find_base</property>
<property name="first_id">1000</property> <property name="first_id">1000</property>
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">dialog_sch_find</property> <property name="name">dialog_sch_find</property>
<property name="namespace"></property> <property name="namespace"></property>
@ -52,42 +53,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose">OnClose</event> <event name="OnClose">OnClose</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">mainSizer</property> <property name="name">mainSizer</property>
@ -160,6 +126,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">&amp;Search for:</property> <property name="label">&amp;Search for:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -185,29 +152,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property> <property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -273,31 +217,6 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCombobox"></event>
<event name="OnComboboxCloseup"></event>
<event name="OnComboboxDropdown"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText">OnSearchForText</event> <event name="OnText">OnSearchForText</event>
<event name="OnTextEnter">OnTextEnter</event> <event name="OnTextEnter">OnTextEnter</event>
<event name="OnUpdateUI">OnUpdateDrcUI</event> <event name="OnUpdateUI">OnUpdateDrcUI</event>
@ -336,6 +255,7 @@
<property name="hidden">1</property> <property name="hidden">1</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Replace &amp;with:</property> <property name="label">Replace &amp;with:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -361,29 +281,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property> <property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -449,32 +346,6 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCombobox"></event>
<event name="OnComboboxCloseup"></event>
<event name="OnComboboxDropdown"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter">OnTextEnter</event> <event name="OnTextEnter">OnTextEnter</event>
<event name="OnUpdateUI">OnUpdateDrcUI</event> <event name="OnUpdateUI">OnUpdateDrcUI</event>
</object> </object>
@ -512,6 +383,7 @@
<property name="hidden">1</property> <property name="hidden">1</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Direction:</property> <property name="label">Direction:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -537,29 +409,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property> <property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -633,30 +482,6 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioButton"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -721,30 +546,6 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioButton"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
@ -831,30 +632,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnOptions</event> <event name="OnCheckBox">OnOptions</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="gbsizeritem" expanded="1"> <object class="gbsizeritem" expanded="1">
@ -922,30 +700,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnOptions</event> <event name="OnCheckBox">OnOptions</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="gbsizeritem" expanded="1"> <object class="gbsizeritem" expanded="1">
@ -1013,30 +768,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnOptions</event> <event name="OnCheckBox">OnOptions</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="gbsizeritem" expanded="1"> <object class="gbsizeritem" expanded="1">
@ -1075,7 +807,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Search all com&amp;ponent fields</property> <property name="label">Search user-defined fields</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1104,30 +836,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnOptions</event> <event name="OnCheckBox">OnOptions</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="gbsizeritem" expanded="1"> <object class="gbsizeritem" expanded="1">
@ -1166,7 +875,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Search all pin &amp;names and numbers</property> <property name="label">Search pin &amp;names and numbers</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1195,30 +904,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnOptions</event> <event name="OnCheckBox">OnOptions</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="gbsizeritem" expanded="1"> <object class="gbsizeritem" expanded="1">
@ -1286,30 +972,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox">OnOptions</event> <event name="OnCheckBox">OnOptions</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="gbsizeritem" expanded="1"> <object class="gbsizeritem" expanded="1">
@ -1377,30 +1040,6 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
@ -1431,25 +1070,31 @@
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="current"></property>
<property name="default">1</property> <property name="default">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property> <property name="font"></property>
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_FIND</property> <property name="id">wxID_FIND</property>
<property name="label">&amp;Find</property> <property name="label">&amp;Find</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1464,6 +1109,8 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
@ -1479,29 +1126,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnFind</event> <event name="OnButtonClick">OnFind</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -1519,25 +1143,31 @@
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property> <property name="font"></property>
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">1</property> <property name="hidden">1</property>
<property name="id">wxID_REPLACE</property> <property name="id">wxID_REPLACE</property>
<property name="label">&amp;Replace</property> <property name="label">&amp;Replace</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1552,6 +1182,8 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
@ -1567,28 +1199,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnReplace</event> <event name="OnButtonClick">OnReplace</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI">OnUpdateReplaceUI</event> <event name="OnUpdateUI">OnUpdateReplaceUI</event>
</object> </object>
</object> </object>
@ -1607,25 +1217,31 @@
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property> <property name="font"></property>
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">1</property> <property name="hidden">1</property>
<property name="id">wxID_REPLACE_ALL</property> <property name="id">wxID_REPLACE_ALL</property>
<property name="label">Replace &amp;All</property> <property name="label">Replace &amp;All</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1640,6 +1256,8 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
@ -1655,28 +1273,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnReplace</event> <event name="OnButtonClick">OnReplace</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI">OnUpdateReplaceAllUI</event> <event name="OnUpdateUI">OnUpdateReplaceAllUI</event>
</object> </object>
</object> </object>
@ -1695,25 +1291,31 @@
<property name="aui_row"></property> <property name="aui_row"></property>
<property name="best_size"></property> <property name="best_size"></property>
<property name="bg"></property> <property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property> <property name="font"></property>
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_CANCEL</property> <property name="id">wxID_CANCEL</property>
<property name="label">Close</property> <property name="label">Close</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1728,6 +1330,8 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
@ -1743,29 +1347,6 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnCancel</event> <event name="OnButtonClick">OnCancel</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>

View File

@ -1,12 +1,11 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017) // C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_SCHEMATIC_FIND_BASE_H__ #pragma once
#define __DIALOG_SCHEMATIC_FIND_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
@ -23,6 +22,9 @@
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/gbsizer.h> #include <wx/gbsizer.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
@ -76,4 +78,3 @@ class DIALOG_SCH_FIND_BASE : public DIALOG_SHIM
}; };
#endif //__DIALOG_SCHEMATIC_FIND_BASE_H__

View File

@ -370,6 +370,8 @@ void SCH_BASE_FRAME::RefreshItem( EDA_ITEM* aItem, bool isAddOrDelete )
// Component children are drawn from their parents. Mark them for re-paint. // Component children are drawn from their parents. Mark them for re-paint.
if( parent && parent->Type() == SCH_COMPONENT_T ) if( parent && parent->Type() == SCH_COMPONENT_T )
GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT ); GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );
else if( parent && parent->Type() == SCH_SHEET_T )
GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );
} }
GetCanvas()->Refresh(); GetCanvas()->Refresh();

View File

@ -807,7 +807,7 @@ public:
* it can happens when the edited sheet used an existying file, or becomes a new instance * it can happens when the edited sheet used an existying file, or becomes a new instance
* of a already existing sheet. * of a already existing sheet.
*/ */
bool EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy, bool* aClearAnnotationNewItems ); bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy, bool* aClearAnnotationNewItems );
void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename ); void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );

View File

@ -80,18 +80,22 @@ const wxString SCH_FIELD::GetFullyQualifiedText() const
// Note that the IDs of FIELDS and SHEETS overlap, so one must check *both* the // Note that the IDs of FIELDS and SHEETS overlap, so one must check *both* the
// id and the parent's type. // id and the parent's type.
if( m_id == REFERENCE && m_Parent && m_Parent->Type() == SCH_COMPONENT_T ) if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{
SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( m_Parent );
if( m_id == REFERENCE )
{ {
// For more than one part per package, we must add the part selection // For more than one part per package, we must add the part selection
// A, B, ... or 1, 2, .. to the reference. // A, B, ... or 1, 2, .. to the reference.
SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( m_Parent );
if( component->GetUnitCount() > 1 ) if( component->GetUnitCount() > 1 )
text << LIB_PART::SubReference( component->GetUnit() ); text << LIB_PART::SubReference( component->GetUnit() );
} }
}
if( m_id == SHEETFILENAME && m_Parent && m_Parent->Type() == SCH_SHEET_T ) if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
{ {
if( m_id == SHEETFILENAME )
text = _( "File: " ) + text; text = _( "File: " ) + text;
} }
@ -122,7 +126,6 @@ void SCH_FIELD::Print( wxDC* aDC, const wxPoint& aOffset )
int orient; int orient;
COLOR4D color; COLOR4D color;
wxPoint textpos; wxPoint textpos;
SCH_COMPONENT* parentComponent = dynamic_cast<SCH_COMPONENT*>( m_Parent );
int lineWidth = GetThickness(); int lineWidth = GetThickness();
if( lineWidth == 0 ) // Use default values for pen size if( lineWidth == 0 ) // Use default values for pen size
@ -142,6 +145,10 @@ void SCH_FIELD::Print( wxDC* aDC, const wxPoint& aOffset )
// Calculate the text orientation according to the component orientation. // Calculate the text orientation according to the component orientation.
orient = GetTextAngle(); orient = GetTextAngle();
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
if( parentComponent && parentComponent->GetTransform().y1 ) // Rotate component 90 degrees. if( parentComponent && parentComponent->GetTransform().y1 ) // Rotate component 90 degrees.
{ {
if( orient == TEXT_ANGLE_HORIZ ) if( orient == TEXT_ANGLE_HORIZ )
@ -149,6 +156,7 @@ void SCH_FIELD::Print( wxDC* aDC, const wxPoint& aOffset )
else else
orient = TEXT_ANGLE_HORIZ; orient = TEXT_ANGLE_HORIZ;
} }
}
/* Calculate the text justification, according to the component /* Calculate the text justification, according to the component
* orientation/mirror this is a bit complicated due to cumulative * orientation/mirror this is a bit complicated due to cumulative
@ -221,12 +229,13 @@ const EDA_RECT SCH_FIELD::GetBoundingBox() const
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T ) if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{ {
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
// Due to the Y axis direction, we must mirror the bounding box, // Due to the Y axis direction, we must mirror the bounding box,
// relative to the text position: // relative to the text position:
MIRROR( begin.y, pos.y ); MIRROR( begin.y, pos.y );
MIRROR( end.y, pos.y ); MIRROR( end.y, pos.y );
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
transform = parentComponent->GetTransform(); transform = parentComponent->GetTransform();
} }
else else
@ -271,31 +280,37 @@ bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void* aAuxData )
{ {
wxString text = GetFullyQualifiedText(); wxString text = GetFullyQualifiedText();
int flags = aSearchData.GetFlags(); int flags = aSearchData.GetFlags();
bool isReference = m_Parent && m_Parent->Type() == SCH_COMPONENT_T && m_id == REFERENCE; bool searchUserDefinedFields = flags & FR_SEARCH_ALL_FIELDS;
bool isValue = m_Parent && m_Parent->Type() == SCH_COMPONENT_T && m_id == VALUE; bool searchAndReplace = flags & FR_SEARCH_REPLACE;
bool replaceReferences = flags & FR_REPLACE_REFERENCES;
// User defined fields have an ID of -1.
if( !isReference && !isValue && !( flags & FR_SEARCH_ALL_FIELDS ) )
return false;
if( ( flags & FR_SEARCH_REPLACE ) && isReference && !( flags & FR_REPLACE_REFERENCES ) )
return false;
wxLogTrace( traceFindItem, wxT( " child item " ) wxLogTrace( traceFindItem, wxT( " child item " )
+ GetSelectMenuText( EDA_UNITS::MILLIMETRES ) ); + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
if( !searchUserDefinedFields && m_id >= MANDATORY_FIELDS )
return false;
if( searchAndReplace && m_id == REFERENCE && !replaceReferences )
return false;
// Take sheet path into account which effects the reference field and the unit for // Take sheet path into account which effects the reference field and the unit for
// components with multiple parts. // components with multiple parts.
if( isReference && aAuxData != NULL ) if( m_id == REFERENCE && aAuxData != NULL )
{ {
SCH_COMPONENT* component = (SCH_COMPONENT*) m_Parent; text = parentComponent->GetRef( (SCH_SHEET_PATH*) aAuxData );
wxCHECK_MSG( component != NULL, false, wxT( "No symbol associated with field" ) + text ); if( parentComponent->GetUnitCount() > 1 )
text << LIB_PART::SubReference( parentComponent->GetUnit() );
text = component->GetRef( (SCH_SHEET_PATH*) aAuxData ); }
}
if( component->GetUnitCount() > 1 ) else if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
text << LIB_PART::SubReference( component->GetUnit() ); {
if( !searchUserDefinedFields && m_id >= SHEET_MANDATORY_FIELDS )
return false;
} }
return SCH_ITEM::Matches( text, aSearchData ); return SCH_ITEM::Matches( text, aSearchData );
@ -306,9 +321,11 @@ bool SCH_FIELD::IsReplaceable() const
{ {
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T ) if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{ {
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
if( m_id == VALUE ) if( m_id == VALUE )
{ {
LIB_PART* part = static_cast<SCH_COMPONENT*>( GetParent() )->GetPartRef().get(); LIB_PART* part = parentComponent->GetPartRef().get();
if( part && part->IsPower() ) if( part && part->IsPower() )
return false; return false;
@ -316,6 +333,7 @@ bool SCH_FIELD::IsReplaceable() const
} }
else if( m_Parent && m_Parent->Type() == SCH_SHEET_T ) else if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
{ {
// See comments in SCH_FIELD::Replace(), below.
if( m_id == SHEETFILENAME ) if( m_id == SHEETFILENAME )
return false; return false;
} }
@ -327,9 +345,12 @@ bool SCH_FIELD::IsReplaceable() const
bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData ) bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
{ {
bool isReplaced = false; bool isReplaced = false;
wxString text = GetFullyQualifiedText();
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T && m_id == REFERENCE ) if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T && m_id == REFERENCE )
{
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
if( m_id == REFERENCE )
{ {
wxCHECK_MSG( aAuxData != NULL, false, wxCHECK_MSG( aAuxData != NULL, false,
wxT( "Cannot replace reference designator without valid sheet path." ) ); wxT( "Cannot replace reference designator without valid sheet path." ) );
@ -337,26 +358,29 @@ bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
wxCHECK_MSG( aSearchData.GetFlags() & FR_REPLACE_REFERENCES, false, wxCHECK_MSG( aSearchData.GetFlags() & FR_REPLACE_REFERENCES, false,
wxT( "Invalid replace symbol reference field call." ) ) ; wxT( "Invalid replace symbol reference field call." ) ) ;
SCH_COMPONENT* component = (SCH_COMPONENT*) m_Parent; wxString text = parentComponent->GetRef( (SCH_SHEET_PATH*) aAuxData );
text = component->GetRef( (SCH_SHEET_PATH*) aAuxData );
// if( component->GetUnitCount() > 1 )
// text << LIB_PART::SubReference( component->GetUnit() );
isReplaced = EDA_ITEM::Replace( aSearchData, text ); isReplaced = EDA_ITEM::Replace( aSearchData, text );
if( isReplaced ) if( isReplaced )
component->SetRef( (SCH_SHEET_PATH*) aAuxData, text ); parentComponent->SetRef( (SCH_SHEET_PATH*) aAuxData, text );
}
else if( m_Parent && m_Parent->Type() == SCH_SHEET_T && m_id == SHEETFILENAME )
{
// This is likely too dangerous to allow....
} }
else else
{ {
isReplaced = EDA_TEXT::Replace( aSearchData ); isReplaced = EDA_TEXT::Replace( aSearchData );
} }
}
else if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
{
isReplaced = EDA_TEXT::Replace( aSearchData );
if( m_id == SHEETFILENAME && isReplaced )
{
// If we allowed this we'd have a bunch of work to do here, including warning
// about it not being undoable, checking for recursive hierarchies, reloading
// sheets, etc. See DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow().
}
}
return isReplaced; return isReplaced;
} }
@ -442,11 +466,6 @@ bool SCH_FIELD::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy )
void SCH_FIELD::Plot( PLOTTER* aPlotter ) void SCH_FIELD::Plot( PLOTTER* aPlotter )
{ {
SCH_COMPONENT* parent = ( SCH_COMPONENT* ) GetParent();
wxCHECK_RET( parent != NULL && parent->Type() == SCH_COMPONENT_T,
wxT( "Cannot plot field with invalid parent." ) );
COLOR4D color = aPlotter->ColorSettings()->GetColor( GetLayer() ); COLOR4D color = aPlotter->ColorSettings()->GetColor( GetLayer() );
if( !IsVisible() ) if( !IsVisible() )
@ -459,13 +478,18 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter )
* orientation/mirror */ * orientation/mirror */
int orient = GetTextAngle(); int orient = GetTextAngle();
if( parent->GetTransform().y1 ) // Rotate component 90 deg. if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
if( parentComponent->GetTransform().y1 ) // Rotate component 90 deg.
{ {
if( orient == TEXT_ANGLE_HORIZ ) if( orient == TEXT_ANGLE_HORIZ )
orient = TEXT_ANGLE_VERT; orient = TEXT_ANGLE_VERT;
else else
orient = TEXT_ANGLE_HORIZ; orient = TEXT_ANGLE_HORIZ;
} }
}
/* Calculate the text justification, according to the component /* Calculate the text justification, according to the component
* orientation/mirror * orientation/mirror
@ -493,29 +517,36 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter )
void SCH_FIELD::SetPosition( const wxPoint& aPosition ) void SCH_FIELD::SetPosition( const wxPoint& aPosition )
{ {
wxPoint pos = GetParentPosition();
// Actual positions are calculated by the rotation/mirror transform of the // Actual positions are calculated by the rotation/mirror transform of the
// parent component of the field. The inverse transform is used to calculate // parent component of the field. The inverse transform is used to calculate
// the position relative to the parent component. // the position relative to the parent component.
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T ) if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
{ {
SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent(); SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
wxPoint pt = aPosition - pos; wxPoint relativePos = aPosition - parentComponent->GetPosition();
pos += component->GetTransform().InverseTransform().TransformCoordinate( pt ); parentComponent->GetTransform().InverseTransform().TransformCoordinate( relativePos );
SetTextPos( relativePos + parentComponent->GetPosition() );
} }
SetTextPos( pos ); SetTextPos( aPosition );
} }
wxPoint SCH_FIELD::GetPosition() const wxPoint SCH_FIELD::GetPosition() const
{ {
SCH_COMPONENT* component = (SCH_COMPONENT*) GetParent(); if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
wxPoint pos = GetTextPos() - component->GetPosition(); {
SCH_COMPONENT* parentComponent = static_cast<SCH_COMPONENT*>( m_Parent );
wxPoint relativePos = GetTextPos() - parentComponent->GetPosition();
return component->GetTransform().TransformCoordinate( pos ) + component->GetPosition(); parentComponent->GetTransform().TransformCoordinate( relativePos );
return relativePos + parentComponent->GetPosition();
}
return GetTextPos();
} }

View File

@ -476,7 +476,7 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHier
} }
bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy, bool SCH_EDIT_FRAME::EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
bool* aClearAnnotationNewItems ) bool* aClearAnnotationNewItems )
{ {
if( aSheet == NULL || aHierarchy == NULL ) if( aSheet == NULL || aHierarchy == NULL )

View File

@ -848,7 +848,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
getViewControls()->SetAutoPan( false ); getViewControls()->SetAutoPan( false );
getViewControls()->CaptureCursor( false ); getViewControls()->CaptureCursor( false );
if( m_frame->EditSheet( (SCH_SHEET*)sheet, g_CurrentSheet, nullptr ) ) if( m_frame->EditSheetProperties((SCH_SHEET*) sheet, g_CurrentSheet, nullptr ) )
{ {
sheet->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false ); sheet->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );

View File

@ -1224,12 +1224,13 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
case SCH_SHEET_T: case SCH_SHEET_T:
{ {
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
bool doClearAnnotation; bool doClearAnnotation;
bool doRefresh = false; bool doRefresh = false;
// Keep track of existing sheet paths. EditSheet() can modify this list // Keep track of existing sheet paths. EditSheet() can modify this list
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet ); SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
doRefresh = m_frame->EditSheet( (SCH_SHEET*) item, g_CurrentSheet, &doClearAnnotation ); doRefresh = m_frame->EditSheetProperties( sheet, g_CurrentSheet, &doClearAnnotation );
if( doClearAnnotation ) // happens when the current sheet load a existing file if( doClearAnnotation ) // happens when the current sheet load a existing file
{ // we must clear "new" components annotation { // we must clear "new" components annotation
@ -1239,7 +1240,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
// Clear annotation of g_CurrentSheet itself, because its sheetpath // Clear annotation of g_CurrentSheet itself, because its sheetpath
// is not a new path, but components managed by its sheet path must have // is not a new path, but components managed by its sheet path must have
// their annotation cleared, because they are new: // their annotation cleared, because they are new:
((SCH_SHEET*) item)->GetScreen()->ClearAnnotation( g_CurrentSheet ); sheet->GetScreen()->ClearAnnotation( g_CurrentSheet );
} }
if( doRefresh ) if( doRefresh )