mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Merge branch kicad:master into master
This commit is contained in:
commit
cde0f2bc6b
@ -312,8 +312,6 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
|
||||
m_MaxPastedTextLength = 100;
|
||||
|
||||
m_hopOverArcRadius = 2.5;
|
||||
|
||||
loadFromConfigFile();
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,13 @@
|
||||
#include <wx/choicdlg.h>
|
||||
#include <wx/crt.h>
|
||||
|
||||
#if defined( _WIN32 ) && wxCHECK_VERSION( 3, 3, 0 )
|
||||
#define KICAD_MESSAGE_DIALOG_BASE wxGenericMessageDialog
|
||||
#define KICAD_RICH_MESSAGE_DIALOG_BASE wxGenericRichMessageDialog
|
||||
#else
|
||||
#define KICAD_MESSAGE_DIALOG_BASE wxMessageDialog
|
||||
#define KICAD_RICH_MESSAGE_DIALOG_BASE wxRichMessageDialog
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Flag to enable confirmation dialog debugging output.
|
||||
@ -53,7 +60,7 @@ bool AskOverrideLock( wxWindow* aParent, const wxString& aMessage )
|
||||
+ wxS( "\n" ) );
|
||||
dlg.SetYesNoLabels( _( "&Cancel" ), _( "&Open Anyway" ) );
|
||||
#else
|
||||
wxMessageDialog dlg( aParent, aMessage, _( "File Open Warning" ),
|
||||
KICAD_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "File Open Warning" ),
|
||||
wxYES_NO | wxICON_ERROR | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "Interleaved saves may produce very unexpected results." ) );
|
||||
dlg.SetYesNoLabels( _( "&Cancel" ), _( "&Open Anyway" ) );
|
||||
@ -67,8 +74,9 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage, bool* aApp
|
||||
{
|
||||
static bool s_apply_to_all = false;
|
||||
|
||||
wxRichMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxYES_NO | wxCANCEL |
|
||||
wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." )
|
||||
+ wxS( "\n" ) );
|
||||
dlg.SetYesNoLabels( _( "&Save" ), _( "&Discard Changes" ) );
|
||||
@ -105,7 +113,7 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
|
||||
wxWindowDisabler disable( true );
|
||||
#endif
|
||||
|
||||
wxMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
KICAD_MESSAGE_DIALOG_BASE dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
|
||||
dlg.SetYesNoLabels( _( "&Save" ), _( "&Discard Changes" ) );
|
||||
@ -118,7 +126,7 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
|
||||
|
||||
bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage )
|
||||
{
|
||||
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
|
||||
KICAD_MESSAGE_DIALOG_BASE dlg( parent, aMessage, wxEmptyString,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
|
||||
dlg.SetOKCancelLabels( _( "&Revert" ), _( "&Cancel" ) );
|
||||
@ -144,7 +152,7 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
|
||||
const wxString& aDetailedMessage, const wxString& aOKLabel,
|
||||
const wxString& aCancelLabel, bool* aApplyToAll )
|
||||
{
|
||||
wxRichMessageDialog dlg( aParent, aMessage, aWarning,
|
||||
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, aWarning,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
|
||||
dlg.SetOKCancelLabels( ( aOKLabel.IsEmpty() ) ? _( "&OK" ) : aOKLabel,
|
||||
@ -181,10 +189,11 @@ void DisplayError( wxWindow* aParent, const wxString& aText )
|
||||
return;
|
||||
}
|
||||
|
||||
wxMessageDialog* dlg;
|
||||
KICAD_MESSAGE_DIALOG_BASE* dlg;
|
||||
|
||||
dlg = new wxMessageDialog( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER |
|
||||
wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
|
||||
dlg->ShowModal();
|
||||
dlg->Destroy();
|
||||
@ -205,10 +214,11 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxStri
|
||||
return;
|
||||
}
|
||||
|
||||
wxMessageDialog* dlg;
|
||||
KICAD_MESSAGE_DIALOG_BASE* dlg;
|
||||
|
||||
dlg = new wxMessageDialog( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER |
|
||||
wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
|
||||
if( !aExtraInfo.IsEmpty() )
|
||||
dlg->SetExtendedMessage( aExtraInfo );
|
||||
@ -232,11 +242,12 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt
|
||||
return;
|
||||
}
|
||||
|
||||
wxMessageDialog* dlg;
|
||||
KICAD_MESSAGE_DIALOG_BASE* dlg;
|
||||
int icon = wxICON_INFORMATION;
|
||||
|
||||
dlg = new wxMessageDialog( aParent, aMessage, _( "Information" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP );
|
||||
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aMessage, _( "Information" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER |
|
||||
icon | wxSTAY_ON_TOP );
|
||||
|
||||
if( !aExtraInfo.IsEmpty() )
|
||||
dlg->SetExtendedMessage( aExtraInfo );
|
||||
@ -262,8 +273,9 @@ bool IsOK( wxWindow* aParent, const wxString& aMessage )
|
||||
#endif
|
||||
|
||||
#if !defined( __WXGTK__ )
|
||||
wxRichMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
|
||||
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT |
|
||||
wxCENTRE | icon | wxSTAY_ON_TOP );
|
||||
#else
|
||||
wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
|
||||
|
@ -82,9 +82,6 @@ DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS( wxWindow* aParent ) :
|
||||
attr->SetEditor( new GRID_CELL_PATH_EDITOR( this, m_EnvVars, &m_curdir, wxEmptyString ) );
|
||||
m_EnvVars->SetColAttr( TV_VALUE_COL, attr );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_EnvVars->SetDefaultRowSize( m_EnvVars->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
|
||||
m_EnvVars->PushEventHandler( new GRID_TRICKS( m_EnvVars,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
{
|
||||
|
@ -52,9 +52,6 @@ DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
|
||||
{
|
||||
SetTitle( wxString::Format( _( "Options for Library '%s'" ), aNickname ) );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_grid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
|
||||
|
||||
// add Cut, Copy, and Paste to wxGrid
|
||||
@ -65,8 +62,7 @@ DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
|
||||
{
|
||||
unsigned int row = 0;
|
||||
|
||||
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin();
|
||||
it != m_choices.end(); ++it, ++row )
|
||||
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin(); it != m_choices.end(); ++it, ++row )
|
||||
{
|
||||
wxString item = From_UTF8( it->first.c_str() );
|
||||
|
||||
@ -111,8 +107,7 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataToWindow()
|
||||
|
||||
int row = 0;
|
||||
|
||||
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end();
|
||||
++it, ++row )
|
||||
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end(); ++it, ++row )
|
||||
{
|
||||
m_grid->SetCellValue( row, 0, From_UTF8( it->first.c_str() ) );
|
||||
m_grid->SetCellValue( row, 1, it->second );
|
||||
@ -142,10 +137,8 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow()
|
||||
UTF8 value = m_grid->GetCellValue( row, 1 ).Trim( false ).Trim();
|
||||
|
||||
if( name.size() )
|
||||
{
|
||||
props[name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
*m_result = LIB_TABLE::FormatOptions( &props ).wx_str();
|
||||
return true;
|
||||
|
@ -65,81 +65,6 @@
|
||||
#include <paths.h>
|
||||
#include <macros.h>
|
||||
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* Container that describes file type info for the add a library options
|
||||
*/
|
||||
struct SUPPORTED_FILE_TYPE
|
||||
{
|
||||
wxString m_Description; ///< Description shown in the file picker dialog.
|
||||
wxString m_FileFilter; ///< Filter used for file pickers if m_IsFile is true.
|
||||
wxString m_FolderSearchExtension; ///< In case of folders it stands for extensions of files
|
||||
///< stored inside.
|
||||
bool m_IsFile; ///< Whether the library is a folder or a file.
|
||||
DESIGN_BLOCK_IO_MGR::DESIGN_BLOCK_FILE_T m_Plugin;
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Traverser implementation that looks to find any and all "folder" libraries by looking for files
|
||||
* with a specific extension inside folders
|
||||
*/
|
||||
class LIBRARY_TRAVERSER : public wxDirTraverser
|
||||
{
|
||||
public:
|
||||
LIBRARY_TRAVERSER( std::vector<std::string> aSearchExtensions, wxString aInitialDir ) :
|
||||
m_searchExtensions( aSearchExtensions ), m_currentDir( aInitialDir )
|
||||
{
|
||||
}
|
||||
|
||||
virtual wxDirTraverseResult OnFile( const wxString& aFileName ) override
|
||||
{
|
||||
wxFileName file( aFileName );
|
||||
|
||||
for( const std::string& ext : m_searchExtensions )
|
||||
{
|
||||
if( file.GetExt().IsSameAs( ext, false ) )
|
||||
m_foundDirs.insert( { m_currentDir, 1 } );
|
||||
}
|
||||
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
||||
virtual wxDirTraverseResult OnOpenError( const wxString& aOpenErrorName ) override
|
||||
{
|
||||
m_failedDirs.insert( { aOpenErrorName, 1 } );
|
||||
return wxDIR_IGNORE;
|
||||
}
|
||||
|
||||
bool HasDirectoryOpenFailures() { return m_failedDirs.size() > 0; }
|
||||
|
||||
virtual wxDirTraverseResult OnDir( const wxString& aDirName ) override
|
||||
{
|
||||
m_currentDir = aDirName;
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
||||
void GetPaths( wxArrayString& aPathArray )
|
||||
{
|
||||
for( std::pair<const wxString, int>& foundDirsPair : m_foundDirs )
|
||||
aPathArray.Add( foundDirsPair.first );
|
||||
}
|
||||
|
||||
void GetFailedPaths( wxArrayString& aPathArray )
|
||||
{
|
||||
for( std::pair<const wxString, int>& failedDirsPair : m_failedDirs )
|
||||
aPathArray.Add( failedDirsPair.first );
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_searchExtensions;
|
||||
wxString m_currentDir;
|
||||
std::unordered_map<wxString, int> m_foundDirs;
|
||||
std::unordered_map<wxString, int> m_failedDirs;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This class builds a wxGridTableBase by wrapping an #DESIGN_BLOCK_LIB_TABLE object.
|
||||
@ -299,8 +224,11 @@ PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE( DIALOG_EDIT_LIBRARY_
|
||||
const wxString& aProjectTblPath,
|
||||
const wxString& aProjectBasePath ) :
|
||||
PANEL_DESIGN_BLOCK_LIB_TABLE_BASE( aParent ),
|
||||
m_globalTable( aGlobalTable ), m_projectTable( aProjectTable ), m_project( aProject ),
|
||||
m_projectBasePath( aProjectBasePath ), m_parent( aParent )
|
||||
m_globalTable( aGlobalTable ),
|
||||
m_projectTable( aProjectTable ),
|
||||
m_project( aProject ),
|
||||
m_projectBasePath( aProjectBasePath ),
|
||||
m_parent( aParent )
|
||||
{
|
||||
m_global_grid->SetTable( new DESIGN_BLOCK_LIB_TABLE_GRID( *aGlobalTable ), true );
|
||||
|
||||
@ -336,9 +264,6 @@ PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE( DIALOG_EDIT_LIBRARY_
|
||||
auto setupGrid =
|
||||
[&]( WX_GRID* aGrid )
|
||||
{
|
||||
// Give a bit more room for wxChoice editors
|
||||
aGrid->SetDefaultRowSize( aGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
// add Cut, Copy, and Paste to wxGrids
|
||||
aGrid->PushEventHandler( new DESIGN_BLOCK_GRID_TRICKS( m_parent, aGrid ) );
|
||||
|
||||
@ -1171,10 +1096,6 @@ void PANEL_DESIGN_BLOCK_LIB_TABLE::populateEnvironReadOnlyTable()
|
||||
m_path_subs_grid->SetCellEditor( row, 1, new GRID_CELL_READONLY_TEXT_EDITOR() );
|
||||
}
|
||||
|
||||
// No combobox editors here, but it looks better if its consistent with the other
|
||||
// grids in the dialog.
|
||||
m_path_subs_grid->SetDefaultRowSize( m_path_subs_grid->GetDefaultRowSize() + 2 );
|
||||
|
||||
adjustPathSubsGridColumns( m_path_subs_grid->GetRect().GetWidth() );
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,8 @@
|
||||
/* ---------- GRID_TRICKS for embedded files grid ---------- */
|
||||
|
||||
EMBEDDED_FILES_GRID_TRICKS::EMBEDDED_FILES_GRID_TRICKS( WX_GRID* aGrid ) :
|
||||
GRID_TRICKS( aGrid ), m_curRow( -1 )
|
||||
GRID_TRICKS( aGrid ),
|
||||
m_curRow( -1 )
|
||||
{
|
||||
}
|
||||
|
||||
@ -89,7 +90,9 @@ void EMBEDDED_FILES_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
|
||||
|
||||
|
||||
PANEL_EMBEDDED_FILES::PANEL_EMBEDDED_FILES( wxWindow* parent, EMBEDDED_FILES* aFiles ) :
|
||||
PANEL_EMBEDDED_FILES_BASE( parent ), m_files( aFiles ), m_localFiles( new EMBEDDED_FILES() )
|
||||
PANEL_EMBEDDED_FILES_BASE( parent ),
|
||||
m_files( aFiles ),
|
||||
m_localFiles( new EMBEDDED_FILES() )
|
||||
{
|
||||
for( auto& [name, file] : m_files->EmbeddedFileMap() )
|
||||
{
|
||||
@ -105,8 +108,9 @@ PANEL_EMBEDDED_FILES::PANEL_EMBEDDED_FILES( wxWindow* parent, EMBEDDED_FILES* aF
|
||||
|
||||
m_files_grid->PushEventHandler( new EMBEDDED_FILES_GRID_TRICKS( m_files_grid ) );
|
||||
|
||||
m_localFiles->SetFileAddedCallback( [this](EMBEDDED_FILES::EMBEDDED_FILE* file) {
|
||||
|
||||
m_localFiles->SetFileAddedCallback(
|
||||
[this](EMBEDDED_FILES::EMBEDDED_FILE* file)
|
||||
{
|
||||
for( int ii = 0; ii < m_files_grid->GetNumberRows(); ii++ )
|
||||
{
|
||||
if( m_files_grid->GetCellValue( ii, 1 ) == file->GetLink() )
|
||||
@ -166,6 +170,7 @@ bool PANEL_EMBEDDED_FILES::TransferDataToWindow()
|
||||
m_files_grid->DeleteRows( 0, m_files_grid->GetNumberRows() );
|
||||
|
||||
int ii = 0;
|
||||
|
||||
for( auto& [name, file] : m_localFiles->EmbeddedFileMap() )
|
||||
{
|
||||
while( m_files_grid->GetNumberRows() < ii + 1 )
|
||||
@ -191,11 +196,10 @@ bool PANEL_EMBEDDED_FILES::TransferDataFromWindow()
|
||||
|
||||
std::vector<EMBEDDED_FILES::EMBEDDED_FILE*> files;
|
||||
|
||||
for( auto it = m_localFiles->EmbeddedFileMap().begin();
|
||||
it != m_localFiles->EmbeddedFileMap().end(); it++ )
|
||||
files.push_back( it->second );
|
||||
for( const auto& [name, file] : m_localFiles->EmbeddedFileMap() )
|
||||
files.push_back( file );
|
||||
|
||||
for( auto& file : files )
|
||||
for( EMBEDDED_FILES::EMBEDDED_FILE* file : files )
|
||||
{
|
||||
m_files->AddFile( file );
|
||||
m_localFiles->RemoveFile( file->name, false );
|
||||
@ -237,8 +241,7 @@ void PANEL_EMBEDDED_FILES::onFontEmbedClick( wxCommandEvent& event )
|
||||
|
||||
for( KIFONT::OUTLINE_FONT* font : fonts )
|
||||
{
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* result =
|
||||
m_localFiles->AddFile( font->GetFileName(), true );
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* result = m_localFiles->AddFile( font->GetFileName(), true );
|
||||
|
||||
if( !result )
|
||||
{
|
||||
@ -326,7 +329,7 @@ void PANEL_EMBEDDED_FILES::onAddEmbeddedFiles( wxCommandEvent& event )
|
||||
wxArrayString paths;
|
||||
fileDialog.GetPaths( paths );
|
||||
|
||||
for( wxString path : paths )
|
||||
for( const wxString& path : paths )
|
||||
AddEmbeddedFile( path );
|
||||
}
|
||||
}
|
||||
@ -396,11 +399,9 @@ void PANEL_EMBEDDED_FILES::onExportFiles( wxCommandEvent& event )
|
||||
|
||||
if( fileName.FileExists() )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "File '%s' already exists." ),
|
||||
fileName.GetFullName() );
|
||||
wxString msg = wxString::Format( _( "File '%s' already exists." ), fileName.GetFullName() );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxICON_WARNING );
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||
errorDlg.SetOKCancelLabels( _( "Overwrite" ), _( "Skip" ) );
|
||||
errorDlg.DoNotShowCheckbox( __FILE__, __LINE__ );
|
||||
|
||||
@ -415,11 +416,9 @@ void PANEL_EMBEDDED_FILES::onExportFiles( wxCommandEvent& event )
|
||||
if( !fileName.IsDirWritable() )
|
||||
{
|
||||
#ifndef __WXMAC__
|
||||
wxString msg = wxString::Format( _( "Directory '%s' is not writable." ),
|
||||
fileName.GetFullName() );
|
||||
wxString msg = wxString::Format( _( "Directory '%s' is not writable." ), fileName.GetFullName() );
|
||||
#else
|
||||
wxString msg = wxString::Format( _( "Folder '%s' is not writable." ),
|
||||
fileName.GetPath() );
|
||||
wxString msg = wxString::Format( _( "Folder '%s' is not writable." ), fileName.GetPath() );
|
||||
#endif
|
||||
// Don't set a 'do not show again' checkbox for this dialog
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Error" ), wxYES_NO | wxCANCEL | wxICON_ERROR );
|
||||
@ -451,8 +450,7 @@ void PANEL_EMBEDDED_FILES::onExportFiles( wxCommandEvent& event )
|
||||
|
||||
if( !out.IsOk() )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Failed to open file '%s'." ),
|
||||
fileName.GetFullName() );
|
||||
wxString msg = wxString::Format( _( "Failed to open file '%s'." ), fileName.GetFullName() );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Error" ), wxOK | wxICON_ERROR );
|
||||
errorDlg.ShowModal();
|
||||
@ -463,8 +461,7 @@ void PANEL_EMBEDDED_FILES::onExportFiles( wxCommandEvent& event )
|
||||
|
||||
if( !out.IsOk() || ( out.LastWrite() != file->decompressedData.size() ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Failed to write file '%s'." ),
|
||||
fileName.GetFullName() );
|
||||
wxString msg = wxString::Format( _( "Failed to write file '%s'." ), fileName.GetFullName() );
|
||||
|
||||
KIDIALOG errorDlg( m_parent, msg, _( "Error" ), wxOK | wxICON_ERROR );
|
||||
|
||||
|
@ -161,14 +161,12 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
attr->SetRenderer( new GRID_CELL_COLOR_RENDERER( PAGED_DIALOG::GetDialog( this ) ) );
|
||||
attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( PAGED_DIALOG::GetDialog( this ),
|
||||
m_netclassGrid ) );
|
||||
attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( PAGED_DIALOG::GetDialog( this ), m_netclassGrid ) );
|
||||
m_netclassGrid->SetColAttr( GRID_SCHEMATIC_COLOR, attr );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr->SetRenderer( new GRID_CELL_COLOR_RENDERER( PAGED_DIALOG::GetDialog( this ) ) );
|
||||
attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( PAGED_DIALOG::GetDialog( this ),
|
||||
m_netclassGrid ) );
|
||||
attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( PAGED_DIALOG::GetDialog( this ), m_netclassGrid ) );
|
||||
m_netclassGrid->SetColAttr( GRID_PCB_COLOR, attr );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
@ -182,8 +180,7 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
|
||||
}
|
||||
else
|
||||
{
|
||||
m_colorDefaultHelpText->SetLabel(
|
||||
_( "Set color to transparent to use layer default color." ) );
|
||||
m_colorDefaultHelpText->SetLabel( _( "Set color to transparent to use layer default color." ) );
|
||||
m_colorDefaultHelpText->GetParent()->Layout();
|
||||
}
|
||||
|
||||
@ -204,11 +201,6 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
|
||||
// Be sure the column labels are readable
|
||||
m_netclassGrid->EnsureColLabelsVisible();
|
||||
|
||||
// Membership combobox editors require a bit more room, so increase the row size of
|
||||
// all our grids for consistency
|
||||
m_netclassGrid->SetDefaultRowSize( m_netclassGrid->GetDefaultRowSize() + 4 );
|
||||
m_assignmentGrid->SetDefaultRowSize( m_assignmentGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_netclassGrid->PushEventHandler( new GRID_TRICKS( m_netclassGrid ) );
|
||||
m_assignmentGrid->PushEventHandler( new GRID_TRICKS( m_assignmentGrid ) );
|
||||
|
||||
@ -232,14 +224,13 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
|
||||
nullptr, this );
|
||||
|
||||
// Handle tooltips for grid
|
||||
m_netclassGrid->GetGridColLabelWindow()->Bind( wxEVT_MOTION,
|
||||
&PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent,
|
||||
m_netclassGrid->GetGridColLabelWindow()->Bind( wxEVT_MOTION, &PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent,
|
||||
this );
|
||||
|
||||
// Allow sorting assignments by column
|
||||
m_assignmentGrid->Connect(
|
||||
wxEVT_GRID_LABEL_LEFT_CLICK,
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassAssignmentSort ), nullptr, this );
|
||||
m_assignmentGrid->Connect( wxEVT_GRID_LABEL_LEFT_CLICK,
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassAssignmentSort ),
|
||||
nullptr, this );
|
||||
|
||||
m_frame->Bind( EDA_EVT_UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
|
||||
|
||||
@ -284,9 +275,9 @@ PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES()
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ),
|
||||
nullptr, this );
|
||||
|
||||
m_assignmentGrid->Disconnect(
|
||||
wxEVT_GRID_LABEL_LEFT_CLICK,
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassAssignmentSort ), nullptr, this );
|
||||
m_assignmentGrid->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK,
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassAssignmentSort ),
|
||||
nullptr, this );
|
||||
|
||||
m_frame->Unbind( EDA_EVT_UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
|
||||
}
|
||||
@ -300,10 +291,8 @@ void PANEL_SETUP_NETCLASSES::loadNetclasses()
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_NAME, nc->GetName() );
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_DELAY_PROFILE, nc->GetDelayProfile() );
|
||||
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_WIREWIDTH,
|
||||
nc->GetWireWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_BUSWIDTH,
|
||||
nc->GetBusWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_WIREWIDTH, nc->GetWireWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_BUSWIDTH, nc->GetBusWidthOpt() );
|
||||
|
||||
wxString colorAsString = nc->GetSchematicColor().ToCSSString();
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_SCHEMATIC_COLOR, colorAsString );
|
||||
@ -315,28 +304,22 @@ void PANEL_SETUP_NETCLASSES::loadNetclasses()
|
||||
if( lineStyleIdx >= (int) g_lineStyleNames.size() + 1 )
|
||||
lineStyleIdx = 0;
|
||||
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_LINESTYLE,
|
||||
g_lineStyleNames[lineStyleIdx + 1] );
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_LINESTYLE, g_lineStyleNames[lineStyleIdx + 1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// <Not defined> line style in list.
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_LINESTYLE,
|
||||
g_lineStyleNames[0] );
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_LINESTYLE, g_lineStyleNames[0] );
|
||||
}
|
||||
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_CLEARANCE, nc->GetClearanceOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_TRACKSIZE,
|
||||
nc->GetTrackWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_TRACKSIZE, nc->GetTrackWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_VIASIZE, nc->GetViaDiameterOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_VIADRILL, nc->GetViaDrillOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_uVIASIZE,
|
||||
nc->GetuViaDiameterOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_uVIASIZE, nc->GetuViaDiameterOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_uVIADRILL, nc->GetuViaDrillOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_DIFF_PAIR_WIDTH,
|
||||
nc->GetDiffPairWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_DIFF_PAIR_GAP,
|
||||
nc->GetDiffPairGapOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_DIFF_PAIR_WIDTH, nc->GetDiffPairWidthOpt() );
|
||||
m_netclassGrid->SetOptionalUnitValue( aRow, GRID_DIFF_PAIR_GAP, nc->GetDiffPairGapOpt() );
|
||||
|
||||
colorAsString = nc->GetPcbColor().ToCSSString();
|
||||
m_netclassGrid->SetCellValue( aRow, GRID_PCB_COLOR, colorAsString );
|
||||
@ -554,8 +537,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
|
||||
// Copy other NetClasses:
|
||||
for( int row = 0; row < m_netclassGrid->GetNumberRows() - 1; ++row )
|
||||
{
|
||||
auto nc =
|
||||
std::make_shared<NETCLASS>( m_netclassGrid->GetCellValue( row, GRID_NAME ), false );
|
||||
auto nc = std::make_shared<NETCLASS>( m_netclassGrid->GetCellValue( row, GRID_NAME ), false );
|
||||
gridRowToNetclass( row, nc );
|
||||
m_netSettings->SetNetclass( nc->GetName(), nc );
|
||||
}
|
||||
@ -970,8 +952,7 @@ void PANEL_SETUP_NETCLASSES::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
{
|
||||
EDA_COMBINED_MATCHER matcher( pattern, CTX_NETCLASS );
|
||||
|
||||
m_matchingNets->Report( wxString::Format( _( "<b>Nets matching '%s':</b>" ),
|
||||
pattern ) );
|
||||
m_matchingNets->Report( wxString::Format( _( "<b>Nets matching '%s':</b>" ), pattern ) );
|
||||
|
||||
for( const wxString& net : m_netNames )
|
||||
{
|
||||
@ -1051,8 +1032,7 @@ void PANEL_SETUP_NETCLASSES::OnMoveNetclassUpClick( wxCommandEvent& event )
|
||||
m_netclassGrid->InsertRows( newRowId );
|
||||
|
||||
for( int col = 0; col < m_netclassGrid->GetNumberCols(); col++ )
|
||||
m_netclassGrid->SetCellValue( newRowId, col,
|
||||
m_netclassGrid->GetCellValue( newRowId + 2, col ) );
|
||||
m_netclassGrid->SetCellValue( newRowId, col, m_netclassGrid->GetCellValue( newRowId + 2, col ) );
|
||||
|
||||
// Set the row nullable editors
|
||||
setNetclassRowNullableEditors( newRowId, false );
|
||||
@ -1086,16 +1066,15 @@ void PANEL_SETUP_NETCLASSES::OnMoveNetclassDownClick( wxCommandEvent& event )
|
||||
// Can't move the last row down, nor move the Default netclass
|
||||
if( selectedRows[0] == ( m_netclassGrid->GetNumberRows() - 2 )
|
||||
|| selectedRows[0] == ( m_netclassGrid->GetNumberRows() - 1 ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int newRowId = selectedRows[0] + 2;
|
||||
m_netclassGrid->InsertRows( newRowId );
|
||||
|
||||
for( int col = 0; col < m_netclassGrid->GetNumberCols(); col++ )
|
||||
{
|
||||
m_netclassGrid->SetCellValue( newRowId, col,
|
||||
m_netclassGrid->GetCellValue( newRowId - 2, col ) );
|
||||
}
|
||||
m_netclassGrid->SetCellValue( newRowId, col, m_netclassGrid->GetCellValue( newRowId - 2, col ) );
|
||||
|
||||
m_netclassGrid->DeleteRows( newRowId - 2, 1 );
|
||||
m_netclassGrid->MakeCellVisible( newRowId - 1, 0 );
|
||||
|
@ -43,8 +43,11 @@ enum TEXT_VAR_GRID_COLUMNS
|
||||
|
||||
|
||||
PANEL_TEXT_VARIABLES::PANEL_TEXT_VARIABLES( wxWindow* aParent, PROJECT* aProject ) :
|
||||
PANEL_TEXT_VARIABLES_BASE( aParent ), m_project( aProject ), m_lastCheckedTicker( 0 ),
|
||||
m_errorRow( -1 ), m_errorCol( -1 )
|
||||
PANEL_TEXT_VARIABLES_BASE( aParent ),
|
||||
m_project( aProject ),
|
||||
m_lastCheckedTicker( 0 ),
|
||||
m_errorRow( -1 ),
|
||||
m_errorCol( -1 )
|
||||
{
|
||||
m_btnAddTextVar->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
|
||||
m_btnDeleteTextVar->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
|
||||
|
@ -71,7 +71,7 @@ JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT( bool aOutputIsDirectory ) :
|
||||
&m_blackAndWhite, m_blackAndWhite ) );
|
||||
|
||||
m_params.emplace_back( new JOB_PARAM<bool>( "show_hop_over",
|
||||
&m_blackAndWhite, m_show_hop_over ) );
|
||||
&m_show_hop_over, m_show_hop_over ) );
|
||||
|
||||
m_params.emplace_back( new JOB_PARAM<JOB_PAGE_SIZE>( "page_size",
|
||||
&m_pageSizeSelect, m_pageSizeSelect ) );
|
||||
|
@ -32,7 +32,7 @@ static std::unordered_map<unsigned long, int> doNotShowAgainDlgs;
|
||||
|
||||
KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, const wxString& aCaption,
|
||||
long aStyle )
|
||||
: wxRichMessageDialog( aParent, aMessage, aCaption, aStyle | wxCENTRE | wxSTAY_ON_TOP ),
|
||||
: KIDIALOG_BASE( aParent, aMessage, aCaption, aStyle | wxCENTRE | wxSTAY_ON_TOP ),
|
||||
m_hash( 0 ),
|
||||
m_cancelMeansCancel( true )
|
||||
{
|
||||
@ -41,7 +41,7 @@ KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, const wxString&
|
||||
|
||||
KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, KD_TYPE aType,
|
||||
const wxString& aCaption )
|
||||
: wxRichMessageDialog( aParent, aMessage, getCaption( aType, aCaption ), getStyle( aType ) ),
|
||||
: KIDIALOG_BASE( aParent, aMessage, getCaption( aType, aCaption ), getStyle( aType ) ),
|
||||
m_hash( 0 ),
|
||||
m_cancelMeansCancel( true )
|
||||
{
|
||||
@ -80,7 +80,7 @@ bool KIDIALOG::Show( bool aShow )
|
||||
return it->second;
|
||||
}
|
||||
|
||||
int ret = wxRichMessageDialog::Show( aShow );
|
||||
int ret = KIDIALOG_BASE::Show( aShow );
|
||||
|
||||
// Has the user asked not to show the dialog again?
|
||||
// Note that we don't save a Cancel value unless the Cancel button is being used for some
|
||||
@ -100,7 +100,7 @@ int KIDIALOG::ShowModal()
|
||||
if( it != doNotShowAgainDlgs.end() )
|
||||
return it->second;
|
||||
|
||||
int ret = wxRichMessageDialog::ShowModal();
|
||||
int ret = KIDIALOG_BASE::ShowModal();
|
||||
|
||||
// Has the user asked not to show the dialog again?
|
||||
// Note that we don't save a Cancel value unless the Cancel button is being used for some
|
||||
|
@ -296,17 +296,23 @@ const wxString NETCLASS::GetHumanReadableName() const
|
||||
|
||||
if( m_constituents.size() == 2 )
|
||||
{
|
||||
name.Printf( _( "%s and %s" ), m_constituents[0]->GetName(), m_constituents[1]->GetName() );
|
||||
name.Printf( _( "%s and %s" ),
|
||||
m_constituents[0]->GetName(),
|
||||
m_constituents[1]->GetName() );
|
||||
}
|
||||
else if( m_constituents.size() == 3 )
|
||||
{
|
||||
name.Printf( _( "%s, %s and %s" ), m_constituents[0]->GetName(),
|
||||
m_constituents[1]->GetName(), m_constituents[2]->GetName() );
|
||||
name.Printf( _( "%s, %s and %s" ),
|
||||
m_constituents[0]->GetName(),
|
||||
m_constituents[1]->GetName(),
|
||||
m_constituents[2]->GetName() );
|
||||
}
|
||||
else if( m_constituents.size() > 3 )
|
||||
{
|
||||
name.Printf( _( "%s, %s and %d more" ), m_constituents[0]->GetName(),
|
||||
m_constituents[1]->GetName(), static_cast<int>( m_constituents.size() - 2 ) );
|
||||
name.Printf( _( "%s, %s and %d more" ),
|
||||
m_constituents[0]->GetName(),
|
||||
m_constituents[1]->GetName(),
|
||||
static_cast<int>( m_constituents.size() - 2 ) );
|
||||
}
|
||||
|
||||
return name;
|
||||
|
@ -263,6 +263,14 @@ void ACTION_TOOLBAR::ApplyConfiguration( const TOOLBAR_CONFIGURATION& aConfig )
|
||||
{
|
||||
wxASSERT( GetParent() );
|
||||
|
||||
std::map<std::string, std::string> currentGroupItems;
|
||||
|
||||
for( const auto& [id, group] : m_actionGroups )
|
||||
{
|
||||
if( m_toolActions[group->GetUIId()] )
|
||||
currentGroupItems[group->GetName()] = m_toolActions[group->GetUIId()]->GetName();
|
||||
}
|
||||
|
||||
// Remove existing tools
|
||||
ClearToolbar();
|
||||
|
||||
@ -284,9 +292,11 @@ void ACTION_TOOLBAR::ApplyConfiguration( const TOOLBAR_CONFIGURATION& aConfig )
|
||||
case TOOLBAR_ITEM_TYPE::TB_GROUP:
|
||||
{
|
||||
// Add a group of items to the toolbar
|
||||
std::string groupName = item.m_GroupName.ToStdString();
|
||||
std::vector<const TOOL_ACTION*> tools;
|
||||
const TOOL_ACTION* defaultTool = nullptr;
|
||||
|
||||
for( auto& groupItem : item.m_GroupItems )
|
||||
for( TOOLBAR_ITEM& groupItem : item.m_GroupItems )
|
||||
{
|
||||
switch( groupItem.m_Type )
|
||||
{
|
||||
@ -294,7 +304,7 @@ void ACTION_TOOLBAR::ApplyConfiguration( const TOOLBAR_CONFIGURATION& aConfig )
|
||||
case TOOLBAR_ITEM_TYPE::SPACER:
|
||||
case TOOLBAR_ITEM_TYPE::TB_GROUP:
|
||||
case TOOLBAR_ITEM_TYPE::CONTROL:
|
||||
wxASSERT_MSG( false, "Unsupported group item type" );
|
||||
wxFAIL_MSG( wxT( "Unsupported group item type" ) );
|
||||
continue;
|
||||
|
||||
case TOOLBAR_ITEM_TYPE::TOOL:
|
||||
@ -302,15 +312,23 @@ void ACTION_TOOLBAR::ApplyConfiguration( const TOOLBAR_CONFIGURATION& aConfig )
|
||||
|
||||
if( !grpAction )
|
||||
{
|
||||
wxASSERT_MSG( false, wxString::Format( "Unable to find group tool %s", groupItem.m_ActionName ) );
|
||||
wxFAIL_MSG( wxString::Format( wxT( "Unable to find group tool %s" ), groupItem.m_ActionName ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
tools.push_back( grpAction );
|
||||
|
||||
if( currentGroupItems[groupName] == groupItem.m_ActionName )
|
||||
defaultTool = grpAction;
|
||||
}
|
||||
}
|
||||
|
||||
AddGroup( std::make_unique<ACTION_GROUP>( item.m_GroupName.ToStdString(), tools ) );
|
||||
std::unique_ptr<ACTION_GROUP> group = std::make_unique<ACTION_GROUP>( groupName, tools );
|
||||
|
||||
if( defaultTool )
|
||||
group->SetDefaultAction( *defaultTool );
|
||||
|
||||
AddGroup( std::move( group ) );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -322,7 +340,7 @@ void ACTION_TOOLBAR::ApplyConfiguration( const TOOLBAR_CONFIGURATION& aConfig )
|
||||
|
||||
if( !factory )
|
||||
{
|
||||
wxASSERT_MSG( false, wxString::Format( "Unable to find control factory for %s", item.m_ControlName ) );
|
||||
wxFAIL_MSG( wxString::Format( wxT( "Unable to find control factory for %s" ), item.m_ControlName ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -337,7 +355,7 @@ void ACTION_TOOLBAR::ApplyConfiguration( const TOOLBAR_CONFIGURATION& aConfig )
|
||||
|
||||
if( !action )
|
||||
{
|
||||
wxASSERT_MSG( false, wxString::Format( "Unable to find toolbar tool %s", item.m_ActionName ) );
|
||||
wxFAIL_MSG( wxString::Format( wxT( "Unable to find toolbar tool %s" ), item.m_ActionName ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -207,6 +207,10 @@ WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxS
|
||||
wxGrid( parent, id, pos, size, style, name ),
|
||||
m_weOwnTable( false )
|
||||
{
|
||||
// Grids with comboboxes need a bit of extra height; other grids look better if they're
|
||||
// consistent.
|
||||
SetDefaultRowSize( GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
|
||||
SetDefaultCellOverflow( false );
|
||||
|
||||
// Make sure the GUI font scales properly
|
||||
@ -214,10 +218,8 @@ WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxS
|
||||
SetLabelFont( KIUI::GetControlFont( this ) );
|
||||
|
||||
Connect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
|
||||
Connect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( WX_GRID::onCellEditorShown ), nullptr,
|
||||
this );
|
||||
Connect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( WX_GRID::onCellEditorHidden ), nullptr,
|
||||
this );
|
||||
Connect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( WX_GRID::onCellEditorShown ), nullptr, this );
|
||||
Connect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( WX_GRID::onCellEditorHidden ), nullptr, this );
|
||||
}
|
||||
|
||||
|
||||
@ -226,19 +228,15 @@ WX_GRID::~WX_GRID()
|
||||
if( m_weOwnTable )
|
||||
DestroyTable( GetTable() );
|
||||
|
||||
Disconnect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( WX_GRID::onCellEditorShown ), nullptr,
|
||||
this );
|
||||
Disconnect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( WX_GRID::onCellEditorHidden ),
|
||||
nullptr, this );
|
||||
Disconnect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr,
|
||||
this );
|
||||
Disconnect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( WX_GRID::onCellEditorShown ), nullptr, this );
|
||||
Disconnect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( WX_GRID::onCellEditorHidden ), nullptr, this );
|
||||
Disconnect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
|
||||
}
|
||||
|
||||
|
||||
void WX_GRID::onDPIChanged(wxDPIChangedEvent& aEvt)
|
||||
{
|
||||
CallAfter(
|
||||
[&]()
|
||||
CallAfter( [&]()
|
||||
{
|
||||
wxGrid::SetColLabelSize( wxGRID_AUTOSIZE );
|
||||
} );
|
||||
@ -301,8 +299,7 @@ void WX_GRID::SetTable( wxGridTableBase* aTable, bool aTakeOwnership )
|
||||
EnableAlternateRowColors( Pgm().GetCommonSettings()->m_Appearance.grid_striping );
|
||||
|
||||
Connect( wxEVT_GRID_COL_MOVE, wxGridEventHandler( WX_GRID::onGridColMove ), nullptr, this );
|
||||
Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( WX_GRID::onGridCellSelect ), nullptr,
|
||||
this );
|
||||
Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( WX_GRID::onGridCellSelect ), nullptr, this );
|
||||
|
||||
m_weOwnTable = aTakeOwnership;
|
||||
}
|
||||
@ -391,11 +388,8 @@ void WX_GRID::onCellEditorHidden( wxGridEvent& aEvent )
|
||||
|
||||
if( cellEditor )
|
||||
{
|
||||
GRID_CELL_MARK_AS_NULLABLE* nullableCell =
|
||||
dynamic_cast<GRID_CELL_MARK_AS_NULLABLE*>( cellEditor );
|
||||
|
||||
if( nullableCell )
|
||||
isNullable = nullableCell->IsNullable();
|
||||
if( GRID_CELL_MARK_AS_NULLABLE* nullable = dynamic_cast<GRID_CELL_MARK_AS_NULLABLE*>( cellEditor ) )
|
||||
isNullable = nullable->IsNullable();
|
||||
|
||||
cellEditor->DecRef();
|
||||
}
|
||||
@ -419,8 +413,8 @@ void WX_GRID::onCellEditorHidden( wxGridEvent& aEvent )
|
||||
|
||||
if( stringValue == UNITS_PROVIDER::NullUiString )
|
||||
{
|
||||
val = unitsProvider->OptionalValueFromString(
|
||||
UNITS_PROVIDER::NullUiString, cellDataType );
|
||||
val = unitsProvider->OptionalValueFromString( UNITS_PROVIDER::NullUiString,
|
||||
cellDataType );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -428,13 +422,11 @@ void WX_GRID::onCellEditorHidden( wxGridEvent& aEvent )
|
||||
cellDataType );
|
||||
}
|
||||
|
||||
evalValue = unitsProvider->StringFromOptionalValue( val, true,
|
||||
cellDataType );
|
||||
evalValue = unitsProvider->StringFromOptionalValue( val, true, cellDataType );
|
||||
}
|
||||
else
|
||||
{
|
||||
int val = unitsProvider->ValueFromString( m_eval->Result(),
|
||||
cellDataType );
|
||||
int val = unitsProvider->ValueFromString( m_eval->Result(), cellDataType );
|
||||
evalValue = unitsProvider->StringFromValue( val, true, cellDataType );
|
||||
}
|
||||
|
||||
@ -458,8 +450,7 @@ void WX_GRID::DestroyTable( wxGridTableBase* aTable )
|
||||
CommitPendingChanges( true /* quiet mode */ );
|
||||
|
||||
Disconnect( wxEVT_GRID_COL_MOVE, wxGridEventHandler( WX_GRID::onGridColMove ), nullptr, this );
|
||||
Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( WX_GRID::onGridCellSelect ), nullptr,
|
||||
this );
|
||||
Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( WX_GRID::onGridCellSelect ), nullptr, this );
|
||||
|
||||
wxGrid::SetTable( nullptr );
|
||||
delete aTable;
|
||||
@ -805,8 +796,7 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep
|
||||
{
|
||||
EnsureColLabelsVisible();
|
||||
|
||||
size = std::max( size,
|
||||
int( GetTextExtent( GetColLabelValue( aCol ) + wxS( "M" ) ).x ) );
|
||||
size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + wxS( "M" ) ).x ) );
|
||||
}
|
||||
|
||||
for( int row = 0; aContents && row < GetNumberRows(); row++ )
|
||||
|
@ -854,7 +854,7 @@ wxString DIALOG_CHANGE_SYMBOLS::getSymbolReferences( SCH_SYMBOL& aSymbol,
|
||||
{
|
||||
wxString msg;
|
||||
wxString references;
|
||||
LIB_ID oldId = aSymbol.GetLibId();
|
||||
const LIB_ID& oldId = aSymbol.GetLibId();
|
||||
|
||||
wxString oldLibLinkName; // For report
|
||||
|
||||
|
@ -150,7 +150,7 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind
|
||||
bSizer8->Add( m_checkAll, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
m_updateOptionsSizer->Add( bSizer8, 0, wxEXPAND|wxRIGHT, 10 );
|
||||
m_updateOptionsSizer->Add( bSizer8, 1, wxEXPAND|wxRIGHT, 10 );
|
||||
|
||||
wxBoxSizer* bSizer9;
|
||||
bSizer9 = new wxBoxSizer( wxVERTICAL );
|
||||
@ -191,7 +191,7 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind
|
||||
bSizer9->Add( m_uncheckAll, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
m_updateOptionsSizer->Add( bSizer9, 0, wxEXPAND|wxLEFT, 5 );
|
||||
m_updateOptionsSizer->Add( bSizer9, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerUpdate->Add( m_updateOptionsSizer, 4, wxEXPAND|wxTOP|wxRIGHT, 10 );
|
||||
|
@ -1287,7 +1287,7 @@
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer8</property>
|
||||
@ -1772,8 +1772,8 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer9</property>
|
||||
|
@ -144,9 +144,6 @@ DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
default: UNIMPLEMENTED_FOR( m_currentLabel->GetClass() ); break;
|
||||
}
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_grid->SetTable( m_fields );
|
||||
m_grid->PushEventHandler( new FIELDS_GRID_TRICKS( m_grid, this, {},
|
||||
[&]( wxCommandEvent& aEvent )
|
||||
|
@ -1054,9 +1054,6 @@ DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE( SYMBOL_EDIT_FRAME* parent,
|
||||
for( int i = 0; i < COL_COUNT; ++i )
|
||||
m_originalColWidths[ i ] = m_grid->GetColSize( i );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_grid->SetTable( m_dataModel );
|
||||
m_grid->PushEventHandler( new GRID_TRICKS( m_grid, [this]( wxCommandEvent& aEvent )
|
||||
{
|
||||
|
@ -72,8 +72,6 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a
|
||||
m_embeddedFiles = new PANEL_EMBEDDED_FILES( m_NoteBook, m_libEntry );
|
||||
m_NoteBook->AddPage( m_embeddedFiles, _( "Embedded Files" ) );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
m_fields = new FIELDS_GRID_TABLE( this, aParent, m_grid, m_libEntry,
|
||||
{ m_embeddedFiles->GetLocalFiles() } );
|
||||
m_grid->SetTable( m_fields );
|
||||
@ -116,8 +114,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a
|
||||
|
||||
// wxFormBuilder doesn't include this event...
|
||||
m_grid->Connect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
||||
nullptr, this );
|
||||
wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ), nullptr, this );
|
||||
|
||||
// Forward the delete button to the tricks
|
||||
m_deleteFilterButton->Bind( wxEVT_BUTTON,
|
||||
@ -167,8 +164,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES::~DIALOG_LIB_SYMBOL_PROPERTIES()
|
||||
m_grid->DestroyTable( m_fields );
|
||||
|
||||
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
||||
nullptr, this );
|
||||
wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ), nullptr, this );
|
||||
|
||||
// Delete the GRID_TRICKS.
|
||||
m_grid->PopEventHandler( true );
|
||||
@ -224,8 +220,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
|
||||
|
||||
m_KeywordCtrl->ChangeValue( m_libEntry->GetKeyWords() );
|
||||
m_SelNumberOfUnits->SetValue( m_libEntry->GetUnitCount() );
|
||||
m_OptionPartsInterchangeable->SetValue( !m_libEntry->UnitsLocked() ||
|
||||
m_libEntry->GetUnitCount() == 1 );
|
||||
m_OptionPartsInterchangeable->SetValue( !m_libEntry->UnitsLocked() || m_libEntry->GetUnitCount() == 1 );
|
||||
|
||||
// If a symbol contains no body-style-specific pins or graphic items,
|
||||
// symbol->HasAlternateBodyStyle() will return false.
|
||||
@ -513,8 +508,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||
m_libEntry->SetName( newName );
|
||||
m_libEntry->SetKeyWords( m_KeywordCtrl->GetValue() );
|
||||
m_libEntry->SetUnitCount( m_SelNumberOfUnits->GetValue() );
|
||||
m_libEntry->LockUnits( m_libEntry->GetUnitCount() > 1 &&
|
||||
!m_OptionPartsInterchangeable->GetValue() );
|
||||
m_libEntry->LockUnits( m_libEntry->GetUnitCount() > 1 && !m_OptionPartsInterchangeable->GetValue() );
|
||||
m_libEntry->SetHasAlternateBodyStyle( m_hasAlternateBodyStyles->GetValue() );
|
||||
m_Parent->SetShowDeMorgan( m_hasAlternateBodyStyles->GetValue() );
|
||||
|
||||
@ -608,8 +602,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event )
|
||||
|
||||
if( newName.CmpNoCase( m_grid->GetCellValue( i, FDC_NAME ) ) == 0 )
|
||||
{
|
||||
DisplayError( this, wxString::Format( _( "The name '%s' is already in use." ),
|
||||
newName ) );
|
||||
DisplayError( this, wxString::Format( _( "The name '%s' is already in use." ), newName ) );
|
||||
event.Veto();
|
||||
m_delayedFocusRow = event.GetRow();
|
||||
m_delayedFocusColumn = event.GetCol();
|
||||
@ -624,10 +617,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event )
|
||||
void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameText( wxCommandEvent& event )
|
||||
{
|
||||
if( m_OptionPower->IsChecked() )
|
||||
{
|
||||
m_grid->SetCellValue( m_fields->GetFieldRow( FIELD_T::VALUE ), FDC_VALUE,
|
||||
m_SymbolNameCtrl->GetValue() );
|
||||
}
|
||||
m_grid->SetCellValue( m_fields->GetFieldRow( FIELD_T::VALUE ), FDC_VALUE, m_SymbolNameCtrl->GetValue() );
|
||||
|
||||
OnModify();
|
||||
}
|
||||
@ -660,8 +650,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField( wxCommandEvent& event )
|
||||
return;
|
||||
|
||||
SYMBOL_EDITOR_SETTINGS* settings = m_Parent->GetSettings();
|
||||
SCH_FIELD newField( m_libEntry, FIELD_T::USER,
|
||||
GetUserFieldName( m_fields->size(), DO_TRANSLATE ) );
|
||||
SCH_FIELD newField( m_libEntry, FIELD_T::USER, GetUserFieldName( m_fields->size(), DO_TRANSLATE ) );
|
||||
|
||||
newField.SetTextSize( VECTOR2I( schIUScale.MilsToIU( settings->m_Defaults.text_size ),
|
||||
schIUScale.MilsToIU( settings->m_Defaults.text_size ) ) );
|
||||
@ -936,8 +925,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
int row = m_grid->GetGridCursorRow();
|
||||
int col = m_grid->GetGridCursorCol();
|
||||
|
||||
if( row == m_fields->GetFieldRow( FIELD_T::VALUE ) && col == FDC_VALUE
|
||||
&& m_OptionPower->IsChecked() )
|
||||
if( row == m_fields->GetFieldRow( FIELD_T::VALUE ) && col == FDC_VALUE && m_OptionPower->IsChecked() )
|
||||
{
|
||||
wxGridCellEditor* editor = m_grid->GetCellEditor( row, col );
|
||||
m_SymbolNameCtrl->ChangeValue( editor->GetValue() );
|
||||
@ -982,7 +970,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
{
|
||||
m_delayedFocusCtrl->SetFocus();
|
||||
|
||||
if( auto textEntry = dynamic_cast<wxTextEntry*>( m_delayedFocusCtrl ) )
|
||||
if( wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_delayedFocusCtrl ) )
|
||||
textEntry->SelectAll();
|
||||
|
||||
m_delayedFocusCtrl = nullptr;
|
||||
|
@ -170,10 +170,7 @@ DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES( SYMBOL_EDIT_FRAME* parent, SCH_PIN
|
||||
const std::vector<BITMAPS>& orientationIcons = PinOrientationIcons();
|
||||
|
||||
for ( unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
|
||||
{
|
||||
m_choiceOrientation->Insert( orientationNames[ii], KiBitmapBundle( orientationIcons[ii] ),
|
||||
ii );
|
||||
}
|
||||
m_choiceOrientation->Insert( orientationNames[ii], KiBitmapBundle( orientationIcons[ii] ), ii );
|
||||
|
||||
// We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
|
||||
// implementation on MSW
|
||||
@ -197,8 +194,7 @@ DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES( SYMBOL_EDIT_FRAME* parent, SCH_PIN
|
||||
|
||||
// Default alternates turndown to whether or not alternates exist, or if we've had it open
|
||||
// before
|
||||
m_alternatesTurndown->Collapse( m_pin->GetAlternates().size() == 0
|
||||
&& !s_alternatesTurndownOpen );
|
||||
m_alternatesTurndown->Collapse( m_pin->GetAlternates().size() == 0 && !s_alternatesTurndownOpen );
|
||||
|
||||
// wxwidgets doesn't call the OnCollapseChange even at init, so we update this value if
|
||||
// the alternates pane defaults to open
|
||||
@ -211,9 +207,6 @@ DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES( SYMBOL_EDIT_FRAME* parent, SCH_PIN
|
||||
for( int i = 0; i < COL_COUNT; ++i )
|
||||
m_originalColWidths[ i ] = m_alternatesGrid->GetColSize( i );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_alternatesGrid->SetDefaultRowSize( m_alternatesGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_alternatesGrid->SetTable( m_alternatesDataModel );
|
||||
m_alternatesGrid->PushEventHandler( new GRID_TRICKS( m_alternatesGrid,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
@ -291,8 +284,7 @@ bool DIALOG_PIN_PROPERTIES::TransferDataToWindow()
|
||||
m_numberSize.SetValue( m_pin->GetNumberTextSize() );
|
||||
m_pinLength.SetValue( m_pin->GetLength() );
|
||||
m_checkApplyToAllParts->Enable( m_pin->GetParentSymbol()->IsMulti() );
|
||||
m_checkApplyToAllParts->SetValue( m_pin->GetParentSymbol()->IsMulti()
|
||||
&& m_pin->GetUnit() == 0 );
|
||||
m_checkApplyToAllParts->SetValue( m_pin->GetParentSymbol()->IsMulti() && m_pin->GetUnit() == 0 );
|
||||
m_checkApplyToAllBodyStyles->SetValue( m_pin->GetBodyStyle() == 0 );
|
||||
m_checkShow->SetValue( m_pin->IsVisible() );
|
||||
|
||||
@ -302,8 +294,7 @@ bool DIALOG_PIN_PROPERTIES::TransferDataToWindow()
|
||||
|
||||
if( m_frame->m_SyncPinEdit )
|
||||
{
|
||||
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( m_infoBar, wxID_ANY,
|
||||
_( "Exit sync pins mode" ),
|
||||
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( m_infoBar, wxID_ANY, _( "Exit sync pins mode" ),
|
||||
wxEmptyString );
|
||||
|
||||
button->Bind( wxEVT_COMMAND_HYPERLINK,
|
||||
@ -483,8 +474,7 @@ void DIALOG_PIN_PROPERTIES::adjustGridColumns()
|
||||
m_alternatesGrid->SetColSize( COL_TYPE, m_originalColWidths[COL_TYPE] );
|
||||
m_alternatesGrid->SetColSize( COL_SHAPE, m_originalColWidths[COL_SHAPE] );
|
||||
|
||||
m_alternatesGrid->SetColSize( COL_NAME, width - m_originalColWidths[COL_TYPE]
|
||||
- m_originalColWidths[COL_SHAPE] );
|
||||
m_alternatesGrid->SetColSize( COL_NAME, width - m_originalColWidths[COL_TYPE] - m_originalColWidths[COL_SHAPE] );
|
||||
}
|
||||
|
||||
|
||||
|
@ -432,7 +432,7 @@ void DIALOG_PLOT_SCHEMATIC::plotSchematic( bool aPlotAll )
|
||||
plotOpts.m_PDFMetadata = m_plotPDFMetadata->GetValue();
|
||||
plotOpts.m_outputDirectory = getOutputPath();
|
||||
plotOpts.m_pageSizeSelect = m_pageSizeSelect;
|
||||
plotOpts.m_plotHopOver = cfg ? cfg->m_Appearance.show_hop_over : false;
|
||||
plotOpts.m_plotHopOver = m_editFrame->Schematic().Settings().m_HopOverScale > 0.0;
|
||||
|
||||
schPlotter->Plot( GetPlotFileFormat(), plotOpts, &renderSettings, &m_MessagesBox->Reporter() );
|
||||
|
||||
|
@ -68,9 +68,6 @@ DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_S
|
||||
m_delayedFocusRow = 0;
|
||||
m_delayedFocusColumn = FDC_VALUE;
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_grid->SetTable( m_fields );
|
||||
m_grid->PushEventHandler( new FIELDS_GRID_TRICKS( m_grid, this, { &aParent->Schematic() },
|
||||
[&]( wxCommandEvent& aEvent )
|
||||
|
@ -282,9 +282,6 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent,
|
||||
m_grid->PushEventHandler( new FIELDS_EDITOR_GRID_TRICKS( this, m_grid, m_fieldsCtrl,
|
||||
m_dataModel, &m_parent->Schematic() ) );
|
||||
|
||||
// give a bit more room for comboboxes
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
// Load our BOM view presets
|
||||
SetUserBomPresets( m_schSettings.m_BomPresets );
|
||||
|
||||
|
@ -329,10 +329,6 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||
|
||||
m_fields = new FIELDS_GRID_TABLE( this, aParent, m_fieldsGrid, m_symbol );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_fieldsGrid->SetDefaultRowSize( m_fieldsGrid->GetDefaultRowSize() + 4 );
|
||||
m_pinGrid->SetDefaultRowSize( m_pinGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_fieldsGrid->SetTable( m_fields );
|
||||
m_fieldsGrid->PushEventHandler( new FIELDS_GRID_TRICKS( m_fieldsGrid, this,
|
||||
{ &aParent->Schematic(), m_part },
|
||||
|
@ -40,10 +40,6 @@ DIALOG_USER_DEFINED_SIGNALS::DIALOG_USER_DEFINED_SIGNALS( SIMULATOR_FRAME* aPare
|
||||
{
|
||||
m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) );
|
||||
|
||||
// Give a little more room for Scintilla text editor (which otherwise likes to scroll
|
||||
// on every other keystroke).
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
attr->SetReadOnly();
|
||||
m_grid->SetColAttr( 1, attr );
|
||||
|
@ -62,7 +62,6 @@ void PANEL_EESCHEMA_DISPLAY_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* cf
|
||||
m_checkShowOPVoltages->SetValue( cfg->m_Appearance.show_op_voltages );
|
||||
m_checkShowPinAltModeIcons->SetValue( cfg->m_Appearance.show_op_currents );
|
||||
m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
|
||||
m_cbHopOver->SetValue( cfg->m_Appearance.show_hop_over );
|
||||
|
||||
m_checkSelDrawChildItems->SetValue( cfg->m_Selection.draw_selected_children );
|
||||
m_checkSelFillShapes->SetValue( cfg->m_Selection.fill_shapes );
|
||||
@ -105,7 +104,6 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||
cfg->m_Appearance.show_op_currents = m_checkShowOPCurrents->GetValue();
|
||||
cfg->m_Appearance.show_pin_alt_icons = m_checkShowPinAltModeIcons->GetValue();
|
||||
cfg->m_Appearance.show_page_limits = m_checkPageLimits->GetValue();
|
||||
cfg->m_Appearance.show_hop_over = m_cbHopOver->GetValue();
|
||||
|
||||
cfg->m_Selection.draw_selected_children = m_checkSelDrawChildItems->GetValue();
|
||||
cfg->m_Selection.fill_shapes = m_checkSelFillShapes->GetValue();
|
||||
|
@ -135,11 +135,6 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
|
||||
m_checkPageLimits->SetValue(true);
|
||||
bAppearanceSizer->Add( m_checkPageLimits, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_cbHopOver = new wxCheckBox( this, wxID_ANY, _("Hop hover on wire crossing"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbHopOver->SetToolTip( _("Show a hop hover when two wires are crossing") );
|
||||
|
||||
bAppearanceSizer->Add( m_cbHopOver, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bRightColumn->Add( bAppearanceSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
|
||||
|
||||
|
@ -1432,71 +1432,6 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<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">0</property>
|
||||
<property name="aui_name"></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="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<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>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Hop hover on wire crossing</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbHopOver</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Show a hop hover when two wires are crossing</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
|
@ -58,7 +58,6 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||
wxCheckBox* m_checkShowOPCurrents;
|
||||
wxCheckBox* m_checkShowPinAltModeIcons;
|
||||
wxCheckBox* m_checkPageLimits;
|
||||
wxCheckBox* m_cbHopOver;
|
||||
wxStaticText* m_selectionLabel;
|
||||
wxStaticLine* m_staticline2;
|
||||
wxCheckBox* m_checkSelDrawChildItems;
|
||||
|
@ -95,6 +95,7 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow()
|
||||
m_lineWidth.SetValue( settings.m_DefaultLineWidth );
|
||||
m_pinSymbolSize.SetValue( settings.m_PinSymbolSize );
|
||||
m_choiceJunctionDotSize->SetSelection( settings.m_JunctionSizeChoice );
|
||||
m_choiceHopOverSize->SetSelection( settings.m_HopOverSizeChoice );
|
||||
m_connectionGridSize.SetValue( settings.m_ConnectionGridSize );
|
||||
|
||||
m_showIntersheetsReferences->SetValue( settings.m_IntersheetRefsShow );
|
||||
@ -162,6 +163,9 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
|
||||
if( m_choiceJunctionDotSize->GetSelection() != wxNOT_FOUND )
|
||||
settings.m_JunctionSizeChoice = m_choiceJunctionDotSize->GetSelection();
|
||||
|
||||
if( m_choiceHopOverSize->GetSelection() != wxNOT_FOUND )
|
||||
settings.m_HopOverSizeChoice = m_choiceHopOverSize->GetSelection();
|
||||
|
||||
settings.m_IntersheetRefsShow = m_showIntersheetsReferences->GetValue();
|
||||
settings.m_IntersheetRefsFormatShort = !m_radioFormatStandard->GetValue();
|
||||
settings.m_IntersheetRefsPrefix = m_prefixCtrl->GetValue();
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -155,9 +155,9 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi
|
||||
gbSizer1->SetFlexibleDirection( wxBOTH );
|
||||
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticText261 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Junction dot size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText261->Wrap( -1 );
|
||||
gbSizer1->Add( m_staticText261, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_junctionDotLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Junction dot size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_junctionDotLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_junctionDotLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
wxString m_choiceJunctionDotSizeChoices[] = { _("None"), _("Smallest"), _("Small"), _("Default"), _("Large"), _("Largest") };
|
||||
int m_choiceJunctionDotSizeNChoices = sizeof( m_choiceJunctionDotSizeChoices ) / sizeof( wxString );
|
||||
@ -165,16 +165,26 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi
|
||||
m_choiceJunctionDotSize->SetSelection( 3 );
|
||||
gbSizer1->Add( m_choiceJunctionDotSize, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_hopOverLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Hop-over size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_hopOverLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_hopOverLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
wxString m_choiceHopOverSizeChoices[] = { _("None"), _("Smallest"), _("Small"), _("Medium"), _("Large"), _("Largest") };
|
||||
int m_choiceHopOverSizeNChoices = sizeof( m_choiceHopOverSizeChoices ) / sizeof( wxString );
|
||||
m_choiceHopOverSize = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHopOverSizeNChoices, m_choiceHopOverSizeChoices, 0 );
|
||||
m_choiceHopOverSize->SetSelection( 0 );
|
||||
gbSizer1->Add( m_choiceHopOverSize, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_connectionGridLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Connection grid:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_connectionGridLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_connectionGridLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
gbSizer1->Add( m_connectionGridLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_connectionGridCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_connectionGridCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
gbSizer1->Add( m_connectionGridCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_connectionGridUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_connectionGridUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_connectionGridUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
gbSizer1->Add( m_connectionGridUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
gbSizer1->AddGrowableCol( 1 );
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -61,8 +61,10 @@ class PANEL_SETUP_FORMATTING_BASE : public wxPanel
|
||||
wxStaticText* m_pinSymbolSizeLabel;
|
||||
wxTextCtrl* m_pinSymbolSizeCtrl;
|
||||
wxStaticText* m_pinSymbolSizeUnits;
|
||||
wxStaticText* m_staticText261;
|
||||
wxStaticText* m_junctionDotLabel;
|
||||
wxChoice* m_choiceJunctionDotSize;
|
||||
wxStaticText* m_hopOverLabel;
|
||||
wxChoice* m_choiceHopOverSize;
|
||||
wxStaticText* m_connectionGridLabel;
|
||||
wxTextCtrl* m_connectionGridCtrl;
|
||||
wxStaticText* m_connectionGridUnits;
|
||||
|
@ -451,8 +451,7 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||
wxYES_NO | wxCENTER | wxICON_QUESTION | wxYES_DEFAULT );
|
||||
badCellDlg.SetExtendedMessage( _( "Empty cells will result in all rows that are "
|
||||
"invalid to be removed from the table." ) );
|
||||
badCellDlg.SetYesNoLabels(
|
||||
wxMessageDialog::ButtonLabel( _( "Remove Invalid Cells" ) ),
|
||||
badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Remove Invalid Cells" ) ),
|
||||
wxMessageDialog::ButtonLabel( _( "Cancel Table Update" ) ) );
|
||||
|
||||
wait.reset();
|
||||
@ -526,8 +525,8 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||
|
||||
if( nick1 == nick2 )
|
||||
{
|
||||
msg = wxString::Format( _( "Multiple libraries cannot share the same "
|
||||
"nickname ('%s')." ), nick1 );
|
||||
msg = wxString::Format( _( "Multiple libraries cannot share the same nickname ('%s')." ),
|
||||
nick1 );
|
||||
|
||||
// show the tabbed panel holding the grid we have flunked:
|
||||
if( model != cur_model() )
|
||||
@ -580,8 +579,7 @@ bool PANEL_SYM_LIB_TABLE::verifyTables()
|
||||
|
||||
wxWindow* topLevelParent = wxGetTopLevelParent( this );
|
||||
wait.reset();
|
||||
wxMessageDialog errdlg( topLevelParent, msg + wxS( "\n" ) + ioe.What(),
|
||||
_( "Error Loading Library" ) );
|
||||
wxMessageDialog errdlg( topLevelParent, msg + wxS( "\n" ) + ioe.What(), _( "Error Loading Library" ) );
|
||||
errdlg.ShowModal();
|
||||
|
||||
return true;
|
||||
@ -983,11 +981,9 @@ void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries( wxCommandEvent& event )
|
||||
std::unique_ptr<std::map<std::string, UTF8>> props(
|
||||
LIB_TABLE::ParseOptions( options.ToStdString() ) );
|
||||
|
||||
if( SCH_IO_MGR::ConvertLibrary( props.get(),
|
||||
legacyLib.GetFullPath(), newLib.GetFullPath() ) )
|
||||
if( SCH_IO_MGR::ConvertLibrary( props.get(), legacyLib.GetFullPath(), newLib.GetFullPath() ) )
|
||||
{
|
||||
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(),
|
||||
m_project );
|
||||
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(), m_project );
|
||||
|
||||
// Do not use the project path in the global library table. This will almost
|
||||
// assuredly be wrong for a different project.
|
||||
@ -1090,10 +1086,6 @@ void PANEL_SYM_LIB_TABLE::populateEnvironReadOnlyTable()
|
||||
m_path_subs_grid->SetCellEditor( row, 1, new GRID_CELL_READONLY_TEXT_EDITOR() );
|
||||
}
|
||||
|
||||
// No combobox editors here, but it looks better if its consistent with the other
|
||||
// grids in the dialog.
|
||||
m_path_subs_grid->SetDefaultRowSize( m_path_subs_grid->GetDefaultRowSize() + 2 );
|
||||
|
||||
adjustPathSubsGridColumns( m_path_subs_grid->GetRect().GetWidth() );
|
||||
}
|
||||
|
||||
@ -1164,8 +1156,7 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
|
||||
if( symbolEditor->HasLibModifications() )
|
||||
{
|
||||
msg = _( "Modifications have been made to one or more symbol libraries.\n"
|
||||
"Changes must be saved or discarded before the symbol library "
|
||||
"table can be modified." );
|
||||
"Changes must be saved or discarded before the symbol library table can be modified." );
|
||||
|
||||
switch( UnsavedChangesDialog( aParent, msg ) )
|
||||
{
|
||||
@ -1218,9 +1209,7 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
|
||||
}
|
||||
|
||||
if( symbolEditor )
|
||||
{
|
||||
symbolEditor->ThawLibraryTree();
|
||||
}
|
||||
|
||||
std::string payload = "";
|
||||
aKiway->ExpressMail( FRAME_SCH, MAIL_RELOAD_LIB, payload );
|
||||
|
@ -60,6 +60,7 @@ bool SCH_EDIT_FRAME::LoadProjectSettings()
|
||||
{
|
||||
SCHEMATIC_SETTINGS& settings = Schematic().Settings();
|
||||
settings.m_JunctionSize = GetSchematicJunctionSize();
|
||||
settings.m_HopOverScale = GetSchematicHopOverScale();
|
||||
|
||||
GetRenderSettings()->SetDefaultPenWidth( settings.m_DefaultLineWidth );
|
||||
GetRenderSettings()->m_LabelSizeRatio = settings.m_LabelSizeRatio;
|
||||
@ -111,9 +112,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
|
||||
if( !dialogLock.owns_lock() )
|
||||
{
|
||||
if( m_schematicSetupDialog && m_schematicSetupDialog->IsShown() )
|
||||
{
|
||||
m_schematicSetupDialog->Raise(); // Brings the existing dialog to the front
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@ -133,7 +132,8 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
|
||||
dlg.SetInitialPage( aInitialPage, wxEmptyString );
|
||||
|
||||
// Assign dlg to the m_schematicSetupDialog pointer to track its status.
|
||||
m_schematicSetupDialog = &dlg;
|
||||
// No, this does not escape the function context.
|
||||
NULLER raii_nuller( (void*&) m_schematicSetupDialog ); m_schematicSetupDialog = &dlg;
|
||||
|
||||
// TODO: is QuasiModal required here?
|
||||
if( dlg.ShowQuasiModal() == wxID_OK )
|
||||
@ -161,8 +161,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
|
||||
|
||||
std::vector<std::shared_ptr<BUS_ALIAS>> newAliases;
|
||||
|
||||
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr;
|
||||
screen = screens.GetNext() )
|
||||
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
|
||||
{
|
||||
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
|
||||
newAliases.push_back( alias );
|
||||
@ -174,9 +173,6 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
|
||||
RefreshOperatingPointDisplay();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
// Reset m_schematicSetupDialog after the dialog is closed
|
||||
m_schematicSetupDialog = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -186,12 +182,20 @@ int SCH_EDIT_FRAME::GetSchematicJunctionSize()
|
||||
|
||||
const std::shared_ptr<NET_SETTINGS>& netSettings = Prj().GetProjectFile().NetSettings();
|
||||
int sizeChoice = Schematic().Settings().m_JunctionSizeChoice;
|
||||
int dotSize = netSettings->GetDefaultNetclass()->GetWireWidth() * sizeMultipliers[sizeChoice];
|
||||
int dotSize = KiROUND( netSettings->GetDefaultNetclass()->GetWireWidth() * sizeMultipliers[sizeChoice] );
|
||||
|
||||
return std::max( dotSize, 1 );
|
||||
}
|
||||
|
||||
|
||||
double SCH_EDIT_FRAME::GetSchematicHopOverScale()
|
||||
{
|
||||
std::vector<double>& sizeMultipliers = eeconfig()->m_Drawing.junction_size_mult_list;
|
||||
|
||||
return sizeMultipliers[Schematic().Settings().m_HopOverSizeChoice];
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::saveProjectSettings()
|
||||
{
|
||||
wxFileName fn = Schematic().RootScreen()->GetFileName(); //ConfigFileName
|
||||
@ -209,8 +213,7 @@ void SCH_EDIT_FRAME::saveProjectSettings()
|
||||
// Save the page layout file if doesn't exist yet (e.g. if we opened a non-kicad schematic)
|
||||
|
||||
// TODO: We need to remove dependence on BASE_SCREEN
|
||||
Prj().GetProjectFile().m_SchematicSettings->m_SchDrawingSheetFileName
|
||||
= BASE_SCREEN::m_DrawingSheetFileName;
|
||||
Prj().GetProjectFile().m_SchematicSettings->m_SchDrawingSheetFileName = BASE_SCREEN::m_DrawingSheetFileName;
|
||||
|
||||
if( !BASE_SCREEN::m_DrawingSheetFileName.IsEmpty() )
|
||||
{
|
||||
@ -303,8 +306,7 @@ void SCH_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||
cfg->m_FindReplaceExtra.search_all_fields = searchData->searchAllFields;
|
||||
cfg->m_FindReplaceExtra.search_metadata = searchData->searchMetadata;
|
||||
cfg->m_FindReplaceExtra.search_all_pins = searchData->searchAllPins;
|
||||
cfg->m_FindReplaceExtra.search_current_sheet_only =
|
||||
searchData->searchCurrentSheetOnly;
|
||||
cfg->m_FindReplaceExtra.search_current_sheet_only = searchData->searchCurrentSheetOnly;
|
||||
cfg->m_FindReplaceExtra.search_selected_only = searchData->searchSelectedOnly;
|
||||
}
|
||||
|
||||
@ -338,7 +340,9 @@ void SCH_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||
cfg->m_AuiPanels.design_blocks_show = designBlocksPane.IsShown();
|
||||
|
||||
if( designBlocksPane.IsDocked() )
|
||||
{
|
||||
cfg->m_AuiPanels.design_blocks_panel_docked_width = m_designBlocksPane->GetSize().x;
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg->m_AuiPanels.design_blocks_panel_float_height = designBlocksPane.floating_size.y;
|
||||
@ -362,7 +366,8 @@ void SCH_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||
// Move legacy user grids to grid list
|
||||
if( !aCfg->m_Window.grid.user_grid_x.empty() )
|
||||
{
|
||||
aCfg->m_Window.grid.grids.emplace_back( GRID{ "User Grid", aCfg->m_Window.grid.user_grid_x,
|
||||
aCfg->m_Window.grid.grids.emplace_back( GRID{ "User Grid",
|
||||
aCfg->m_Window.grid.user_grid_x,
|
||||
aCfg->m_Window.grid.user_grid_y } );
|
||||
aCfg->m_Window.grid.user_grid_x = wxEmptyString;
|
||||
aCfg->m_Window.grid.user_grid_y = wxEmptyString;
|
||||
@ -378,10 +383,8 @@ void SCH_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||
aCfg->m_Window.grid.fast_grid_2 = 2;
|
||||
|
||||
if( aCfg->m_Window.zoom_factors.empty() )
|
||||
{
|
||||
aCfg->m_Window.zoom_factors = { ZOOM_LIST_EESCHEMA };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SCH_BASE_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||
|
@ -244,9 +244,6 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<bool>( "appearance.show_page_limits",
|
||||
&m_Appearance.show_page_limits, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "appearance.show_hop_over",
|
||||
&m_Appearance.show_hop_over, false ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "appearance.show_sexpr_file_convert_warning",
|
||||
&m_Appearance.show_sexpr_file_convert_warning, true ) );
|
||||
|
||||
@ -388,6 +385,9 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<int>( "drawing.junction_size_choice",
|
||||
&m_Drawing.junction_size_choice, 3 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "drawing.hop_over_size_choice",
|
||||
&m_Drawing.hop_over_size_choice, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "find_replace.search_all_fields",
|
||||
&m_FindReplaceExtra.search_all_fields, false ) );
|
||||
|
||||
|
@ -87,7 +87,6 @@ public:
|
||||
bool show_pin_alt_icons;
|
||||
bool show_illegal_symbol_lib_dialog;
|
||||
bool show_page_limits;
|
||||
bool show_hop_over;
|
||||
bool show_sexpr_file_convert_warning;
|
||||
bool show_sheet_filename_case_sensitivity_dialog;
|
||||
};
|
||||
@ -179,8 +178,9 @@ public:
|
||||
bool auto_start_wires;
|
||||
std::vector<double> junction_size_mult_list;
|
||||
|
||||
// Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
|
||||
// Pulldown index for user default junction dot size (e.g. none = 0, smallest = 1, small = 2, etc)
|
||||
int junction_size_choice;
|
||||
int hop_over_size_choice;
|
||||
};
|
||||
|
||||
struct INPUT
|
||||
|
@ -1903,6 +1903,7 @@ void SCH_EDIT_FRAME::CommonSettingsChanged( int aFlags )
|
||||
SCHEMATIC_SETTINGS& settings = Schematic().Settings();
|
||||
|
||||
settings.m_JunctionSize = GetSchematicJunctionSize();
|
||||
settings.m_HopOverScale = GetSchematicHopOverScale();
|
||||
|
||||
ShowAllIntersheetRefs( settings.m_IntersheetRefsShow );
|
||||
|
||||
@ -1929,8 +1930,18 @@ void SCH_EDIT_FRAME::CommonSettingsChanged( int aFlags )
|
||||
SCH_SCREEN* screen = GetCurrentSheet().LastScreen();
|
||||
|
||||
for( SCH_ITEM* item : screen->Items() )
|
||||
{
|
||||
item->ClearCaches();
|
||||
|
||||
if( item->Type() == SCH_LINE_T )
|
||||
{
|
||||
SCH_LINE* line = static_cast<SCH_LINE*>( item );
|
||||
|
||||
if( line->IsWire() )
|
||||
UpdateHopOveredWires( line );
|
||||
}
|
||||
}
|
||||
|
||||
for( const auto& [ libItemName, libSymbol ] : screen->GetLibSymbols() )
|
||||
libSymbol->ClearCaches();
|
||||
|
||||
|
@ -767,6 +767,7 @@ public:
|
||||
const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
|
||||
|
||||
int GetSchematicJunctionSize();
|
||||
double GetSchematicHopOverScale();
|
||||
|
||||
void FocusOnItem( EDA_ITEM* aItem ) override;
|
||||
|
||||
|
@ -1096,7 +1096,8 @@ std::vector<VECTOR3I> SCH_LINE::BuildWireWithHopShape( const SCH_SCREEN* aScreen
|
||||
}
|
||||
else
|
||||
{
|
||||
auto getDistance = []( const VECTOR2I& a, const VECTOR2I& b ) -> double
|
||||
auto getDistance =
|
||||
[]( const VECTOR2I& a, const VECTOR2I& b ) -> double
|
||||
{
|
||||
return std::sqrt( std::pow( a.x - b.x, 2 ) + std::pow( a.y - b.y, 2 ) );
|
||||
};
|
||||
@ -1137,7 +1138,7 @@ std::vector<VECTOR3I> SCH_LINE::BuildWireWithHopShape( const SCH_SCREEN* aScreen
|
||||
VECTOR2I arcMidPoint = {
|
||||
hopMid.x + static_cast<int>( arcRadius
|
||||
* cos( ( startAngleRad + endAngleRad ) / 2.0f ) ),
|
||||
hopMid.y + static_cast<int>( arcRadius
|
||||
hopMid.y - static_cast<int>( arcRadius
|
||||
* sin( ( startAngleRad + endAngleRad ) / 2.0f ) )
|
||||
};
|
||||
|
||||
|
@ -1364,11 +1364,13 @@ void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer )
|
||||
bool highlightNetclassColors = false;
|
||||
double highlightAlpha = 0.6;
|
||||
EESCHEMA_SETTINGS* eeschemaCfg = eeconfig();
|
||||
bool showHopOver = false;
|
||||
double hopOverScale = 0.0;
|
||||
|
||||
if( aLine->Schematic() ) // Can be nullptr when run from the color selection panel
|
||||
hopOverScale = aLine->Schematic()->Settings().m_HopOverScale;
|
||||
|
||||
if( eeschemaCfg )
|
||||
{
|
||||
showHopOver = eeschemaCfg->m_Appearance.show_hop_over;
|
||||
highlightNetclassColors = eeschemaCfg->m_Selection.highlight_netclass_colors;
|
||||
highlightAlpha = eeschemaCfg->m_Selection.highlight_netclass_colors_alpha;
|
||||
}
|
||||
@ -1485,10 +1487,10 @@ void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer )
|
||||
|
||||
std::vector<VECTOR3I> curr_wire_shape;
|
||||
|
||||
if( aLine->IsWire() && showHopOver )
|
||||
if( aLine->IsWire() && hopOverScale > 0.0 )
|
||||
{
|
||||
double lineWidth = getLineWidth( aLine, false, drawingNetColorHighlights );
|
||||
double arcRadius = lineWidth * ADVANCED_CFG::GetCfg().m_hopOverArcRadius;
|
||||
double arcRadius = lineWidth * hopOverScale;
|
||||
curr_wire_shape = aLine->BuildWireWithHopShape( m_schematic->GetCurrentScreen(), arcRadius );
|
||||
}
|
||||
else
|
||||
|
@ -925,10 +925,12 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_OPTS& aPlotOpts ) const
|
||||
SCH_LINE* aLine = static_cast<SCH_LINE*>( item );
|
||||
|
||||
if( !aLine->IsWire() || !aPlotOpts.m_plotHopOver )
|
||||
{
|
||||
item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
double arcRadius = lineWidth * ADVANCED_CFG::GetCfg().m_hopOverArcRadius;
|
||||
double arcRadius = lineWidth * aLine->Schematic()->Settings().m_HopOverScale;
|
||||
std::vector<VECTOR3I> curr_wire_shape = aLine->BuildWireWithHopShape( this, arcRadius );
|
||||
|
||||
for( size_t ii = 1; ii < curr_wire_shape.size(); ii++ )
|
||||
|
@ -45,6 +45,8 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
||||
m_PinSymbolSize( DEFAULT_TEXT_SIZE * schIUScale.IU_PER_MILS / 2 ),
|
||||
m_JunctionSizeChoice( 3 ),
|
||||
m_JunctionSize( DEFAULT_JUNCTION_DIAM * schIUScale.IU_PER_MILS ),
|
||||
m_HopOverSizeChoice( 0 ),
|
||||
m_HopOverScale( 0.0 ),
|
||||
m_ConnectionGridSize( DEFAULT_CONNECTION_GRID_MILS * schIUScale.IU_PER_MILS ),
|
||||
m_AnnotateStartNum( 0 ),
|
||||
m_IntersheetRefsShow( false ),
|
||||
@ -73,6 +75,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
||||
int defaultTextSize = cfg ? cfg->m_Drawing.default_text_size : DEFAULT_TEXT_SIZE;
|
||||
int defaultPinSymbolSize = cfg ? cfg->m_Drawing.pin_symbol_size : DEFAULT_TEXT_SIZE / 2;
|
||||
int defaultJunctionSizeChoice = cfg ? cfg->m_Drawing.junction_size_choice : 3;
|
||||
int defaultHopOverSizeChoice = cfg ? cfg->m_Drawing.hop_over_size_choice : 0;
|
||||
bool defaultIntersheetsRefShow = cfg ? cfg->m_Drawing.intersheets_ref_show : false;
|
||||
bool defaultIntersheetsRefOwnPage = cfg ? cfg->m_Drawing.intersheets_ref_own_page : true;
|
||||
bool defaultIntersheetsRefFormatShort = cfg ? cfg->m_Drawing.intersheets_ref_short : false;
|
||||
@ -146,6 +149,9 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
||||
m_params.emplace_back( new PARAM<int>( "drawing.junction_size_choice",
|
||||
&m_JunctionSizeChoice, defaultJunctionSizeChoice ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "drawing.hop_over_size_choice",
|
||||
&m_HopOverSizeChoice, defaultHopOverSizeChoice ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "drawing.field_names",
|
||||
[&]() -> nlohmann::json
|
||||
{
|
||||
|
@ -62,6 +62,9 @@ public:
|
||||
int m_JunctionSizeChoice; // none = 0, smallest = 1, small = 2, etc.
|
||||
int m_JunctionSize; // a runtime cache of the calculated size
|
||||
|
||||
int m_HopOverSizeChoice; // none = 0, smallest = 1, etc.
|
||||
double m_HopOverScale; // a runtime cache of the calculated lineWidth multiplier
|
||||
|
||||
int m_ConnectionGridSize; // usually 50mils (IU internally; mils in the JSON file)
|
||||
|
||||
int m_AnnotateStartNum; // Starting value for annotation
|
||||
|
@ -559,7 +559,7 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
SetSheetNumberAndCount();
|
||||
|
||||
// Restore hop over shapes of wires, if any
|
||||
if( eeconfig()->m_Appearance.show_hop_over )
|
||||
if( m_schematic->Settings().m_HopOverScale > 0.0 )
|
||||
{
|
||||
for( SCH_ITEM* item : GetScreen()->Items() )
|
||||
{
|
||||
|
@ -713,15 +713,6 @@ public:
|
||||
*/
|
||||
double m_MinimumMarkerSeparationDistance;
|
||||
|
||||
/**
|
||||
* Default value for the Hop-Over Arc Radius, used to calculate the arc radius by multiplying
|
||||
* the line width when drawing a hop-over in scenarios where a wire crosses another.
|
||||
*
|
||||
* Setting name: "HopOverArcRadius"
|
||||
* Default value: 2.5
|
||||
*/
|
||||
double m_hopOverArcRadius;
|
||||
|
||||
/**
|
||||
* When updating the net inspector, it either recalculates all nets or iterates through items
|
||||
* one-by-one. This value controls the threshold at which all nets are recalculated rather than
|
||||
|
@ -36,10 +36,17 @@
|
||||
#include <wx/richmsgdlg.h>
|
||||
|
||||
|
||||
#if defined( _WIN32 ) && wxCHECK_VERSION( 3, 3, 0 )
|
||||
#define KIDIALOG_BASE wxGenericRichMessageDialog
|
||||
#else
|
||||
#define KIDIALOG_BASE wxRichMessageDialog
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
|
||||
*/
|
||||
class KICOMMON_API KIDIALOG : public wxRichMessageDialog
|
||||
class KICOMMON_API KIDIALOG : public KIDIALOG_BASE
|
||||
{
|
||||
public:
|
||||
///< Dialog type. Selects appropriate icon and default dialog title
|
||||
@ -53,7 +60,7 @@ public:
|
||||
bool SetOKCancelLabels( const ButtonLabel& ok, const ButtonLabel& cancel ) override
|
||||
{
|
||||
m_cancelMeansCancel = false;
|
||||
return wxRichMessageDialog::SetOKCancelLabels( ok, cancel );
|
||||
return KIDIALOG_BASE::SetOKCancelLabels( ok, cancel );
|
||||
}
|
||||
|
||||
/// Shows the 'do not show again' checkbox.
|
||||
|
@ -160,10 +160,6 @@ void DIALOG_EXECUTECOMMAND_JOB_SETTINGS::populateEnvironReadOnlyTable()
|
||||
m_path_subs_grid->SetCellEditor( row, 1, new GRID_CELL_READONLY_TEXT_EDITOR() );
|
||||
}
|
||||
|
||||
// No combobox editors here, but it looks better if its consistent with the other
|
||||
// grids in the dialog.
|
||||
m_path_subs_grid->SetDefaultRowSize( m_path_subs_grid->GetDefaultRowSize() + 2 );
|
||||
|
||||
adjustPathSubsGridColumns( m_path_subs_grid->GetRect().GetWidth() );
|
||||
}
|
||||
|
||||
|
@ -149,10 +149,7 @@ public:
|
||||
|
||||
if( m_destination->m_lastRunReporters.contains( jobId ) )
|
||||
{
|
||||
WX_STRING_REPORTER* reporter =
|
||||
static_cast<WX_STRING_REPORTER*>( m_destination->m_lastRunReporters[jobId] );
|
||||
|
||||
if( reporter )
|
||||
if( auto* reporter = static_cast<WX_STRING_REPORTER*>( m_destination->m_lastRunReporters[jobId] ) )
|
||||
m_textCtrlOutput->SetValue( reporter->GetMessages() );
|
||||
}
|
||||
else
|
||||
@ -253,9 +250,8 @@ public:
|
||||
{
|
||||
wxClientDC dc( this );
|
||||
int width = GetSize().GetWidth();
|
||||
wxString msg = aMsg;
|
||||
|
||||
m_pathInfo->SetLabel( wxControl::Ellipsize( msg, dc, wxELLIPSIZE_MIDDLE, width ) );
|
||||
m_pathInfo->SetLabel( wxControl::Ellipsize( aMsg, dc, wxELLIPSIZE_MIDDLE, width ) );
|
||||
}
|
||||
|
||||
virtual void OnGenerate( wxCommandEvent& event ) override
|
||||
@ -274,15 +270,14 @@ public:
|
||||
|
||||
JOBS_RUNNER jobRunner( &( m_frame->Kiway() ), m_jobsFile, &project );
|
||||
|
||||
auto* progressReporter = new WX_PROGRESS_REPORTER( m_frame, _( "Run Jobs" ), 1,
|
||||
PR_NO_ABORT );
|
||||
{
|
||||
WX_PROGRESS_REPORTER progressReporter( m_frame, _( "Run Jobs" ), 1, PR_NO_ABORT );
|
||||
|
||||
if( JOBSET_DESTINATION* destination = GetDestination() )
|
||||
jobRunner.RunJobsForDestination( destination );
|
||||
|
||||
UpdateStatus();
|
||||
|
||||
delete progressReporter;
|
||||
}
|
||||
|
||||
// Bring the Kicad manager frame back to the front
|
||||
m_frame->Raise();
|
||||
@ -486,7 +481,6 @@ PANEL_JOBSET::PANEL_JOBSET( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
|
||||
{
|
||||
m_jobsGrid->PushEventHandler( new JOBS_GRID_TRICKS( this, m_jobsGrid ) );
|
||||
|
||||
m_jobsGrid->SetDefaultRowSize( m_jobsGrid->GetDefaultRowSize() + 4 );
|
||||
m_jobsGrid->OverrideMinSize( 0.6, 0.3 );
|
||||
m_jobsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
|
||||
@ -577,11 +571,10 @@ void PANEL_JOBSET::UpdateTitle()
|
||||
tabName = wxS( "*" ) + tabName;
|
||||
|
||||
int pageIdx = m_parentBook->FindPage( this );
|
||||
|
||||
if( pageIdx >= 0 )
|
||||
{
|
||||
m_parentBook->SetPageText( pageIdx, tabName );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PANEL_JOBSET::addDestinationPanel( JOBSET_DESTINATION* aOutput )
|
||||
@ -778,7 +771,10 @@ void PANEL_JOBSET::OnJobButtonDelete( wxCommandEvent& aEvent )
|
||||
m_jobsGrid->ClearSelection();
|
||||
|
||||
// Reverse sort so deleting a row doesn't change the indexes of the other rows.
|
||||
selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
|
||||
selectedRows.Sort( []( int* first, int* second )
|
||||
{
|
||||
return *second - *first;
|
||||
} );
|
||||
|
||||
int select = selectedRows[0];
|
||||
|
||||
@ -995,15 +991,14 @@ void PANEL_JOBSET::OnGenerateAllDestinationsClick( wxCommandEvent& event )
|
||||
|
||||
JOBS_RUNNER jobRunner( &( m_frame->Kiway() ), m_jobsFile.get(), &project );
|
||||
|
||||
auto* progressReporter = new WX_PROGRESS_REPORTER( m_frame, _( "Run Jobs" ), 1,
|
||||
PR_NO_ABORT );
|
||||
{
|
||||
WX_PROGRESS_REPORTER progressReporter( m_frame, _( "Run Jobs" ), 1, PR_NO_ABORT );
|
||||
|
||||
jobRunner.RunJobsAllDestinations();
|
||||
|
||||
for( PANEL_DESTINATION* panel : GetDestinationPanels() )
|
||||
panel->UpdateStatus();
|
||||
|
||||
delete progressReporter;
|
||||
}
|
||||
|
||||
// Bring the Kicad manager frame back to the front
|
||||
m_frame->Raise();
|
||||
@ -1013,8 +1008,7 @@ void PANEL_JOBSET::OnGenerateAllDestinationsClick( wxCommandEvent& event )
|
||||
|
||||
void PANEL_JOBSET::OnSizeGrid( wxSizeEvent& aEvent )
|
||||
{
|
||||
m_jobsGrid->SetColSize( COL_DESCR, m_jobsGrid->GetSize().x
|
||||
- m_jobsGrid->GetColSize( COL_SOURCE )
|
||||
m_jobsGrid->SetColSize( COL_DESCR, m_jobsGrid->GetSize().x - m_jobsGrid->GetColSize( COL_SOURCE )
|
||||
- m_jobsGrid->GetColSize( COL_NUMBER ) );
|
||||
|
||||
// Always propagate for a grid repaint (needed if the height changes, as well as width)
|
||||
|
@ -174,17 +174,17 @@ void DIALOG_BOARD_STATISTICS::refreshItemsTypes()
|
||||
m_viaTypes.push_back( LINE_ITEM<VIATYPE>( VIATYPE::MICROVIA, _( "Micro vias:" ) ) );
|
||||
|
||||
// If there not enough rows in grids, append some
|
||||
int appendRows = m_fpTypes.size() + 2 - m_gridComponents->GetNumberRows();
|
||||
int appendRows = (int) m_fpTypes.size() + 2 - m_gridComponents->GetNumberRows();
|
||||
|
||||
if( appendRows > 0 )
|
||||
m_gridComponents->AppendRows( appendRows );
|
||||
|
||||
appendRows = m_padTypes.size() + 1 - m_gridPads->GetNumberRows();
|
||||
appendRows = (int) m_padTypes.size() + 1 - m_gridPads->GetNumberRows();
|
||||
|
||||
if( appendRows > 0 )
|
||||
m_gridPads->AppendRows( appendRows );
|
||||
|
||||
appendRows = m_viaTypes.size() + 1 - m_gridVias->GetNumberRows();
|
||||
appendRows = (int) m_viaTypes.size() + 1 - m_gridVias->GetNumberRows();
|
||||
|
||||
if( appendRows )
|
||||
m_gridVias->AppendRows( appendRows );
|
||||
@ -403,13 +403,21 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB()
|
||||
// to be taken in account to calculate the physical board bbox
|
||||
BOX2I bbox = polySet.BBox();
|
||||
|
||||
m_boardWidth = bbox.GetWidth();
|
||||
m_boardHeight = bbox.GetHeight();
|
||||
m_boardWidth = (int) bbox.GetWidth();
|
||||
m_boardHeight = (int) bbox.GetHeight();
|
||||
}
|
||||
|
||||
board->RunOnChildren(
|
||||
[&]( BOARD_ITEM* child )
|
||||
{
|
||||
if( child->Type() == PCB_FOOTPRINT_T
|
||||
|| child->Type() == PCB_GROUP_T
|
||||
|| child->Type() == PCB_GENERATOR_T )
|
||||
{
|
||||
// Wait for recursion into children
|
||||
return;
|
||||
}
|
||||
|
||||
if( child->IsOnLayer( F_Cu ) )
|
||||
child->TransformShapeToPolySet( frontCopper, F_Cu, 0, ARC_LOW_DEF, ERROR_INSIDE );
|
||||
|
||||
@ -438,7 +446,8 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB()
|
||||
if( via->IsOnLayer( B_Cu ) )
|
||||
TransformCircleToPolygon( backHoles, center, R, ARC_LOW_DEF, ERROR_OUTSIDE );
|
||||
}
|
||||
}, RECURSE_MODE::RECURSE );
|
||||
},
|
||||
RECURSE_MODE::RECURSE );
|
||||
|
||||
if( m_checkBoxSubtractHolesFromCopper->GetValue() )
|
||||
{
|
||||
@ -595,15 +604,15 @@ void DIALOG_BOARD_STATISTICS::printGridToStringAsTable( wxGrid* aGrid, wxString&
|
||||
if( aUseColLabels )
|
||||
{
|
||||
for( int col = 0; col < aGrid->GetNumberCols(); col++ )
|
||||
widths[col] = aGrid->GetColLabelValue( col ).length();
|
||||
widths[col] = (int) aGrid->GetColLabelValue( col ).length();
|
||||
}
|
||||
|
||||
for( int row = 0; row < aGrid->GetNumberRows(); row++ )
|
||||
{
|
||||
rowLabelsWidth = std::max<int>( rowLabelsWidth, aGrid->GetRowLabelValue( row ).length() );
|
||||
rowLabelsWidth = std::max( rowLabelsWidth, (int) aGrid->GetRowLabelValue( row ).length() );
|
||||
|
||||
for( int col = 0; col < aGrid->GetNumberCols(); col++ )
|
||||
widths[col] = std::max<int>( widths[col], aGrid->GetCellValue( row, col ).length() );
|
||||
widths[col] = std::max( widths[col], (int) aGrid->GetCellValue( row, col ).length() );
|
||||
}
|
||||
|
||||
// Print the cells.
|
||||
@ -783,7 +792,7 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
|
||||
widths.reserve( labels.size() );
|
||||
|
||||
for( const wxString& label : labels )
|
||||
widths.push_back( label.size() );
|
||||
widths.push_back( (int) label.size() );
|
||||
|
||||
int frontTotal = 0;
|
||||
int backTotal = 0;
|
||||
@ -791,18 +800,18 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent )
|
||||
for( const FP_LINE_ITEM& line : m_fpTypes )
|
||||
{
|
||||
// Get maximum width for left label column
|
||||
widths[0] = std::max<int>( line.title.size(), widths[0] );
|
||||
widths[0] = std::max( (int) line.title.size(), widths[0] );
|
||||
frontTotal += line.frontSideQty;
|
||||
backTotal += line.backSideQty;
|
||||
}
|
||||
|
||||
// Get maximum width for other columns
|
||||
tmp.Printf( wxT( "%i" ), frontTotal );
|
||||
widths[1] = std::max<int>( tmp.size(), widths[1] );
|
||||
widths[1] = std::max( (int) tmp.size(), widths[1] );
|
||||
tmp.Printf( wxT( "%i" ), backTotal );
|
||||
widths[2] = std::max<int>( tmp.size(), widths[2] );
|
||||
widths[2] = std::max( (int) tmp.size(), widths[2] );
|
||||
tmp.Printf( wxT( "%i" ), frontTotal + backTotal );
|
||||
widths[3] = std::max<int>( tmp.size(), widths[3] );
|
||||
widths[3] = std::max( (int) tmp.size(), widths[3] );
|
||||
|
||||
//Write components amount to file
|
||||
msg << wxT( "\n" );
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/pcb_selection_tool.h>
|
||||
|
||||
#include <ranges>
|
||||
|
||||
|
||||
#define ID_MATCH_FP_ALL 4200
|
||||
#define ID_MATCH_FP_SELECTED 4201
|
||||
@ -246,62 +248,74 @@ void DIALOG_EXCHANGE_FOOTPRINTS::updateMatchModeRadioButtons( wxUpdateUIEvent& )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked( wxCommandEvent& event )
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked( wxCommandEvent& aEvent )
|
||||
{
|
||||
*m_matchMode = ID_MATCH_FP_ALL;
|
||||
|
||||
if( event.GetEventObject() == this )
|
||||
if( aEvent.GetEventObject() == this )
|
||||
SetInitialFocus( m_matchAll );
|
||||
else
|
||||
m_matchAll->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked( wxCommandEvent& event )
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked( wxCommandEvent& aEvent )
|
||||
{
|
||||
*m_matchMode = ID_MATCH_FP_SELECTED;
|
||||
|
||||
if( event.GetEventObject() == this )
|
||||
if( aEvent.GetEventObject() == this )
|
||||
SetInitialFocus( m_matchSelected );
|
||||
else
|
||||
m_matchSelected->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked( wxCommandEvent& event )
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked( wxCommandEvent& aEvent )
|
||||
{
|
||||
*m_matchMode = ID_MATCH_FP_REF;
|
||||
|
||||
if( event.GetEventObject() == this )
|
||||
if( aEvent.GetEventObject() == this )
|
||||
SetInitialFocus( m_specifiedRef );
|
||||
else if( event.GetEventObject() != m_specifiedRef )
|
||||
else if( aEvent.GetEventObject() != m_specifiedRef )
|
||||
m_specifiedRef->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked( wxCommandEvent& event )
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked( wxCommandEvent& aEvent )
|
||||
{
|
||||
*m_matchMode = ID_MATCH_FP_VAL;
|
||||
|
||||
if( event.GetEventObject() == this )
|
||||
if( aEvent.GetEventObject() == this )
|
||||
SetInitialFocus( m_specifiedValue );
|
||||
else if( event.GetEventObject() != m_specifiedValue )
|
||||
else if( aEvent.GetEventObject() != m_specifiedValue )
|
||||
m_specifiedValue->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked( wxCommandEvent& event )
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked( wxCommandEvent& aEvent )
|
||||
{
|
||||
*m_matchMode = ID_MATCH_FP_ID;
|
||||
|
||||
if( event.GetEventObject() == this )
|
||||
if( aEvent.GetEventObject() == this )
|
||||
SetInitialFocus( m_specifiedID );
|
||||
else if( event.GetEventObject() != m_specifiedID )
|
||||
else if( aEvent.GetEventObject() != m_specifiedID )
|
||||
m_specifiedID->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked( wxCommandEvent& event )
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::checkAll( bool aCheck )
|
||||
{
|
||||
m_removeExtraBox->SetValue( aCheck );
|
||||
m_resetTextItemLayers->SetValue( aCheck );
|
||||
m_resetTextItemEffects->SetValue( aCheck );
|
||||
m_resetTextItemContent->SetValue( aCheck );
|
||||
m_resetFabricationAttrs->SetValue( aCheck );
|
||||
m_resetClearanceOverrides->SetValue( aCheck );
|
||||
m_reset3DModels->SetValue( aCheck );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked( wxCommandEvent& aEvent )
|
||||
{
|
||||
PCB_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
|
||||
wxBusyCursor dummy;
|
||||
@ -340,11 +354,8 @@ void DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints()
|
||||
* NB: the change is done from the last footprint because processFootprint() modifies the
|
||||
* last item in the list.
|
||||
*/
|
||||
for( auto it = m_parent->GetBoard()->Footprints().rbegin();
|
||||
it != m_parent->GetBoard()->Footprints().rend(); it++ )
|
||||
for( FOOTPRINT* footprint : std::ranges::reverse_view( m_parent->GetBoard()->Footprints() ) )
|
||||
{
|
||||
FOOTPRINT* footprint = *it;
|
||||
|
||||
if( !isMatch( footprint ) )
|
||||
continue;
|
||||
|
||||
|
@ -41,14 +41,26 @@ public:
|
||||
~DIALOG_EXCHANGE_FOOTPRINTS() override;
|
||||
|
||||
private:
|
||||
void updateMatchModeRadioButtons( wxUpdateUIEvent& event ) override;
|
||||
void OnMatchAllClicked( wxCommandEvent& event ) override;
|
||||
void OnMatchSelectedClicked( wxCommandEvent& event ) override;
|
||||
void OnMatchRefClicked( wxCommandEvent& event ) override;
|
||||
void OnMatchValueClicked( wxCommandEvent& event ) override;
|
||||
void OnMatchIDClicked( wxCommandEvent& event ) override;
|
||||
void OnOKClicked( wxCommandEvent& event ) override;
|
||||
void ViewAndSelectFootprint( wxCommandEvent& event ) override;
|
||||
void updateMatchModeRadioButtons( wxUpdateUIEvent& aEvent ) override;
|
||||
void OnMatchAllClicked( wxCommandEvent& aEvent ) override;
|
||||
void OnMatchSelectedClicked( wxCommandEvent& aEvent ) override;
|
||||
void OnMatchRefClicked( wxCommandEvent& aEvent ) override;
|
||||
void OnMatchValueClicked( wxCommandEvent& aEvent ) override;
|
||||
void OnMatchIDClicked( wxCommandEvent& aEvent ) override;
|
||||
void OnOKClicked( wxCommandEvent& aEvent ) override;
|
||||
void ViewAndSelectFootprint( wxCommandEvent& aEvent ) override;
|
||||
|
||||
void onCheckAll( wxCommandEvent& aEvent ) override
|
||||
{
|
||||
checkAll( true );
|
||||
}
|
||||
|
||||
void onUncheckAll( wxCommandEvent& aEvent ) override
|
||||
{
|
||||
checkAll( false );
|
||||
}
|
||||
|
||||
void checkAll( bool aCheck );
|
||||
|
||||
wxRadioButton* getRadioButtonForMode();
|
||||
|
||||
|
@ -23,27 +23,39 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
||||
m_upperSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_matchAll = new wxRadioButton( this, wxID_ANY, _("Update all footprints on board"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALL, 5 );
|
||||
m_upperSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_matchSelected = new wxRadioButton( this, wxID_ANY, _("Update selected footprint(s)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSelected, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
|
||||
m_upperSizer->Add( m_matchSelected, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("Update footprints matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedRef, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
|
||||
m_upperSizer->Add( m_matchSpecifiedRef, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_specifiedRef = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
||||
m_specifiedRef->SetMinSize( wxSize( 200,-1 ) );
|
||||
|
||||
m_upperSizer->Add( m_specifiedRef, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND, 2 );
|
||||
m_upperSizer->Add( m_specifiedRef, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
|
||||
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("Update footprints matching value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALL, 5 );
|
||||
m_upperSizer->Add( m_matchSpecifiedValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_specifiedValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
||||
m_upperSizer->Add( m_specifiedValue, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 2 );
|
||||
m_upperSizer->Add( m_specifiedValue, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
|
||||
m_matchSpecifiedID = new wxRadioButton( this, wxID_ANY, _("Update footprints with library id:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedID, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
|
||||
m_upperSizer->Add( m_matchSpecifiedID, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer7;
|
||||
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_specifiedID = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
||||
bSizer7->Add( m_specifiedID, 1, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_specifiedIDBrowseButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bSizer7->Add( m_specifiedIDBrowseButton, 0, wxALIGN_CENTER_VERTICAL, 2 );
|
||||
|
||||
|
||||
m_upperSizer->Add( bSizer7, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
m_upperSizer->AddGrowableCol( 1 );
|
||||
@ -53,14 +65,6 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
||||
wxBoxSizer* bSizer4;
|
||||
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_specifiedID = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
||||
m_specifiedID->SetMinSize( wxSize( 500,-1 ) );
|
||||
|
||||
bSizer4->Add( m_specifiedID, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
m_specifiedIDBrowseButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bSizer4->Add( m_specifiedIDBrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2 );
|
||||
|
||||
|
||||
m_mainSizer->Add( bSizer4, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
@ -68,15 +72,15 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
||||
|
||||
wxStaticLine* staticline1;
|
||||
staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
m_changeSizer->Add( staticline1, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
m_changeSizer->Add( staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 3 );
|
||||
|
||||
wxBoxSizer* bSizer3;
|
||||
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxStaticText* newIdLabel;
|
||||
newIdLabel = new wxStaticText( this, wxID_ANY, _("New footprint library id:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
newIdLabel->Wrap( -1 );
|
||||
m_changeSizer->Add( newIdLabel, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizer3;
|
||||
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
|
||||
bSizer3->Add( newIdLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_newID = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_newID->SetMinSize( wxSize( 500,-1 ) );
|
||||
@ -84,38 +88,65 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
||||
bSizer3->Add( m_newID, 1, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_newIDBrowseButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
bSizer3->Add( m_newIDBrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 2 );
|
||||
bSizer3->Add( m_newIDBrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_changeSizer->Add( bSizer3, 1, wxEXPAND|wxLEFT, 5 );
|
||||
m_changeSizer->Add( bSizer3, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( m_changeSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
|
||||
m_changeSizer->Add( 0, 3, 0, wxEXPAND, 5 );
|
||||
|
||||
m_updateOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Update Options") ), wxVERTICAL );
|
||||
|
||||
m_removeExtraBox = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Remove text items which are not in library footprint"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_mainSizer->Add( m_changeSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_updateOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Update Options") ), wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizer5;
|
||||
bSizer5 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_removeExtraBox = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Remove text items if not in library footprint"), 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, 5 );
|
||||
bSizer5->Add( m_removeExtraBox, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_resetTextItemLayers = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset text layers and visibilities"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateOptionsSizer->Add( m_resetTextItemLayers, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizer5->Add( m_resetTextItemLayers, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_resetTextItemEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset text sizes, styles and positions"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateOptionsSizer->Add( m_resetTextItemEffects, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizer5->Add( m_resetTextItemEffects, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_resetTextItemContent = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset text content"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateOptionsSizer->Add( m_resetTextItemContent, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizer5->Add( m_resetTextItemContent, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizer5->Add( 0, 10, 1, 0, 5 );
|
||||
|
||||
m_checkAll = new wxButton( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Check All Update Options"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer5->Add( m_checkAll, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_updateOptionsSizer->Add( bSizer5, 1, wxEXPAND|wxRIGHT, 10 );
|
||||
|
||||
wxBoxSizer* bSizer6;
|
||||
bSizer6 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_resetFabricationAttrs = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset fabrication attributes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateOptionsSizer->Add( m_resetFabricationAttrs, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizer6->Add( m_resetFabricationAttrs, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_resetClearanceOverrides = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset clearance overrides"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateOptionsSizer->Add( m_resetClearanceOverrides, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizer6->Add( m_resetClearanceOverrides, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_reset3DModels = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset 3D models"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateOptionsSizer->Add( m_reset3DModels, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizer6->Add( m_reset3DModels, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizer6->Add( 0, 10, 1, 0, 5 );
|
||||
|
||||
m_uncheckAll = new wxButton( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Uncheck All Update Options"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer6->Add( m_uncheckAll, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_updateOptionsSizer->Add( bSizer6, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( m_updateOptionsSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
|
||||
@ -154,6 +185,8 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
||||
m_specifiedID->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchIDClicked ), NULL, this );
|
||||
m_specifiedIDBrowseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this );
|
||||
m_newIDBrowseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this );
|
||||
m_checkAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::onCheckAll ), NULL, this );
|
||||
m_uncheckAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::onUncheckAll ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnOKClicked ), NULL, this );
|
||||
}
|
||||
|
||||
@ -174,6 +207,8 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::~DIALOG_EXCHANGE_FOOTPRINTS_BASE()
|
||||
m_specifiedID->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchIDClicked ), NULL, this );
|
||||
m_specifiedIDBrowseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this );
|
||||
m_newIDBrowseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::ViewAndSelectFootprint ), NULL, this );
|
||||
m_checkAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::onCheckAll ), NULL, this );
|
||||
m_uncheckAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::onUncheckAll ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnOKClicked ), NULL, this );
|
||||
|
||||
}
|
||||
|
@ -84,7 +84,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="false">
|
||||
@ -153,7 +153,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="true">
|
||||
@ -222,7 +222,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="false">
|
||||
@ -291,7 +291,7 @@
|
||||
<property name="border">2</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxTextCtrl" expanded="false">
|
||||
@ -361,7 +361,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">3</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="false">
|
||||
@ -430,7 +430,7 @@
|
||||
<property name="border">2</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="row">3</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxTextCtrl" expanded="false">
|
||||
@ -498,9 +498,9 @@
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxTOP|wxEXPAND</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="row">4</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="false">
|
||||
@ -565,20 +565,21 @@
|
||||
<event name="OnRadioButton">OnMatchIDClicked</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="gbsizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">4</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer4</property>
|
||||
<property name="name">bSizer7</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -615,7 +616,7 @@
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">500,-1</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_specifiedID</property>
|
||||
<property name="pane_border">1</property>
|
||||
@ -645,7 +646,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -720,18 +721,31 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer4</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_changeSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -790,7 +804,16 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxTOP|wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer3</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -850,15 +873,6 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer3</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
@ -925,7 +939,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
@ -1001,6 +1015,16 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">3</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
@ -1012,9 +1036,18 @@
|
||||
<property name="label">Update Options</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_updateOptionsSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer5</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT</property>
|
||||
@ -1049,7 +1082,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Remove text items which are not in library footprint</property>
|
||||
<property name="label">Remove text items if not in library footprint</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -1275,6 +1308,102 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag"></property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">10</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" 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">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<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>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Check All Update Options</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_checkAll</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onCheckAll</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer6</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT</property>
|
||||
@ -1470,6 +1599,93 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag"></property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">10</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" 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">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<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>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Uncheck All Update Options</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_uncheckAll</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onUncheckAll</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
|
@ -21,13 +21,13 @@ class WX_HTML_REPORT_PANEL;
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/checkbox.h>
|
||||
@ -64,9 +64,11 @@ class DIALOG_EXCHANGE_FOOTPRINTS_BASE : public DIALOG_SHIM
|
||||
wxCheckBox* m_resetTextItemLayers;
|
||||
wxCheckBox* m_resetTextItemEffects;
|
||||
wxCheckBox* m_resetTextItemContent;
|
||||
wxButton* m_checkAll;
|
||||
wxCheckBox* m_resetFabricationAttrs;
|
||||
wxCheckBox* m_resetClearanceOverrides;
|
||||
wxCheckBox* m_reset3DModels;
|
||||
wxButton* m_uncheckAll;
|
||||
WX_HTML_REPORT_PANEL* m_MessageWindow;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
@ -80,6 +82,8 @@ class DIALOG_EXCHANGE_FOOTPRINTS_BASE : public DIALOG_SHIM
|
||||
virtual void OnMatchValueClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnMatchIDClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void ViewAndSelectFootprint( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onCheckAll( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUncheckAll( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOKClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
@ -53,8 +53,7 @@
|
||||
int DIALOG_FOOTPRINT_PROPERTIES::m_page = 0; // remember the last open page during session
|
||||
|
||||
|
||||
DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent,
|
||||
FOOTPRINT* aFootprint ) :
|
||||
DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent, FOOTPRINT* aFootprint ) :
|
||||
DIALOG_FOOTPRINT_PROPERTIES_BASE( aParent ),
|
||||
m_frame( aParent ),
|
||||
m_footprint( aFootprint ),
|
||||
@ -62,12 +61,9 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
|
||||
m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
|
||||
m_orientation( aParent, m_orientationLabel, m_orientationCtrl, nullptr ),
|
||||
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
|
||||
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
|
||||
m_SolderMaskMarginUnits ),
|
||||
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
|
||||
m_SolderPasteMarginUnits ),
|
||||
m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
|
||||
m_PasteMarginRatioUnits ),
|
||||
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
|
||||
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
|
||||
m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl, m_PasteMarginRatioUnits ),
|
||||
m_returnValue( FP_PROPS_CANCEL ),
|
||||
m_initialized( false ),
|
||||
m_gridSize( 0, 0 ),
|
||||
@ -101,9 +97,6 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
|
||||
icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit ) );
|
||||
SetIcon( icon );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_itemsGrid->SetDefaultRowSize( m_itemsGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_itemsGrid->SetTable( m_fields );
|
||||
m_itemsGrid->PushEventHandler( new GRID_TRICKS( m_itemsGrid ) );
|
||||
|
||||
|
@ -125,20 +125,16 @@ void PRIVATE_LAYERS_GRID_TABLE::SetValueAsLong( int aRow, int aCol, long aValue
|
||||
NOTEBOOK_PAGES DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::m_page = NOTEBOOK_PAGES::PAGE_GENERAL;
|
||||
|
||||
|
||||
DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(
|
||||
FOOTPRINT_EDIT_FRAME* aParent,
|
||||
DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent,
|
||||
FOOTPRINT* aFootprint ) :
|
||||
DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE( aParent ),
|
||||
m_frame( aParent ),
|
||||
m_footprint( aFootprint ),
|
||||
m_initialized( false ),
|
||||
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
|
||||
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
|
||||
m_SolderMaskMarginUnits ),
|
||||
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
|
||||
m_SolderPasteMarginUnits ),
|
||||
m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
|
||||
m_PasteMarginRatioUnits ),
|
||||
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
|
||||
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
|
||||
m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl, m_PasteMarginRatioUnits ),
|
||||
m_gridSize( 0, 0 ),
|
||||
m_lastRequestedSize( 0, 0 )
|
||||
{
|
||||
@ -166,10 +162,6 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(
|
||||
icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit ) );
|
||||
SetIcon( icon );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_itemsGrid->SetDefaultRowSize( m_itemsGrid->GetDefaultRowSize() + 4 );
|
||||
m_privateLayersGrid->SetDefaultRowSize( m_privateLayersGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_itemsGrid->SetTable( m_fields );
|
||||
m_privateLayersGrid->SetTable( m_privateLayers );
|
||||
|
||||
|
@ -91,7 +91,6 @@ DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS( PCB_BASE_EDIT_FRAME* aParent,
|
||||
m_gridTable = new LAYER_GRID_TABLE( m_parent->GetBoard()->GetCopperLayerCount() );
|
||||
m_grid->SetTable( m_gridTable );
|
||||
m_grid->SetMinSize( FromDIP( m_grid->GetMinSize() ) );
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
m_grid->SetCellHighlightROPenWidth( 0 );
|
||||
m_grid->SetUseNativeColLabels();
|
||||
|
||||
|
@ -155,8 +155,6 @@ PANEL_DISPLAY_OPTIONS::PANEL_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BA
|
||||
|
||||
m_optionsBook->SetSelection( m_isPCBEdit ? 1 : 0 );
|
||||
|
||||
m_layerNameitemsGrid->SetDefaultRowSize( m_layerNameitemsGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_layerNameitemsGrid->SetTable( new LAYER_NAMES_GRID_TABLE(), true );
|
||||
m_layerNameitemsGrid->PushEventHandler( new GRID_TRICKS( m_layerNameitemsGrid ) );
|
||||
m_layerNameitemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
@ -191,9 +189,9 @@ void PANEL_DISPLAY_OPTIONS::loadFPSettings( const FOOTPRINT_EDITOR_SETTINGS* aCf
|
||||
{
|
||||
wxGridTableBase* table = m_layerNameitemsGrid->GetTable();
|
||||
|
||||
for( auto& item : aCfg->m_DesignSettings.m_UserLayerNames )
|
||||
for( const auto& [canonicalName, userName] : aCfg->m_DesignSettings.m_UserLayerNames )
|
||||
{
|
||||
wxString orig_name = item.first;
|
||||
wxString orig_name = canonicalName;
|
||||
int layer = LSET::NameToLayer( orig_name );
|
||||
|
||||
if( !IsUserLayer( static_cast<PCB_LAYER_ID>( layer ) ) )
|
||||
@ -202,7 +200,7 @@ void PANEL_DISPLAY_OPTIONS::loadFPSettings( const FOOTPRINT_EDITOR_SETTINGS* aCf
|
||||
int row = m_layerNameitemsGrid->GetNumberRows();
|
||||
table->AppendRows( 1 );
|
||||
table->SetValueAsLong( row, 0, layer );
|
||||
table->SetValue( row, 1, item.second );
|
||||
table->SetValue( row, 1, userName );
|
||||
}
|
||||
|
||||
Layout();
|
||||
@ -284,8 +282,7 @@ void PANEL_DISPLAY_OPTIONS::onLayerChange( wxGridEvent& event )
|
||||
|
||||
for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
|
||||
{
|
||||
if( i != event.GetRow()
|
||||
&& table->GetValueAsLong( i, 0 ) == layer )
|
||||
if( i != event.GetRow() && table->GetValueAsLong( i, 0 ) == layer )
|
||||
{
|
||||
table->SetValueAsLong( event.GetRow(), 0, getNextAvailableLayer() );
|
||||
return;
|
||||
|
@ -175,11 +175,10 @@ static FOOTPRINT_EDITOR_SETTINGS& GetPgmSettings()
|
||||
|
||||
PANEL_FP_EDITOR_FIELD_DEFAULTS::PANEL_FP_EDITOR_FIELD_DEFAULTS( wxWindow* aParent,
|
||||
UNITS_PROVIDER* aUnitsProvider ) :
|
||||
PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE( aParent ), m_unitProvider( aUnitsProvider ),
|
||||
PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE( aParent ),
|
||||
m_unitProvider( aUnitsProvider ),
|
||||
m_designSettings( GetPgmSettings().m_DesignSettings )
|
||||
{
|
||||
m_fieldPropsGrid->SetDefaultRowSize( m_fieldPropsGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_fieldPropsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( true ), true );
|
||||
m_fieldPropsGrid->PushEventHandler( new GRID_TRICKS( m_fieldPropsGrid ) );
|
||||
m_fieldPropsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
@ -195,8 +194,6 @@ PANEL_FP_EDITOR_FIELD_DEFAULTS::PANEL_FP_EDITOR_FIELD_DEFAULTS( wxWindow*
|
||||
attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, {} ) );
|
||||
m_fieldPropsGrid->SetColAttr( 2, attr );
|
||||
|
||||
m_textItemsGrid->SetDefaultRowSize( m_textItemsGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_textItemsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( false ), true );
|
||||
m_textItemsGrid->PushEventHandler( new GRID_TRICKS( m_textItemsGrid ) );
|
||||
m_textItemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
|
@ -64,18 +64,18 @@ static FOOTPRINT_EDITOR_SETTINGS& GetPgmSettings()
|
||||
}
|
||||
|
||||
|
||||
PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::PANEL_FP_EDITOR_GRAPHICS_DEFAULTS(
|
||||
wxWindow* aParent, UNITS_PROVIDER* aUnitsProvider ) :
|
||||
PANEL_FP_EDITOR_GRAPHICS_DEFAULTS_BASE( aParent ), m_unitProvider( aUnitsProvider ),
|
||||
PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( wxWindow* aParent,
|
||||
UNITS_PROVIDER* aUnitsProvider ) :
|
||||
PANEL_FP_EDITOR_GRAPHICS_DEFAULTS_BASE( aParent ),
|
||||
m_unitProvider( aUnitsProvider ),
|
||||
m_designSettings( GetPgmSettings().m_DesignSettings ),
|
||||
m_dimensionsPanel( std::make_unique<PANEL_SETUP_DIMENSIONS>( this, *m_unitProvider,
|
||||
m_designSettings ) )
|
||||
m_dimensionsPanel( std::make_unique<PANEL_SETUP_DIMENSIONS>( this, *m_unitProvider, m_designSettings ) )
|
||||
{
|
||||
m_graphicsGrid->SetUnitsProvider( aUnitsProvider );
|
||||
m_graphicsGrid->SetAutoEvalCols(
|
||||
{ COL_LINE_THICKNESS, COL_TEXT_WIDTH, COL_TEXT_HEIGHT, COL_TEXT_THICKNESS } );
|
||||
|
||||
m_graphicsGrid->SetDefaultRowSize( m_graphicsGrid->GetDefaultRowSize() + 4 );
|
||||
m_graphicsGrid->SetAutoEvalCols( { COL_LINE_THICKNESS,
|
||||
COL_TEXT_WIDTH,
|
||||
COL_TEXT_HEIGHT,
|
||||
COL_TEXT_THICKNESS } );
|
||||
|
||||
// Work around a bug in wxWidgets where it fails to recalculate the grid height
|
||||
// after changing the default row size
|
||||
@ -140,13 +140,11 @@ void PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::loadFPSettings( const FOOTPRINT_EDITOR_S
|
||||
for( int col = 0; col < m_graphicsGrid->GetNumberCols(); col++ )
|
||||
{
|
||||
// Set the minimal width to the column label size.
|
||||
m_graphicsGrid->SetColMinimalWidth( col,
|
||||
m_graphicsGrid->GetVisibleWidth( col, true, false ) );
|
||||
m_graphicsGrid->SetColMinimalWidth( col, m_graphicsGrid->GetVisibleWidth( col, true, false ) );
|
||||
|
||||
// Set the width to see the full contents
|
||||
if( m_graphicsGrid->IsColShown( col ) )
|
||||
m_graphicsGrid->SetColSize( col,
|
||||
m_graphicsGrid->GetVisibleWidth( col, true, true, true ) );
|
||||
m_graphicsGrid->SetColSize( col, m_graphicsGrid->GetVisibleWidth( col, true, true, true ) );
|
||||
}
|
||||
|
||||
m_graphicsGrid->SetRowLabelSize( m_graphicsGrid->GetVisibleWidth( -1, true, true, true ) );
|
||||
@ -225,8 +223,7 @@ bool PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::TransferDataFromWindow()
|
||||
int textHeight = m_graphicsGrid->GetUnitValue( i, COL_TEXT_HEIGHT );
|
||||
int textThickness = m_graphicsGrid->GetUnitValue( i, COL_TEXT_THICKNESS );
|
||||
|
||||
if( textWidth < minSize || textHeight < minSize || textWidth > maxSize
|
||||
|| textHeight > maxSize )
|
||||
if( textWidth < minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
|
||||
{
|
||||
if( !errorsMsg.IsEmpty() )
|
||||
errorsMsg += wxT( "\n\n" );
|
||||
@ -249,17 +246,19 @@ bool PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::TransferDataFromWindow()
|
||||
errorsMsg += wxT( "\n\n" );
|
||||
|
||||
if( textThickness > textMaxThickness )
|
||||
errorsMsg += wxString::Format(
|
||||
_( "%s: Text thickness is too large.\n"
|
||||
{
|
||||
errorsMsg += wxString::Format( _( "%s: Text thickness is too large.\n"
|
||||
"It will be truncated to %s" ),
|
||||
m_graphicsGrid->GetRowLabelValue( i ),
|
||||
m_unitProvider->StringFromValue( textMaxThickness, true ) );
|
||||
|
||||
}
|
||||
else if( textThickness < minWidth )
|
||||
{
|
||||
errorsMsg += wxString::Format( _( "%s: Text thickness is too small.\n"
|
||||
"It will be truncated to %s" ),
|
||||
m_graphicsGrid->GetRowLabelValue( i ),
|
||||
m_unitProvider->StringFromValue( minWidth, true ) );
|
||||
}
|
||||
|
||||
textThickness = std::min( textThickness, textMaxThickness );
|
||||
textThickness = std::max( textThickness, minWidth );
|
||||
@ -281,8 +280,7 @@ bool PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::TransferDataFromWindow()
|
||||
if( errorsMsg.IsEmpty() )
|
||||
return true;
|
||||
|
||||
KIDIALOG dlg( wxGetTopLevelParent( this ), errorsMsg, KIDIALOG::KD_ERROR,
|
||||
_( "Parameter error" ) );
|
||||
KIDIALOG dlg( wxGetTopLevelParent( this ), errorsMsg, KIDIALOG::KD_ERROR, _( "Parameter error" ) );
|
||||
dlg.ShowModal();
|
||||
|
||||
return false;
|
||||
|
@ -75,83 +75,6 @@
|
||||
#include <dialog_HTML_reporter_base.h>
|
||||
#include <widgets/wx_html_report_box.h>
|
||||
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* Container that describes file type info for the add a library options
|
||||
*/
|
||||
struct SUPPORTED_FILE_TYPE
|
||||
{
|
||||
wxString m_Description; ///< Description shown in the file picker dialog
|
||||
wxString m_FileFilter; ///< Filter used for file pickers if m_IsFile is true
|
||||
wxString m_FolderSearchExtension; ///< In case of folders it stands for extensions of files stored inside
|
||||
bool m_IsFile; ///< Whether the library is a folder or a file
|
||||
PCB_IO_MGR::PCB_FILE_T m_Plugin;
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Traverser implementation that looks to find any and all "folder" libraries by looking for files
|
||||
* with a specific extension inside folders
|
||||
*/
|
||||
class LIBRARY_TRAVERSER : public wxDirTraverser
|
||||
{
|
||||
public:
|
||||
LIBRARY_TRAVERSER( std::vector<std::string> aSearchExtensions, wxString aInitialDir ) :
|
||||
m_searchExtensions( aSearchExtensions ), m_currentDir( aInitialDir )
|
||||
{
|
||||
}
|
||||
|
||||
virtual wxDirTraverseResult OnFile( const wxString& aFileName ) override
|
||||
{
|
||||
wxFileName file( aFileName );
|
||||
|
||||
for( const std::string& ext : m_searchExtensions )
|
||||
{
|
||||
if( file.GetExt().IsSameAs( ext, false ) )
|
||||
m_foundDirs.insert( { m_currentDir, 1 } );
|
||||
}
|
||||
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
||||
virtual wxDirTraverseResult OnOpenError( const wxString& aOpenErrorName ) override
|
||||
{
|
||||
m_failedDirs.insert( { aOpenErrorName, 1 } );
|
||||
return wxDIR_IGNORE;
|
||||
}
|
||||
|
||||
bool HasDirectoryOpenFailures()
|
||||
{
|
||||
return m_failedDirs.size() > 0;
|
||||
}
|
||||
|
||||
virtual wxDirTraverseResult OnDir( const wxString& aDirName ) override
|
||||
{
|
||||
m_currentDir = aDirName;
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
||||
void GetPaths( wxArrayString& aPathArray )
|
||||
{
|
||||
for( std::pair<const wxString, int>& foundDirsPair : m_foundDirs )
|
||||
aPathArray.Add( foundDirsPair.first );
|
||||
}
|
||||
|
||||
void GetFailedPaths( wxArrayString& aPathArray )
|
||||
{
|
||||
for( std::pair<const wxString, int>& failedDirsPair : m_failedDirs )
|
||||
aPathArray.Add( failedDirsPair.first );
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_searchExtensions;
|
||||
wxString m_currentDir;
|
||||
std::unordered_map<wxString, int> m_foundDirs;
|
||||
std::unordered_map<wxString, int> m_failedDirs;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This class builds a wxGridTableBase by wrapping an #FP_LIB_TABLE object.
|
||||
@ -484,8 +407,7 @@ PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, PRO
|
||||
|
||||
if( desc.m_IsFile && !desc.m_FileExtensions.empty() )
|
||||
{
|
||||
entryStr << wxString::Format( wxS( " (%s)" ),
|
||||
joinExts( desc.m_FileExtensions ) );
|
||||
entryStr << wxString::Format( wxS( " (%s)" ), joinExts( desc.m_FileExtensions ) );
|
||||
}
|
||||
else if( !desc.m_IsFile && !desc.m_ExtensionsInDir.empty() )
|
||||
{
|
||||
@ -497,8 +419,7 @@ PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, PRO
|
||||
|
||||
browseMenu->Append( type, entryStr );
|
||||
|
||||
browseMenu->Bind( wxEVT_COMMAND_MENU_SELECTED, &PANEL_FP_LIB_TABLE::browseLibrariesHandler,
|
||||
this, type );
|
||||
browseMenu->Bind( wxEVT_COMMAND_MENU_SELECTED, &PANEL_FP_LIB_TABLE::browseLibrariesHandler, this, type );
|
||||
}
|
||||
|
||||
Layout();
|
||||
@ -634,8 +555,7 @@ bool PANEL_FP_LIB_TABLE::verifyTables()
|
||||
|
||||
if( nick1 == nick2 )
|
||||
{
|
||||
msg = wxString::Format( _( "Multiple libraries cannot share the same "
|
||||
"nickname ('%s')." ),
|
||||
msg = wxString::Format( _( "Multiple libraries cannot share the same nickname ('%s')." ),
|
||||
nick1 );
|
||||
|
||||
// show the tabbed panel holding the grid we have flunked:
|
||||
@ -841,14 +761,12 @@ void PANEL_FP_LIB_TABLE::onMigrateLibraries( wxCommandEvent& event )
|
||||
{
|
||||
if( rowsToMigrate.size() == 1 )
|
||||
{
|
||||
msg.Printf( _( "Save '%s' as current KiCad format "
|
||||
"and replace entry in table?" ),
|
||||
msg.Printf( _( "Save '%s' as current KiCad format and replace entry in table?" ),
|
||||
m_cur_grid->GetCellValue( rowsToMigrate[0], COL_NICKNAME ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "Save %d libraries as current KiCad format "
|
||||
"and replace entries in table?" ),
|
||||
msg.Printf( _( "Save %d libraries as current KiCad format and replace entries in table?" ),
|
||||
(int) rowsToMigrate.size() );
|
||||
}
|
||||
|
||||
@ -880,8 +798,7 @@ void PANEL_FP_LIB_TABLE::onMigrateLibraries( wxCommandEvent& event )
|
||||
msg.Printf( _( "Folder '%s' already exists. Do you want overwrite any existing footprints?" ),
|
||||
newLib.GetFullPath() );
|
||||
|
||||
switch( wxMessageBox( msg, _( "Migrate Library" ),
|
||||
wxYES_NO | wxCANCEL | wxICON_QUESTION, m_parent ) )
|
||||
switch( wxMessageBox( msg, _( "Migrate Library" ), wxYES_NO|wxCANCEL|wxICON_QUESTION, m_parent ) )
|
||||
{
|
||||
case wxYES: break;
|
||||
case wxNO: continue;
|
||||
@ -892,11 +809,10 @@ void PANEL_FP_LIB_TABLE::onMigrateLibraries( wxCommandEvent& event )
|
||||
wxString options = m_cur_grid->GetCellValue( row, COL_OPTIONS );
|
||||
std::unique_ptr<std::map<std::string, UTF8>> props( LIB_TABLE::ParseOptions( options.ToStdString() ) );
|
||||
|
||||
if( PCB_IO_MGR::ConvertLibrary( props.get(), legacyLib.GetFullPath(),
|
||||
newLib.GetFullPath(), errorReporter.m_Reporter ) )
|
||||
if( PCB_IO_MGR::ConvertLibrary( props.get(), legacyLib.GetFullPath(), newLib.GetFullPath(),
|
||||
errorReporter.m_Reporter ) )
|
||||
{
|
||||
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(),
|
||||
m_project );
|
||||
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(), m_project );
|
||||
|
||||
// Do not use the project path in the global library table. This will almost
|
||||
// assuredly be wrong for a different project.
|
||||
@ -942,8 +858,7 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||
|
||||
if( fileType == PCB_IO_MGR::FILE_TYPE_NONE )
|
||||
{
|
||||
wxLogWarning( wxT( "File type selection event received but could not find the file type "
|
||||
"in the table" ) );
|
||||
wxLogWarning( wxT( "File type selection event received but could not find the file type in the table" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1213,10 +1128,6 @@ void PANEL_FP_LIB_TABLE::populateEnvironReadOnlyTable()
|
||||
m_path_subs_grid->SetCellEditor( row, 1, new GRID_CELL_READONLY_TEXT_EDITOR() );
|
||||
}
|
||||
|
||||
// No combobox editors here, but it looks better if its consistent with the other
|
||||
// grids in the dialog.
|
||||
m_path_subs_grid->SetDefaultRowSize( m_path_subs_grid->GetDefaultRowSize() + 2 );
|
||||
|
||||
adjustPathSubsGridColumns( m_path_subs_grid->GetRect().GetWidth() );
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,6 @@ PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL( PCB_BASE_EDIT_FRAME*
|
||||
m_splitter1->SetSashPosition( FromDIP( m_splitter1->GetSashPosition() ) );
|
||||
m_splitter1->SetMinimumPaneSize( FromDIP( m_splitter1->GetMinimumPaneSize() ) );
|
||||
|
||||
m_modelsGrid->SetDefaultRowSize( m_modelsGrid->GetDefaultRowSize() + 4 );
|
||||
|
||||
GRID_TRICKS* trick = new GRID_TRICKS( m_modelsGrid, [this]( wxCommandEvent& aEvent )
|
||||
{
|
||||
OnAdd3DRow( aEvent );
|
||||
@ -125,8 +123,7 @@ PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL( PCB_BASE_EDIT_FRAME*
|
||||
|
||||
PROJECT_PCB::Get3DCacheManager( &m_frame->Prj() )->GetResolver()->SetProgramBase( &Pgm() );
|
||||
|
||||
m_previewPane = new PANEL_PREVIEW_3D_MODEL( m_lowerPanel, m_frame, m_footprint,
|
||||
&m_shapes3D_list );
|
||||
m_previewPane = new PANEL_PREVIEW_3D_MODEL( m_lowerPanel, m_frame, m_footprint, &m_shapes3D_list );
|
||||
|
||||
m_LowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
|
||||
|
||||
@ -503,8 +500,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::updateValidateStatus( int aRow )
|
||||
}
|
||||
|
||||
m_modelsGrid->SetCellValue( aRow, COL_PROBLEM, errStr );
|
||||
m_modelsGrid->SetCellRenderer( aRow, COL_PROBLEM,
|
||||
new GRID_CELL_STATUS_ICON_RENDERER( icon ) );
|
||||
m_modelsGrid->SetCellRenderer( aRow, COL_PROBLEM, new GRID_CELL_STATUS_ICON_RENDERER( icon ) );
|
||||
}
|
||||
|
||||
|
||||
@ -524,6 +520,7 @@ MODEL_VALIDATE_ERRORS PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists( const w
|
||||
|
||||
wxString libraryName = m_footprint->GetFPID().GetLibNickname();
|
||||
const FP_LIB_TABLE_ROW* fpRow = nullptr;
|
||||
|
||||
try
|
||||
{
|
||||
fpRow = PROJECT_PCB::PcbFootprintLibs( &m_frame->Prj() )->FindRow( libraryName, false );
|
||||
@ -568,8 +565,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::AdjustGridColumnWidths()
|
||||
// Account for scroll bars
|
||||
int modelsWidth = KIPLATFORM::UI::GetUnobscuredSize( m_modelsGrid ).x;
|
||||
|
||||
int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN )
|
||||
- m_modelsGrid->GetColSize( COL_PROBLEM );
|
||||
int width = modelsWidth - m_modelsGrid->GetColSize( COL_SHOWN ) - m_modelsGrid->GetColSize( COL_PROBLEM );
|
||||
|
||||
if( width > 0 )
|
||||
m_modelsGrid->SetColSize( COL_FILENAME, width );
|
||||
@ -606,8 +602,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::onShowEvent( wxShowEvent& aEvent )
|
||||
|
||||
void PANEL_FP_PROPERTIES_3D_MODEL::onDialogActivateEvent( wxActivateEvent& aEvent )
|
||||
{
|
||||
postCustomPanelShownEventWithPredicate( aEvent.GetActive()
|
||||
&& m_previewPane->IsShownOnScreen() );
|
||||
postCustomPanelShownEventWithPredicate( aEvent.GetActive() && m_previewPane->IsShownOnScreen() );
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
@ -61,15 +61,13 @@ PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aP
|
||||
PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( aParentWindow ),
|
||||
m_Frame( aFrame ),
|
||||
m_BrdSettings( &m_Frame->GetBoard()->GetDesignSettings() ),
|
||||
m_dimensionsPanel(
|
||||
std::make_unique<PANEL_SETUP_DIMENSIONS>( this, *aFrame, *m_BrdSettings ) )
|
||||
m_dimensionsPanel( std::make_unique<PANEL_SETUP_DIMENSIONS>( this, *aFrame, *m_BrdSettings ) )
|
||||
{
|
||||
m_grid->SetUnitsProvider( m_Frame );
|
||||
m_grid->SetAutoEvalCols( { COL_LINE_THICKNESS,
|
||||
COL_TEXT_WIDTH,
|
||||
COL_TEXT_HEIGHT,
|
||||
COL_TEXT_THICKNESS } );
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
m_grid->SetUseNativeColLabels();
|
||||
|
||||
// Work around a bug in wxWidgets where it fails to recalculate the grid height
|
||||
@ -157,10 +155,10 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow()
|
||||
SET_MILS_CELL( i, COL_TEXT_WIDTH, m_BrdSettings->m_TextSize[ i ].x );
|
||||
SET_MILS_CELL( i, COL_TEXT_HEIGHT, m_BrdSettings->m_TextSize[ i ].y );
|
||||
SET_MILS_CELL( i, COL_TEXT_THICKNESS, m_BrdSettings->m_TextThickness[ i ] );
|
||||
m_grid->SetCellValue( i, COL_TEXT_ITALIC,
|
||||
m_BrdSettings->m_TextItalic[ i ] ? wxT( "1" ) : wxT( "" ) );
|
||||
m_grid->SetCellValue( i, COL_TEXT_UPRIGHT,
|
||||
m_BrdSettings->m_TextUpright[ i ] ? wxT( "1" ) : wxT( "" ) );
|
||||
m_grid->SetCellValue( i, COL_TEXT_ITALIC, m_BrdSettings->m_TextItalic[ i ] ? wxT( "1" )
|
||||
: wxT( "" ) );
|
||||
m_grid->SetCellValue( i, COL_TEXT_UPRIGHT, m_BrdSettings->m_TextUpright[ i ] ? wxT( "1" )
|
||||
: wxT( "" ) );
|
||||
|
||||
auto attr = new wxGridCellAttr;
|
||||
attr->SetRenderer( new wxGridCellBoolRenderer() );
|
||||
@ -233,8 +231,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow()
|
||||
int textHeight = m_grid->GetUnitValue( i, COL_TEXT_HEIGHT );
|
||||
int textThickness = m_grid->GetUnitValue( i, COL_TEXT_THICKNESS );
|
||||
|
||||
if( textWidth < minSize || textHeight < minSize
|
||||
|| textWidth > maxSize || textHeight > maxSize )
|
||||
if( textWidth < minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
|
||||
{
|
||||
if( !errorsMsg.IsEmpty() )
|
||||
errorsMsg += wxT( "\n\n" );
|
||||
@ -255,18 +252,20 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow()
|
||||
if( !errorsMsg.IsEmpty() )
|
||||
errorsMsg += wxT( "\n\n" );
|
||||
|
||||
|
||||
if( textThickness > textMaxThickness )
|
||||
{
|
||||
errorsMsg += wxString::Format( _( "%s: Text thickness is too large.\n"
|
||||
"It will be truncated to %s" ),
|
||||
m_grid->GetRowLabelValue( i ),
|
||||
unitProvider->StringFromValue( textMaxThickness , true) );
|
||||
|
||||
}
|
||||
else if( textThickness < minWidth )
|
||||
{
|
||||
errorsMsg += wxString::Format( _( "%s: Text thickness is too small.\n"
|
||||
"It will be truncated to %s" ),
|
||||
m_grid->GetRowLabelValue( i ),
|
||||
unitProvider->StringFromValue( minWidth , true ) );
|
||||
}
|
||||
|
||||
textThickness = std::min( textThickness, textMaxThickness );
|
||||
textThickness = std::max( textThickness, minWidth );
|
||||
@ -290,8 +289,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow()
|
||||
if( errorsMsg.IsEmpty() )
|
||||
return true;
|
||||
|
||||
KIDIALOG dlg( wxGetTopLevelParent( this ), errorsMsg, KIDIALOG::KD_ERROR,
|
||||
_( "Parameter error" ) );
|
||||
KIDIALOG dlg( wxGetTopLevelParent( this ), errorsMsg, KIDIALOG::KD_ERROR, _( "Parameter error" ) );
|
||||
dlg.ShowModal();
|
||||
|
||||
return false;
|
||||
|
@ -37,7 +37,9 @@ PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(
|
||||
wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame, BOARD* aBoard,
|
||||
std::shared_ptr<TIME_DOMAIN_PARAMETERS> aTimeDomainParameters ) :
|
||||
PANEL_SETUP_TIME_DOMAIN_PARAMETERS_BASE( aParentWindow ),
|
||||
m_timeDomainParameters( std::move( aTimeDomainParameters ) ), m_frame( aFrame ), m_board( aFrame->GetBoard() )
|
||||
m_timeDomainParameters( std::move( aTimeDomainParameters ) ),
|
||||
m_frame( aFrame ),
|
||||
m_board( aFrame->GetBoard() )
|
||||
{
|
||||
m_timeDomainParametersPane->SetBorders( true, false, false, false );
|
||||
|
||||
@ -55,7 +57,6 @@ PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(
|
||||
m_tracePropagationGrid->SetUseNativeColLabels();
|
||||
|
||||
m_tracePropagationGrid->EnsureColLabelsVisible();
|
||||
m_tracePropagationGrid->SetDefaultRowSize( m_tracePropagationGrid->GetDefaultRowSize() + 4 );
|
||||
m_tracePropagationGrid->PushEventHandler( new GRID_TRICKS( m_tracePropagationGrid ) );
|
||||
m_tracePropagationGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
|
||||
@ -73,7 +74,6 @@ PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(
|
||||
m_viaPropagationGrid->SetUseNativeColLabels();
|
||||
|
||||
m_viaPropagationGrid->EnsureColLabelsVisible();
|
||||
m_viaPropagationGrid->SetDefaultRowSize( m_viaPropagationGrid->GetDefaultRowSize() + 4 );
|
||||
m_viaPropagationGrid->PushEventHandler( new GRID_TRICKS( m_viaPropagationGrid ) );
|
||||
m_viaPropagationGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
|
||||
|
||||
@ -169,11 +169,9 @@ void PANEL_SETUP_TIME_DOMAIN_PARAMETERS::addProfileRow( const DELAY_PROFILE& aDe
|
||||
int col = m_copperLayerIdsToColumns[layerId];
|
||||
|
||||
if( col < m_tracePropagationGrid->GetNumberCols() )
|
||||
{
|
||||
m_tracePropagationGrid->SetUnitValue( rowId, col, velocity );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DELAY_PROFILE PANEL_SETUP_TIME_DOMAIN_PARAMETERS::getProfileRow( const int aRow )
|
||||
|
@ -69,12 +69,6 @@ PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS( wxWindow* aParentWindo
|
||||
m_diffPairsSortButton->SetBitmap( KiBitmapBundle( BITMAPS::small_sort_desc ) );
|
||||
m_diffPairsRemoveButton->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
|
||||
|
||||
// Membership combobox editors require a bit more room, so increase the row size of
|
||||
// all our grids for consistency
|
||||
m_trackWidthsGrid->SetDefaultRowSize( m_trackWidthsGrid->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
m_viaSizesGrid->SetDefaultRowSize( m_viaSizesGrid->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
m_diffPairsGrid->SetDefaultRowSize( m_diffPairsGrid->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
|
||||
m_trackWidthsGrid->PushEventHandler( new GRID_TRICKS( m_trackWidthsGrid,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
{
|
||||
@ -441,7 +435,7 @@ void removeSelectedRows( WX_GRID* aGrid )
|
||||
if( selectedRows.empty() && curRow >= 0 && curRow < aGrid->GetNumberRows() )
|
||||
selectedRows.Add( curRow );
|
||||
|
||||
for( int ii = selectedRows.Count() - 1; ii >= 0; --ii )
|
||||
for( int ii = (int) selectedRows.Count() - 1; ii >= 0; --ii )
|
||||
{
|
||||
int row = selectedRows.Item( ii );
|
||||
aGrid->DeleteRows( row, 1 );
|
||||
|
@ -303,9 +303,9 @@ bool HYPERLYNX_EXPORTER::writeBoardInfo()
|
||||
const SEG& s = outl.CSegment( i );
|
||||
m_out->Print( 1, "(PERIMETER_SEGMENT X1=%.9f Y1=%.9f X2=%.9f Y2=%.9f)\n",
|
||||
iu2hyp( s.A.x ),
|
||||
iu2hyp( s.A.y ),
|
||||
iu2hyp( -s.A.y ),
|
||||
iu2hyp( s.B.x ),
|
||||
iu2hyp( s.B.y ) );
|
||||
iu2hyp( -s.B.y ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
||||
|
||||
m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",
|
||||
iu2hyp( pad->GetPosition().x ),
|
||||
iu2hyp( pad->GetPosition().y ),
|
||||
iu2hyp( -pad->GetPosition().y ),
|
||||
(const char*) ref.c_str(),
|
||||
(const char*) padName.c_str(),
|
||||
pstackIter->second->GetId() );
|
||||
@ -461,7 +461,7 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
||||
{
|
||||
m_out->Print( 1, "(VIA X=%.10f Y=%.10f P=%d)\n",
|
||||
iu2hyp( via->GetPosition().x ),
|
||||
iu2hyp( via->GetPosition().y ),
|
||||
iu2hyp( -via->GetPosition().y ),
|
||||
pstackIter->second->GetId() );
|
||||
}
|
||||
}
|
||||
@ -471,9 +471,9 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
||||
|
||||
m_out->Print( 1, "(SEG X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f W=%.10f L=\"%s\")\n",
|
||||
iu2hyp( track->GetStart().x ),
|
||||
iu2hyp( track->GetStart().y ),
|
||||
iu2hyp( -track->GetStart().y ),
|
||||
iu2hyp( track->GetEnd().x ),
|
||||
iu2hyp( track->GetEnd().y ),
|
||||
iu2hyp( -track->GetEnd().y ),
|
||||
iu2hyp( track->GetWidth() ),
|
||||
(const char*) layerName.c_str() );
|
||||
}
|
||||
@ -488,11 +488,11 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
||||
|
||||
m_out->Print( 1, "(ARC X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f XC=%.10f YC=%.10f R=%.10f W=%.10f L=\"%s\")\n",
|
||||
iu2hyp( start.x ),
|
||||
iu2hyp( start.y ),
|
||||
iu2hyp( -start.y ),
|
||||
iu2hyp( end.x ),
|
||||
iu2hyp( end.y ),
|
||||
iu2hyp( -end.y ),
|
||||
iu2hyp( arc->GetCenter().x ),
|
||||
iu2hyp( arc->GetCenter().y ),
|
||||
iu2hyp( -arc->GetCenter().y ),
|
||||
iu2hyp( arc->GetRadius() ),
|
||||
iu2hyp( arc->GetWidth() ),
|
||||
(const char*) layerName.c_str() );
|
||||
@ -515,16 +515,16 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
||||
(const char*) layerName.c_str(),
|
||||
m_polyId,
|
||||
iu2hyp( p0.x ),
|
||||
iu2hyp( p0.y ) );
|
||||
iu2hyp( -p0.y ) );
|
||||
|
||||
for( int v = 0; v < outl.PointCount(); v++ )
|
||||
{
|
||||
m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
|
||||
iu2hyp( outl.CPoint( v ).x ),
|
||||
iu2hyp( outl.CPoint( v ).y ) );
|
||||
iu2hyp( -outl.CPoint( v ).y ) );
|
||||
}
|
||||
|
||||
m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( p0.y ) );
|
||||
m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( -p0.y ) );
|
||||
m_out->Print( 1, "}\n" );
|
||||
|
||||
for( int h = 0; h < fill.HoleCount( i ); h++ )
|
||||
@ -535,18 +535,18 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
||||
m_out->Print( 1, "{POLYVOID ID=%d X=%.10f Y=%.10f\n",
|
||||
m_polyId,
|
||||
iu2hyp( ph0.x ),
|
||||
iu2hyp( ph0.y ) );
|
||||
iu2hyp( -ph0.y ) );
|
||||
|
||||
for( int v = 0; v < holeShape.PointCount(); v++ )
|
||||
{
|
||||
m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
|
||||
iu2hyp( holeShape.CPoint( v ).x ),
|
||||
iu2hyp( holeShape.CPoint( v ).y ) );
|
||||
iu2hyp( -holeShape.CPoint( v ).y ) );
|
||||
}
|
||||
|
||||
m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
|
||||
iu2hyp( ph0.x ),
|
||||
iu2hyp( ph0.y ) );
|
||||
iu2hyp( -ph0.y ) );
|
||||
m_out->Print( 1, "}\n" );
|
||||
}
|
||||
|
||||
|
@ -155,18 +155,14 @@ public:
|
||||
|
||||
const wxString& AsString() const override
|
||||
{
|
||||
const_cast<PCBEXPR_NETCLASS_VALUE*>( this )->Set(
|
||||
m_item->GetEffectiveNetClass()->GetName() );
|
||||
const_cast<PCBEXPR_NETCLASS_VALUE*>( this )->Set( m_item->GetEffectiveNetClass()->GetName() );
|
||||
return LIBEVAL::VALUE::AsString();
|
||||
}
|
||||
|
||||
bool EqualTo( LIBEVAL::CONTEXT* aCtx, const VALUE* b ) const override
|
||||
{
|
||||
if( const PCBEXPR_NETCLASS_VALUE* bValue = dynamic_cast<const PCBEXPR_NETCLASS_VALUE*>( b ) )
|
||||
{
|
||||
return *( m_item->GetEffectiveNetClass() )
|
||||
== *( bValue->m_item->GetEffectiveNetClass() );
|
||||
}
|
||||
return *( m_item->GetEffectiveNetClass() ) == *( bValue->m_item->GetEffectiveNetClass() );
|
||||
|
||||
if( b->GetType() == LIBEVAL::VT_STRING )
|
||||
{
|
||||
@ -195,10 +191,7 @@ public:
|
||||
bool NotEqualTo( LIBEVAL::CONTEXT* aCtx, const LIBEVAL::VALUE* b ) const override
|
||||
{
|
||||
if( const PCBEXPR_NETCLASS_VALUE* bValue = dynamic_cast<const PCBEXPR_NETCLASS_VALUE*>( b ) )
|
||||
{
|
||||
return *( m_item->GetEffectiveNetClass() )
|
||||
!= *( bValue->m_item->GetEffectiveNetClass() );
|
||||
}
|
||||
return *( m_item->GetEffectiveNetClass() ) != *( bValue->m_item->GetEffectiveNetClass() );
|
||||
|
||||
if( b->GetType() == LIBEVAL::VT_STRING )
|
||||
{
|
||||
@ -245,7 +238,8 @@ class PCBEXPR_COMPONENT_CLASS_VALUE : public LIBEVAL::VALUE
|
||||
{
|
||||
public:
|
||||
PCBEXPR_COMPONENT_CLASS_VALUE( BOARD_ITEM* aItem ) :
|
||||
LIBEVAL::VALUE( wxEmptyString ), m_item( dynamic_cast<FOOTPRINT*>( aItem ) )
|
||||
LIBEVAL::VALUE( wxEmptyString ),
|
||||
m_item( dynamic_cast<FOOTPRINT*>( aItem ) )
|
||||
{};
|
||||
|
||||
const wxString& AsString() const override
|
||||
@ -261,8 +255,7 @@ public:
|
||||
|
||||
bool EqualTo( LIBEVAL::CONTEXT* aCtx, const VALUE* b ) const override
|
||||
{
|
||||
if( const PCBEXPR_COMPONENT_CLASS_VALUE* bValue =
|
||||
dynamic_cast<const PCBEXPR_COMPONENT_CLASS_VALUE*>( b ) )
|
||||
if( const PCBEXPR_COMPONENT_CLASS_VALUE* bValue = dynamic_cast<const PCBEXPR_COMPONENT_CLASS_VALUE*>( b ) )
|
||||
{
|
||||
if( !m_item || !bValue->m_item )
|
||||
return LIBEVAL::VALUE::EqualTo( aCtx, b );
|
||||
@ -299,8 +292,7 @@ public:
|
||||
|
||||
bool NotEqualTo( LIBEVAL::CONTEXT* aCtx, const LIBEVAL::VALUE* b ) const override
|
||||
{
|
||||
if( const PCBEXPR_COMPONENT_CLASS_VALUE* bValue =
|
||||
dynamic_cast<const PCBEXPR_COMPONENT_CLASS_VALUE*>( b ) )
|
||||
if( const PCBEXPR_COMPONENT_CLASS_VALUE* bValue = dynamic_cast<const PCBEXPR_COMPONENT_CLASS_VALUE*>( b ) )
|
||||
{
|
||||
if( !m_item || !bValue->m_item )
|
||||
return LIBEVAL::VALUE::NotEqualTo( aCtx, b );
|
||||
|
Loading…
x
Reference in New Issue
Block a user