diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index 0e752a6678..f40948746a 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -315,6 +315,8 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen DIALOG_FIELD_PROPERTIES( aParent, aTitle, aField ), m_field( aField ) { + m_isSheetFilename = false; + if( aField->GetParent() && aField->GetParent()->Type() == SCH_SYMBOL_T ) { m_fieldId = aField->GetId(); @@ -323,9 +325,19 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen { switch( aField->GetId() ) { - case SHEETNAME: m_fieldId = SHEETNAME_V; break; - case SHEETFILENAME: m_fieldId = SHEETFILENAME_V; break; - default: m_fieldId = SHEETUSERFIELD_V; break; + case SHEETNAME: + m_fieldId = SHEETNAME_V; + break; + + case SHEETFILENAME: + m_isSheetFilename = true; + m_fieldId = SHEETFILENAME_V; + m_stSheetFnWarning->Show( true ); + break; + + default: + m_fieldId = SHEETUSERFIELD_V; + break; } } @@ -353,6 +365,12 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen &DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded, this ); init(); + + if( m_isSheetFilename ) + { + m_StyledTextCtrl->Enable( false ); + m_TextCtrl->Enable( false ); + } } diff --git a/eeschema/dialogs/dialog_field_properties.h b/eeschema/dialogs/dialog_field_properties.h index 5abc46961d..e2cedb9468 100644 --- a/eeschema/dialogs/dialog_field_properties.h +++ b/eeschema/dialogs/dialog_field_properties.h @@ -152,6 +152,7 @@ public: private: const SCH_FIELD* m_field; + bool m_isSheetFilename; }; #endif // DIALOG_EDIT_ONE_FIELD_H_ diff --git a/eeschema/dialogs/dialog_lib_text_properties.cpp b/eeschema/dialogs/dialog_lib_text_properties.cpp index b6bfa61696..21840d6e74 100644 --- a/eeschema/dialogs/dialog_lib_text_properties.cpp +++ b/eeschema/dialogs/dialog_lib_text_properties.cpp @@ -39,6 +39,7 @@ DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aPare { m_parent = aParent; m_graphicText = aText; + m_stSheetFnWarning->Show( false ); // Shown only for sheet filename // Disable options for fieldedit, not existing in graphic text m_visible->Show( false ); diff --git a/eeschema/dialogs/dialog_lib_text_properties_base.cpp b/eeschema/dialogs/dialog_lib_text_properties_base.cpp index 3756d20cbf..170a85ea73 100644 --- a/eeschema/dialogs/dialog_lib_text_properties_base.cpp +++ b/eeschema/dialogs/dialog_lib_text_properties_base.cpp @@ -16,6 +16,10 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); + m_stSheetFnWarning = new wxStaticText( this, wxID_ANY, _("Warning: Sheet filename can be modified only in sheet properties dialog."), wxDefaultPosition, wxDefaultSize, 0 ); + m_stSheetFnWarning->Wrap( -1 ); + bMainSizer->Add( m_stSheetFnWarning, 0, wxALL, 5 ); + wxBoxSizer* bPropertiesSizer; bPropertiesSizer = new wxBoxSizer( wxVERTICAL ); diff --git a/eeschema/dialogs/dialog_lib_text_properties_base.fbp b/eeschema/dialogs/dialog_lib_text_properties_base.fbp index 8f20ad55c4..2cf6e7f4a7 100644 --- a/eeschema/dialogs/dialog_lib_text_properties_base.fbp +++ b/eeschema/dialogs/dialog_lib_text_properties_base.fbp @@ -59,6 +59,67 @@ bMainSizer wxVERTICAL none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Warning: Sheet filename can be modified only in sheet properties dialog. + 0 + + 0 + + + 0 + + 1 + m_stSheetFnWarning + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT diff --git a/eeschema/dialogs/dialog_lib_text_properties_base.h b/eeschema/dialogs/dialog_lib_text_properties_base.h index 82e1c2c87f..5bc387cf51 100644 --- a/eeschema/dialogs/dialog_lib_text_properties_base.h +++ b/eeschema/dialogs/dialog_lib_text_properties_base.h @@ -40,6 +40,7 @@ class DIALOG_LIB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM private: protected: + wxStaticText* m_stSheetFnWarning; wxStaticText* m_textLabel; wxTextCtrl* m_TextCtrl; wxStyledTextCtrl* m_StyledTextCtrl;