37 changed files with 197 additions and 587 deletions
-
27common/legacy_gal/block.cpp
-
4common/legacy_gal/eda_draw_frame.cpp
-
7eeschema/CMakeLists.txt
-
2eeschema/connection_graph.h
-
67eeschema/controle.cpp
-
2eeschema/dialogs/dialog_edit_component_in_lib.cpp
-
2eeschema/ee_collectors.h
-
84eeschema/libedit/controller.cpp
-
133eeschema/libedit/lib_edit_frame.cpp
-
16eeschema/libedit/lib_edit_frame.h
-
53eeschema/libedit/libedit.cpp
-
29eeschema/libedit/libedit_onrightclick.cpp
-
3eeschema/libedit/libedit_undo_redo.cpp
-
41eeschema/libedit/libfield.cpp
-
2eeschema/netlist_object.h
-
38eeschema/sch_base_frame.h
-
2eeschema/sch_bitmap.h
-
2eeschema/sch_bus_entry.h
-
2eeschema/sch_field.h
-
2eeschema/sch_item.cpp
-
12eeschema/sch_item.h
-
2eeschema/sch_junction.h
-
2eeschema/sch_line.h
-
2eeschema/sch_marker.h
-
2eeschema/sch_no_connect.h
-
2eeschema/sch_painter.cpp
-
2eeschema/sch_pin.h
-
2eeschema/sch_screen.cpp
-
2eeschema/sch_screen.h
-
2eeschema/sch_sheet_path.cpp
-
2eeschema/sch_text.h
-
186eeschema/selpart.cpp
-
2eeschema/tools/ee_selection_tool.cpp
-
4eeschema/tools/sch_edit_tool.cpp
-
2eeschema/tools/sch_move_tool.cpp
-
2eeschema/tools/selection.cpp
-
38eeschema/viewlib_frame.cpp
@ -1,67 +0,0 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> |
|||
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <fctsys.h>
|
|||
#include <sch_draw_panel.h>
|
|||
#include <sch_edit_frame.h>
|
|||
#include <eeschema_id.h>
|
|||
#include <ee_hotkeys.h>
|
|||
#include <lib_edit_frame.h>
|
|||
#include <viewlib_frame.h>
|
|||
#include <sch_view.h>
|
|||
|
|||
|
|||
bool LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey ) |
|||
{ |
|||
bool eventHandled = true; |
|||
|
|||
// Filter out the 'fake' mouse motion after a keyboard movement
|
|||
if( !aHotKey && m_movingCursorWithKeyboard ) |
|||
{ |
|||
m_movingCursorWithKeyboard = false; |
|||
return false; |
|||
} |
|||
|
|||
wxPoint pos = aPosition; |
|||
GeneralControlKeyMovement( aHotKey, &pos, true ); |
|||
|
|||
// Update cursor position.
|
|||
m_canvas->CrossHairOn( aDC ); |
|||
SetCrossHairPosition( pos, true ); |
|||
|
|||
if( aHotKey ) |
|||
{ |
|||
SCH_SCREEN* screen = GetScreen(); |
|||
|
|||
if( screen->GetCurItem() && screen->GetCurItem()->GetEditFlags() ) |
|||
eventHandled = OnHotKey( aDC, aHotKey, aPosition, screen->GetCurItem() ); |
|||
else |
|||
eventHandled = OnHotKey( aDC, aHotKey, aPosition, NULL ); |
|||
} |
|||
|
|||
UpdateStatusBar(); // Display cursor coordinates info.
|
|||
|
|||
return eventHandled; |
|||
} |
|||
@ -1,84 +0,0 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> |
|||
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <fctsys.h>
|
|||
#include <gr_basic.h>
|
|||
#include <sch_draw_panel.h>
|
|||
#include <eda_dde.h>
|
|||
#include <sch_edit_frame.h>
|
|||
#include <menus_helpers.h>
|
|||
#include <msgpanel.h>
|
|||
#include <bitmaps.h>
|
|||
|
|||
#include <eeschema_id.h>
|
|||
#include <general.h>
|
|||
#include <ee_hotkeys.h>
|
|||
#include <lib_edit_frame.h>
|
|||
#include <viewlib_frame.h>
|
|||
#include <lib_draw_item.h>
|
|||
#include <lib_pin.h>
|
|||
#include <sch_sheet.h>
|
|||
#include <sch_sheet_path.h>
|
|||
#include <sch_marker.h>
|
|||
#include <sch_component.h>
|
|||
#include <sch_view.h>
|
|||
|
|||
bool LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey ) |
|||
{ |
|||
bool keyHandled = false; |
|||
wxPoint pos = aPosition; |
|||
|
|||
// Filter out the 'fake' mouse motion after a keyboard movement
|
|||
if( !aHotKey && m_movingCursorWithKeyboard ) |
|||
{ |
|||
m_movingCursorWithKeyboard = false; |
|||
return false; |
|||
} |
|||
|
|||
if( aHotKey ) |
|||
keyHandled = GeneralControlKeyMovement( aHotKey, &pos, true ); |
|||
|
|||
if( GetToolId() == ID_NO_TOOL_SELECTED ) |
|||
m_canvas->CrossHairOff( aDC ); |
|||
else |
|||
m_canvas->CrossHairOn( aDC ); |
|||
|
|||
GetGalCanvas()->GetViewControls()->SetSnapping( false ); |
|||
SetCrossHairPosition( pos, false ); |
|||
|
|||
if( m_canvas->IsMouseCaptured() ) |
|||
m_canvas->CallMouseCapture( aDC, aPosition, true ); |
|||
|
|||
if( aHotKey && OnHotKey( aDC, aHotKey, aPosition, NULL ) ) |
|||
keyHandled = true; |
|||
|
|||
// Make sure current-part highlighting doesn't get lost in seleciton highlighting
|
|||
ClearSearchTreeSelection(); |
|||
|
|||
UpdateStatusBar(); |
|||
|
|||
return keyHandled; |
|||
} |
|||
|
|||
@ -1,29 +0,0 @@ |
|||
|
|||
#if 0
|
|||
case LIB_POLYLINE_T: |
|||
if( item->IsNew() ) |
|||
{ |
|||
if( ( (LIB_POLYLINE*) item )->GetCornerCount() > 2 ) |
|||
{ |
|||
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE ); |
|||
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, |
|||
msg, KiBitmap( delete_xpm ) ); |
|||
} |
|||
} |
|||
|
|||
break; |
|||
|
|||
//===============================================
|
|||
|
|||
case ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT: |
|||
{ |
|||
// Delete the last created segment, while creating a polyline draw item
|
|||
if( item == NULL ) |
|||
break; |
|||
|
|||
m_canvas->MoveCursorToCrossHair(); |
|||
static_cast<LIB_POLYLINE*>( item )->DeleteSegment( GetCrossHairPosition( true ) ); |
|||
} |
|||
break; |
|||
#endif
|
|||
|
|||
@ -1,41 +0,0 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|||
* Copyright (C) 2007-2017 KiCad Developers, see CHANGELOG.TXT for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <fctsys.h>
|
|||
#include <gr_basic.h>
|
|||
#include <sch_draw_panel.h>
|
|||
#include <confirm.h>
|
|||
#include <sch_view.h>
|
|||
#include <sch_component.h>
|
|||
#include <lib_edit_frame.h>
|
|||
#include <class_library.h>
|
|||
#include <symbol_lib_table.h>
|
|||
#include <template_fieldnames.h>
|
|||
#include <dialog_edit_one_field.h>
|
|||
|
|||
#include <lib_manager.h>
|
|||
#include <widgets/symbol_tree_pane.h>
|
|||
#include <widgets/lib_tree.h>
|
|||
|
|||
|
|||
@ -1,186 +0,0 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|||
* Copyright (C) 2015-2017 KiCad Developers, see CHANGELOG.TXT for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
/**
|
|||
* @file selpart.cpp |
|||
*/ |
|||
|
|||
#include <fctsys.h>
|
|||
#include <gr_basic.h>
|
|||
#include <confirm.h>
|
|||
#include <pgm_base.h>
|
|||
#include <sch_base_frame.h>
|
|||
#include <symbol_lib_table.h>
|
|||
|
|||
#include <general.h>
|
|||
#include <class_library.h>
|
|||
#include <dialog_helpers.h>
|
|||
|
|||
|
|||
static void DisplayCmpDocAndKeywords( wxString& aSelection, void* aData ) |
|||
{ |
|||
SYMBOL_LIB_TABLE* libs = (SYMBOL_LIB_TABLE*) aData; |
|||
|
|||
wxASSERT( libs ); |
|||
|
|||
LIB_ID id; |
|||
|
|||
if( id.Parse( aSelection, LIB_ID::ID_SCH ) != -1 ) |
|||
{ |
|||
aSelection = _( "Invalid symbol library identifier!" ); |
|||
return; |
|||
} |
|||
|
|||
LIB_ALIAS* part = nullptr; |
|||
|
|||
try |
|||
{ |
|||
part = libs->LoadSymbol( id ); |
|||
} |
|||
catch( const IO_ERROR& ) |
|||
{ |
|||
aSelection.Printf( _( "Error occurred loading symbol \"%s\" from library \"%s\"." ), |
|||
id.GetLibItemName().wx_str(), id.GetLibNickname().wx_str() ); |
|||
return; |
|||
} |
|||
|
|||
if( !part ) |
|||
return; |
|||
|
|||
aSelection = _( "Description:" ) + " " + part->GetDescription() + "\n"; |
|||
aSelection += _( "Key words:" ) + " " + part->GetKeyWords(); |
|||
} |
|||
|
|||
|
|||
wxString SCH_BASE_FRAME::SelectLibraryFromList() |
|||
{ |
|||
PROJECT& prj = Prj(); |
|||
|
|||
if( prj.SchSymbolLibTable()->IsEmpty() ) |
|||
{ |
|||
DisplayError( this, _( "No symbol libraries are loaded." ) ); |
|||
return wxEmptyString; |
|||
} |
|||
|
|||
wxArrayString headers; |
|||
|
|||
headers.Add( _( "Library" ) ); |
|||
|
|||
std::vector< wxArrayString > itemsToDisplay; |
|||
std::vector< wxString > libNicknames = prj.SchSymbolLibTable()->GetLogicalLibs(); |
|||
|
|||
// Conversion from wxArrayString to vector of ArrayString
|
|||
for( const auto& name : libNicknames ) |
|||
{ |
|||
wxArrayString item; |
|||
|
|||
item.Add( name ); |
|||
itemsToDisplay.push_back( item ); |
|||
} |
|||
|
|||
wxString old_lib_name = prj.GetRString( PROJECT::SCH_LIB_SELECT ); |
|||
|
|||
EDA_LIST_DIALOG dlg( this, _( "Select Symbol Library" ), headers, itemsToDisplay, |
|||
old_lib_name ); |
|||
|
|||
if( dlg.ShowModal() != wxID_OK ) |
|||
return wxEmptyString; |
|||
|
|||
wxString libname = dlg.GetTextSelection(); |
|||
|
|||
if( !libname.empty() ) |
|||
{ |
|||
if( prj.SchSymbolLibTable()->HasLibrary( libname ) ) |
|||
prj.SetRString( PROJECT::SCH_LIB_SELECT, libname ); |
|||
else |
|||
libname = wxEmptyString; |
|||
} |
|||
|
|||
return libname; |
|||
} |
|||
|
|||
|
|||
|
|||
bool SCH_BASE_FRAME::DisplayListComponentsInLib( wxString& aLibrary, wxString& aBuffer, |
|||
wxString& aPreviousChoice ) |
|||
{ |
|||
wxArrayString nameList; |
|||
|
|||
if( !aLibrary ) |
|||
aLibrary = SelectLibraryFromList(); |
|||
|
|||
if( !aLibrary ) |
|||
return false; |
|||
|
|||
try |
|||
{ |
|||
Prj().SchSymbolLibTable()->EnumerateSymbolLib( aLibrary, nameList ); |
|||
} |
|||
catch( const IO_ERROR& ioe ) |
|||
{ |
|||
wxString msg; |
|||
|
|||
msg.Printf( _( "Error occurred loading symbol library \"%s\"." ), aLibrary ); |
|||
DisplayErrorMessage( this, msg, ioe.What() ); |
|||
return false; |
|||
} |
|||
|
|||
wxArrayString headers; |
|||
headers.Add( _( "Library:Symbol" ) ); |
|||
|
|||
std::vector<wxArrayString> itemsToDisplay; |
|||
|
|||
// Conversion from wxArrayString to vector of ArrayString
|
|||
for( unsigned i = 0; i < nameList.GetCount(); i++ ) |
|||
{ |
|||
LIB_ID id; |
|||
wxArrayString item; |
|||
id.SetLibItemName( nameList[i], false ); |
|||
id.SetLibNickname( aLibrary ); |
|||
item.Add( id.Format() ); |
|||
itemsToDisplay.push_back( item ); |
|||
} |
|||
|
|||
EDA_LIST_DIALOG dlg( this, _( "Select Symbol" ), headers, itemsToDisplay, aPreviousChoice, |
|||
DisplayCmpDocAndKeywords, Prj().SchSymbolLibTable() ); |
|||
|
|||
if( dlg.ShowModal() != wxID_OK ) |
|||
return false; |
|||
|
|||
aBuffer = dlg.GetTextSelection(); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
bool SCH_BASE_FRAME::SelectPartNameToLoad( wxString& aLibrary, wxString& aBufName ) |
|||
{ |
|||
static wxString previousCmpName; |
|||
|
|||
if( !DisplayListComponentsInLib( aLibrary, aBufName, previousCmpName ) || aBufName.empty() ) |
|||
return false; |
|||
|
|||
previousCmpName = aBufName; |
|||
return true; |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue