mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Yet even more open-coded dialog state-saving cleanup.
This commit is contained in:
parent
1b0ed24558
commit
833a5ee3ab
@ -60,11 +60,10 @@
|
||||
DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent )
|
||||
: DIALOG_MIGRATE_BUSES_BASE( aParent ), m_frame( aParent ), m_selected_index( 0 )
|
||||
{
|
||||
m_migration_list->Bind( wxEVT_LIST_ITEM_SELECTED,
|
||||
&DIALOG_MIGRATE_BUSES::onItemSelected, this );
|
||||
OptOut( this ); // No control state save/restore
|
||||
|
||||
m_btn_accept->Bind( wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
&DIALOG_MIGRATE_BUSES::onAcceptClicked, this );
|
||||
m_migration_list->Bind( wxEVT_LIST_ITEM_SELECTED, &DIALOG_MIGRATE_BUSES::onItemSelected, this );
|
||||
m_btn_accept->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_MIGRATE_BUSES::onAcceptClicked, this );
|
||||
|
||||
loadGraphData();
|
||||
updateUi();
|
||||
@ -75,11 +74,8 @@ DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent )
|
||||
|
||||
DIALOG_MIGRATE_BUSES::~DIALOG_MIGRATE_BUSES()
|
||||
{
|
||||
m_migration_list->Unbind( wxEVT_LIST_ITEM_SELECTED, &DIALOG_MIGRATE_BUSES::onItemSelected,
|
||||
this );
|
||||
|
||||
m_btn_accept->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_MIGRATE_BUSES::onAcceptClicked,
|
||||
this );
|
||||
m_migration_list->Unbind( wxEVT_LIST_ITEM_SELECTED, &DIALOG_MIGRATE_BUSES::onItemSelected, this );
|
||||
m_btn_accept->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_MIGRATE_BUSES::onAcceptClicked, this );
|
||||
}
|
||||
|
||||
|
||||
@ -119,6 +115,7 @@ void DIALOG_MIGRATE_BUSES::updateUi()
|
||||
for( auto& item : m_items )
|
||||
{
|
||||
wxString old = item.labels[0];
|
||||
|
||||
for( unsigned j = 1; j < item.labels.size(); j++ )
|
||||
old << ", " << item.labels[j];
|
||||
|
||||
@ -135,8 +132,7 @@ void DIALOG_MIGRATE_BUSES::updateUi()
|
||||
}
|
||||
|
||||
|
||||
std::vector<wxString> DIALOG_MIGRATE_BUSES::getProposedLabels(
|
||||
const std::vector<wxString>& aLabelList )
|
||||
std::vector<wxString> DIALOG_MIGRATE_BUSES::getProposedLabels( const std::vector<wxString>& aLabelList )
|
||||
{
|
||||
int lowest_start = INT_MAX;
|
||||
int highest_end = -1;
|
||||
|
@ -19,13 +19,10 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _DIALOG_MIGRATE_BUSES_H
|
||||
#define _DIALOG_MIGRATE_BUSES_H
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <sch_edit_frame.h>
|
||||
|
||||
#include <dialog_migrate_buses_base.h>
|
||||
|
||||
class CONNECTION_SUBGRAPH;
|
||||
@ -34,25 +31,19 @@ class CONNECTION_SUBGRAPH;
|
||||
struct BUS_MIGRATION_STATUS
|
||||
{
|
||||
const CONNECTION_SUBGRAPH* subgraph;
|
||||
|
||||
std::vector<wxString> labels;
|
||||
|
||||
std::vector<wxString> possible_labels;
|
||||
|
||||
wxString approved_label;
|
||||
|
||||
bool approved;
|
||||
};
|
||||
|
||||
class DIALOG_MIGRATE_BUSES : public DIALOG_MIGRATE_BUSES_BASE
|
||||
{
|
||||
public:
|
||||
|
||||
DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent );
|
||||
~DIALOG_MIGRATE_BUSES();
|
||||
|
||||
private:
|
||||
|
||||
void loadGraphData();
|
||||
|
||||
void updateUi();
|
||||
@ -63,12 +54,9 @@ private:
|
||||
|
||||
void onAcceptClicked( wxCommandEvent& aEvent );
|
||||
|
||||
|
||||
private:
|
||||
SCH_EDIT_FRAME* m_frame;
|
||||
|
||||
unsigned m_selected_index;
|
||||
|
||||
std::vector<BUS_MIGRATION_STATUS> m_items;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -86,7 +86,7 @@ DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* aEditFrame, wxWind
|
||||
}
|
||||
|
||||
// DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
|
||||
// non-job versions (which have different sizes).
|
||||
// non-job versions.
|
||||
m_hash_key = TO_UTF8( GetTitle() );
|
||||
|
||||
for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
|
||||
|
@ -53,16 +53,9 @@ public:
|
||||
*/
|
||||
DIALOG_RESCUE_EACH( wxWindow* aParent, RESCUER& aRescuer, SCH_SHEET_PATH* aCurrentSheet,
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType, bool aAskShowAgain );
|
||||
|
||||
~DIALOG_RESCUE_EACH();
|
||||
~DIALOG_RESCUE_EACH() = default;
|
||||
|
||||
private:
|
||||
SYMBOL_PREVIEW_WIDGET* m_previewNewWidget;
|
||||
SYMBOL_PREVIEW_WIDGET* m_previewOldWidget;
|
||||
RESCUER* m_Rescuer;
|
||||
SCH_SHEET_PATH* m_currentSheet;
|
||||
bool m_AskShowAgain;
|
||||
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
void PopulateConflictList();
|
||||
@ -74,32 +67,33 @@ private:
|
||||
// Display the 2 items (old in cache and new in library) corresponding to the
|
||||
// selected conflict in m_ListOfConflicts
|
||||
void displayItemsInConflict();
|
||||
|
||||
private:
|
||||
SYMBOL_PREVIEW_WIDGET* m_previewNewWidget;
|
||||
SYMBOL_PREVIEW_WIDGET* m_previewOldWidget;
|
||||
RESCUER* m_rescuer;
|
||||
SCH_SHEET_PATH* m_currentSheet;
|
||||
bool m_askShowAgain;
|
||||
};
|
||||
|
||||
|
||||
DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent,
|
||||
RESCUER& aRescuer,
|
||||
SCH_SHEET_PATH* aCurrentSheet,
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType,
|
||||
bool aAskShowAgain )
|
||||
: DIALOG_RESCUE_EACH_BASE( aParent ),
|
||||
m_Rescuer( &aRescuer ),
|
||||
DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent, RESCUER& aRescuer, SCH_SHEET_PATH* aCurrentSheet,
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType, bool aAskShowAgain ) :
|
||||
DIALOG_RESCUE_EACH_BASE( aParent ),
|
||||
m_rescuer( &aRescuer ),
|
||||
m_currentSheet( aCurrentSheet ),
|
||||
m_AskShowAgain( aAskShowAgain )
|
||||
m_askShowAgain( aAskShowAgain )
|
||||
{
|
||||
wxASSERT( aCurrentSheet );
|
||||
|
||||
m_previewOldWidget = new SYMBOL_PREVIEW_WIDGET( m_previewOldPanel, &Kiway(), false,
|
||||
aGalBackEndType );
|
||||
m_previewOldWidget = new SYMBOL_PREVIEW_WIDGET( m_previewOldPanel, &Kiway(), false, aGalBackEndType );
|
||||
m_SizerOldPanel->Add( m_previewOldWidget, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_previewNewWidget = new SYMBOL_PREVIEW_WIDGET( m_previewNewPanel, &Kiway(), false,
|
||||
aGalBackEndType );
|
||||
m_previewNewWidget = new SYMBOL_PREVIEW_WIDGET( m_previewNewPanel, &Kiway(), false, aGalBackEndType );
|
||||
m_SizerNewPanel->Add( m_previewNewWidget, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
// Set the info message, customized to include the proper suffix.
|
||||
wxString info =
|
||||
_( "This schematic was made using older symbol libraries which may break the "
|
||||
wxString info = _( "This schematic was made using older symbol libraries which may break the "
|
||||
"schematic. Some symbols may need to be linked to a different symbol name. "
|
||||
"Some symbols may need to be \"rescued\" (copied and renamed) into a new library.\n\n"
|
||||
"The following changes are recommended to update the project." );
|
||||
@ -117,8 +111,7 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent,
|
||||
|
||||
int width = dc.GetTextExtent( header ).GetWidth() * 1.25;
|
||||
|
||||
m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width,
|
||||
wxALIGN_CENTER );
|
||||
m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width, wxALIGN_CENTER );
|
||||
|
||||
header = _( "Symbol Name" );
|
||||
width = dc.GetTextExtent( header ).GetWidth() * 2;
|
||||
@ -158,11 +151,6 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent,
|
||||
}
|
||||
|
||||
|
||||
DIALOG_RESCUE_EACH::~DIALOG_RESCUE_EACH()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_RESCUE_EACH::TransferDataToWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
@ -171,7 +159,7 @@ bool DIALOG_RESCUE_EACH::TransferDataToWindow()
|
||||
PopulateConflictList();
|
||||
PopulateInstanceList();
|
||||
|
||||
if( !m_AskShowAgain )
|
||||
if( !m_askShowAgain )
|
||||
m_btnNeverShowAgain->Hide();
|
||||
|
||||
return true;
|
||||
@ -182,7 +170,7 @@ void DIALOG_RESCUE_EACH::PopulateConflictList()
|
||||
{
|
||||
wxVector<wxVariant> data;
|
||||
|
||||
for( RESCUE_CANDIDATE& each_candidate : m_Rescuer->m_all_candidates )
|
||||
for( RESCUE_CANDIDATE& each_candidate : m_rescuer->m_all_candidates )
|
||||
{
|
||||
data.clear();
|
||||
data.push_back( wxVariant( true ) );
|
||||
@ -192,7 +180,7 @@ void DIALOG_RESCUE_EACH::PopulateConflictList()
|
||||
m_ListOfConflicts->AppendItem( data );
|
||||
}
|
||||
|
||||
if( !m_Rescuer->m_all_candidates.empty() )
|
||||
if( !m_rescuer->m_all_candidates.empty() )
|
||||
{
|
||||
// Select the first choice
|
||||
m_ListOfConflicts->SelectRow( 0 );
|
||||
@ -212,12 +200,12 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList()
|
||||
if( row == wxNOT_FOUND )
|
||||
row = 0;
|
||||
|
||||
RESCUE_CANDIDATE& selected_part = m_Rescuer->m_all_candidates[row];
|
||||
RESCUE_CANDIDATE& selected_part = m_rescuer->m_all_candidates[row];
|
||||
|
||||
wxVector<wxVariant> data;
|
||||
int count = 0;
|
||||
|
||||
for( SCH_SYMBOL* eachSymbol : *m_Rescuer->GetSymbols() )
|
||||
for( SCH_SYMBOL* eachSymbol : *m_rescuer->GetSymbols() )
|
||||
{
|
||||
if( eachSymbol->GetLibId().Format() != UTF8( selected_part.GetRequestedName() ) )
|
||||
continue;
|
||||
@ -247,13 +235,11 @@ void DIALOG_RESCUE_EACH::displayItemsInConflict()
|
||||
}
|
||||
else
|
||||
{
|
||||
RESCUE_CANDIDATE& selected_part = m_Rescuer->m_all_candidates[row];
|
||||
RESCUE_CANDIDATE& selected_part = m_rescuer->m_all_candidates[row];
|
||||
|
||||
m_previewOldWidget->DisplayPart( selected_part.GetCacheCandidate(),
|
||||
selected_part.GetUnit(),
|
||||
m_previewOldWidget->DisplayPart( selected_part.GetCacheCandidate(), selected_part.GetUnit(),
|
||||
selected_part.GetConvert() );
|
||||
m_previewNewWidget->DisplayPart( selected_part.GetLibCandidate(),
|
||||
selected_part.GetUnit(),
|
||||
m_previewNewWidget->DisplayPart( selected_part.GetLibCandidate(), selected_part.GetUnit(),
|
||||
selected_part.GetConvert() );
|
||||
}
|
||||
}
|
||||
@ -277,14 +263,14 @@ bool DIALOG_RESCUE_EACH::TransferDataFromWindow()
|
||||
if( !wxDialog::TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
for( size_t index = 0; index < m_Rescuer->GetCandidateCount(); ++index )
|
||||
for( size_t index = 0; index < m_rescuer->GetCandidateCount(); ++index )
|
||||
{
|
||||
wxVariant val;
|
||||
m_ListOfConflicts->GetValue( val, index, 0 );
|
||||
bool rescue_part = val.GetBool();
|
||||
|
||||
if( rescue_part )
|
||||
m_Rescuer->m_chosen_candidates.push_back( &m_Rescuer->m_all_candidates[index] );
|
||||
m_rescuer->m_chosen_candidates.push_back( &m_rescuer->m_all_candidates[index] );
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -308,7 +294,7 @@ void DIALOG_RESCUE_EACH::OnNeverShowClick( wxCommandEvent& aEvent )
|
||||
if( cfg )
|
||||
cfg->m_RescueNeverShow = true;
|
||||
|
||||
m_Rescuer->m_chosen_candidates.clear();
|
||||
m_rescuer->m_chosen_candidates.clear();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
@ -316,7 +302,7 @@ void DIALOG_RESCUE_EACH::OnNeverShowClick( wxCommandEvent& aEvent )
|
||||
|
||||
void DIALOG_RESCUE_EACH::OnCancelClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_Rescuer->m_chosen_candidates.clear();
|
||||
m_rescuer->m_chosen_candidates.clear();
|
||||
DIALOG_RESCUE_EACH_BASE::OnCancelClick( aEvent );
|
||||
}
|
||||
|
||||
|
@ -25,31 +25,22 @@
|
||||
#include <sch_edit_frame.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <confirm.h>
|
||||
#include <schematic.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <wx/filedlg.h>
|
||||
|
||||
#include <dialog_sch_import_settings.h>
|
||||
|
||||
|
||||
wxString DIALOG_SCH_IMPORT_SETTINGS::m_filePath; // remember for session
|
||||
|
||||
|
||||
DIALOG_SCH_IMPORT_SETTINGS::DIALOG_SCH_IMPORT_SETTINGS( wxWindow* aParent,
|
||||
SCH_EDIT_FRAME* aFrame ) :
|
||||
DIALOG_SCH_IMPORT_SETTINGS::DIALOG_SCH_IMPORT_SETTINGS( wxWindow* aParent, SCH_EDIT_FRAME* aFrame ) :
|
||||
DIALOG_SCH_IMPORT_SETTINGS_BASE( aParent ),
|
||||
m_frame( aFrame )
|
||||
{
|
||||
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
|
||||
|
||||
SetupStandardButtons( { { wxID_OK, _( "Import Settings" ) } } );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_SCH_IMPORT_SETTINGS::TransferDataToWindow()
|
||||
{
|
||||
m_filePathCtrl->SetValue( m_filePath );
|
||||
return true;
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
@ -59,8 +50,7 @@ void DIALOG_SCH_IMPORT_SETTINGS::OnBrowseClicked( wxCommandEvent& event )
|
||||
fn.SetExt( FILEEXT::ProjectFileExtension );
|
||||
|
||||
wxFileDialog dlg( this, _( "Import Settings From" ), fn.GetPath(), fn.GetFullName(),
|
||||
FILEEXT::ProjectFileWildcard(),
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR );
|
||||
FILEEXT::ProjectFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR );
|
||||
|
||||
if( dlg.ShowModal() == wxID_OK )
|
||||
m_filePathCtrl->SetValue( dlg.GetPath() );
|
||||
@ -76,7 +66,6 @@ bool DIALOG_SCH_IMPORT_SETTINGS::TransferDataFromWindow()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_filePath = m_filePathCtrl->GetValue();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -21,13 +21,10 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef KICAD_DIALOG_SCH_IMPORT_SETTINGS_H
|
||||
#define KICAD_DIALOG_SCH_IMPORT_SETTINGS_H
|
||||
#pragma once
|
||||
|
||||
#include "dialog_sch_import_settings_base.h"
|
||||
|
||||
|
||||
class SCH_EDIT_FRAME;
|
||||
|
||||
|
||||
@ -39,14 +36,11 @@ public:
|
||||
void OnBrowseClicked( wxCommandEvent& event ) override;
|
||||
void OnSelectAll( wxCommandEvent& event ) override;
|
||||
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
wxString GetFilePath() { return m_filePath; }
|
||||
wxString GetFilePath() { return m_filePathCtrl->GetValue(); }
|
||||
|
||||
protected:
|
||||
SCH_EDIT_FRAME* m_frame;
|
||||
static wxString m_filePath;
|
||||
};
|
||||
|
||||
#endif //KICAD_DIALOG_SCH_IMPORT_SETTINGS_H
|
||||
|
@ -95,8 +95,7 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
||||
{
|
||||
ERC_SETTINGS& ercSettings = m_frame->Schematic().ErcSettings();
|
||||
return new PANEL_SETUP_SEVERITIES( aParent, ERC_ITEM::GetItemsWithSeverities(),
|
||||
ercSettings.m_ERCSeverities,
|
||||
m_pinToPinError.get() );
|
||||
ercSettings.m_ERCSeverities, m_pinToPinError.get() );
|
||||
}, _( "Violation Severity" ) );
|
||||
|
||||
m_pinMapPage = m_treebook->GetPageCount();
|
||||
@ -115,8 +114,7 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
||||
SCHEMATIC& schematic = m_frame->Schematic();
|
||||
return new PANEL_SETUP_NETCLASSES( aParent, m_frame,
|
||||
m_frame->Prj().GetProjectFile().NetSettings(),
|
||||
schematic.GetNetClassAssignmentCandidates(),
|
||||
true );
|
||||
schematic.GetNetClassAssignmentCandidates(), true );
|
||||
}, _( "Net Classes" ) );
|
||||
|
||||
m_busesPage = m_treebook->GetPageCount();
|
||||
@ -152,8 +150,8 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
||||
|
||||
if( Prj().IsReadOnly() )
|
||||
{
|
||||
m_infoBar->ShowMessage( _( "Project is missing or read-only. Settings will not be "
|
||||
"editable." ), wxICON_WARNING );
|
||||
m_infoBar->ShowMessage( _( "Project is missing or read-only. Settings will not be editable." ),
|
||||
wxICON_WARNING );
|
||||
}
|
||||
|
||||
wxBookCtrlEvent evt( wxEVT_TREEBOOK_PAGE_CHANGED, wxID_ANY, 0 );
|
||||
@ -162,11 +160,6 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
||||
}
|
||||
|
||||
|
||||
DIALOG_SCHEMATIC_SETUP::~DIALOG_SCHEMATIC_SETUP()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SCHEMATIC_SETUP::onPageChanged( wxBookCtrlEvent& aEvent )
|
||||
{
|
||||
PAGED_DIALOG::onPageChanged( aEvent );
|
||||
|
@ -17,9 +17,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef KICAD_DIALOG_SCHEMATIC_SETUP_H
|
||||
#define KICAD_DIALOG_SCHEMATIC_SETUP_H
|
||||
#pragma once
|
||||
|
||||
#include <widgets/paged_dialog.h>
|
||||
|
||||
@ -38,13 +36,14 @@ class DIALOG_SCHEMATIC_SETUP : public PAGED_DIALOG
|
||||
{
|
||||
public:
|
||||
DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame );
|
||||
~DIALOG_SCHEMATIC_SETUP();
|
||||
~DIALOG_SCHEMATIC_SETUP() = default;
|
||||
|
||||
protected:
|
||||
// event handlers
|
||||
void onPageChanged( wxBookCtrlEvent& aEvent ) override;
|
||||
void onAuxiliaryAction( wxCommandEvent& aEvent ) override;
|
||||
|
||||
protected:
|
||||
SCH_EDIT_FRAME* m_frame;
|
||||
|
||||
std::shared_ptr<ERC_ITEM> m_pinToPinError;
|
||||
@ -60,6 +59,3 @@ protected:
|
||||
size_t m_netclassesPage;
|
||||
size_t m_embeddedFilesPage;
|
||||
};
|
||||
|
||||
|
||||
#endif //KICAD_DIALOG_SCHEMATIC_SETUP_H
|
||||
|
@ -44,7 +44,7 @@ DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( SCH_BASE_FRAME* aParent, SCH_S
|
||||
|
||||
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
|
||||
// different shapes (and even whether or not we're within the symbol editor) cause different
|
||||
// dialog layouts).
|
||||
// dialog layouts.
|
||||
m_hash_key = TO_UTF8( GetTitle() + aParent->GetName() );
|
||||
|
||||
m_helpLabel1->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
||||
|
@ -37,8 +37,7 @@
|
||||
#include <gr_text.h>
|
||||
|
||||
|
||||
DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES( SCH_EDIT_FRAME* parent,
|
||||
SCH_SHEET_PIN* aPin ) :
|
||||
DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_SHEET_PIN* aPin ) :
|
||||
DIALOG_SHEET_PIN_PROPERTIES_BASE( parent ),
|
||||
m_frame( parent ),
|
||||
m_sheetPin( aPin ),
|
||||
@ -70,18 +69,7 @@ DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES( SCH_EDIT_FRAME* parent
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
|
||||
/* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier versions for
|
||||
* the flex grid sizer in wxGTK that prevents the last column from being sized
|
||||
* correctly. It doesn't cause any problems on win32 so it doesn't need to wrapped
|
||||
* in ugly #ifdef __WXGTK__ #endif.
|
||||
*/
|
||||
Layout();
|
||||
Fit();
|
||||
SetMinSize( GetSize() );
|
||||
|
||||
// On some windows manager (Unity, XFCE), this dialog is
|
||||
// not always raised, depending on this dialog is run.
|
||||
// Force it to be raised
|
||||
// On some windows manager (Unity, XFCE), this dialog is not always raised, depending on how it is run.
|
||||
Raise();
|
||||
}
|
||||
|
||||
@ -143,8 +131,7 @@ bool DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow()
|
||||
|
||||
if( m_fontCtrl->HaveFontSelection() )
|
||||
{
|
||||
m_sheetPin->SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(),
|
||||
m_italic->IsChecked() ) );
|
||||
m_sheetPin->SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(), m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
// Currently, eeschema uses only the text width as text size,
|
||||
|
@ -22,9 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_SHEET_PIN_PROPERTIES_H
|
||||
#define DIALOG_SHEET_PIN_PROPERTIES_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <dialog_sheet_pin_properties_base.h>
|
||||
#include <widgets/unit_binder.h>
|
||||
@ -55,5 +53,3 @@ private:
|
||||
|
||||
HTML_MESSAGE_BOX* m_helpWindow;
|
||||
};
|
||||
|
||||
#endif // DIALOG_SHEET_PIN_PROPERTIES_H
|
||||
|
@ -107,17 +107,15 @@ DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_S
|
||||
// wxFormBuilder doesn't include this event...
|
||||
m_grid->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_SHEET_PROPERTIES::OnGridCellChanging ),
|
||||
nullptr, this );
|
||||
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
DIALOG_SHEET_PROPERTIES::~DIALOG_SHEET_PROPERTIES()
|
||||
{
|
||||
if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() ) )
|
||||
{
|
||||
cfg->m_Appearance.edit_sheet_visible_columns = m_grid->GetShownColumnsAsString();
|
||||
cfg->m_Appearance.edit_sheet_width = GetSize().x;
|
||||
cfg->m_Appearance.edit_sheet_height = GetSize().y;
|
||||
}
|
||||
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
m_grid->DestroyTable( m_fields );
|
||||
@ -314,14 +312,12 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
|
||||
|
||||
if( fn.IsAbsolute() && fn.MakeRelativeTo( screenFileName.GetPath() ) )
|
||||
{
|
||||
wxMessageDialog makeRelDlg( this, _( "Use relative path for sheet file?" ),
|
||||
_( "Sheet File Path" ),
|
||||
wxMessageDialog makeRelDlg( this, _( "Use relative path for sheet file?" ), _( "Sheet File Path" ),
|
||||
wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION | wxCENTER );
|
||||
|
||||
makeRelDlg.SetExtendedMessage( _( "Using relative hierarchical sheet file name paths "
|
||||
"improves schematic portability across systems and "
|
||||
"platforms. Using absolute paths can result in "
|
||||
"portability issues." ) );
|
||||
makeRelDlg.SetExtendedMessage( _( "Using relative hierarchical sheet file name paths improves "
|
||||
"schematic portability across systems and platforms. Using "
|
||||
"absolute paths can result in portability issues." ) );
|
||||
makeRelDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Use Relative Path" ) ),
|
||||
wxMessageDialog::ButtonLabel( _( "Use Absolute Path" ) ) );
|
||||
|
||||
@ -516,7 +512,8 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
|
||||
if( !wxCopyFile( *m_sourceSheetFilename, newAbsoluteFilename, false ) )
|
||||
{
|
||||
msg.Printf( _( "Failed to copy schematic file '%s' to destination '%s'." ),
|
||||
currentScreenFileName.GetFullPath(), newAbsoluteFilename );
|
||||
currentScreenFileName.GetFullPath(),
|
||||
newAbsoluteFilename );
|
||||
|
||||
DisplayError( m_frame, msg );
|
||||
|
||||
@ -575,8 +572,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
|
||||
{
|
||||
if( m_sheet->GetScreenCount() > 1 )
|
||||
{
|
||||
if( !IsOK( this, wxString::Format( _( "Create new file '%s' with contents "
|
||||
"of '%s'?" ),
|
||||
if( !IsOK( this, wxString::Format( _( "Create new file '%s' with contents of '%s'?" ),
|
||||
sheetFileName.GetFullName(),
|
||||
m_sheet->GetFileName() )
|
||||
+ wxT( "\n\n" )
|
||||
@ -869,7 +865,6 @@ void DIALOG_SHEET_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
|
||||
if( m_size != new_size )
|
||||
{
|
||||
m_size = new_size;
|
||||
|
||||
AdjustGridColumns();
|
||||
}
|
||||
|
||||
@ -877,17 +872,3 @@ void DIALOG_SHEET_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SHEET_PROPERTIES::OnInitDlg( wxInitDialogEvent& event )
|
||||
{
|
||||
TransferDataToWindow();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
|
||||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
|
||||
if( cfg && cfg->m_Appearance.edit_sheet_width > 0 && cfg->m_Appearance.edit_sheet_height > 0 )
|
||||
SetSize( cfg->m_Appearance.edit_sheet_width, cfg->m_Appearance.edit_sheet_height );
|
||||
|
||||
}
|
||||
|
@ -22,8 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_SHEET_PROPERTIES_H
|
||||
#define DIALOG_SHEET_PROPERTIES_H
|
||||
#pragma once
|
||||
|
||||
#include <fields_grid_table.h>
|
||||
#include <widgets/unit_binder.h>
|
||||
@ -59,7 +58,6 @@ private:
|
||||
void OnSizeGrid( wxSizeEvent& event ) override;
|
||||
void OnGridCellChanging( wxGridEvent& event );
|
||||
void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
||||
void OnInitDlg( wxInitDialogEvent& event ) override;
|
||||
|
||||
void AdjustGridColumns();
|
||||
|
||||
@ -82,5 +80,3 @@ private:
|
||||
SCH_SHEET m_dummySheet;
|
||||
SCH_FIELD m_dummySheetNameField;
|
||||
};
|
||||
|
||||
#endif // DIALOG_SHEET_PROPERTIES_H
|
||||
|
@ -30,6 +30,8 @@ DIALOG_SIM_FORMAT_VALUE::DIALOG_SIM_FORMAT_VALUE( wxWindow* aParent, SPICE_VALUE
|
||||
DIALOG_SIM_FORMAT_VALUE_BASE( aParent ),
|
||||
m_format( aFormat )
|
||||
{
|
||||
OptOut( this );
|
||||
|
||||
if( aFormat->Range.EndsWith( wxS( "V" ) ) )
|
||||
{
|
||||
m_units = aFormat->Range.Right( 1 );
|
||||
|
@ -21,8 +21,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_SIM_FORMAT_VALUE_H
|
||||
#define DIALOG_SIM_FORMAT_VALUE_H
|
||||
#pragma once
|
||||
|
||||
#include <dialog_sim_format_value_base.h>
|
||||
|
||||
@ -40,5 +39,3 @@ private:
|
||||
SPICE_VALUE_FORMAT* m_format;
|
||||
wxString m_units;
|
||||
};
|
||||
|
||||
#endif /* DIALOG_SIM_FORMAT_VALUE_H */
|
||||
|
@ -80,12 +80,6 @@ DIALOG_SYMBOL_CHOOSER::DIALOG_SYMBOL_CHOOSER( SCH_BASE_FRAME* aParent, const LIB
|
||||
m_useUnits = new wxCheckBox( this, wxID_ANY, _( "Place all units" ) );
|
||||
m_useUnits->SetToolTip( _( "Sequentially place all units of the symbol." ) );
|
||||
|
||||
if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() ) )
|
||||
{
|
||||
m_keepSymbol->SetValue( cfg->m_SymChooserPanel.keep_symbol );
|
||||
m_useUnits->SetValue( cfg->m_SymChooserPanel.place_all_units );
|
||||
}
|
||||
|
||||
buttonsSizer->Add( m_keepSymbol, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
|
||||
buttonsSizer->Add( m_useUnits, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 30 );
|
||||
|
||||
@ -114,12 +108,6 @@ DIALOG_SYMBOL_CHOOSER::DIALOG_SYMBOL_CHOOSER( SCH_BASE_FRAME* aParent, const LIB
|
||||
|
||||
DIALOG_SYMBOL_CHOOSER::~DIALOG_SYMBOL_CHOOSER()
|
||||
{
|
||||
if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() ) )
|
||||
{
|
||||
cfg->m_SymChooserPanel.keep_symbol = m_keepSymbol->GetValue();
|
||||
cfg->m_SymChooserPanel.place_all_units = m_useUnits->GetValue();
|
||||
}
|
||||
|
||||
Unbind( wxEVT_CHAR_HOOK, &PANEL_SYMBOL_CHOOSER::OnChar, m_chooserPanel );
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,9 @@ public:
|
||||
*/
|
||||
std::vector<std::pair<FIELD_T, wxString>> GetFields() const;
|
||||
|
||||
bool GetKeepSymbol() { return m_keepSymbol; }
|
||||
bool GetPlaceAllUnits() { return m_useUnits; }
|
||||
|
||||
public:
|
||||
static std::mutex g_Mutex;
|
||||
|
||||
|
@ -68,15 +68,6 @@ DIALOG_USER_DEFINED_SIGNALS::~DIALOG_USER_DEFINED_SIGNALS()
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_USER_DEFINED_SIGNALS::TransferDataToWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_USER_DEFINED_SIGNALS::addGridRow( const wxString& aText, int aId )
|
||||
{
|
||||
int row = m_grid->GetNumberRows();
|
||||
@ -127,8 +118,7 @@ void DIALOG_USER_DEFINED_SIGNALS::onDeleteSignal( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded( wxStyledTextEvent &aEvent,
|
||||
SCINTILLA_TRICKS* aTricks )
|
||||
void DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded( wxStyledTextEvent &aEvent, SCINTILLA_TRICKS* aTricks )
|
||||
{
|
||||
wxStyledTextCtrl* textCtrl = aTricks->Scintilla();
|
||||
wxArrayString tokens;
|
||||
|
@ -21,8 +21,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_USER_DEFINED_SIGNALS_H
|
||||
#define DIALOG_USER_DEFINED_SIGNALS_H
|
||||
#pragma once
|
||||
|
||||
#include <dialog_user_defined_signals_base.h>
|
||||
|
||||
@ -46,7 +45,6 @@ private:
|
||||
void onScintillaCharAdded( wxStyledTextEvent &aEvent, SCINTILLA_TRICKS* aTricks );
|
||||
void OnFormattingHelp( wxHyperlinkEvent& aEvent ) override;
|
||||
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
private:
|
||||
@ -55,7 +53,3 @@ private:
|
||||
|
||||
HTML_MESSAGE_BOX* m_helpWindow;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // DIALOG_USER_DEFINED_SIGNALS_H
|
||||
|
@ -180,12 +180,6 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_sheet_visible_columns",
|
||||
&m_Appearance.edit_sheet_visible_columns, "0 1 2 3 4 5 6 7" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_sheet_width",
|
||||
&m_Appearance.edit_sheet_width, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "appearance.edit_sheet_height",
|
||||
&m_Appearance.edit_sheet_height, -1 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_label_visible_columns",
|
||||
&m_Appearance.edit_label_visible_columns, "0 1 2 3 4 5 6 7" ) );
|
||||
|
||||
@ -599,12 +593,6 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<int>( "symbol_chooser.sort_mode",
|
||||
&m_SymChooserPanel.sort_mode, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "symbol_chooser.keep_symbol",
|
||||
&m_SymChooserPanel.keep_symbol, false ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "symbol_chooser.place_all_units",
|
||||
&m_SymChooserPanel.place_all_units, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "import_graphics.interactive_placement",
|
||||
&m_ImportGraphics.interactive_placement, true ) );
|
||||
|
||||
@ -855,8 +843,6 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||
ret &= fromLegacy<int>( aCfg, "SymbolChooserVSashPosition", "symbol_chooser.sash_pos_v" );
|
||||
ret &= fromLegacy<int>( aCfg, "SymbolChooserWidth", "symbol_chooser.width" );
|
||||
ret &= fromLegacy<int>( aCfg, "SymbolChooserHeight", "symbol_chooser.height" );
|
||||
ret &= fromLegacy<bool>( aCfg, "SymbolChooserKeepSymbol", "symbol_chooser.keep_symbol" );
|
||||
ret &= fromLegacy<bool>( aCfg, "SymbolChooserUseUnits", "symbol_chooser.place_all_units" );
|
||||
|
||||
const std::string vlf = "ViewlibFrame";
|
||||
ret &= fromLegacy<bool>( aCfg, vlf + "Maximized", "lib_view.window.maximized" );
|
||||
|
@ -21,8 +21,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef _EESCHEMA_SETTINGS_H
|
||||
#define _EESCHEMA_SETTINGS_H
|
||||
#pragma once
|
||||
|
||||
#include <wx/aui/framemanager.h>
|
||||
|
||||
@ -65,8 +64,6 @@ public:
|
||||
int edit_symbol_width;
|
||||
int edit_symbol_height;
|
||||
wxString edit_sheet_visible_columns;
|
||||
int edit_sheet_width;
|
||||
int edit_sheet_height;
|
||||
wxString edit_label_visible_columns;
|
||||
int edit_label_width;
|
||||
int edit_label_height;
|
||||
@ -267,8 +264,6 @@ public:
|
||||
int width;
|
||||
int height;
|
||||
int sort_mode;
|
||||
bool keep_symbol;
|
||||
bool place_all_units;
|
||||
};
|
||||
|
||||
struct DIALOG_IMPORT_GRAPHICS
|
||||
@ -371,5 +366,3 @@ public:
|
||||
wxString m_lastSymbolLibDir;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -90,6 +90,8 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibrary( const SYMBOL_LIBRARY_FILTER
|
||||
aHistoryList.insert( aHistoryList.begin(), sel );
|
||||
}
|
||||
|
||||
sel.KeepSymbol = dlg.GetKeepSymbol();
|
||||
sel.PlaceAllUnits = dlg.GetPlaceAllUnits();
|
||||
return sel;
|
||||
}
|
||||
|
||||
|
@ -81,11 +81,16 @@ struct PICKED_SYMBOL
|
||||
int Unit;
|
||||
int Convert;
|
||||
|
||||
bool KeepSymbol;
|
||||
bool PlaceAllUnits;
|
||||
|
||||
std::vector<std::pair<FIELD_T, wxString>> Fields;
|
||||
|
||||
PICKED_SYMBOL() :
|
||||
Unit( 1 ),
|
||||
Convert( 1 )
|
||||
Convert( 1 ),
|
||||
KeepSymbol( false ),
|
||||
PlaceAllUnits( false )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -135,9 +135,9 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
const SCH_ACTIONS::PLACE_SYMBOL_PARAMS& toolParams = aEvent.Parameter<SCH_ACTIONS::PLACE_SYMBOL_PARAMS>();
|
||||
|
||||
SCH_SYMBOL* symbol = toolParams.m_Symbol;
|
||||
// If we get an parameterised symbol, we probably just want to place
|
||||
// that and get out of the placmeent tool, rather than popping the
|
||||
// chooser afterwards
|
||||
|
||||
// If we get a parameterised symbol, we probably just want to place that and get out of the placmeent tool,
|
||||
// rather than popping up the chooser afterwards
|
||||
bool placeOneOnly = symbol != nullptr;
|
||||
|
||||
SYMBOL_LIBRARY_FILTER filter;
|
||||
@ -146,6 +146,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
|
||||
SCHEMATIC_SETTINGS& schSettings = m_frame->Schematic().Settings();
|
||||
SCH_SCREEN* screen = m_frame->GetScreen();
|
||||
bool keepSymbol = false;
|
||||
bool placeAllUnits = false;
|
||||
|
||||
if( m_inDrawingTool )
|
||||
return 0;
|
||||
@ -156,15 +158,12 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
EE_GRID_HELPER grid( m_toolMgr );
|
||||
VECTOR2I cursorPos;
|
||||
|
||||
// First we need to get all instances of this sheet so we can annotate
|
||||
// whatever symbols we place on all copies
|
||||
// First we need to get all instances of this sheet so we can annotate whatever symbols we place on all copies
|
||||
SCH_SHEET_LIST hierarchy = m_frame->Schematic().Hierarchy();
|
||||
SCH_SHEET_LIST newInstances =
|
||||
hierarchy.FindAllSheetsForScreen( m_frame->GetCurrentSheet().LastScreen() );
|
||||
SCH_SHEET_LIST newInstances = hierarchy.FindAllSheetsForScreen( m_frame->GetCurrentSheet().LastScreen() );
|
||||
newInstances.SortByPageNumbers();
|
||||
|
||||
// Get a list of all references in the schematic to avoid duplicates wherever
|
||||
// they're placed
|
||||
// Get a list of all references in the schematic to avoid duplicates wherever they're placed
|
||||
SCH_REFERENCE_LIST existingRefs;
|
||||
hierarchy.GetSymbols( existingRefs );
|
||||
existingRefs.SortByReferenceOnly();
|
||||
@ -204,8 +203,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
auto setCursor =
|
||||
[&]()
|
||||
{
|
||||
m_frame->GetCanvas()->SetCurrentCursor( symbol ? KICURSOR::MOVING
|
||||
: KICURSOR::COMPONENT );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( symbol ? KICURSOR::MOVING : KICURSOR::COMPONENT );
|
||||
};
|
||||
|
||||
auto cleanup =
|
||||
@ -238,8 +236,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
refs.ReannotateByOptions( (ANNOTATE_ORDER_T) cfg->m_AnnotatePanel.sort_order,
|
||||
(ANNOTATE_ALGO_T) cfg->m_AnnotatePanel.method,
|
||||
schSettings.m_AnnotateStartNum,
|
||||
existingRefs, false, &hierarchy );
|
||||
schSettings.m_AnnotateStartNum, existingRefs, false,
|
||||
&hierarchy );
|
||||
|
||||
refs.UpdateAnnotation();
|
||||
|
||||
@ -368,12 +366,13 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
|
||||
// Pick the symbol to be placed
|
||||
bool footprintPreviews = m_frame->eeconfig()->m_Appearance.footprint_preview;
|
||||
PICKED_SYMBOL sel = m_frame->PickSymbolFromLibrary( &filter, *historyList,
|
||||
alreadyPlaced,
|
||||
PICKED_SYMBOL sel = m_frame->PickSymbolFromLibrary( &filter, *historyList, alreadyPlaced,
|
||||
footprintPreviews );
|
||||
|
||||
LIB_SYMBOL* libSymbol = sel.LibId.IsValid() ? m_frame->GetLibSymbol( sel.LibId )
|
||||
: nullptr;
|
||||
keepSymbol = sel.KeepSymbol;
|
||||
placeAllUnits = sel.PlaceAllUnits;
|
||||
|
||||
LIB_SYMBOL* libSymbol = sel.LibId.IsValid() ? m_frame->GetLibSymbol( sel.LibId ) : nullptr;
|
||||
|
||||
if( !libSymbol )
|
||||
continue;
|
||||
@ -469,13 +468,12 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
|
||||
SCH_SYMBOL* nextSymbol = nullptr;
|
||||
|
||||
if( m_frame->eeconfig()->m_SymChooserPanel.place_all_units
|
||||
|| m_frame->eeconfig()->m_SymChooserPanel.keep_symbol )
|
||||
if( keepSymbol || placeAllUnits )
|
||||
{
|
||||
SCH_REFERENCE currentReference( symbol, m_frame->GetCurrentSheet() );
|
||||
SCHEMATIC& schematic = m_frame->Schematic();
|
||||
|
||||
if( m_frame->eeconfig()->m_SymChooserPanel.place_all_units )
|
||||
if( placeAllUnits )
|
||||
{
|
||||
while( currentReference.GetUnit() <= symbol->GetUnitCount()
|
||||
&& schematic.Contains( currentReference ) )
|
||||
@ -490,8 +488,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
// We are either stepping to the next unit or next symbol
|
||||
if( m_frame->eeconfig()->m_SymChooserPanel.keep_symbol ||
|
||||
currentReference.GetUnit() > 1 )
|
||||
if( keepSymbol || currentReference.GetUnit() > 1 )
|
||||
{
|
||||
nextSymbol = static_cast<SCH_SYMBOL*>( symbol->Duplicate( IGNORE_PARENT_GROUP ) );
|
||||
nextSymbol->SetUnit( currentReference.GetUnit() );
|
||||
|
@ -50,13 +50,3 @@ bool DIALOG_UPDATE_CHECK_PROMPT::TransferDataFromWindow()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_UPDATE_CHECK_PROMPT::TransferDataToWindow()
|
||||
{
|
||||
// Since this is a first time start dialog, just default to both checks true
|
||||
m_cbPCMUpdates->SetValue( true );
|
||||
m_cbKiCadUpdates->SetValue( true );
|
||||
|
||||
return true;
|
||||
}
|
@ -22,8 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_UPDATE_CHECK_PROMPT_H
|
||||
#define DIALOG_UPDATE_CHECK_PROMPT_H
|
||||
#pragma once
|
||||
|
||||
#include <dialogs/dialog_update_check_prompt_base.h>
|
||||
|
||||
@ -34,7 +33,4 @@ public:
|
||||
|
||||
protected:
|
||||
bool TransferDataFromWindow() override;
|
||||
bool TransferDataToWindow() override;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -29,9 +29,11 @@ DIALOG_UPDATE_CHECK_PROMPT_BASE::DIALOG_UPDATE_CHECK_PROMPT_BASE( wxWindow* pare
|
||||
bSizer4->Add( m_messageLine1, 0, wxALL, 5 );
|
||||
|
||||
m_cbKiCadUpdates = new wxCheckBox( this, wxID_ANY, _("KiCad"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbKiCadUpdates->SetValue(true);
|
||||
bSizer4->Add( m_cbKiCadUpdates, 0, wxALL, 5 );
|
||||
|
||||
m_cbPCMUpdates = new wxCheckBox( this, wxID_ANY, _("Plugin and Content Manager"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbPCMUpdates->SetValue(true);
|
||||
bSizer4->Add( m_cbPCMUpdates, 0, wxALL, 5 );
|
||||
|
||||
|
||||
|
@ -1,41 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_update_check_prompt_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">dialog_update_check_prompt_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
@ -56,16 +59,16 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<object class="wxFlexGridSizer" expanded="true">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols"></property>
|
||||
@ -77,28 +80,28 @@
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">10</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer4</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -111,6 +114,7 @@
|
||||
<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>
|
||||
@ -147,25 +151,25 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
@ -173,6 +177,7 @@
|
||||
<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>
|
||||
@ -211,25 +216,25 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<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_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
@ -237,6 +242,7 @@
|
||||
<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>
|
||||
@ -277,21 +283,21 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<object class="wxStdDialogButtonSizer" expanded="true">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -24,7 +24,6 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_UPDATE_CHECK_PROMPT_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user