Update naming.
This commit is contained in:
parent
253b2da717
commit
8a720ef305
|
@ -187,7 +187,7 @@ set( EESCHEMA_SRCS
|
||||||
lib_polyline.cpp
|
lib_polyline.cpp
|
||||||
lib_rectangle.cpp
|
lib_rectangle.cpp
|
||||||
lib_text.cpp
|
lib_text.cpp
|
||||||
lib_view_frame.cpp
|
symbol_viewer_frame.cpp
|
||||||
libarch.cpp
|
libarch.cpp
|
||||||
menubar.cpp
|
menubar.cpp
|
||||||
pin_number.cpp
|
pin_number.cpp
|
||||||
|
@ -233,7 +233,7 @@ set( EESCHEMA_SRCS
|
||||||
symbol_lib_table.cpp
|
symbol_lib_table.cpp
|
||||||
symbol_tree_model_adapter.cpp
|
symbol_tree_model_adapter.cpp
|
||||||
symbol_tree_synchronizing_adapter.cpp
|
symbol_tree_synchronizing_adapter.cpp
|
||||||
toolbars_lib_view.cpp
|
toolbars_symbol_viewer.cpp
|
||||||
toolbars_sch_editor.cpp
|
toolbars_sch_editor.cpp
|
||||||
transform.cpp
|
transform.cpp
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include <class_library.h>
|
#include <class_library.h>
|
||||||
#include <core/kicad_algo.h>
|
#include <core/kicad_algo.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <project_rescue.h>
|
#include <project_rescue.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io_mgr.h>
|
||||||
#include <sch_component.h>
|
#include <sch_component.h>
|
||||||
|
@ -95,7 +95,7 @@ void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
|
||||||
|
|
||||||
if( RESCUER::RescueProject( this, rescuer, false ) )
|
if( RESCUER::RescueProject( this, rescuer, false ) )
|
||||||
{
|
{
|
||||||
LIB_VIEW_FRAME* viewer = (LIB_VIEW_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false );
|
auto viewer = (SYMBOL_VIEWER_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false );
|
||||||
|
|
||||||
if( viewer )
|
if( viewer )
|
||||||
viewer->ReCreateLibList();
|
viewer->ReCreateLibList();
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include <env_paths.h>
|
#include <env_paths.h>
|
||||||
#include <eeschema_id.h>
|
#include <eeschema_id.h>
|
||||||
#include <symbol_edit_frame.h>
|
#include <symbol_edit_frame.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
|
@ -925,7 +925,7 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
|
||||||
{
|
{
|
||||||
auto* schEditor = (SCH_EDIT_FRAME*) aKiway->Player( FRAME_SCH, false );
|
auto* schEditor = (SCH_EDIT_FRAME*) aKiway->Player( FRAME_SCH, false );
|
||||||
auto* symbolEditor = (SYMBOL_EDIT_FRAME*) aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
|
auto* symbolEditor = (SYMBOL_EDIT_FRAME*) aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
|
||||||
auto* symbolViewer = (LIB_VIEW_FRAME*) aKiway->Player( FRAME_SCH_VIEWER, false );
|
auto* symbolViewer = (SYMBOL_VIEWER_FRAME*) aKiway->Player( FRAME_SCH_VIEWER, false );
|
||||||
|
|
||||||
SYMBOL_LIB_TABLE* globalTable = &SYMBOL_LIB_TABLE::GetGlobalLibTable();
|
SYMBOL_LIB_TABLE* globalTable = &SYMBOL_LIB_TABLE::GetGlobalLibTable();
|
||||||
wxString globalTablePath = SYMBOL_LIB_TABLE::GetGlobalTableFileName();
|
wxString globalTablePath = SYMBOL_LIB_TABLE::GetGlobalTableFileName();
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <eeschema_settings.h>
|
#include <eeschema_settings.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <symbol_edit_frame.h>
|
#include <symbol_edit_frame.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <transform.h>
|
#include <transform.h>
|
||||||
#include <symbol_lib_table.h>
|
#include <symbol_lib_table.h>
|
||||||
#include <dialogs/dialog_global_sym_lib_table_config.h>
|
#include <dialogs/dialog_global_sym_lib_table_config.h>
|
||||||
|
@ -155,7 +155,8 @@ static struct IFACE : public KIFACE_I
|
||||||
case FRAME_SCH_VIEWER:
|
case FRAME_SCH_VIEWER:
|
||||||
case FRAME_SCH_VIEWER_MODAL:
|
case FRAME_SCH_VIEWER_MODAL:
|
||||||
{
|
{
|
||||||
LIB_VIEW_FRAME* frame = new LIB_VIEW_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
|
SYMBOL_VIEWER_FRAME* frame = new SYMBOL_VIEWER_FRAME( aKiway, aParent,
|
||||||
|
FRAME_T( aClassId ) );
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <eeschema_id.h>
|
#include <eeschema_id.h>
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
#include <sch_component.h>
|
#include <sch_component.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
|
@ -46,41 +46,41 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibBrowser( wxTopLevelWindow* aParen
|
||||||
int aUnit, int aConvert )
|
int aUnit, int aConvert )
|
||||||
{
|
{
|
||||||
// Close any open non-modal Lib browser, and open a new one, in "modal" mode:
|
// Close any open non-modal Lib browser, and open a new one, in "modal" mode:
|
||||||
LIB_VIEW_FRAME* viewlibFrame = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false );
|
SYMBOL_VIEWER_FRAME* viewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false );
|
||||||
|
|
||||||
if( viewlibFrame )
|
if( viewer )
|
||||||
viewlibFrame->Destroy();
|
viewer->Destroy();
|
||||||
|
|
||||||
viewlibFrame = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, true, aParent );
|
viewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, true, aParent );
|
||||||
|
|
||||||
if( aFilter )
|
if( aFilter )
|
||||||
viewlibFrame->SetFilter( aFilter );
|
viewer->SetFilter( aFilter );
|
||||||
|
|
||||||
if( aPreselectedLibId.IsValid() )
|
if( aPreselectedLibId.IsValid() )
|
||||||
{
|
{
|
||||||
viewlibFrame->SetSelectedLibrary( aPreselectedLibId.GetLibNickname() );
|
viewer->SetSelectedLibrary( aPreselectedLibId.GetLibNickname() );
|
||||||
viewlibFrame->SetSelectedComponent( aPreselectedLibId.GetLibItemName() );
|
viewer->SetSelectedComponent( aPreselectedLibId.GetLibItemName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
viewlibFrame->SetUnitAndConvert( aUnit, aConvert );
|
viewer->SetUnitAndConvert( aUnit, aConvert );
|
||||||
|
|
||||||
viewlibFrame->Refresh();
|
viewer->Refresh();
|
||||||
|
|
||||||
PICKED_SYMBOL sel;
|
PICKED_SYMBOL sel;
|
||||||
wxString symbol;
|
wxString symbol;
|
||||||
|
|
||||||
if( viewlibFrame->ShowModal( &symbol, aParent ) )
|
if( viewer->ShowModal( &symbol, aParent ) )
|
||||||
{
|
{
|
||||||
LIB_ID id;
|
LIB_ID id;
|
||||||
|
|
||||||
if( id.Parse( symbol ) == -1 )
|
if( id.Parse( symbol ) == -1 )
|
||||||
sel.LibId = id;
|
sel.LibId = id;
|
||||||
|
|
||||||
sel.Unit = viewlibFrame->GetUnit();
|
sel.Unit = viewer->GetUnit();
|
||||||
sel.Convert = viewlibFrame->GetConvert();
|
sel.Convert = viewer->GetConvert();
|
||||||
}
|
}
|
||||||
|
|
||||||
viewlibFrame->Destroy();
|
viewer->Destroy();
|
||||||
|
|
||||||
return sel;
|
return sel;
|
||||||
}
|
}
|
||||||
|
@ -88,10 +88,8 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibBrowser( wxTopLevelWindow* aParen
|
||||||
|
|
||||||
PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibTree( const SCHLIB_FILTER* aFilter,
|
PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibTree( const SCHLIB_FILTER* aFilter,
|
||||||
std::vector<PICKED_SYMBOL>& aHistoryList,
|
std::vector<PICKED_SYMBOL>& aHistoryList,
|
||||||
bool aUseLibBrowser,
|
bool aUseLibBrowser, int aUnit, int aConvert,
|
||||||
int aUnit, int aConvert,
|
bool aShowFootprints, const LIB_ID* aHighlight,
|
||||||
bool aShowFootprints,
|
|
||||||
const LIB_ID* aHighlight,
|
|
||||||
bool aAllowFields )
|
bool aAllowFields )
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> dialogLock( DIALOG_CHOOSE_SYMBOL::g_Mutex, std::defer_lock );
|
std::unique_lock<std::mutex> dialogLock( DIALOG_CHOOSE_SYMBOL::g_Mutex, std::defer_lock );
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <connection_graph.h>
|
#include <connection_graph.h>
|
||||||
#include <invoke_sch_dialog.h>
|
#include <invoke_sch_dialog.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <project_rescue.h>
|
#include <project_rescue.h>
|
||||||
#include <sch_component.h>
|
#include <sch_component.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace KIGFX
|
||||||
|
|
||||||
class PAGE_INFO;
|
class PAGE_INFO;
|
||||||
class TITLE_BLOCK;
|
class TITLE_BLOCK;
|
||||||
class LIB_VIEW_FRAME;
|
class SYMBOL_VIEWER_FRAME;
|
||||||
class SYMBOL_EDIT_FRAME;
|
class SYMBOL_EDIT_FRAME;
|
||||||
class LIB_PART;
|
class LIB_PART;
|
||||||
class PART_LIB;
|
class PART_LIB;
|
||||||
|
@ -80,7 +80,7 @@ LIB_PART* SchGetLibPart( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A shim class between EDA_DRAW_FRAME and several derived classes:
|
* A shim class between EDA_DRAW_FRAME and several derived classes:
|
||||||
* SYMBOL_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME, and it brings in a
|
* SYMBOL_EDIT_FRAME, SYMBOL_VIEWER_FRAME, and SCH_EDIT_FRAME, and it brings in a
|
||||||
* common way of handling the provided virtual functions for the derived classes.
|
* common way of handling the provided virtual functions for the derived classes.
|
||||||
*
|
*
|
||||||
* The motivation here is to switch onto GetScreen() for the underlying data model.
|
* The motivation here is to switch onto GetScreen() for the underlying data model.
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include <kiplatform/app.h>
|
#include <kiplatform/app.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
#include <symbol_edit_frame.h>
|
#include <symbol_edit_frame.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
#include <profile.h>
|
#include <profile.h>
|
||||||
#include <project.h>
|
#include <project.h>
|
||||||
|
@ -600,12 +600,12 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||||
if( symbolEditor && !symbolEditor->Close() ) // Can close symbol editor?
|
if( symbolEditor && !symbolEditor->Close() ) // Can close symbol editor?
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto* symbolViewer = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false );
|
auto* symbolViewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false );
|
||||||
|
|
||||||
if( symbolViewer && !symbolViewer->Close() ) // Can close symbol viewer?
|
if( symbolViewer && !symbolViewer->Close() ) // Can close symbol viewer?
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
symbolViewer = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, false );
|
symbolViewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, false );
|
||||||
|
|
||||||
if( symbolViewer && !symbolViewer->Close() ) // Can close modal symbol viewer?
|
if( symbolViewer && !symbolViewer->Close() ) // Can close modal symbol viewer?
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <eeschema_settings.h>
|
#include <eeschema_settings.h>
|
||||||
#include <kiface_i.h>
|
#include <kiface_i.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <widgets/msgpanel.h>
|
#include <widgets/msgpanel.h>
|
||||||
#include <sch_view.h>
|
#include <sch_view.h>
|
||||||
#include <sch_painter.h>
|
#include <sch_painter.h>
|
||||||
|
@ -57,34 +57,34 @@
|
||||||
#include <default_values.h>
|
#include <default_values.h>
|
||||||
|
|
||||||
// Save previous component library viewer state.
|
// Save previous component library viewer state.
|
||||||
wxString LIB_VIEW_FRAME::m_libraryName;
|
wxString SYMBOL_VIEWER_FRAME::m_libraryName;
|
||||||
wxString LIB_VIEW_FRAME::m_entryName;
|
wxString SYMBOL_VIEWER_FRAME::m_entryName;
|
||||||
|
|
||||||
int LIB_VIEW_FRAME::m_unit = 1;
|
int SYMBOL_VIEWER_FRAME::m_unit = 1;
|
||||||
int LIB_VIEW_FRAME::m_convert = 1;
|
int SYMBOL_VIEWER_FRAME::m_convert = 1;
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE( LIB_VIEW_FRAME, EDA_DRAW_FRAME )
|
BEGIN_EVENT_TABLE( SYMBOL_VIEWER_FRAME, EDA_DRAW_FRAME )
|
||||||
// Window events
|
// Window events
|
||||||
EVT_SIZE( LIB_VIEW_FRAME::OnSize )
|
EVT_SIZE( SYMBOL_VIEWER_FRAME::OnSize )
|
||||||
EVT_ACTIVATE( LIB_VIEW_FRAME::OnActivate )
|
EVT_ACTIVATE( SYMBOL_VIEWER_FRAME::OnActivate )
|
||||||
|
|
||||||
// Toolbar events
|
// Toolbar events
|
||||||
EVT_TOOL( ID_LIBVIEW_SELECT_PART, LIB_VIEW_FRAME::OnSelectSymbol )
|
EVT_TOOL( ID_LIBVIEW_SELECT_PART, SYMBOL_VIEWER_FRAME::OnSelectSymbol )
|
||||||
EVT_TOOL( ID_LIBVIEW_NEXT, LIB_VIEW_FRAME::onSelectNextSymbol )
|
EVT_TOOL( ID_LIBVIEW_NEXT, SYMBOL_VIEWER_FRAME::onSelectNextSymbol )
|
||||||
EVT_TOOL( ID_LIBVIEW_PREVIOUS, LIB_VIEW_FRAME::onSelectPreviousSymbol )
|
EVT_TOOL( ID_LIBVIEW_PREVIOUS, SYMBOL_VIEWER_FRAME::onSelectPreviousSymbol )
|
||||||
EVT_CHOICE( ID_LIBVIEW_SELECT_PART_NUMBER, LIB_VIEW_FRAME::onSelectSymbolUnit )
|
EVT_CHOICE( ID_LIBVIEW_SELECT_PART_NUMBER, SYMBOL_VIEWER_FRAME::onSelectSymbolUnit )
|
||||||
|
|
||||||
// listbox events
|
// listbox events
|
||||||
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, LIB_VIEW_FRAME::ClickOnLibList )
|
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, SYMBOL_VIEWER_FRAME::ClickOnLibList )
|
||||||
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::ClickOnCmpList )
|
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, SYMBOL_VIEWER_FRAME::ClickOnCmpList )
|
||||||
EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::DClickOnCmpList )
|
EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST, SYMBOL_VIEWER_FRAME::DClickOnCmpList )
|
||||||
|
|
||||||
// Menu (and/or hotkey) events
|
// Menu (and/or hotkey) events
|
||||||
EVT_MENU( wxID_CLOSE, LIB_VIEW_FRAME::CloseLibraryViewer )
|
EVT_MENU( wxID_CLOSE, SYMBOL_VIEWER_FRAME::CloseLibraryViewer )
|
||||||
EVT_MENU( ID_GRID_SETTINGS, SCH_BASE_FRAME::OnGridSettings )
|
EVT_MENU( ID_GRID_SETTINGS, SCH_BASE_FRAME::OnGridSettings )
|
||||||
|
|
||||||
EVT_UPDATE_UI( ID_LIBVIEW_SELECT_PART_NUMBER, LIB_VIEW_FRAME::onUpdateUnitChoice )
|
EVT_UPDATE_UI( ID_LIBVIEW_SELECT_PART_NUMBER, SYMBOL_VIEWER_FRAME::onUpdateUnitChoice )
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
@ -96,8 +96,8 @@ END_EVENT_TABLE()
|
||||||
#define LIB_VIEW_STYLE_MODAL ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT )
|
#define LIB_VIEW_STYLE_MODAL ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT )
|
||||||
|
|
||||||
|
|
||||||
LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||||
const wxString& aLibraryName ) :
|
const wxString& aLibraryName ) :
|
||||||
SCH_BASE_FRAME( aKiway, aParent, aFrameType, _( "Symbol Library Browser" ),
|
SCH_BASE_FRAME( aKiway, aParent, aFrameType, _( "Symbol Library Browser" ),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_STYLE_MODAL : LIB_VIEW_STYLE,
|
aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_STYLE_MODAL : LIB_VIEW_STYLE,
|
||||||
|
@ -210,7 +210,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIB_VIEW_FRAME::~LIB_VIEW_FRAME()
|
SYMBOL_VIEWER_FRAME::~SYMBOL_VIEWER_FRAME()
|
||||||
{
|
{
|
||||||
// Shutdown all running tools
|
// Shutdown all running tools
|
||||||
if( m_toolManager )
|
if( m_toolManager )
|
||||||
|
@ -221,7 +221,7 @@ LIB_VIEW_FRAME::~LIB_VIEW_FRAME()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::setupTools()
|
void SYMBOL_VIEWER_FRAME::setupTools()
|
||||||
{
|
{
|
||||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||||
m_toolManager = new TOOL_MANAGER;
|
m_toolManager = new TOOL_MANAGER;
|
||||||
|
@ -248,7 +248,7 @@ void LIB_VIEW_FRAME::setupTools()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::setupUIConditions()
|
void SYMBOL_VIEWER_FRAME::setupUIConditions()
|
||||||
{
|
{
|
||||||
SCH_BASE_FRAME::setupUIConditions();
|
SCH_BASE_FRAME::setupUIConditions();
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ void LIB_VIEW_FRAME::setupUIConditions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::SetUnitAndConvert( int aUnit, int aConvert )
|
void SYMBOL_VIEWER_FRAME::SetUnitAndConvert( int aUnit, int aConvert )
|
||||||
{
|
{
|
||||||
m_unit = aUnit > 0 ? aUnit : 1;
|
m_unit = aUnit > 0 ? aUnit : 1;
|
||||||
m_convert = aConvert > 0 ? aConvert : LIB_ITEM::LIB_CONVERT::BASE;
|
m_convert = aConvert > 0 ? aConvert : LIB_ITEM::LIB_CONVERT::BASE;
|
||||||
|
@ -319,7 +319,7 @@ void LIB_VIEW_FRAME::SetUnitAndConvert( int aUnit, int aConvert )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIB_PART* LIB_VIEW_FRAME::GetSelectedSymbol() const
|
LIB_PART* SYMBOL_VIEWER_FRAME::GetSelectedSymbol() const
|
||||||
{
|
{
|
||||||
LIB_PART* symbol = nullptr;
|
LIB_PART* symbol = nullptr;
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ LIB_PART* LIB_VIEW_FRAME::GetSelectedSymbol() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::updatePreviewSymbol()
|
void SYMBOL_VIEWER_FRAME::updatePreviewSymbol()
|
||||||
{
|
{
|
||||||
LIB_PART* symbol = GetSelectedSymbol();
|
LIB_PART* symbol = GetSelectedSymbol();
|
||||||
KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
|
KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
|
||||||
|
@ -367,7 +367,7 @@ void LIB_VIEW_FRAME::updatePreviewSymbol()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_VIEW_FRAME::ShowModal( wxString* aSymbol, wxWindow* aParent )
|
bool SYMBOL_VIEWER_FRAME::ShowModal( wxString* aSymbol, wxWindow* aParent )
|
||||||
{
|
{
|
||||||
if( aSymbol && !aSymbol->IsEmpty() )
|
if( aSymbol && !aSymbol->IsEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -407,7 +407,7 @@ bool LIB_VIEW_FRAME::ShowModal( wxString* aSymbol, wxWindow* aParent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::doCloseWindow()
|
void SYMBOL_VIEWER_FRAME::doCloseWindow()
|
||||||
{
|
{
|
||||||
GetCanvas()->StopDrawing();
|
GetCanvas()->StopDrawing();
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ void LIB_VIEW_FRAME::doCloseWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::OnSize( wxSizeEvent& SizeEv )
|
void SYMBOL_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv )
|
||||||
{
|
{
|
||||||
if( m_auimgr.GetManagedWindow() )
|
if( m_auimgr.GetManagedWindow() )
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
@ -434,7 +434,7 @@ void LIB_VIEW_FRAME::OnSize( wxSizeEvent& SizeEv )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent )
|
void SYMBOL_VIEWER_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
LIB_PART* part = GetSelectedSymbol();
|
LIB_PART* part = GetSelectedSymbol();
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ void LIB_VIEW_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_VIEW_FRAME::ReCreateLibList()
|
bool SYMBOL_VIEWER_FRAME::ReCreateLibList()
|
||||||
{
|
{
|
||||||
if( !m_libList )
|
if( !m_libList )
|
||||||
return false;
|
return false;
|
||||||
|
@ -537,7 +537,7 @@ bool LIB_VIEW_FRAME::ReCreateLibList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_VIEW_FRAME::ReCreateSymbolList()
|
bool SYMBOL_VIEWER_FRAME::ReCreateSymbolList()
|
||||||
{
|
{
|
||||||
if( m_symbolList == NULL )
|
if( m_symbolList == NULL )
|
||||||
return false;
|
return false;
|
||||||
|
@ -587,7 +587,7 @@ bool LIB_VIEW_FRAME::ReCreateSymbolList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
|
void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int ii = m_libList->GetSelection();
|
int ii = m_libList->GetSelection();
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName )
|
void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName )
|
||||||
{
|
{
|
||||||
if( m_libraryName == aLibraryName )
|
if( m_libraryName == aLibraryName )
|
||||||
return;
|
return;
|
||||||
|
@ -623,7 +623,7 @@ void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
|
void SYMBOL_VIEWER_FRAME::ClickOnCmpList( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int ii = m_symbolList->GetSelection();
|
int ii = m_symbolList->GetSelection();
|
||||||
|
|
||||||
|
@ -642,7 +642,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName )
|
void SYMBOL_VIEWER_FRAME::SetSelectedComponent( const wxString& aComponentName )
|
||||||
{
|
{
|
||||||
if( m_entryName != aComponentName )
|
if( m_entryName != aComponentName )
|
||||||
{
|
{
|
||||||
|
@ -667,13 +667,13 @@ void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::DClickOnCmpList( wxCommandEvent& event )
|
void SYMBOL_VIEWER_FRAME::DClickOnCmpList( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
m_toolManager->RunAction( EE_ACTIONS::addSymbolToSchematic, true );
|
m_toolManager->RunAction( EE_ACTIONS::addSymbolToSchematic, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
void SYMBOL_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
{
|
{
|
||||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ void LIB_VIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg)
|
void SYMBOL_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg)
|
||||||
{
|
{
|
||||||
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
|
@ -713,7 +713,7 @@ void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WINDOW_SETTINGS* LIB_VIEW_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg )
|
WINDOW_SETTINGS* SYMBOL_VIEWER_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
{
|
{
|
||||||
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg );
|
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg );
|
||||||
wxASSERT( cfg );
|
wxASSERT( cfg );
|
||||||
|
@ -721,7 +721,7 @@ WINDOW_SETTINGS* LIB_VIEW_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
void SYMBOL_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||||
{
|
{
|
||||||
SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||||
|
|
||||||
|
@ -730,7 +730,7 @@ void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event )
|
void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
|
||||||
{
|
{
|
||||||
if( event.GetActive() )
|
if( event.GetActive() )
|
||||||
{
|
{
|
||||||
|
@ -748,13 +748,13 @@ void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::CloseLibraryViewer( wxCommandEvent& event )
|
void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::SetFilter( const SCHLIB_FILTER* aFilter )
|
void SYMBOL_VIEWER_FRAME::SetFilter( const SCHLIB_FILTER* aFilter )
|
||||||
{
|
{
|
||||||
m_listPowerCmpOnly = false;
|
m_listPowerCmpOnly = false;
|
||||||
m_allowedLibs.Clear();
|
m_allowedLibs.Clear();
|
||||||
|
@ -769,7 +769,7 @@ void LIB_VIEW_FRAME::SetFilter( const SCHLIB_FILTER* aFilter )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const BOX2I LIB_VIEW_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
|
const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
|
||||||
{
|
{
|
||||||
LIB_PART* part = GetSelectedSymbol();
|
LIB_PART* part = GetSelectedSymbol();
|
||||||
|
|
||||||
|
@ -791,7 +791,7 @@ const BOX2I LIB_VIEW_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::FinishModal()
|
void SYMBOL_VIEWER_FRAME::FinishModal()
|
||||||
{
|
{
|
||||||
if( m_symbolList->GetSelection() >= 0 )
|
if( m_symbolList->GetSelection() >= 0 )
|
||||||
DismissModal( true, m_libraryName + ':' + m_symbolList->GetStringSelection() );
|
DismissModal( true, m_libraryName + ':' + m_symbolList->GetStringSelection() );
|
||||||
|
@ -802,7 +802,7 @@ void LIB_VIEW_FRAME::FinishModal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::OnSelectSymbol( wxCommandEvent& aEvent )
|
void SYMBOL_VIEWER_FRAME::OnSelectSymbol( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> dialogLock( DIALOG_CHOOSE_SYMBOL::g_Mutex, std::defer_lock );
|
std::unique_lock<std::mutex> dialogLock( DIALOG_CHOOSE_SYMBOL::g_Mutex, std::defer_lock );
|
||||||
|
|
||||||
|
@ -846,7 +846,7 @@ void LIB_VIEW_FRAME::OnSelectSymbol( wxCommandEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent )
|
void SYMBOL_VIEWER_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
|
wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
|
||||||
int ii = m_symbolList->GetSelection();
|
int ii = m_symbolList->GetSelection();
|
||||||
|
@ -860,7 +860,7 @@ void LIB_VIEW_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::onSelectPreviousSymbol( wxCommandEvent& aEvent )
|
void SYMBOL_VIEWER_FRAME::onSelectPreviousSymbol( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
|
wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
|
||||||
int ii = m_symbolList->GetSelection();
|
int ii = m_symbolList->GetSelection();
|
||||||
|
@ -874,7 +874,7 @@ void LIB_VIEW_FRAME::onSelectPreviousSymbol( wxCommandEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
|
void SYMBOL_VIEWER_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
int ii = m_unitChoice->GetSelection();
|
int ii = m_unitChoice->GetSelection();
|
||||||
|
|
||||||
|
@ -887,7 +887,7 @@ void LIB_VIEW_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::DisplayLibInfos()
|
void SYMBOL_VIEWER_FRAME::DisplayLibInfos()
|
||||||
{
|
{
|
||||||
if( m_libList && !m_libList->IsEmpty() && !m_libraryName.IsEmpty() )
|
if( m_libList && !m_libList->IsEmpty() && !m_libraryName.IsEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -900,7 +900,7 @@ void LIB_VIEW_FRAME::DisplayLibInfos()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SELECTION& LIB_VIEW_FRAME::GetCurrentSelection()
|
SELECTION& SYMBOL_VIEWER_FRAME::GetCurrentSelection()
|
||||||
{
|
{
|
||||||
return m_toolManager->GetTool<EE_SELECTION_TOOL>()->GetSelection();
|
return m_toolManager->GetTool<EE_SELECTION_TOOL>()->GetSelection();
|
||||||
}
|
}
|
|
@ -40,7 +40,7 @@ class SYMBOL_LIB_TABLE_ROW;
|
||||||
/**
|
/**
|
||||||
* Symbol library viewer main window.
|
* Symbol library viewer main window.
|
||||||
*/
|
*/
|
||||||
class LIB_VIEW_FRAME : public SCH_BASE_FRAME
|
class SYMBOL_VIEWER_FRAME : public SCH_BASE_FRAME
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -51,10 +51,10 @@ public:
|
||||||
* @param aFrameType must be either FRAME_SCH_LIB_VIEWER or FRAME_SCH_LIB_VIEWER_MODAL
|
* @param aFrameType must be either FRAME_SCH_LIB_VIEWER or FRAME_SCH_LIB_VIEWER_MODAL
|
||||||
* @param aLibrary = the library to open when starting (default = NULL)
|
* @param aLibrary = the library to open when starting (default = NULL)
|
||||||
*/
|
*/
|
||||||
LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||||
FRAME_T aFrameType, const wxString& aLibraryName = wxEmptyString );
|
const wxString& aLibraryName = wxEmptyString );
|
||||||
|
|
||||||
~LIB_VIEW_FRAME();
|
~SYMBOL_VIEWER_FRAME();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ShowModal
|
* Function ShowModal
|
|
@ -24,7 +24,7 @@
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include "class_library.h"
|
#include "class_library.h"
|
||||||
#include "eeschema_id.h"
|
#include "eeschema_id.h"
|
||||||
#include "lib_view_frame.h"
|
#include "symbol_viewer_frame.h"
|
||||||
#include "sch_painter.h"
|
#include "sch_painter.h"
|
||||||
#include <tool/action_menu.h>
|
#include <tool/action_menu.h>
|
||||||
#include <tool/action_toolbar.h>
|
#include <tool/action_toolbar.h>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
#include <tools/symbol_editor_control.h>
|
#include <tools/symbol_editor_control.h>
|
||||||
#include <widgets/wx_menubar.h>
|
#include <widgets/wx_menubar.h>
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::ReCreateHToolbar()
|
void SYMBOL_VIEWER_FRAME::ReCreateHToolbar()
|
||||||
{
|
{
|
||||||
if( m_mainToolBar )
|
if( m_mainToolBar )
|
||||||
{
|
{
|
||||||
|
@ -41,8 +41,7 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR,
|
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
|
||||||
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_HORIZONTAL );
|
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_HORIZONTAL );
|
||||||
m_mainToolBar->SetAuiManager( &m_auimgr );
|
m_mainToolBar->SetAuiManager( &m_auimgr );
|
||||||
}
|
}
|
||||||
|
@ -89,12 +88,12 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::ReCreateVToolbar()
|
void SYMBOL_VIEWER_FRAME::ReCreateVToolbar()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::ReCreateMenuBar()
|
void SYMBOL_VIEWER_FRAME::ReCreateMenuBar()
|
||||||
{
|
{
|
||||||
SYMBOL_EDITOR_CONTROL* libControl = m_toolManager->GetTool<SYMBOL_EDITOR_CONTROL>();
|
SYMBOL_EDITOR_CONTROL* libControl = m_toolManager->GetTool<SYMBOL_EDITOR_CONTROL>();
|
||||||
// wxWidgets handles the OSX Application menu behind the scenes, but that means
|
// wxWidgets handles the OSX Application menu behind the scenes, but that means
|
|
@ -32,11 +32,10 @@
|
||||||
#include <tools/ee_inspection_tool.h>
|
#include <tools/ee_inspection_tool.h>
|
||||||
#include <tools/ee_selection_tool.h>
|
#include <tools/ee_selection_tool.h>
|
||||||
#include <tools/ee_selection.h>
|
#include <tools/ee_selection.h>
|
||||||
#include <search_stack.h>
|
|
||||||
#include <sim/sim_plot_frame.h>
|
#include <sim/sim_plot_frame.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <symbol_edit_frame.h>
|
#include <symbol_edit_frame.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <eda_doc.h>
|
#include <eda_doc.h>
|
||||||
#include <invoke_sch_dialog.h>
|
#include <invoke_sch_dialog.h>
|
||||||
#include <project.h>
|
#include <project.h>
|
||||||
|
@ -394,7 +393,7 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
|
else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
|
||||||
{
|
{
|
||||||
LIB_PART* entry = static_cast<LIB_VIEW_FRAME*>( m_frame )->GetSelectedSymbol();
|
LIB_PART* entry = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame )->GetSelectedSymbol();
|
||||||
|
|
||||||
if( !entry )
|
if( !entry )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <eeschema_id.h> // For MAX_SELECT_ITEM_IDS
|
#include <eeschema_id.h> // For MAX_SELECT_ITEM_IDS
|
||||||
#include <symbol_edit_frame.h>
|
#include <symbol_edit_frame.h>
|
||||||
#include <lib_item.h>
|
#include <lib_item.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <math/util.h>
|
#include <math/util.h>
|
||||||
#include <menus_helpers.h>
|
#include <menus_helpers.h>
|
||||||
#include <painter.h>
|
#include <painter.h>
|
||||||
|
@ -107,7 +107,7 @@ EE_SELECTION_TOOL::EE_SELECTION_TOOL() :
|
||||||
m_skip_heuristics( false ),
|
m_skip_heuristics( false ),
|
||||||
m_nonModifiedCursor( KICURSOR::ARROW ),
|
m_nonModifiedCursor( KICURSOR::ARROW ),
|
||||||
m_isSymbolEditor( false ),
|
m_isSymbolEditor( false ),
|
||||||
m_isLibView( false ),
|
m_isSymbolViewer( false ),
|
||||||
m_unit( 0 ),
|
m_unit( 0 ),
|
||||||
m_convert( 0 )
|
m_convert( 0 )
|
||||||
{
|
{
|
||||||
|
@ -128,8 +128,8 @@ bool EE_SELECTION_TOOL::Init()
|
||||||
{
|
{
|
||||||
m_frame = getEditFrame<SCH_BASE_FRAME>();
|
m_frame = getEditFrame<SCH_BASE_FRAME>();
|
||||||
|
|
||||||
LIB_VIEW_FRAME* libViewFrame = dynamic_cast<LIB_VIEW_FRAME*>( m_frame );
|
SYMBOL_VIEWER_FRAME* symbolViewerFrame = dynamic_cast<SYMBOL_VIEWER_FRAME*>( m_frame );
|
||||||
SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
||||||
|
|
||||||
if( symbolEditorFrame )
|
if( symbolEditorFrame )
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,7 @@ bool EE_SELECTION_TOOL::Init()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_isLibView = libViewFrame != nullptr;
|
m_isSymbolViewer = symbolViewerFrame != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static KICAD_T wireOrBusTypes[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, EOT };
|
static KICAD_T wireOrBusTypes[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, EOT };
|
||||||
|
@ -156,23 +156,24 @@ bool EE_SELECTION_TOOL::Init()
|
||||||
auto schEditSheetPageNumberCondition =
|
auto schEditSheetPageNumberCondition =
|
||||||
[this] ( const SELECTION& aSel )
|
[this] ( const SELECTION& aSel )
|
||||||
{
|
{
|
||||||
return ( !m_isSymbolEditor && !m_isLibView ) && ( E_C::Empty || ( E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T ) ) );
|
return !m_isSymbolEditor
|
||||||
|
&& !m_isSymbolViewer
|
||||||
|
&& ( E_C::Empty || ( E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T ) ) );
|
||||||
};
|
};
|
||||||
|
|
||||||
auto schEditCondition =
|
auto schEditCondition =
|
||||||
[this] ( const SELECTION& aSel )
|
[this] ( const SELECTION& aSel )
|
||||||
{
|
{
|
||||||
return !m_isSymbolEditor && !m_isLibView;
|
return !m_isSymbolEditor && !m_isSymbolViewer;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto belowRootSheetCondition =
|
auto belowRootSheetCondition =
|
||||||
[&]( const SELECTION& aSel )
|
[&]( const SELECTION& aSel )
|
||||||
{
|
{
|
||||||
SCH_EDIT_FRAME* schEditFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
|
SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
|
||||||
|
|
||||||
return ( schEditFrame &&
|
return editFrame
|
||||||
schEditFrame->GetCurrentSheet().Last() !=
|
&& editFrame->GetCurrentSheet().Last() != &editFrame->Schematic().Root();
|
||||||
&schEditFrame->Schematic().Root() );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
auto havePartCondition =
|
auto havePartCondition =
|
||||||
|
@ -231,17 +232,17 @@ void EE_SELECTION_TOOL::Reset( RESET_REASON aReason )
|
||||||
m_selection.Clear();
|
m_selection.Clear();
|
||||||
getView()->GetPainter()->GetSettings()->SetHighlight( false );
|
getView()->GetPainter()->GetSettings()->SetHighlight( false );
|
||||||
|
|
||||||
SYMBOL_EDIT_FRAME* libEditFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
SYMBOL_EDIT_FRAME* symbolEditFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
||||||
LIB_VIEW_FRAME* libViewFrame = dynamic_cast<LIB_VIEW_FRAME*>( m_frame );
|
SYMBOL_VIEWER_FRAME* symbolViewerFrame = dynamic_cast<SYMBOL_VIEWER_FRAME*>( m_frame );
|
||||||
|
|
||||||
if( libEditFrame )
|
if( symbolEditFrame )
|
||||||
{
|
{
|
||||||
m_isSymbolEditor = true;
|
m_isSymbolEditor = true;
|
||||||
m_unit = libEditFrame->GetUnit();
|
m_unit = symbolEditFrame->GetUnit();
|
||||||
m_convert = libEditFrame->GetConvert();
|
m_convert = symbolEditFrame->GetConvert();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_isLibView = libViewFrame != nullptr;
|
m_isSymbolViewer = symbolViewerFrame != nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// Restore previous properties of selected items and remove them from containers
|
// Restore previous properties of selected items and remove them from containers
|
||||||
|
|
|
@ -294,7 +294,7 @@ private:
|
||||||
KICURSOR m_nonModifiedCursor; // Cursor in the absence of shift/ctrl/alt
|
KICURSOR m_nonModifiedCursor; // Cursor in the absence of shift/ctrl/alt
|
||||||
|
|
||||||
bool m_isSymbolEditor; // True when the symbol editor is the parent frame
|
bool m_isSymbolEditor; // True when the symbol editor is the parent frame
|
||||||
bool m_isLibView; // True when libview is the parent frame
|
bool m_isSymbolViewer; // True when the symbol browser is the parent frame
|
||||||
int m_unit; // Fixed unit filter (for symbol editor)
|
int m_unit; // Fixed unit filter (for symbol editor)
|
||||||
int m_convert; // Fixed DeMorgan filter (for symbol editor)
|
int m_convert; // Fixed DeMorgan filter (for symbol editor)
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <advanced_config.h>
|
#include <advanced_config.h>
|
||||||
#include <sim/sim_plot_frame.h>
|
#include <sim/sim_plot_frame.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <status_popup.h>
|
#include <status_popup.h>
|
||||||
#include <tool/picker_tool.h>
|
#include <tool/picker_tool.h>
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
|
@ -157,7 +157,7 @@ bool SCH_EDITOR_CONTROL::rescueProject( RESCUER& aRescuer, bool aRunningOnDemand
|
||||||
KIWAY_PLAYER* viewer = m_frame->Kiway().Player( FRAME_SCH_VIEWER, false );
|
KIWAY_PLAYER* viewer = m_frame->Kiway().Player( FRAME_SCH_VIEWER, false );
|
||||||
|
|
||||||
if( viewer )
|
if( viewer )
|
||||||
static_cast<LIB_VIEW_FRAME*>( viewer )->ReCreateLibList();
|
static_cast<SYMBOL_VIEWER_FRAME*>( viewer )->ReCreateLibList();
|
||||||
|
|
||||||
if( aRunningOnDemand )
|
if( aRunningOnDemand )
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <tools/ee_actions.h>
|
#include <tools/ee_actions.h>
|
||||||
#include <tools/symbol_editor_control.h>
|
#include <tools/symbol_editor_control.h>
|
||||||
#include <symbol_edit_frame.h>
|
#include <symbol_edit_frame.h>
|
||||||
#include <lib_view_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <symbol_tree_model_adapter.h>
|
#include <symbol_tree_model_adapter.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
#include <gestfich.h>
|
#include <gestfich.h>
|
||||||
|
@ -221,16 +221,16 @@ int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent )
|
||||||
m_toolMgr->RunAction( ACTIONS::cancelInteractive, true );
|
m_toolMgr->RunAction( ACTIONS::cancelInteractive, true );
|
||||||
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
|
||||||
|
|
||||||
SYMBOL_EDIT_FRAME* libEditFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
SYMBOL_EDIT_FRAME* symbolEditor = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
||||||
libEditFrame->SetConvert( convert );
|
symbolEditor->SetConvert( convert );
|
||||||
|
|
||||||
m_toolMgr->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
m_toolMgr->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||||
libEditFrame->RebuildView();
|
symbolEditor->RebuildView();
|
||||||
}
|
}
|
||||||
else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
|
else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
|
||||||
{
|
{
|
||||||
LIB_VIEW_FRAME* libViewFrame = static_cast<LIB_VIEW_FRAME*>( m_frame );
|
SYMBOL_VIEWER_FRAME* symbolViewer = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame );
|
||||||
libViewFrame->SetUnitAndConvert( libViewFrame->GetUnit(), convert );
|
symbolViewer->SetUnitAndConvert( symbolViewer->GetUnit(), convert );
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -414,20 +414,20 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LIB_VIEW_FRAME* viewFrame = getEditFrame<LIB_VIEW_FRAME>();
|
SYMBOL_VIEWER_FRAME* viewerFrame = getEditFrame<SYMBOL_VIEWER_FRAME>();
|
||||||
|
|
||||||
if( viewFrame->IsModal() )
|
if( viewerFrame->IsModal() )
|
||||||
{
|
{
|
||||||
// if we're modal then we just need to return the symbol selection; the caller is
|
// if we're modal then we just need to return the symbol selection; the caller is
|
||||||
// already in a EE_ACTIONS::placeSymbol coroutine.
|
// already in a EE_ACTIONS::placeSymbol coroutine.
|
||||||
viewFrame->FinishModal();
|
viewerFrame->FinishModal();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
part = viewFrame->GetSelectedSymbol();
|
part = viewerFrame->GetSelectedSymbol();
|
||||||
unit = viewFrame->GetUnit();
|
unit = viewerFrame->GetUnit();
|
||||||
convert = viewFrame->GetConvert();
|
convert = viewerFrame->GetConvert();
|
||||||
|
|
||||||
if( part )
|
if( part )
|
||||||
libId = part->GetLibId();
|
libId = part->GetLibId();
|
||||||
|
|
Loading…
Reference in New Issue