mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Cleanup.
This commit is contained in:
parent
be492af55f
commit
35b2f36759
@ -250,13 +250,18 @@ void FIELDS_GRID_TABLE::initGrid( WX_GRID* aGrid )
|
||||
EMBEDDED_FILES* files = nullptr;
|
||||
|
||||
if( m_frame->GetFrameType() == FRAME_SCH )
|
||||
{
|
||||
files = m_frame->GetScreen()->Schematic();
|
||||
else if( m_frame->GetFrameType() == FRAME_SCH_SYMBOL_EDITOR || m_frame->GetFrameType() == FRAME_SCH_VIEWER )
|
||||
}
|
||||
else if( m_frame->GetFrameType() == FRAME_SCH_SYMBOL_EDITOR
|
||||
|| m_frame->GetFrameType() == FRAME_SCH_VIEWER )
|
||||
{
|
||||
files = m_part;
|
||||
}
|
||||
|
||||
m_urlAttr = new wxGridCellAttr;
|
||||
GRID_CELL_URL_EDITOR* urlEditor =
|
||||
new GRID_CELL_URL_EDITOR( m_dialog, PROJECT_SCH::SchSearchS( &m_frame->Prj() ), files );
|
||||
SEARCH_STACK* prjSearchStack = PROJECT_SCH::SchSearchS( &m_frame->Prj() );
|
||||
GRID_CELL_URL_EDITOR* urlEditor = new GRID_CELL_URL_EDITOR( m_dialog, prjSearchStack, files );
|
||||
urlEditor->SetValidator( m_urlValidator );
|
||||
m_urlAttr->SetEditor( urlEditor );
|
||||
|
||||
@ -323,24 +328,24 @@ void FIELDS_GRID_TABLE::initGrid( WX_GRID* aGrid )
|
||||
for( const auto& [name, netclass] : settings->GetNetclasses() )
|
||||
existingNetclasses.push_back( name );
|
||||
|
||||
// We don't need to re-cache the embedded fonts when looking at symbols in the schematic editor
|
||||
// because the fonts are all available in the schematic.
|
||||
// We don't need to re-cache the embedded fonts when looking at symbols in the schematic
|
||||
// editor because the fonts are all available in the schematic.
|
||||
const std::vector<wxString>* fontFiles = nullptr;
|
||||
|
||||
if( m_frame->GetScreen() && m_frame->GetScreen()->Schematic() )
|
||||
fontFiles = m_frame->GetScreen()->Schematic()->GetEmbeddedFiles()->GetFontFiles();
|
||||
|
||||
Fontconfig()->ListFonts( fontNames, std::string( Pgm().GetLanguageTag().utf8_str() ),
|
||||
fontFiles, false );
|
||||
fontFiles, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<wxString>* fontFiles = m_part->GetEmbeddedFiles()->UpdateFontFiles();
|
||||
|
||||
// If there are font files embedded, we want to re-cache our fonts for each symbol that we
|
||||
// are looking at in the symbol editor.
|
||||
// If there are font files embedded, we want to re-cache our fonts for each symbol that
|
||||
// we are looking at in the symbol editor.
|
||||
Fontconfig()->ListFonts( fontNames, std::string( Pgm().GetLanguageTag().utf8_str() ),
|
||||
fontFiles, !fontFiles->empty() );
|
||||
fontFiles, !fontFiles->empty() );
|
||||
}
|
||||
|
||||
m_netclassAttr = new wxGridCellAttr;
|
||||
@ -986,7 +991,7 @@ wxString FIELDS_GRID_TABLE::StringFromBool( bool aValue ) const
|
||||
}
|
||||
|
||||
|
||||
bool FIELDS_GRID_TABLE::BoolFromString( wxString aValue ) const
|
||||
bool FIELDS_GRID_TABLE::BoolFromString( const wxString& aValue ) const
|
||||
{
|
||||
if( aValue == wxS( "1" ) )
|
||||
{
|
||||
|
@ -48,7 +48,9 @@ public:
|
||||
protected:
|
||||
void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
|
||||
void doPopupSelection( wxCommandEvent& event ) override;
|
||||
DIALOG_SHIM* m_dlg;
|
||||
|
||||
protected::
|
||||
DIALOG_SHIM* m_dlg;
|
||||
EMBEDDED_FILES* m_files;
|
||||
};
|
||||
|
||||
@ -109,7 +111,7 @@ public:
|
||||
void SetValueAsBool( int aRow, int aCol, bool aValue ) override;
|
||||
|
||||
wxString StringFromBool( bool aValue ) const;
|
||||
bool BoolFromString( wxString aValue ) const;
|
||||
bool BoolFromString( const wxString& aValue ) const;
|
||||
|
||||
protected:
|
||||
void initGrid( WX_GRID* aGrid );
|
||||
@ -117,13 +119,13 @@ protected:
|
||||
void onUnitsChanged( wxCommandEvent& aEvent );
|
||||
|
||||
private:
|
||||
SCH_BASE_FRAME* m_frame;
|
||||
DIALOG_SHIM* m_dialog;
|
||||
KICAD_T m_parentType;
|
||||
int m_mandatoryFieldCount;
|
||||
LIB_SYMBOL* m_part;
|
||||
wxString m_symbolNetlist;
|
||||
wxString m_curdir;
|
||||
SCH_BASE_FRAME* m_frame;
|
||||
DIALOG_SHIM* m_dialog;
|
||||
KICAD_T m_parentType;
|
||||
int m_mandatoryFieldCount;
|
||||
LIB_SYMBOL* m_part;
|
||||
wxString m_symbolNetlist;
|
||||
wxString m_curdir;
|
||||
|
||||
FIELD_VALIDATOR m_fieldNameValidator;
|
||||
FIELD_VALIDATOR m_referenceValidator;
|
||||
@ -132,21 +134,21 @@ private:
|
||||
FIELD_VALIDATOR m_nonUrlValidator;
|
||||
FIELD_VALIDATOR m_filepathValidator;
|
||||
|
||||
wxGridCellAttr* m_readOnlyAttr;
|
||||
wxGridCellAttr* m_fieldNameAttr;
|
||||
wxGridCellAttr* m_referenceAttr;
|
||||
wxGridCellAttr* m_valueAttr;
|
||||
wxGridCellAttr* m_footprintAttr;
|
||||
wxGridCellAttr* m_urlAttr;
|
||||
wxGridCellAttr* m_nonUrlAttr;
|
||||
wxGridCellAttr* m_filepathAttr;
|
||||
wxGridCellAttr* m_boolAttr;
|
||||
wxGridCellAttr* m_vAlignAttr;
|
||||
wxGridCellAttr* m_hAlignAttr;
|
||||
wxGridCellAttr* m_orientationAttr;
|
||||
wxGridCellAttr* m_netclassAttr;
|
||||
wxGridCellAttr* m_fontAttr;
|
||||
wxGridCellAttr* m_colorAttr;
|
||||
wxGridCellAttr* m_readOnlyAttr;
|
||||
wxGridCellAttr* m_fieldNameAttr;
|
||||
wxGridCellAttr* m_referenceAttr;
|
||||
wxGridCellAttr* m_valueAttr;
|
||||
wxGridCellAttr* m_footprintAttr;
|
||||
wxGridCellAttr* m_urlAttr;
|
||||
wxGridCellAttr* m_nonUrlAttr;
|
||||
wxGridCellAttr* m_filepathAttr;
|
||||
wxGridCellAttr* m_boolAttr;
|
||||
wxGridCellAttr* m_vAlignAttr;
|
||||
wxGridCellAttr* m_hAlignAttr;
|
||||
wxGridCellAttr* m_orientationAttr;
|
||||
wxGridCellAttr* m_netclassAttr;
|
||||
wxGridCellAttr* m_fontAttr;
|
||||
wxGridCellAttr* m_colorAttr;
|
||||
|
||||
std::unique_ptr<NUMERIC_EVALUATOR> m_eval;
|
||||
std::map< std::pair<int, int>, wxString > m_evalOriginal;
|
||||
|
Loading…
x
Reference in New Issue
Block a user