Commit e8fef505 authored by charras's avatar charras

Pcbnew: fixed a double deletion that crashes pcbnew. Starting my work on net...

Pcbnew: fixed a double deletion that crashes pcbnew. Starting my work on net classes (moving target)
parent ee661525
...@@ -4,6 +4,45 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,45 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-sept-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
* make pcbnew compatible with last changes
(Delete base screen in WinEDA_DrawFrame destructor to prevent potential memory leak.)
* Starting complementary work on Net Classes (moving target)
2009-sept-25 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
Component library editor improvements and minor bug fixes.
* Component library objects renamed for improved readability.
* Fields now move when selected in library editor.
* Add copy constructor to all library draw and library component objects.
* Added copy constructor to EDA_BaseStruct.
* Delete base screen in WinEDA_DrawFrame destructor to prevent potential memory leak.
* Fixed memory access bug when replacing and adding a component to library.
* Moved library component block manipulation code into component object.
* Removed all of the global variables used by the library editor main window object.
* The usual code cleaning and refactoring.
2009-sept-22:
Command ID refactoring and other minor improvements.
* Split out application specific command IDs to prevent unnecessary rebuilding.
* Eliminate duplicate menu and tool bar command IDs.
* Split component library editor and viewer definitions to separate header files.
* More component library and document file merge code.
* A bunch of minor string readability and consistency fixes.
2009-sept-18:
Component library object and other minor improvements.
* Create static component library methods to manage library list.
* Rename component library, component, and alias objects to more readable name.
* Use pointer to component instead of root name to prevent redundant library searches.
* Add append message helper to message panel that calculates string length.
* Initial ground work for merging library and library document files.
* Improved component library file load error checking.
* Minor component library editor improvements.
2009-sept-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-sept-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++pcbnew ++pcbnew
......
...@@ -75,9 +75,6 @@ enum KICAD_T { ...@@ -75,9 +75,6 @@ enum KICAD_T {
COMPONENT_FIELD_DRAW_TYPE, COMPONENT_FIELD_DRAW_TYPE,
COMPONENT_BEZIER_DRAW_TYPE, COMPONENT_BEZIER_DRAW_TYPE,
// Special id used to store clearance values (this is not a good idea: TODO: change it)
TYPE_CLEARANCE,
// End value // End value
MAX_STRUCT_TYPE_ID MAX_STRUCT_TYPE_ID
}; };
......
...@@ -281,6 +281,11 @@ public: ...@@ -281,6 +281,11 @@ public:
* returns the NETCLASS for this item. * returns the NETCLASS for this item.
*/ */
NETCLASS* GetNetClass() const; NETCLASS* GetNetClass() const;
/** function GetNetClassName
* @return the Net Class name of this item
*/
wxString GetNetClassName( ) const;
}; };
......
...@@ -156,7 +156,6 @@ public: ...@@ -156,7 +156,6 @@ public:
int m_PcbTextWidth; // current Pcb (not module) Text width int m_PcbTextWidth; // current Pcb (not module) Text width
wxSize m_PcbTextSize; // current Pcb (not module) Text size wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_TrackClearance; // track to track and track to pads clearance int m_TrackClearance; // track to track and track to pads clearance
int m_TrackClearanceHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used track widths
int m_TrackMinWidth; // track min value for width ((min copper size value int m_TrackMinWidth; // track min value for width ((min copper size value
int m_ViasMinSize; // vias (not micro vias) min diameter int m_ViasMinSize; // vias (not micro vias) min diameter
int m_MicroViasMinSize; // micro vias (not vias) min diameter int m_MicroViasMinSize; // micro vias (not vias) min diameter
......
...@@ -53,12 +53,12 @@ class WinEDA_PcbFrame: public WinEDA_BasePcbFrame ...@@ -53,12 +53,12 @@ class WinEDA_PcbFrame: public WinEDA_BasePcbFrame
public: public:
WinEDAChoiceBox* m_SelLayerBox; WinEDAChoiceBox* m_SelLayerBox;
WinEDAChoiceBox* m_SelTrackWidthBox; WinEDAChoiceBox* m_SelTrackWidthBox;
WinEDAChoiceBox* m_SelClrWidthBox; wxTextCtrl* m_ClearanceBox;
wxTextCtrl* m_NetClassSelectedBox;
WinEDAChoiceBox* m_SelViaSizeBox; WinEDAChoiceBox* m_SelViaSizeBox;
private: private:
bool m_SelTrackWidthBox_Changed; bool m_SelTrackWidthBox_Changed;
bool m_SelClrWidthBox_Changed;
bool m_SelViaSizeBox_Changed; bool m_SelViaSizeBox_Changed;
DRC* m_drc; ///< the DRC controller, see drc.cpp DRC* m_drc; ///< the DRC controller, see drc.cpp
...@@ -112,6 +112,7 @@ public: ...@@ -112,6 +112,7 @@ public:
*/ */
void ShowDesignRulesEditor( wxCommandEvent& event ); void ShowDesignRulesEditor( wxCommandEvent& event );
/* toolbars update UI functions: */
/** /**
* Function UpdateToolbarLayerInfo * Function UpdateToolbarLayerInfo
* updates the currently selected layer in the layer listbox and * updates the currently selected layer in the layer listbox and
...@@ -120,6 +121,22 @@ public: ...@@ -120,6 +121,22 @@ public:
void UpdateToolbarLayerInfo(); void UpdateToolbarLayerInfo();
void PrepareLayerIndicator(); void PrepareLayerIndicator();
/**
* Function AuxiliaryToolBar_Update_UI
* update the displayed values on auxiliary horizontal toolbar
* (track width, via sizes, clearance ...
*/
void AuxiliaryToolBar_Update_UI( );
/**
* Function AuxiliaryToolBar_DesignRules_Update_UI
* update the displayed values: track width, via sizes, clearance
* used when a ne netclass is selected
*/
void AuxiliaryToolBar_DesignRules_Update_UI( );
/* mouse functions events: */
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
......
No preview for this file type
This diff is collapsed.
...@@ -136,6 +136,7 @@ set(PCBNEW_SRCS ...@@ -136,6 +136,7 @@ set(PCBNEW_SRCS
tool_modedit.cpp tool_modedit.cpp
tool_onrightclick.cpp tool_onrightclick.cpp
tool_pcb.cpp tool_pcb.cpp
toolbars_update_user_interface.cpp
tracepcb.cpp tracepcb.cpp
track.cpp track.cpp
tr_modif.cpp tr_modif.cpp
......
...@@ -20,7 +20,7 @@ wxPoint BOARD_ITEM::ZeroOffset( 0, 0 ); ...@@ -20,7 +20,7 @@ wxPoint BOARD_ITEM::ZeroOffset( 0, 0 );
/* Constructor */ /* Constructor */
BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) : BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
BOARD_ITEM( (BOARD_ITEM*)parent, TYPE_PCB ), BOARD_ITEM( (BOARD_ITEM*)parent, TYPE_PCB ),
m_NetClasses(this) m_NetClasses( this )
{ {
m_PcbFrame = frame; m_PcbFrame = frame;
m_Status_Pcb = 0; // Mot d'etat: Bit 1 = Chevelu calcule m_Status_Pcb = 0; // Mot d'etat: Bit 1 = Chevelu calcule
...@@ -42,7 +42,8 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) : ...@@ -42,7 +42,8 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
// within g_DesignSettings via the NETCLASS() constructor. // within g_DesignSettings via the NETCLASS() constructor.
// Should user eventually load a board from a disk file, then these defaults // Should user eventually load a board from a disk file, then these defaults
// will get overwritten during load. // will get overwritten during load.
m_NetClasses.GetDefault()->SetDescription( _("This is the default net class.") ); m_NetClasses.GetDefault()->SetDescription( _( "This is the default net class." ) );
m_CurrentNetClassName = m_NetClasses.GetDefault()->GetName( );
} }
...@@ -239,6 +240,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl ) ...@@ -239,6 +240,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
else else
m_Modules.PushFront( (MODULE*) aBoardItem ); m_Modules.PushFront( (MODULE*) aBoardItem );
aBoardItem->SetParent( this ); aBoardItem->SetParent( this );
// Because the list of pads has changed, reset the status // Because the list of pads has changed, reset the status
// This indicate the list of pad and nets must be recalculated before use // This indicate the list of pad and nets must be recalculated before use
m_Status_Pcb = 0; m_Status_Pcb = 0;
...@@ -263,7 +265,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl ) ...@@ -263,7 +265,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
msg.Printf( msg.Printf(
wxT( "BOARD::Add() needs work: BOARD_ITEM type (%d) not handled" ), wxT( "BOARD::Add() needs work: BOARD_ITEM type (%d) not handled" ),
aBoardItem->Type() ); aBoardItem->Type() );
wxFAIL_MSG(msg ); wxFAIL_MSG( msg );
} }
break; break;
} }
...@@ -840,7 +842,10 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const ...@@ -840,7 +842,10 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
#if defined(DEBUG) #if defined(DEBUG)
if( net ) // item can be NULL if anetcode is not valid if( net ) // item can be NULL if anetcode is not valid
{ {
wxASSERT( anetcode == net->GetNet() ); if( anetcode != net->GetNet() )
{
printf("FindNet() anetcode %d != GetNet() %d\n", anetcode, net->GetNet());
}
} }
#endif #endif
...@@ -862,25 +867,26 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const ...@@ -862,25 +867,26 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const
return NULL; return NULL;
int ncount = m_NetInfo->GetCount(); int ncount = m_NetInfo->GetCount();
// Search for a netname = aNetname // Search for a netname = aNetname
#if 0 #if 0
// Use a sequencial search: easy to understand, but slow
printf("\nsearch %s, nets %d\n", CONV_TO_UTF8(aNetname), ncount);
// Use a sequencial search: easy to understand, but slow
for( int ii = 1; ii < ncount; ii++ ) for( int ii = 1; ii < ncount; ii++ )
{ {
NETINFO_ITEM* item = m_NetInfo->GetNetItem( ii ); NETINFO_ITEM* item = m_NetInfo->GetNetItem( ii );
if( item && item->GetNetname() == aNetname ) if( item && item->GetNetname() == aNetname )
{ {
printf(" found\n");
return item; return item;
} }
} }
#else #else
// Use a fast binary search, // Use a fast binary search,
// this is possible because Nets are alphabetically ordered in list // this is possible because Nets are alphabetically ordered in list
// see NETINFO_LIST::BuildListOfNets() and NETINFO_LIST::Build_Pads_Full_List() // see NETINFO_LIST::BuildListOfNets() and NETINFO_LIST::Build_Pads_Full_List()
int imax = ncount-1; int imax = ncount - 1;
int index = imax; int index = imax;
while( ncount > 0 ) while( ncount > 0 )
{ {
...@@ -893,24 +899,28 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const ...@@ -893,24 +899,28 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const
NETINFO_ITEM* item = m_NetInfo->GetNetItem( index ); NETINFO_ITEM* item = m_NetInfo->GetNetItem( index );
if( item == NULL ) if( item == NULL )
return NULL; return NULL;
int icmp = item->GetNetname().Cmp(aNetname); int icmp = item->GetNetname().Cmp( aNetname );
if (icmp == 0 ) // found ! if( icmp == 0 ) // found !
{ {
printf(" found\n");
return item; return item;
} }
if( icmp < 0 ) // must search after item if( icmp < 0 ) // must search after item
{ {
index += ncount; index += ncount;
if( index > imax )
index = imax;
continue; continue;
} }
if( icmp > 0 ) // must search before item if( icmp > 0 ) // must search before item
{ {
index -= ncount; index -= ncount;
if( index < 1 )
index = 1;
continue; continue;
} }
} }
#endif #endif
return NULL; return NULL;
} }
......
...@@ -98,6 +98,9 @@ public: ...@@ -98,6 +98,9 @@ public:
* (used while moving a footprint) */ * (used while moving a footprint) */
NETCLASSES m_NetClasses; ///< List of current netclasses. There is always the default netclass NETCLASSES m_NetClasses; ///< List of current netclasses. There is always the default netclass
wxString m_CurrentNetClassName; /* Current net class name used to display netclass info.
* this is also the last used netclass after starting a track
*/
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
...@@ -259,6 +262,7 @@ public: ...@@ -259,6 +262,7 @@ public:
return m_NetInfo->GetPadsCount(); return m_NetInfo->GetPadsCount();
} }
// Calcul du rectangle d'encadrement: // Calcul du rectangle d'encadrement:
bool ComputeBoundaryBox(); bool ComputeBoundaryBox();
...@@ -534,7 +538,7 @@ public: ...@@ -534,7 +538,7 @@ public:
* 1 if intersecting sides * 1 if intersecting sides
* Also sets areas->utility1 flags if areas are modified * Also sets areas->utility1 flags if areas are modified
*/ */
int ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, int ClipAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList,
ZONE_CONTAINER* aCurrArea, ZONE_CONTAINER* aCurrArea,
bool bMessageBoxArc, bool bMessageBoxArc,
bool bMessageBoxInt, bool bMessageBoxInt,
...@@ -569,7 +573,10 @@ public: ...@@ -569,7 +573,10 @@ public:
* Sets utility flag = 1 for any areas modified * Sets utility flag = 1 for any areas modified
* If an area has self-intersecting arcs, doesn't try to combine it * If an area has self-intersecting arcs, doesn't try to combine it
*/ */
int CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode, bool bMessageBox, bool bUseUtility ); int CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
int aNetCode,
bool bMessageBox,
bool bUseUtility );
/** Function RemoveArea /** Function RemoveArea
* remove copper area from net, and put it in a deleted list (if exists) * remove copper area from net, and put it in a deleted list (if exists)
...@@ -611,7 +618,9 @@ public: ...@@ -611,7 +618,9 @@ public:
* 1 if intersection * 1 if intersection
* 2 if arcs intersect * 2 if arcs intersect
*/ */
int CombineAreas( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combine ); int CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
ZONE_CONTAINER* area_ref,
ZONE_CONTAINER* area_to_combine );
/** /**
* Function Test_Drc_Areas_Outlines_To_Areas_Outlines * Function Test_Drc_Areas_Outlines_To_Areas_Outlines
......
...@@ -146,3 +146,22 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const ...@@ -146,3 +146,22 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const
return NULL; return NULL;
} }
/** function GetNetClassName
* @return the Net Class name of this item
*/
wxString BOARD_CONNECTED_ITEM::GetNetClassName( ) const
{
wxString name;
NETCLASS* myclass = GetNetClass();
if( myclass )
name = myclass->GetName();
else
{
BOARD* board = GetBoard();
name = board->m_NetClasses.GetDefault()->GetName();
}
return name;
}
...@@ -1007,6 +1007,14 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -1007,6 +1007,14 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame )
} }
else else
Affiche_1_Parametre( frame, text_pos, _( "Width" ), msg, DARKCYAN ); Affiche_1_Parametre( frame, text_pos, _( "Width" ), msg, DARKCYAN );
NETCLASS* netclass = GetNetClass();
if( netclass )
{
msg = netclass->GetName();
text_pos += 10;
Affiche_1_Parametre( frame, text_pos, _( "Net Class" ), msg, DARKCYAN );
}
} }
......
...@@ -206,7 +206,6 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -206,7 +206,6 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths
m_TrackClearanceHistory[ii] = 0;
m_ViaSizeHistory[ii] = 0; // Last HISTORY_NUMBER used via sizes m_ViaSizeHistory[ii] = 0; // Last HISTORY_NUMBER used via sizes
} }
......
...@@ -42,11 +42,8 @@ private: ...@@ -42,11 +42,8 @@ private:
NETCUPS m_AllNets; NETCUPS m_AllNets;
private: private:
// void OnLayerCountClick( wxCommandEvent& event ); void OnNetClassesNameLeftClick( wxGridEvent& event ){ event.Skip(); }
// void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); } void OnNetClassesNameRightClick( wxGridEvent& event ){ event.Skip(); }
// void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); }
void OnCancelButtonClick( wxCommandEvent& event ); void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event ); void OnOkButtonClick( wxCommandEvent& event );
void OnAddNetclassClick( wxCommandEvent& event ); void OnAddNetclassClick( wxCommandEvent& event );
......
...@@ -59,7 +59,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -59,7 +59,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_grid->SetToolTip( _("Net Class parameters") ); m_grid->SetToolTip( _("Net Class parameters") );
m_grid->SetMinSize( wxSize( -1,150 ) ); m_grid->SetMinSize( wxSize( -1,150 ) );
sbSizer1->Add( m_grid, 1, wxALL|wxEXPAND, 5 ); sbSizer1->Add( m_grid, 1, wxEXPAND, 5 );
wxBoxSizer* buttonBoxSizer; wxBoxSizer* buttonBoxSizer;
buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL ); buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
...@@ -67,21 +67,21 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -67,21 +67,21 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_addButton = new wxButton( this, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_addButton = new wxButton( this, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_addButton->SetToolTip( _("Add another Net Class") ); m_addButton->SetToolTip( _("Add another Net Class") );
buttonBoxSizer->Add( m_addButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); buttonBoxSizer->Add( m_addButton, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_removeButton = new wxButton( this, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_removeButton = new wxButton( this, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeButton->SetToolTip( _("Remove the currently select Net Class") ); m_removeButton->SetToolTip( _("Remove the currently select Net Class") );
buttonBoxSizer->Add( m_removeButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); buttonBoxSizer->Add( m_removeButton, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_moveUpButton = new wxButton( this, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); m_moveUpButton = new wxButton( this, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") ); m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") );
buttonBoxSizer->Add( m_moveUpButton, 0, wxALL, 5 ); buttonBoxSizer->Add( m_moveUpButton, 0, wxRIGHT|wxLEFT, 5 );
sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
bMainSizer->Add( sbSizer1, 1, wxALL|wxEXPAND, 5 ); bMainSizer->Add( sbSizer1, 1, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizer4; wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Membership:") ), wxHORIZONTAL ); sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Membership:") ), wxHORIZONTAL );
...@@ -92,12 +92,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -92,12 +92,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxArrayString m_leftClassChoiceChoices; wxArrayString m_leftClassChoiceChoices;
m_leftClassChoice = new wxChoice( this, ID_LEFT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_leftClassChoiceChoices, 0 ); m_leftClassChoice = new wxChoice( this, ID_LEFT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_leftClassChoiceChoices, 0 );
m_leftClassChoice->SetSelection( 0 ); m_leftClassChoice->SetSelection( 0 );
leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxALL|wxEXPAND, 5 ); leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_leftListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES ); m_leftListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES );
m_leftListCtrl->SetMinSize( wxSize( 220,-1 ) ); m_leftListCtrl->SetMinSize( wxSize( 220,300 ) );
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxALL|wxEXPAND, 5 ); leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
sbSizer4->Add( leftNetSelectBoxSizer, 1, wxALL|wxEXPAND, 5 ); sbSizer4->Add( leftNetSelectBoxSizer, 1, wxALL|wxEXPAND, 5 );
...@@ -129,12 +129,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -129,12 +129,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxArrayString m_rightClassChoiceChoices; wxArrayString m_rightClassChoiceChoices;
m_rightClassChoice = new wxChoice( this, ID_RIGHT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_rightClassChoiceChoices, 0 ); m_rightClassChoice = new wxChoice( this, ID_RIGHT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_rightClassChoiceChoices, 0 );
m_rightClassChoice->SetSelection( 0 ); m_rightClassChoice->SetSelection( 0 );
rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxALL|wxEXPAND, 5 ); rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_rightListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES ); m_rightListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES );
m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) ); m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) );
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxALL|wxEXPAND, 5 ); rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
sbSizer4->Add( rghtNetSelectBoxSizer, 0, wxALL|wxEXPAND, 5 ); sbSizer4->Add( rghtNetSelectBoxSizer, 0, wxALL|wxEXPAND, 5 );
...@@ -144,9 +144,9 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -144,9 +144,9 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL ); sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL );
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER ); m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
m_MessagesList->SetMinSize( wxSize( -1,100 ) ); m_MessagesList->SetMinSize( wxSize( -1,90 ) );
sbSizer2->Add( m_MessagesList, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); sbSizer2->Add( m_MessagesList, 1, wxEXPAND, 5 );
bMainSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 ); bMainSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
...@@ -162,8 +162,8 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -162,8 +162,8 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
this->Layout(); this->Layout();
// Connect Events // Connect Events
m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridLeftClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameLeftClick ), NULL, this );
m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameRightClick ), NULL, this );
m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this ); m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this ); m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this ); m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this );
...@@ -180,8 +180,8 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -180,8 +180,8 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE() DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
{ {
// Disconnect Events // Disconnect Events
m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridLeftClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameLeftClick ), NULL, this );
m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameRightClick ), NULL, this );
m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this ); m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this ); m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this ); m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this );
......
...@@ -77,9 +77,9 @@ ...@@ -77,9 +77,9 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="0"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Net Classes:</property> <property name="label">Net Classes:</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxGrid" expanded="1"> <object class="wxGrid" expanded="1">
<property name="autosize_cols">0</property> <property name="autosize_cols">0</property>
...@@ -145,9 +145,9 @@ ...@@ -145,9 +145,9 @@
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event> <event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick">OnNetClassesGridLeftClick</event> <event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event> <event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick">OnNetClassesGridRightClick</event> <event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event> <event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event> <event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event> <event name="OnGridCmdCellLeftClick"></event>
...@@ -169,9 +169,9 @@ ...@@ -169,9 +169,9 @@
<event name="OnGridEditorCreated"></event> <event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event> <event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event> <event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event> <event name="OnGridLabelLeftClick">OnNetClassesNameLeftClick</event>
<event name="OnGridLabelLeftDClick"></event> <event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event> <event name="OnGridLabelRightClick">OnNetClassesNameRightClick</event>
<event name="OnGridLabelRightDClick"></event> <event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event> <event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event> <event name="OnGridRowSize"></event>
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="1"> <object class="wxChoice" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -441,7 +441,7 @@ ...@@ -441,7 +441,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxListCtrl" expanded="1"> <object class="wxListCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -452,7 +452,7 @@ ...@@ -452,7 +452,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">220,-1</property> <property name="minimum_size">220,300</property>
<property name="name">m_leftListCtrl</property> <property name="name">m_leftListCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
...@@ -751,7 +751,7 @@ ...@@ -751,7 +751,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="1"> <object class="wxChoice" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -802,7 +802,7 @@ ...@@ -802,7 +802,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxListCtrl" expanded="1"> <object class="wxListCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -887,7 +887,7 @@ ...@@ -887,7 +887,7 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1"> <object class="wxHtmlWindow" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -898,7 +898,7 @@ ...@@ -898,7 +898,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">-1,100</property> <property name="minimum_size">-1,90</property>
<property name="name">m_MessagesList</property> <property name="name">m_MessagesList</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
......
...@@ -59,8 +59,8 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog ...@@ -59,8 +59,8 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); } virtual void OnNetClassesNameLeftClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); } virtual void OnNetClassesNameRightClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnAddNetclassClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddNetclassClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveNetclassClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveNetclassClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMoveUpSelectedNetClass( wxCommandEvent& event ){ event.Skip(); } virtual void OnMoveUpSelectedNetClass( wxCommandEvent& event ){ event.Skip(); }
......
...@@ -224,7 +224,6 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -224,7 +224,6 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
if( id == ID_TB_OPTIONS_SELECT_UNIT_INCH ) if( id == ID_TB_OPTIONS_SELECT_UNIT_INCH )
g_UnitMetric = INCHES; g_UnitMetric = INCHES;
m_SelTrackWidthBox_Changed = TRUE; m_SelTrackWidthBox_Changed = TRUE;
m_SelClrWidthBox_Changed = TRUE;
UpdateStatusBar(); /* Reaffichage des coord curseur */ UpdateStatusBar(); /* Reaffichage des coord curseur */
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
DisplayUnitsMsg(); DisplayUnitsMsg();
......
...@@ -119,7 +119,6 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event ) ...@@ -119,7 +119,6 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event )
m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPE_VIA ); m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPE_VIA );
m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPE_TRACK ); m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPE_TRACK );
m_Parent->AddHistory( g_DesignSettings.m_TrackClearance, TYPE_CLEARANCE );
EndModal( 1 ); EndModal( 1 );
} }
...@@ -171,42 +170,6 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type ) ...@@ -171,42 +170,6 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
} }
break; break;
case TYPE_CLEARANCE:
for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{
if( g_DesignSettings.m_TrackClearanceHistory[ii] == value )
{
addhistory = FALSE;
break;
}
}
if( !addhistory )
break;
for( ii = HISTORY_NUMBER - 1; ii > 0; ii-- )
{
g_DesignSettings.m_TrackClearanceHistory[ii] =
g_DesignSettings.m_TrackClearanceHistory[ii - 1];
}
g_DesignSettings.m_TrackClearanceHistory[0] = value;
// Reclassement par valeur croissante
for( ii = 0; ii < HISTORY_NUMBER - 1; ii++ )
{
if( g_DesignSettings.m_TrackClearanceHistory[ii + 1] == 0 )
break; // Fin de liste
if( g_DesignSettings.m_TrackClearanceHistory[ii] >
g_DesignSettings.m_TrackClearanceHistory[ii + 1] )
{
EXCHG( g_DesignSettings.m_TrackClearanceHistory[ii],
g_DesignSettings.m_TrackClearanceHistory[ii + 1] );
}
}
break;
case TYPE_VIA: case TYPE_VIA:
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
......
...@@ -50,7 +50,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -50,7 +50,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case wxID_CUT: case wxID_CUT:
case wxID_COPY: case wxID_COPY:
case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH: case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH:
case ID_AUX_TOOLBAR_PCB_CLR_WIDTH:
case ID_AUX_TOOLBAR_PCB_VIA_SIZE: case ID_AUX_TOOLBAR_PCB_VIA_SIZE:
case ID_ON_GRID_SELECT: case ID_ON_GRID_SELECT:
case ID_ON_ZOOM_SELECT: case ID_ON_ZOOM_SELECT:
...@@ -1004,19 +1003,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1004,19 +1003,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
} }
break; break;
case ID_AUX_TOOLBAR_PCB_CLR_WIDTH:
{
int ii = m_SelClrWidthBox->GetChoice();
g_DesignSettings.m_TrackClearance =
g_DesignSettings.m_TrackClearanceHistory[ii];
DisplayTrackSettings();
m_SelTrackWidthBox_Changed = false;
m_SelClrWidthBox_Changed = false;
m_SelViaSizeBox_Changed = false;
g_DesignSettings.m_UseConnectedTrackWidth = false;
}
break;
case ID_POPUP_PCB_SELECT_WIDTH1: case ID_POPUP_PCB_SELECT_WIDTH1:
case ID_POPUP_PCB_SELECT_WIDTH2: case ID_POPUP_PCB_SELECT_WIDTH2:
case ID_POPUP_PCB_SELECT_WIDTH3: case ID_POPUP_PCB_SELECT_WIDTH3:
......
...@@ -34,7 +34,6 @@ void WinEDA_PcbFrame::DisplayTrackSettings() ...@@ -34,7 +34,6 @@ void WinEDA_PcbFrame::DisplayTrackSettings()
buftrc.GetData(), bufvia.GetData() ); buftrc.GetData(), bufvia.GetData() );
Affiche_Message( msg ); Affiche_Message( msg );
m_SelTrackWidthBox_Changed = TRUE; m_SelTrackWidthBox_Changed = TRUE;
m_SelClrWidthBox_Changed = TRUE;
m_SelViaSizeBox_Changed = TRUE; m_SelViaSizeBox_Changed = TRUE;
} }
......
...@@ -140,8 +140,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -140,8 +140,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
else // no starting point, but a filled zone area can exist. This is also a good starting point. else // no starting point, but a filled zone area can exist. This is also a good starting point.
{ {
ZONE_CONTAINER* zone = GetBoard()->HitTestForAnyFilledArea( pos, ZONE_CONTAINER* zone = GetBoard()->HitTestForAnyFilledArea( pos,
GetScreen()-> GetScreen()->m_Active_Layer );
m_Active_Layer );
if( zone ) if( zone )
g_HightLigth_NetCode = zone->GetNet(); g_HightLigth_NetCode = zone->GetNet();
} }
...@@ -154,7 +153,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -154,7 +153,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
Hight_Light( DC ); Hight_Light( DC );
g_CurrentTrackSegment->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer ); g_CurrentTrackSegment->SetLayer( GetScreen()->m_Active_Layer );
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth; g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if( g_DesignSettings.m_UseConnectedTrackWidth ) if( g_DesignSettings.m_UseConnectedTrackWidth )
...@@ -170,6 +169,10 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -170,6 +169,10 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
g_CurrentTrackSegment->m_End = pos; g_CurrentTrackSegment->m_End = pos;
g_CurrentTrackSegment->SetNet( g_HightLigth_NetCode ); g_CurrentTrackSegment->SetNet( g_HightLigth_NetCode );
// Display info about track Net class:
GetBoard()->m_CurrentNetClassName = g_CurrentTrackSegment->GetNetClassName();
AuxiliaryToolBar_DesignRules_Update_UI();
if( pt_pad ) if( pt_pad )
{ {
g_CurrentTrackSegment->start = pt_pad; g_CurrentTrackSegment->start = pt_pad;
......
...@@ -102,11 +102,11 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) ...@@ -102,11 +102,11 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
} }
case ID_APPEND_FILE: case ID_APPEND_FILE:
LoadOnePcbFile( wxEmptyString, TRUE ); LoadOnePcbFile( wxEmptyString, true );
break; break;
case ID_NEW_BOARD: case ID_NEW_BOARD:
Clear_Pcb( TRUE ); Clear_Pcb( true );
GetScreen()->m_FileName.Printf( wxT( "%s%cnoname%s" ), GetScreen()->m_FileName.Printf( wxT( "%s%cnoname%s" ),
wxGetCwd().GetData(), DIR_SEP, wxGetCwd().GetData(), DIR_SEP,
PcbExtBuffer.GetData() ); PcbExtBuffer.GetData() );
...@@ -148,9 +148,8 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ...@@ -148,9 +148,8 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
return false; return false;
} }
m_SelTrackWidthBox_Changed = TRUE; m_SelTrackWidthBox_Changed = true;
m_SelClrWidthBox_Changed = TRUE; m_SelViaSizeBox_Changed = true;
m_SelViaSizeBox_Changed = TRUE;
if( Append ) if( Append )
{ {
...@@ -300,7 +299,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName ) ...@@ -300,7 +299,7 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
wxString lowerTxt; wxString lowerTxt;
wxString msg; wxString msg;
bool saveok = TRUE; bool saveok = true;
FILE* dest; FILE* dest;
if( FileName == wxEmptyString ) if( FileName == wxEmptyString )
......
...@@ -178,13 +178,11 @@ bool WinEDA_PcbFrame::Clear_Pcb( bool aQuery ) ...@@ -178,13 +178,11 @@ bool WinEDA_PcbFrame::Clear_Pcb( bool aQuery )
for( int ii = 1; ii < HISTORY_NUMBER; ii++ ) for( int ii = 1; ii < HISTORY_NUMBER; ii++ )
{ {
g_DesignSettings.m_ViaSizeHistory[ii] = g_DesignSettings.m_ViaSizeHistory[ii] = 0;
g_DesignSettings.m_TrackWidthHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
g_DesignSettings.m_TrackClearanceHistory[ii] = 0;
} }
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_TrackClearanceHistory[0] = g_DesignSettings.m_TrackClearance;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
g_DesignSettings.m_CopperLayerCount = 2; // Default copper layers count set to 2: double layer board g_DesignSettings.m_CopperLayerCount = 2; // Default copper layers count set to 2: double layer board
......
...@@ -380,13 +380,6 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum ) ...@@ -380,13 +380,6 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
continue; continue;
} }
if( stricmp( Line, "TrackClearenceHistory" ) == 0 )
{
int tmp = atoi( data );
AddHistory( tmp, TYPE_CLEARANCE );
continue;
}
if( stricmp( Line, "ZoneClearence" ) == 0 ) if( stricmp( Line, "ZoneClearence" ) == 0 )
{ {
g_Zone_Default_Setting.m_ZoneClearance = atoi( data ); g_Zone_Default_Setting.m_ZoneClearance = atoi( data );
...@@ -561,13 +554,6 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard ) ...@@ -561,13 +554,6 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
fprintf( aFile, "TrackClearence %d\n", g_DesignSettings.m_TrackClearance ); fprintf( aFile, "TrackClearence %d\n", g_DesignSettings.m_TrackClearance );
for( int ii = 0; ii < HISTORY_NUMBER; ii++ )
{
if( g_DesignSettings.m_TrackClearanceHistory[ii] == 0 )
break;
fprintf( aFile, "TrackClearenceHistory %d\n",
g_DesignSettings.m_TrackClearanceHistory[ii] );
}
fprintf( aFile, "ZoneClearence %d\n", g_Zone_Default_Setting.m_ZoneClearance ); fprintf( aFile, "ZoneClearence %d\n", g_Zone_Default_Setting.m_ZoneClearance );
fprintf( aFile, "TrackMinWidth %d\n" , g_DesignSettings.m_TrackMinWidth ); fprintf( aFile, "TrackMinWidth %d\n" , g_DesignSettings.m_TrackMinWidth );
...@@ -959,6 +945,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append ) ...@@ -959,6 +945,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
board->SynchronizeNetsAndNetClasses( ); board->SynchronizeNetsAndNetClasses( );
board->m_Status_Pcb = 0; board->m_Status_Pcb = 0;
SetToolbars();
return 1; return 1;
} }
......
This diff is collapsed.
...@@ -188,13 +188,11 @@ bool Read_Config( const wxString& projectFileName ) ...@@ -188,13 +188,11 @@ bool Read_Config( const wxString& projectFileName )
// Some parameters must be reinitialized after loading a new board or config // Some parameters must be reinitialized after loading a new board or config
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_TrackClearanceHistory[0] = g_DesignSettings.m_TrackClearance;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
for( ii = 1; ii < HISTORY_NUMBER; ii++ ) for( ii = 1; ii < HISTORY_NUMBER; ii++ )
{ {
g_DesignSettings.m_TrackWidthHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
g_DesignSettings.m_TrackClearanceHistory[ii] = 0;
g_DesignSettings.m_ViaSizeHistory[ii] = 0; g_DesignSettings.m_ViaSizeHistory[ii] = 0;
} }
......
This diff is collapsed.
...@@ -54,8 +54,6 @@ wxSize ModuleTextSize; /* Default footprint texts size */ ...@@ -54,8 +54,6 @@ wxSize ModuleTextSize; /* Default footprint texts size */
wxPoint g_Offset_Module; /* Offset de trace du modul en depl */ wxPoint g_Offset_Module; /* Offset de trace du modul en depl */
wxString g_Current_PadName; // Last used pad name (pad num) wxString g_Current_PadName; // Last used pad name (pad num)
PCB_SCREEN* ScreenModule = NULL;
// Wildcard for footprint libraries filesnames // Wildcard for footprint libraries filesnames
const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (*.mod)|*.mod" ) ); const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (*.mod)|*.mod" ) );
......
...@@ -102,8 +102,6 @@ extern int g_MagneticTrackOption; ...@@ -102,8 +102,6 @@ extern int g_MagneticTrackOption;
extern bool g_HightLigt_Status; extern bool g_HightLigt_Status;
extern int g_HightLigth_NetCode; extern int g_HightLigth_NetCode;
extern PCB_SCREEN* ScreenModule; /* Ecran de l'editeur de modules */
extern wxPoint g_Offset_Module; /* Offset de trace du modul en depl */ extern wxPoint g_Offset_Module; /* Offset de trace du modul en depl */
extern wxString g_Current_PadName; // Last used pad name (pad num) extern wxString g_Current_PadName; // Last used pad name (pad num)
......
...@@ -227,7 +227,7 @@ enum pcbnew_ids ...@@ -227,7 +227,7 @@ enum pcbnew_ids
ID_AUX_TOOLBAR_PCB_VIA_SIZE, ID_AUX_TOOLBAR_PCB_VIA_SIZE,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
ID_AUX_TOOLBAR_PCB_CLR_WIDTH, ID_AUX_TOOLBAR_PCB_UNUSED2,
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
ID_AUX_TOOLBAR_PCB_UNUSED3, ID_AUX_TOOLBAR_PCB_UNUSED3,
......
...@@ -112,7 +112,6 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -112,7 +112,6 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default( ); // revert to the current locale
m_SelTrackWidthBox_Changed = TRUE; m_SelTrackWidthBox_Changed = TRUE;
m_SelClrWidthBox_Changed = TRUE;
m_SelViaSizeBox_Changed = TRUE; m_SelViaSizeBox_Changed = TRUE;
GetScreen()->SetModify(); GetScreen()->SetModify();
......
...@@ -558,12 +558,14 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -558,12 +558,14 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
wxSize( LISTBOX_WIDTH + 20, -1 ) ); wxSize( LISTBOX_WIDTH + 20, -1 ) );
m_AuxiliaryToolBar->AddControl( m_SelTrackWidthBox ); m_AuxiliaryToolBar->AddControl( m_SelTrackWidthBox );
m_SelTrackWidthBox_Changed = TRUE; m_SelTrackWidthBox_Changed = TRUE;
m_SelClrWidthBox = new WinEDAChoiceBox( m_AuxiliaryToolBar, m_ClearanceBox = new wxTextCtrl( m_AuxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_CLR_WIDTH, -1,
wxEmptyString,
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH + 20, -1 ) ); wxSize( LISTBOX_WIDTH + 20, -1 ),
m_AuxiliaryToolBar->AddControl( m_SelClrWidthBox ); wxTE_READONLY );
m_SelClrWidthBox_Changed = TRUE; m_AuxiliaryToolBar->AddControl( m_ClearanceBox );
m_ClearanceBox->SetToolTip(_("Current NetClass clearance value") );
m_AuxiliaryToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, m_AuxiliaryToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
wxEmptyString, wxEmptyString,
...@@ -575,12 +577,20 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -575,12 +577,20 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
m_SelViaSizeBox = new WinEDAChoiceBox( m_AuxiliaryToolBar, m_SelViaSizeBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_VIA_SIZE, ID_AUX_TOOLBAR_PCB_VIA_SIZE,
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH + 10, -1 ) ); wxSize( LISTBOX_WIDTH, -1 ) );
m_AuxiliaryToolBar->AddControl( m_SelViaSizeBox ); m_AuxiliaryToolBar->AddControl( m_SelViaSizeBox );
m_AuxiliaryToolBar->AddSeparator(); m_NetClassSelectedBox = new wxTextCtrl( m_AuxiliaryToolBar,
-1,
wxEmptyString,
wxPoint( -1, -1 ),
wxSize( LISTBOX_WIDTH, -1 ),
wxTE_READONLY );
m_AuxiliaryToolBar->AddControl( m_NetClassSelectedBox );
m_NetClassSelectedBox->SetToolTip(_("Name of the current NetClass") );
// Boite de selection du pas de grille // Boite de selection du pas de grille
m_AuxiliaryToolBar->AddSeparator();
m_SelGridBox = new WinEDAChoiceBox( m_AuxiliaryToolBar, m_SelGridBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
ID_ON_GRID_SELECT, ID_ON_GRID_SELECT,
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
...@@ -642,7 +652,6 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -642,7 +652,6 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
m_SelViaSizeBox_Changed = TRUE; m_SelViaSizeBox_Changed = TRUE;
m_SelTrackWidthBox_Changed = TRUE; m_SelTrackWidthBox_Changed = TRUE;
m_SelClrWidthBox_Changed = TRUE;
ReCreateLayerBox( NULL ); ReCreateLayerBox( NULL );
......
This diff is collapsed.
...@@ -797,12 +797,15 @@ int BOARD::CombineAreas( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_r ...@@ -797,12 +797,15 @@ int BOARD::CombineAreas( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_r
#endif #endif
// add holes // add holes
bool show_error = true;
while( booleng->StartPolygonGet() ) while( booleng->StartPolygonGet() )
{ {
if( booleng->GetPolygonPointEdgeType() != KB_INSIDE_EDGE ) if( booleng->GetPolygonPointEdgeType() != KB_INSIDE_EDGE ) // we expect all vertex are holes inside the main outline
{ {
if( show_error ) // show this error only once, if happens
DisplayError( NULL, DisplayError( NULL,
wxT( "BOARD::CombineAreas() error: unexpected outside contour descriptor" ) ); wxT( "BOARD::CombineAreas() error: unexpected outside contour descriptor" ) );
show_error = false;
continue; continue;
} }
while( booleng->PolygonHasMorePoints() ) while( booleng->PolygonHasMorePoints() )
......
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