Browse Source

Slight improvement to schematic editor title bar.

Also improves some other clients of PathHumanReadable(), such as the
set page number dialog.
7.0
Jeff Young 3 years ago
parent
commit
f75d18c7c8
  1. 6
      eeschema/hierarch.cpp
  2. 6
      eeschema/sch_edit_frame.cpp
  3. 2
      eeschema/sch_sheet.cpp
  4. 6
      eeschema/sch_sheet_path.cpp
  5. 3
      eeschema/sch_sheet_path.h

6
eeschema/hierarch.cpp

@ -277,12 +277,12 @@ void HIERARCHY_NAVIG_PANEL::onRightClick( wxTreeEvent& aEvent )
if( GetPopupMenuSelectionFromUser( ctxMenu ) == 1 ) if( GetPopupMenuSelectionFromUser( ctxMenu ) == 1 )
{ {
wxString msg; wxString msg;
wxString sheetPath = itemData->m_SheetPath.PathHumanReadable( false );
wxString sheetPath = itemData->m_SheetPath.PathHumanReadable( false, true );
wxString pageNumber = itemData->m_SheetPath.GetPageNumber(); wxString pageNumber = itemData->m_SheetPath.GetPageNumber();
msg.Printf( _( "Enter page number for sheet path %s" ), msg.Printf( _( "Enter page number for sheet path %s" ),
( sheetPath.Length() > 20 ) ? wxS( " \n" ) + sheetPath + wxT( ": " )
: sheetPath + wxT( ": " ) );
( sheetPath.Length() > 20 ) ? wxS( " \n" ) + sheetPath + wxT( ": " )
: sheetPath + wxT( ": " ) );
wxTextEntryDialog dlg( m_frame, msg, _( "Edit Sheet Page Number" ), pageNumber ); wxTextEntryDialog dlg( m_frame, msg, _( "Edit Sheet Page Number" ), pageNumber );

6
eeschema/sch_edit_frame.cpp

@ -1402,7 +1402,11 @@ void SCH_EDIT_FRAME::UpdateTitle()
title = wxT( "*" ); title = wxT( "*" );
title += fn.GetName(); title += fn.GetName();
title += wxString::Format( wxT( " [%s]" ), GetCurrentSheet().PathHumanReadable( false ) );
wxString sheetPath = GetCurrentSheet().PathHumanReadable( false, true );
if( sheetPath != title )
title += wxString::Format( wxT( " [%s]" ), sheetPath );
if( readOnly ) if( readOnly )
title += wxS( " " ) + _( "[Read Only]" ); title += wxS( " " ) + _( "[Read Only]" );

2
eeschema/sch_sheet.cpp

@ -787,7 +787,7 @@ void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
SCH_SHEET_PATH path = schframe->GetCurrentSheet(); SCH_SHEET_PATH path = schframe->GetCurrentSheet();
path.push_back( this ); path.push_back( this );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false ) );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false, true ) );
} }
aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText() ); aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText() );

6
eeschema/sch_sheet_path.cpp

@ -288,7 +288,8 @@ KIID_PATH SCH_SHEET_PATH::Path() const
} }
wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName ) const
wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName,
bool aStripTrailingSeparator ) const
{ {
wxString s; wxString s;
@ -312,6 +313,9 @@ wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName ) const
for( unsigned i = 1; i < size(); i++ ) for( unsigned i = 1; i < size(); i++ )
s << at( i )->GetFields()[SHEETNAME].GetShownText() << wxS( "/" ); s << at( i )->GetFields()[SHEETNAME].GetShownText() << wxS( "/" );
if( aStripTrailingSeparator && s.EndsWith( "/" ) )
s = s.Left( s.length() - 1 );
return s; return s;
} }

3
eeschema/sch_sheet_path.h

@ -287,7 +287,8 @@ public:
* The "normal" path instead uses the #KIID objects in the path that do not change * The "normal" path instead uses the #KIID objects in the path that do not change
* even when editing sheet parameters. * even when editing sheet parameters.
*/ */
wxString PathHumanReadable( bool aUseShortRootName = true ) const;
wxString PathHumanReadable( bool aUseShortRootName = true,
bool aStripTrailingSeparator = false ) const;
/** /**
* Update all the symbol references for this sheet path. * Update all the symbol references for this sheet path.

Loading…
Cancel
Save