Separate strings into full strings

This commit is contained in:
Seth Hillbrand 2020-10-16 19:57:07 -07:00
parent 2fcd0721a9
commit 971eb529f4
4 changed files with 52 additions and 61 deletions

View File

@ -50,22 +50,15 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO
m_mode( aMode )
{
wxASSERT( aParent );
wxString label;
wxString verb = ( m_mode == MODE::UPDATE ) ? _( "Update" ) : _( "Change" );
wxString reset = ( m_mode == MODE::UPDATE ) ? _( "Reset" ) : _( "Update" );
wxString library = ( m_mode == MODE::UPDATE ) ? _( "library" ) : _( "new" );
label.Printf( m_matchAll->GetLabel(), verb );
if( m_mode == MODE::UPDATE )
{
m_matchAll->SetLabel( label );
SetTitle( _( "Update Symbol(s) from Library" ) );
m_newIdSizer->Show( false );
}
else
{
SetTitle( _( "Change Symbol(s)" ) );
m_matchAll->SetLabel( _( "Change all symbols in schematic" ) );
SetTitle( _( "Change Symbols" ) );
m_matchSizer->FindItem( m_matchAll )->Show( false );
}
@ -73,8 +66,9 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO
{
SCH_SHEET_PATH* currentSheet = &aParent->Schematic().CurrentSheet();
label.Printf( m_matchBySelection->GetLabel(), verb );
m_matchBySelection->SetLabel( label );
if( m_mode == MODE::CHANGE )
m_matchBySelection->SetLabel( _( "Change selected Symbol" ) );
m_newId->AppendText( FROM_UTF8( m_symbol->GetLibId().Format().c_str() ) );
m_specifiedReference->ChangeValue( m_symbol->GetRef( currentSheet ) );
m_specifiedValue->ChangeValue( m_symbol->GetValue( currentSheet ) );
@ -88,12 +82,12 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO
m_matchIdBrowserButton->SetBitmap( KiBitmap( small_library_xpm ) );
m_newIdBrowserButton->SetBitmap( KiBitmap( small_library_xpm ) );
label.Printf( m_matchByReference->GetLabel(), verb );
m_matchByReference->SetLabel( label );
label.Printf( m_matchByValue->GetLabel(), verb );
m_matchByValue->SetLabel( label );
label.Printf( m_matchById->GetLabel(), verb );
m_matchById->SetLabel( label );
if( m_mode == MODE::CHANGE )
{
m_matchByReference->SetLabel( _( "Change symbols matching reference designator:" ) );
m_matchByValue->SetLabel( _( "Change symbols matching value:" ) );
m_matchById->SetLabel( _( "Change symbols matching library identifier:" ) );
}
m_matchSizer->SetEmptyCellSize( wxSize( 0, 0 ) );
m_matchSizer->Layout();
@ -122,23 +116,15 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO
m_matchByReference->SetValue( true );
}
label.Printf( m_updateFieldsSizer->GetStaticBox()->GetLabel(), reset );
m_updateFieldsSizer->GetStaticBox()->SetLabel( label );
label.Printf( m_removeExtraBox->GetLabel(), library );
m_removeExtraBox->SetLabel( label );
label.Printf( m_resetEmptyFields->GetLabel(), library );
m_resetEmptyFields->SetLabel( label );
label.Printf( m_resetFieldVisibilities->GetLabel(), reset );
m_resetFieldVisibilities->SetLabel( label );
label.Printf( m_resetFieldEffects->GetLabel(), reset );
m_resetFieldEffects->SetLabel( label );
label.Printf( m_resetFieldPositions->GetLabel(), reset );
m_resetFieldPositions->SetLabel( label );
if( m_mode == MODE::CHANGE )
{
m_updateFieldsSizer->GetStaticBox()->SetLabel( _( "Update Fields") );
m_removeExtraBox->SetLabel( _( "Remove fields if not in new symbol" ) );
m_resetEmptyFields->SetLabel( _( "Reset fields if empty in new symbol" ) );
m_resetFieldVisibilities->SetLabel( _( "Update field visibilities" ) );
m_resetFieldEffects->SetLabel( _( "Update field sizes and styles" ) );
m_resetFieldPositions->SetLabel( _( "Update field positions" ) );
}
m_removeExtraBox->SetValue( g_removeExtraFields );
m_resetEmptyFields->SetValue( g_resetEmptyFields );
@ -153,7 +139,12 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO
// Ensure m_closeButton (with id = wxID_CANCEL) has the right label
// (to fix automatic renaming of button label )
m_sdbSizerCancel->SetLabel( _( "Close" ) );
m_sdbSizerOK->SetLabel( verb );
if( m_mode == MODE::CHANGE )
m_sdbSizerOK->SetLabel( _( "Change" ) );
else
m_sdbSizerOK->SetLabel( _( "Update" ) );
m_sdbSizerOK->SetDefault();
// Now all widgets have the size fixed, call FinishDialogSettings

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.9.0 Jul 27 2020)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -24,25 +24,25 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind
m_matchSizer->SetFlexibleDirection( wxBOTH );
m_matchSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_matchAll = new wxRadioButton( this, wxID_ANY, _("%s all symbols in schematic"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchAll = new wxRadioButton( this, wxID_ANY, _("Update all symbols in schematic"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
m_matchBySelection = new wxRadioButton( this, wxID_ANY, _("%s selected symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchBySelection = new wxRadioButton( this, wxID_ANY, _("Update selected symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSizer->Add( m_matchBySelection, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
m_matchByReference = new wxRadioButton( this, wxID_ANY, _("%s symbols matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchByReference = new wxRadioButton( this, wxID_ANY, _("Update symbols matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSizer->Add( m_matchByReference, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
m_specifiedReference = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), wxTE_PROCESS_ENTER );
m_matchSizer->Add( m_specifiedReference, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 2 );
m_matchByValue = new wxRadioButton( this, wxID_ANY, _("%s symbols matching value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchByValue = new wxRadioButton( this, wxID_ANY, _("Update symbols matching value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSizer->Add( m_matchByValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_specifiedValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_matchSizer->Add( m_specifiedValue, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_matchById = new wxRadioButton( this, wxID_ANY, _("%s symbols matching library indentifier:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchById = new wxRadioButton( this, wxID_ANY, _("Update symbols matching library identifier:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSizer->Add( m_matchById, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxTOP, 6 );
m_specifiedId = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
@ -91,7 +91,7 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind
wxBoxSizer* bSizerUpdate;
bSizerUpdate = new wxBoxSizer( wxHORIZONTAL );
m_updateFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("%s Fields") ), wxVERTICAL );
m_updateFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Reset Fields") ), wxVERTICAL );
wxArrayString m_fieldsBoxChoices;
m_fieldsBox = new wxCheckListBox( m_updateFieldsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fieldsBoxChoices, wxLB_NEEDED_SB );
@ -116,24 +116,24 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind
m_updateOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
m_removeExtraBox = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Remove fields if not in %s symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeExtraBox = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Remove fields if not in library symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeExtraBox->SetToolTip( _("Removes fields that do not occur in the original library symbols") );
m_updateOptionsSizer->Add( m_removeExtraBox, 0, wxBOTTOM|wxRIGHT, 4 );
m_resetEmptyFields = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset fields if empty in %s symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetEmptyFields = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset fields if empty in library symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetEmptyFields, 0, wxBOTTOM|wxRIGHT, 4 );
m_updateOptionsSizer->Add( 0, 15, 0, wxEXPAND, 5 );
m_resetFieldVisibilities = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s field visibilities"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetFieldVisibilities = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset field visibilities"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetFieldVisibilities, 0, wxBOTTOM|wxRIGHT, 4 );
m_resetFieldEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s field sizes and styles"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetFieldEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset field sizes and styles"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetFieldEffects, 0, wxBOTTOM|wxRIGHT, 4 );
m_resetFieldPositions = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s field positions"), wxDefaultPosition, wxDefaultSize, 0 );
m_resetFieldPositions = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset field positions"), wxDefaultPosition, wxDefaultSize, 0 );
m_updateOptionsSizer->Add( m_resetFieldPositions, 0, wxBOTTOM|wxRIGHT, 4 );

View File

@ -48,7 +48,7 @@
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h; forward_declare</property>
<property name="title">%s</property>
<property name="title">Update Symbols from Library</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
@ -117,7 +117,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s all symbols in schematic</property>
<property name="label">Update all symbols in schematic</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -185,7 +185,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s selected symbol</property>
<property name="label">Update selected symbol</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -253,7 +253,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s symbols matching reference designator:</property>
<property name="label">Update symbols matching reference designator:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -389,7 +389,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s symbols matching value:</property>
<property name="label">Update symbols matching value:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -526,7 +526,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s symbols matching library indentifier:</property>
<property name="label">Update symbols matching library identifier:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1009,7 +1009,7 @@
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">%s Fields</property>
<property name="label">Reset Fields</property>
<property name="minimum_size"></property>
<property name="name">m_updateFieldsSizer</property>
<property name="orient">wxVERTICAL</property>
@ -1282,7 +1282,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Remove fields if not in %s symbol</property>
<property name="label">Remove fields if not in library symbol</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1346,7 +1346,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Reset fields if empty in %s symbol</property>
<property name="label">Reset fields if empty in library symbol</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1420,7 +1420,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s field visibilities</property>
<property name="label">Reset field visibilities</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1484,7 +1484,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s field sizes and styles</property>
<property name="label">Reset field sizes and styles</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1548,7 +1548,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%s field positions</property>
<property name="label">Reset field positions</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version 3.9.0 Jul 27 2020)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -93,7 +93,7 @@ class DIALOG_CHANGE_SYMBOLS_BASE : public DIALOG_SHIM
public:
DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("%s"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Update Symbols from Library"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_CHANGE_SYMBOLS_BASE();
};