Commit 396538e1 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: minor fixes:

* make 2 bitmaps more visible.
* fix incorrect screen redraw when rotating a component.
* netlist : the pcbnew advanced format can be now stored (persistant option) in project config.
parent 2e29b4f1
This diff is collapsed.
...@@ -8,53 +8,37 @@ ...@@ -8,53 +8,37 @@
static const unsigned char png[] = { static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x02, 0xd2, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xe5, 0x96, 0xdd, 0x72, 0xd2, 0xce, 0x00, 0x00, 0x01, 0xd3, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xd5, 0xd6, 0xcf, 0x2b, 0xc3,
0x40, 0x14, 0x80, 0x3b, 0xe3, 0x8d, 0x4f, 0xe3, 0x43, 0x78, 0xa1, 0x3e, 0x86, 0x97, 0x3e, 0x80, 0x71, 0x1c, 0xc7, 0x71, 0x27, 0x87, 0xd5, 0x8a, 0x91, 0x52, 0xe3, 0xb0, 0x70, 0x76, 0xf0, 0xa3,
0x17, 0x5e, 0x32, 0x63, 0x91, 0xb6, 0xbc, 0x84, 0x57, 0xda, 0x06, 0x68, 0xbd, 0x72, 0x74, 0x1c, 0x4c, 0x7c, 0x37, 0x63, 0x58, 0x2b, 0xe3, 0xc2, 0xd5, 0x41, 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x16, 0xdf, 0xf6, 0x27, 0x81, 0x65, 0xbf, 0xef, 0x6f, 0x13, 0x0c,
0xfa, 0xef, 0xdc, 0xe8, 0xff, 0xba, 0xef, 0x49, 0x7f, 0xe3, 0x35, 0xe9, 0xea, 0x10, 0xae, 0x00,
0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
}; };
const BITMAP_OPAQUE hierarchy_nav_xpm[1] = {{ png, sizeof( png ), "hierarchy_nav_xpm" }}; const BITMAP_OPAQUE hierarchy_nav_xpm[1] = {{ png, sizeof( png ), "hierarchy_nav_xpm" }};
......
This diff is collapsed.
This diff is collapsed.
...@@ -285,11 +285,8 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters() ...@@ -285,11 +285,8 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_componentLibFiles, &m_componentLibFiles,
GROUPLIB ) ); GROUPLIB ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "NetFmt" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
&m_netListFormat, &m_netListFormat) );
NET_TYPE_PCBNEW,
NET_TYPE_PCBNEW,
NET_TYPE_CUSTOM_MAX ) );
// NOTE: Left as global until supporting code can be fixed. // NOTE: Left as global until supporting code can be fixed.
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLSpd" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLSpd" ),
......
...@@ -299,15 +299,19 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation ) ...@@ -299,15 +299,19 @@ void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
m_canvas->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
if( component->GetFlags() ) if( component->GetFlags() )
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
else else
{
component->SetFlags( IS_MOVED ); // do not redraw the component
m_canvas->RefreshDrawingRect( component->GetBoundingBox() ); m_canvas->RefreshDrawingRect( component->GetBoundingBox() );
component->ClearFlags( IS_MOVED );
}
component->SetOrientation( aOrientation ); component->SetOrientation( aOrientation );
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( component->GetFlags() ) if( component->GetFlags() )
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode, g_GhostColor ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), g_XorMode );
else else
component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); component->Draw( m_canvas, &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
......
...@@ -117,17 +117,34 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -117,17 +117,34 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
const wxString& title, const wxString& title,
int id_NetType, int id_NetType,
int idCheckBox, int idCheckBox,
int idCreateFile, int idCreateFile ) :
bool selected ) :
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN ) wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN )
{ {
m_IdNetType = id_NetType; m_IdNetType = id_NetType;
m_pageNetFmtName = title;
m_CommandStringCtrl = NULL; m_CommandStringCtrl = NULL;
m_TitleStringCtrl = NULL; m_TitleStringCtrl = NULL;
m_IsCurrentFormat = NULL; m_IsCurrentFormat = NULL;
m_AddSubPrefix = NULL; m_AddSubPrefix = NULL;
m_ButtonCancel = NULL; m_ButtonCancel = NULL;
m_NetOption = NULL; m_NetOption = NULL;
wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_NetFmtName;
int fmtOption = 0;
bool selected = m_pageNetFmtName == netfmtName;
// PCBNEW Format is a special type:
if( id_NetType == NET_TYPE_PCBNEW )
{
if( netfmtName.IsEmpty() )
selected = true;
if( netfmtName == wxT("PcbnewAdvanced" ) )
{
selected = true;
fmtOption = 1;
}
}
parent->AddPage( this, title, selected ); parent->AddPage( this, title, selected );
...@@ -162,6 +179,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -162,6 +179,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
2, netlist_opt, 1, 2, netlist_opt, 1,
wxRA_SPECIFY_COLS ); wxRA_SPECIFY_COLS );
m_NetOption->SetSelection( fmtOption );
m_LeftBoxSizer->Add( m_NetOption, 0, wxGROW | wxALL, 5 ); m_LeftBoxSizer->Add( m_NetOption, 0, wxGROW | wxALL, 5 );
} }
...@@ -199,6 +217,19 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -199,6 +217,19 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
} }
} }
const wxString NETLIST_PAGE_DIALOG::GetPageNetFmtName()
{
// PCBNEW Format is a special type:
if( m_IdNetType == NET_TYPE_PCBNEW )
{
if( m_NetOption->GetSelection() )
return wxT( "PcbnewAdvanced" );
else
return wxT( "Pcbnew" );
}
return m_pageNetFmtName;
}
NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition, wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition,
...@@ -207,6 +238,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -207,6 +238,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
int ii; int ii;
m_Parent = parent; m_Parent = parent;
m_NetFmtName = m_Parent->GetNetListFormatName();
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
{ {
...@@ -230,8 +262,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -230,8 +262,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
wxT( "Pcbnew" ), wxT( "Pcbnew" ),
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST );
m_Parent->GetNetListFormat() == NET_TYPE_PCBNEW );
// Add Panel FORMAT ORCADPCB2 // Add Panel FORMAT ORCADPCB2
m_PanelNetType[PANELORCADPCB2] = m_PanelNetType[PANELORCADPCB2] =
...@@ -239,8 +270,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -239,8 +270,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
wxT( "OrcadPCB2" ), wxT( "OrcadPCB2" ),
NET_TYPE_ORCADPCB2, NET_TYPE_ORCADPCB2,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST );
m_Parent->GetNetListFormat() == NET_TYPE_ORCADPCB2 );
// Add Panel FORMAT CADSTAR // Add Panel FORMAT CADSTAR
m_PanelNetType[PANELCADSTAR] = m_PanelNetType[PANELCADSTAR] =
...@@ -248,8 +278,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -248,8 +278,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
wxT( "CadStar" ), wxT( "CadStar" ),
NET_TYPE_CADSTAR, NET_TYPE_CADSTAR,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST );
m_Parent->GetNetListFormat() == NET_TYPE_CADSTAR );
// Add Panel spice // Add Panel spice
InstallPageSpice(); InstallPageSpice();
...@@ -268,17 +297,17 @@ void NETLIST_DIALOG::InstallPageSpice() ...@@ -268,17 +297,17 @@ void NETLIST_DIALOG::InstallPageSpice()
{ {
wxButton* Button; wxButton* Button;
NETLIST_PAGE_DIALOG* page; NETLIST_PAGE_DIALOG* page;
wxString title = wxT( "Spice" );
page = m_PanelNetType[PANELSPICE] = page = m_PanelNetType[PANELSPICE] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
wxT( "Spice" ), title,
NET_TYPE_SPICE, NET_TYPE_SPICE,
0, 0, 0, 0 );
m_Parent->GetNetListFormat() == NET_TYPE_SPICE );
page->m_IsCurrentFormat = new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT, page->m_IsCurrentFormat = new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT,
_( "Default format" ) ); _( "Default format" ) );
page->m_IsCurrentFormat->SetValue( m_Parent->GetNetListFormat() == NET_TYPE_SPICE ); page->m_IsCurrentFormat->SetValue( m_NetFmtName == title );
page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 1, wxGROW | wxALL, 5 ); page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 1, wxGROW | wxALL, 5 );
page->m_AddSubPrefix = new wxCheckBox( page, ID_ADD_SUBCIRCUIT_PREFIX, page->m_AddSubPrefix = new wxCheckBox( page, ID_ADD_SUBCIRCUIT_PREFIX,
...@@ -327,7 +356,6 @@ void NETLIST_DIALOG::InstallPageSpice() ...@@ -327,7 +356,6 @@ void NETLIST_DIALOG::InstallPageSpice()
*/ */
void NETLIST_DIALOG::InstallCustomPages() void NETLIST_DIALOG::InstallCustomPages()
{ {
bool selected;
int ii, CustomCount; int ii, CustomCount;
wxString title, previoustitle, msg; wxString title, previoustitle, msg;
NETLIST_PAGE_DIALOG* CurrPage; NETLIST_PAGE_DIALOG* CurrPage;
...@@ -342,8 +370,6 @@ void NETLIST_DIALOG::InstallCustomPages() ...@@ -342,8 +370,6 @@ void NETLIST_DIALOG::InstallCustomPages()
if( title.IsEmpty() && previoustitle.IsEmpty() ) if( title.IsEmpty() && previoustitle.IsEmpty() )
break; // No more panel to install break; // No more panel to install
selected = m_Parent->GetNetListFormat() == ( NET_TYPE_CUSTOM1 + ii );
/* Install the panel "Add Plugin" after /* Install the panel "Add Plugin" after
* the last initialized panel */ * the last initialized panel */
...@@ -356,8 +382,7 @@ void NETLIST_DIALOG::InstallCustomPages() ...@@ -356,8 +382,7 @@ void NETLIST_DIALOG::InstallCustomPages()
_( "Add Plugin" ), _( "Add Plugin" ),
NET_TYPE_CUSTOM1 + ii, NET_TYPE_CUSTOM1 + ii,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_SETUP_PLUGIN, ID_SETUP_PLUGIN );
selected );
else /* Install a plugin panel */ else /* Install a plugin panel */
CurrPage = CurrPage =
m_PanelNetType[PANELCUSTOMBASE + ii] = m_PanelNetType[PANELCUSTOMBASE + ii] =
...@@ -365,8 +390,7 @@ void NETLIST_DIALOG::InstallCustomPages() ...@@ -365,8 +390,7 @@ void NETLIST_DIALOG::InstallCustomPages()
title, title,
NET_TYPE_CUSTOM1 + ii, NET_TYPE_CUSTOM1 + ii,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST );
selected );
msg = CUSTOM_NETLIST_COMMAND; msg = CUSTOM_NETLIST_COMMAND;
msg << ii + 1; msg << ii + 1;
...@@ -462,14 +486,14 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event ) ...@@ -462,14 +486,14 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event )
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
if( m_PanelNetType[ii] ) if( m_PanelNetType[ii] )
m_PanelNetType[ii]->m_IsCurrentFormat->SetValue( false ); m_PanelNetType[ii]->m_IsCurrentFormat->SetValue( false );
CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( CurrPage == NULL ) if( CurrPage == NULL )
return; return;
m_Parent->SetNetListFormat( CurrPage->m_IdNetType ); m_Parent->SetNetListFormatName( CurrPage->GetPageNetFmtName() );
CurrPage->m_IsCurrentFormat->SetValue( true ); CurrPage->m_IsCurrentFormat->SetValue( true );
} }
...@@ -496,7 +520,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt() ...@@ -496,7 +520,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
int ii; int ii;
m_Parent->SetSimulatorCommand( m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue() ); m_Parent->SetSimulatorCommand( m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue() );
m_Parent->SetNetListFormat( NET_TYPE_PCBNEW ); m_Parent->SetNetListFormatName( wxEmptyString );
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
{ {
...@@ -504,7 +528,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt() ...@@ -504,7 +528,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
break; break;
if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == true ) if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == true )
m_Parent->SetNetListFormat( m_PanelNetType[ii]->m_IdNetType ); m_Parent->SetNetListFormatName( m_PanelNetType[ii]->GetPageNetFmtName() );
} }
g_OptNetListUseNames = true; // Used for pspice, gnucap g_OptNetListUseNames = true; // Used for pspice, gnucap
...@@ -712,6 +736,7 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) ...@@ -712,6 +736,7 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void )
if( CurrPage->m_TitleStringCtrl ) if( CurrPage->m_TitleStringCtrl )
{ {
wxString title = CurrPage->m_TitleStringCtrl->GetValue(); wxString title = CurrPage->m_TitleStringCtrl->GetValue();
CurrPage->SetPageNetFmtName( title );
if( msg != title ) // Title has changed, Update config if( msg != title ) // Title has changed, Update config
{ {
......
...@@ -54,9 +54,11 @@ public: ...@@ -54,9 +54,11 @@ public:
wxBoxSizer* m_RightOptionsBoxSizer; wxBoxSizer* m_RightOptionsBoxSizer;
wxBoxSizer* m_LowBoxSizer; wxBoxSizer* m_LowBoxSizer;
wxRadioBox* m_NetOption; wxRadioBox* m_NetOption;
private:
wxString m_pageNetFmtName;
public: public:
/** Contructor to create a setup page for one netlist format. /** Constructor to create a setup page for one netlist format.
* Used in Netlist format Dialog box creation * Used in Netlist format Dialog box creation
* @param parent = wxNotebook * parent * @param parent = wxNotebook * parent
* @param title = title (name) of the notebook page * @param title = title (name) of the notebook page
...@@ -67,9 +69,19 @@ public: ...@@ -67,9 +69,19 @@ public:
* Only one page can be created with selected = true. * Only one page can be created with selected = true.
*/ */
NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title, NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
int id_NetType, int idCheckBox, int idCreateFile, int id_NetType, int idCheckBox, int idCreateFile );
bool selected );
~NETLIST_PAGE_DIALOG() { }; ~NETLIST_PAGE_DIALOG() { };
/**
* function GetPageNetFmtName
* @return the name of the netlist format for this page
* This is usually the page label.
* For the pcbnew netlist, this is the page label when the "old" format is selected
* and "PcbnewAdvanced" when the advanced format is selected
*/
const wxString GetPageNetFmtName();
void SetPageNetFmtName( const wxString &aName ) { m_pageNetFmtName =aName; }
}; };
...@@ -92,8 +104,8 @@ enum TypeNetForm { ...@@ -92,8 +104,8 @@ enum TypeNetForm {
// Options for Spice netlist generation (OR'ed bits // Options for Spice netlist generation (OR'ed bits
enum netlistOptions { enum netlistOptions {
NET_USE_NETNAMES = 1, // for Spice netlist : use netnames instead of numbers NET_USE_NETNAMES = 1, // for Spice netlist : use netnames instead of numbers
NET_USE_X_PREFIX = 2, // for Spice netlist : change "U" and "IC" refernce prefix to "X" NET_USE_X_PREFIX = 2, // for Spice netlist : change "U" and "IC" reference prefix to "X"
NET_PCBNEW_USE_NEW_FORMAT = 1, // For Pcbnew use the new format (S expression and SWEET) NET_PCBNEW_USE_NEW_FORMAT = 1, // For Pcbnew use the new format (S expression and SWEET)
}; };
...@@ -102,6 +114,7 @@ class NETLIST_DIALOG : public wxDialog ...@@ -102,6 +114,7 @@ class NETLIST_DIALOG : public wxDialog
{ {
public: public:
SCH_EDIT_FRAME* m_Parent; SCH_EDIT_FRAME* m_Parent;
wxString m_NetFmtName;
wxNotebook* m_NoteBook; wxNotebook* m_NoteBook;
NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX]; NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX];
......
...@@ -1453,7 +1453,13 @@ EDA_RECT SCH_COMPONENT::GetBodyBoundingBox() const ...@@ -1453,7 +1453,13 @@ EDA_RECT SCH_COMPONENT::GetBodyBoundingBox() const
EDA_RECT SCH_COMPONENT::GetBoundingBox() const EDA_RECT SCH_COMPONENT::GetBoundingBox() const
{ {
return GetBodyBoundingBox(); EDA_RECT bbox = GetBodyBoundingBox();
for( size_t i = 0; i < m_Fields.size(); i++ )
{
bbox.Merge( m_Fields[i].GetBoundingBox() );
}
return bbox;
} }
...@@ -1850,9 +1856,9 @@ bool SCH_COMPONENT::doHitTest( const EDA_RECT& aRect, bool aContained, int aAccu ...@@ -1850,9 +1856,9 @@ bool SCH_COMPONENT::doHitTest( const EDA_RECT& aRect, bool aContained, int aAccu
rect.Inflate( aAccuracy ); rect.Inflate( aAccuracy );
if( aContained ) if( aContained )
return rect.Contains( GetBoundingBox() ); return rect.Contains( GetBodyBoundingBox() );
return rect.Intersects( GetBoundingBox() ); return rect.Intersects( GetBodyBoundingBox() );
} }
......
...@@ -623,9 +623,6 @@ void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event ) ...@@ -623,9 +623,6 @@ void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event )
{ {
int i; int i;
if( m_netListFormat < NET_TYPE_PCBNEW )
m_netListFormat = NET_TYPE_PCBNEW;
do do
{ {
NETLIST_DIALOG* dlg = new NETLIST_DIALOG( this ); NETLIST_DIALOG* dlg = new NETLIST_DIALOG( this );
......
...@@ -148,8 +148,8 @@ private: ...@@ -148,8 +148,8 @@ private:
/// Flag to indicate show hidden pins. /// Flag to indicate show hidden pins.
bool m_showAllPins; bool m_showAllPins;
/// The format to use when generating a net list. /// The name of the format to use when generating a net list.
int m_netListFormat; wxString m_netListFormat;
/// Add X prefix to componen referencess when generating spice net lists. /// Add X prefix to componen referencess when generating spice net lists.
bool m_addReferencPrefix; bool m_addReferencPrefix;
...@@ -206,9 +206,9 @@ public: ...@@ -206,9 +206,9 @@ public:
void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; } void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; }
int GetNetListFormat() const { return m_netListFormat; } const wxString GetNetListFormatName() const { return m_netListFormat; }
void SetNetListFormat( int aFormat ) { m_netListFormat = aFormat; } void SetNetListFormatName( const wxString& aFormat ) { m_netListFormat = aFormat; }
bool GetAddReferencePrefix() const { return m_addReferencPrefix; } bool GetAddReferencePrefix() const { return m_addReferencPrefix; }
......
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
<property name="growablerows"></property> <property name="growablerows"></property>
<property name="hgap">0</property> <property name="hgap">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fgSizer5</property> <property name="name">fgSizerPadType</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property> <property name="permission">none</property>
<property name="rows">0</property> <property name="rows">0</property>
...@@ -863,11 +863,11 @@ ...@@ -863,11 +863,11 @@
<object class="wxFlexGridSizer" expanded="1"> <object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property> <property name="cols">3</property>
<property name="flexible_direction">wxBOTH</property> <property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property> <property name="growablecols">1</property>
<property name="growablerows"></property> <property name="growablerows"></property>
<property name="hgap">0</property> <property name="hgap">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fgSizer6</property> <property name="name">fgSizerShapeType</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property> <property name="permission">none</property>
<property name="rows">0</property> <property name="rows">0</property>
...@@ -5420,7 +5420,7 @@ ...@@ -5420,7 +5420,7 @@
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="0"> <object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Technical</property> <property name="label">Technical Layers</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">sbSizerTechlayers</property> <property name="name">sbSizerTechlayers</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment