Commit fd27b262 authored by charras's avatar charras

pcbnew: minor work about netclasses. eeschema: bug fix

parent 9861941d
...@@ -4,6 +4,27 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,27 @@ 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-oct-01 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
* Component library viewer restores state between uses.
* Fixed automatic zoom calculations in library viewer.
* Make library entry list dialog restore previous selection.
* Fix bounding box calculation for vertical field and text draw objects.
* Changed library draw object comparison to test for greater and less than.
* Initial preparation for merging separate library component draw item lists.
2009-sept-29 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
* Eliminate external direct manipulation of component draw item pointer.
* Add draw item remove, add, and locate methods to library component object.
* Remove redundant locate pin, field, and draw item code.
* Fix add new pin drawing bug that left initial pin draw in place.
* Improved best zoom calculations for small components.
* Library component bounding box calculation now includes fields.
* Removed unnecessary header file "libcmp.h".
* Fixed potential locate draw item bug in library editor hot key handler.
2009-sept-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-sept-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++pcbnew ++pcbnew
......
...@@ -4,24 +4,26 @@ extern const char *via_sketch_xpm[]; ...@@ -4,24 +4,26 @@ extern const char *via_sketch_xpm[];
#else #else
const char * via_sketch_xpm[] = { const char * via_sketch_xpm[] = {
"16 16 3 1", "16 16 5 1",
" c None", " c None",
". c #7D7D00", ". c #7D7D00",
"+ c #7C7C00", "+ c #7C7C00",
" ", "* c #CC0000",
" .... ", "= c #00AC00",
" ..++++.. ", " .... ",
" .. .. ", " ..++++.. ",
" .. .. ", " .. .. ",
" . .. . ", " .. .. ",
" .+ .... +. ", " . .. . ",
" .+ .. .. +. ", "***+***.... +.",
" .+ .. .. +. ", "**.+**..**.. +.",
" .+ .... +. ", "**.+**..**.. +.",
" . .. . ", "***+***.... +.",
" .. .. ", " . =..= . ",
" .. .. ", " .. ==== .. ",
" ..++++.. ", " .. ==== .. ",
" .... ", " ..++++.. ",
" "}; " ...= ",
" ==== ",
" ==== "};
#endif #endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#define BUILD_VERSION "(20090921-unstable)" #define BUILD_VERSION "(20091001-unstable)"
#ifdef HAVE_SVN_VERSION #ifdef HAVE_SVN_VERSION
......
...@@ -390,7 +390,6 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, ...@@ -390,7 +390,6 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
wxDC* DC ) wxDC* DC )
{ {
int ii;
LIB_COMPONENT* LibEntry; LIB_COMPONENT* LibEntry;
if( DrawComponent == NULL ) if( DrawComponent == NULL )
...@@ -414,7 +413,13 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, ...@@ -414,7 +413,13 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
DrawComponent->m_Convert++; DrawComponent->m_Convert++;
if( DrawComponent->m_Convert > ii ) // ensure m_Convert = 0, 1 or 2
// 0 and 1 = shape 1 = not converted
// 2 = shape 2 = first converted shape
// > 2 is not used but could be used for more shapes
// like multiple shapes for a programmable component
// When m_Convert = val max, return to the first shape
if( DrawComponent->m_Convert > 2 )
DrawComponent->m_Convert = 1; DrawComponent->m_Convert = 1;
/* Redessine le composant dans la nouvelle position */ /* Redessine le composant dans la nouvelle position */
......
...@@ -18,7 +18,6 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, ...@@ -18,7 +18,6 @@ void WinEDA_LibeditFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
int unused_flag ) int unused_flag )
/*************************************************************************/ /*************************************************************************/
{ {
EDA_BaseStruct* item;
LIB_COMPONENT* CopyItem; LIB_COMPONENT* CopyItem;
PICKED_ITEMS_LIST* lastcmd; PICKED_ITEMS_LIST* lastcmd;
......
...@@ -58,8 +58,7 @@ public: ...@@ -58,8 +58,7 @@ public:
WinEDAChoiceBox* m_SelViaSizeBox; WinEDAChoiceBox* m_SelViaSizeBox;
private: private:
bool m_SelTrackWidthBox_Changed; bool m_TrackAndViasSizesList_Changed;
bool m_SelViaSizeBox_Changed;
DRC* m_drc; ///< the DRC controller, see drc.cpp DRC* m_drc; ///< the DRC controller, see drc.cpp
......
No preview for this file type
This diff is collapsed.
...@@ -43,7 +43,9 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) : ...@@ -43,7 +43,9 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
// 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( ); m_ViaSizeSelector = 0;
m_TrackWidthSelector = 0;
SetCurrentNetClass(m_NetClasses.GetDefault()->GetName( )); // Initialize default values
} }
...@@ -74,6 +76,31 @@ BOARD::~BOARD() ...@@ -74,6 +76,31 @@ BOARD::~BOARD()
delete m_NetInfo; delete m_NetInfo;
} }
/**
* Function SetCurrentNetClass
* Must be called after a netclass selection (or after a netclass parameter change
* Initialise vias and tracks values displayed in comb boxs of the auxiliary toolbar
* and some others parametres (netclass name ....)
*/
void BOARD::SetCurrentNetClass( const wxString & aNetClassName)
{
NETCLASS * netClass = m_NetClasses.Find(aNetClassName);
// if not found (should not happen) use the default
if ( netClass == NULL )
netClass = m_NetClasses.GetDefault();
m_CurrentNetClassName = netClass->GetName();
// Initialize others values:
if( m_ViaSizeHistory.size() == 0 )
m_ViaSizeHistory.push_back(0);
if( m_TrackWidthHistory.size() == 0 )
m_TrackWidthHistory.push_back(0);
m_ViaSizeHistory[0] = netClass->GetViaDiameter();
m_TrackWidthHistory[0] = netClass->GetTrackWidth();
}
wxString BOARD::GetLayerName( int aLayerIndex ) const wxString BOARD::GetLayerName( int aLayerIndex ) const
{ {
......
...@@ -97,14 +97,22 @@ public: ...@@ -97,14 +97,22 @@ public:
std::vector<RATSNEST_ITEM> m_LocalRatsnest; /* Rastnest list relative to a given footprint std::vector<RATSNEST_ITEM> m_LocalRatsnest; /* Rastnest list relative to a given footprint
* (used while moving a footprint) */ * (used while moving a footprint) */
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
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. wxString m_CurrentNetClassName; /* Current net class name used to display netclass info.
* this is also the last used netclass after starting a track * this is also the last used netclass after starting a track
*/ */
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
std::vector <int> m_ViaSizeHistory; // Last used via sizes (max count = HISTORY_MAX_COUNT) // handling of vias and tracks size:
std::vector <int> m_TrackWidthHistory; // Last used track widths (max count = HISTORY_MAX_COUNT) // the first value is always the value of the current NetClass
// The others values are extra values
std::vector <int> m_ViaSizeHistory; // Last used via sizes (max count = HISTORY_MAX_COUNT)
std::vector <int> m_TrackWidthHistory; // Last used track widths (max count = HISTORY_MAX_COUNT)
int m_ViaSizeSelector; // index for m_ViaSizeHistory to select the value
// O is the selection of the default value Netclass
int m_TrackWidthSelector; // index for m_TrackWidthHistory to select the value
/**********************************/ /**********************************/
public: public:
...@@ -356,6 +364,13 @@ public: ...@@ -356,6 +364,13 @@ public:
*/ */
void SynchronizeNetsAndNetClasses(); void SynchronizeNetsAndNetClasses();
/**
* Function SetCurrentNetClass
* Must be called after a netclass selection (or after a netclass parameter change
* Initialise vias and tracks values displayed in comb boxs of the auxiliary toolbar
* and some others parametres (netclass name ....)
*/
void SetCurrentNetClass( const wxString & aNetClassName);
/** /**
* Function Save * Function Save
......
...@@ -93,7 +93,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) ...@@ -93,7 +93,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
int ii; int ii;
DisplayOpt.DisplayPolarCood = DisplayOpt.DisplayPolarCood =
(m_PolarDisplay->GetSelection() == 0) ? FALSE : TRUE; (m_PolarDisplay->GetSelection() == 0) ? FALSE : true;
ii = g_UnitMetric; ii = g_UnitMetric;
g_UnitMetric = (m_UnitsSelection->GetSelection() == 0) ? 0 : 1; g_UnitMetric = (m_UnitsSelection->GetSelection() == 0) ? 0 : 1;
if( ii != g_UnitMetric ) if( ii != g_UnitMetric )
...@@ -113,7 +113,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) ...@@ -113,7 +113,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
{ {
g_Show_Ratsnest = m_ShowGlobalRatsnest->GetValue(); g_Show_Ratsnest = m_ShowGlobalRatsnest->GetValue();
m_Parent->Ratsnest_On_Off( m_DC ); m_Parent->Ratsnest_On_Off( m_DC );
m_Parent->RedrawActiveWindow( m_DC, TRUE); m_Parent->RedrawActiveWindow( m_DC, true);
} }
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue(); g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue(); g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
...@@ -195,7 +195,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -195,7 +195,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id ) switch( id )
{ {
case ID_TB_OPTIONS_DRC_OFF: case ID_TB_OPTIONS_DRC_OFF:
Drc_On = m_OptionsToolBar->GetToolState( id ) ? FALSE : TRUE; Drc_On = m_OptionsToolBar->GetToolState( id ) ? FALSE : true;
break; break;
case ID_TB_OPTIONS_SHOW_GRID: case ID_TB_OPTIONS_SHOW_GRID:
...@@ -209,7 +209,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -209,7 +209,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc ); DrawPanel->PrepareGraphicContext( &dc );
Ratsnest_On_Off( &dc ); Ratsnest_On_Off( &dc );
RedrawActiveWindow( &dc, TRUE); RedrawActiveWindow( &dc, true);
} }
break; break;
...@@ -223,7 +223,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -223,7 +223,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SELECT_UNIT_INCH: case ID_TB_OPTIONS_SELECT_UNIT_INCH:
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_TrackAndViasSizesList_Changed = true;
UpdateStatusBar(); /* Reaffichage des coord curseur */ UpdateStatusBar(); /* Reaffichage des coord curseur */
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
DisplayUnitsMsg(); DisplayUnitsMsg();
......
...@@ -997,8 +997,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -997,8 +997,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
int ii = m_SelTrackWidthBox->GetChoice(); int ii = m_SelTrackWidthBox->GetChoice();
g_DesignSettings.m_CurrentTrackWidth = GetBoard()->m_TrackWidthHistory[ii]; g_DesignSettings.m_CurrentTrackWidth = GetBoard()->m_TrackWidthHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
m_SelTrackWidthBox_Changed = false; m_TrackAndViasSizesList_Changed = false;
m_SelViaSizeBox_Changed = false;
g_DesignSettings.m_UseConnectedTrackWidth = false; g_DesignSettings.m_UseConnectedTrackWidth = false;
} }
break; break;
...@@ -1035,8 +1034,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1035,8 +1034,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
int ii = m_SelViaSizeBox->GetChoice(); int ii = m_SelViaSizeBox->GetChoice();
g_DesignSettings.m_CurrentViaSize = GetBoard()->m_ViaSizeHistory[ii]; g_DesignSettings.m_CurrentViaSize = GetBoard()->m_ViaSizeHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
m_SelTrackWidthBox_Changed = false; m_TrackAndViasSizesList_Changed = false;
m_SelViaSizeBox_Changed = false;
} }
break; break;
......
...@@ -33,8 +33,7 @@ void WinEDA_PcbFrame::DisplayTrackSettings() ...@@ -33,8 +33,7 @@ void WinEDA_PcbFrame::DisplayTrackSettings()
msg.Printf( _( "Track Width: %s Vias Size : %s" ), msg.Printf( _( "Track Width: %s Vias Size : %s" ),
buftrc.GetData(), bufvia.GetData() ); buftrc.GetData(), bufvia.GetData() );
Affiche_Message( msg ); Affiche_Message( msg );
m_SelTrackWidthBox_Changed = TRUE; m_TrackAndViasSizesList_Changed = TRUE;
m_SelViaSizeBox_Changed = TRUE;
} }
......
...@@ -44,7 +44,7 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -44,7 +44,7 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
if( track && ( track->Type()==TYPE_VIA || track->Type()==TYPE_TRACK ) ) if( track && ( track->Type()==TYPE_VIA || track->Type()==TYPE_TRACK ) )
{ {
/* Erase the current drawing */ /* Erase the current drawing */
ShowNewTrackWhenMovingCursor( Panel, DC, FALSE ); ShowNewTrackWhenMovingCursor( Panel, DC, false );
if( g_HightLigt_Status ) if( g_HightLigt_Status )
frame->Hight_Light( DC ); frame->Hight_Light( DC );
...@@ -147,7 +147,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -147,7 +147,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
build_ratsnest_pad( LockPoint, wxPoint( 0, 0 ), TRUE ); build_ratsnest_pad( LockPoint, wxPoint( 0, 0 ), true );
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
...@@ -170,7 +170,8 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -170,7 +170,8 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
g_CurrentTrackSegment->SetNet( g_HightLigth_NetCode ); g_CurrentTrackSegment->SetNet( g_HightLigth_NetCode );
// Display info about track Net class: // Display info about track Net class:
GetBoard()->m_CurrentNetClassName = g_CurrentTrackSegment->GetNetClassName(); GetBoard()->SetCurrentNetClass( g_CurrentTrackSegment->GetNetClassName() );
m_TrackAndViasSizesList_Changed = true;
AuxiliaryToolBar_DesignRules_Update_UI(); AuxiliaryToolBar_DesignRules_Update_UI();
if( pt_pad ) if( pt_pad )
...@@ -198,7 +199,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -198,7 +199,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
g_CurrentTrackSegment->DisplayInfo( this ); g_CurrentTrackSegment->DisplayInfo( this );
SetCurItem( g_CurrentTrackSegment ); SetCurItem( g_CurrentTrackSegment );
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false );
if( Drc_On ) if( Drc_On )
{ {
...@@ -227,20 +228,20 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -227,20 +228,20 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
/* Current track is Ok: current segment is kept, and a new one is created /* Current track is Ok: current segment is kept, and a new one is created
* unless the current segment is null, or 2 last are null if a 2 segments track build * unless the current segment is null, or 2 last are null if a 2 segments track build
*/ */
bool CanCreateNewSegment = TRUE; bool CanCreateNewSegment = true;
if( !g_TwoSegmentTrackBuild && g_CurrentTrackSegment->IsNull() ) if( !g_TwoSegmentTrackBuild && g_CurrentTrackSegment->IsNull() )
CanCreateNewSegment = FALSE; CanCreateNewSegment = false;
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->IsNull() if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->IsNull()
&& g_CurrentTrackSegment->Back() && g_CurrentTrackSegment->Back()->IsNull() ) && g_CurrentTrackSegment->Back() && g_CurrentTrackSegment->Back()->IsNull() )
CanCreateNewSegment = FALSE; CanCreateNewSegment = false;
if( CanCreateNewSegment ) if( CanCreateNewSegment )
{ {
/* Erase old track on screen */ /* Erase old track on screen */
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); ShowNewTrackWhenMovingCursor( DrawPanel, DC, false );
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
...@@ -279,7 +280,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -279,7 +280,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
/* Show the new position */ /* Show the new position */
ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); ShowNewTrackWhenMovingCursor( DrawPanel, DC, false );
} }
g_CurrentTrackSegment->DisplayInfo( this ); g_CurrentTrackSegment->DisplayInfo( this );
} }
...@@ -446,8 +447,8 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC ) ...@@ -446,8 +447,8 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
if( Begin_Route( aTrack, DC ) == NULL ) if( Begin_Route( aTrack, DC ) == NULL )
return; return;
ShowNewTrackWhenMovingCursor( DrawPanel, DC, TRUE ); /* mise a jour trace reel */ ShowNewTrackWhenMovingCursor( DrawPanel, DC, true ); /* mise a jour trace reel */
ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); /* efface trace piste*/ ShowNewTrackWhenMovingCursor( DrawPanel, DC, false ); /* efface trace piste*/
trace_ratsnest_pad( DC ); /* efface trace chevelu*/ trace_ratsnest_pad( DC ); /* efface trace chevelu*/
/* cleanup /* cleanup
...@@ -776,7 +777,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -776,7 +777,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; DisplayOpt.DisplayPcbTrackFill = Track_fill_copy;
( (WinEDA_BasePcbFrame*)(panel->m_Parent) )-> ( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->
build_ratsnest_pad( NULL, g_CurrentTrackSegment->m_End, FALSE ); build_ratsnest_pad( NULL, g_CurrentTrackSegment->m_End, false );
( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->trace_ratsnest_pad( DC ); ( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->trace_ratsnest_pad( DC );
} }
......
...@@ -148,8 +148,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ...@@ -148,8 +148,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
return false; return false;
} }
m_SelTrackWidthBox_Changed = true; m_TrackAndViasSizesList_Changed = true;
m_SelViaSizeBox_Changed = true;
if( Append ) if( Append )
{ {
......
...@@ -220,13 +220,12 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -220,13 +220,12 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
wxConfig* config = wxGetApp().m_EDA_Config; wxConfig* config = wxGetApp().m_EDA_Config;
m_FrameName = wxT( "PcbFrame" ); m_FrameName = wxT( "PcbFrame" );
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine m_Draw_Sheet_Ref = true; // true pour avoir le cartouche dessine
m_Draw_Auxiliary_Axis = TRUE; m_Draw_Auxiliary_Axis = true;
m_SelTrackWidthBox = NULL; m_SelTrackWidthBox = NULL;
m_SelViaSizeBox = NULL; m_SelViaSizeBox = NULL;
m_SelLayerBox = NULL; m_SelLayerBox = NULL;
m_SelTrackWidthBox_Changed = FALSE; m_TrackAndViasSizesList_Changed = false;
m_SelViaSizeBox_Changed = FALSE;
SetBoard( new BOARD( NULL, this ) ); SetBoard( new BOARD( NULL, this ) );
...@@ -260,7 +259,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -260,7 +259,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
GetScreen()->SetGrid( GridSize ); GetScreen()->SetGrid( GridSize );
if( DrawPanel ) if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE; DrawPanel->m_Block_Enable = true;
ReCreateMenuBar(); ReCreateMenuBar();
ReCreateHToolbar(); ReCreateHToolbar();
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
...@@ -295,7 +294,7 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -295,7 +294,7 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
{ {
wxConfig * config = wxGetApp().m_EDA_Config; wxConfig * config = wxGetApp().m_EDA_Config;
DrawPanel->m_AbortRequest = TRUE; DrawPanel->m_AbortRequest = true;
if( ScreenPcb->IsModify() ) if( ScreenPcb->IsModify() )
{ {
...@@ -354,7 +353,7 @@ void WinEDA_PcbFrame::Show3D_Frame( wxCommandEvent& event ) ...@@ -354,7 +353,7 @@ void WinEDA_PcbFrame::Show3D_Frame( wxCommandEvent& event )
} }
m_Draw3DFrame = new WinEDA3D_DrawFrame( this, _( "3D Viewer" ) ); m_Draw3DFrame = new WinEDA3D_DrawFrame( this, _( "3D Viewer" ) );
m_Draw3DFrame->Show( TRUE ); m_Draw3DFrame->Show( true );
} }
/** /**
......
...@@ -26,17 +26,17 @@ ...@@ -26,17 +26,17 @@
#include "eda_dde.h" #include "eda_dde.h"
bool Drc_On = TRUE; bool Drc_On = true;
bool g_AutoDeleteOldTrack = TRUE; bool g_AutoDeleteOldTrack = true;
bool g_No_Via_Route; bool g_No_Via_Route;
bool g_Drag_Pistes_On; bool g_Drag_Pistes_On;
bool g_Show_Ratsnest; bool g_Show_Ratsnest;
bool g_Show_Module_Ratsnest; bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = TRUE; bool g_Show_Pads_Module_in_Move = true;
bool g_Raccord_45_Auto = TRUE; bool g_Raccord_45_Auto = true;
bool Track_45_Only; bool Track_45_Only;
bool Segments_45_Only; bool Segments_45_Only;
bool g_TwoSegmentTrackBuild = TRUE; bool g_TwoSegmentTrackBuild = true;
bool g_HightLigt_Status; bool g_HightLigt_Status;
extern PARAM_CFG_BASE* ParamCfgList[]; extern PARAM_CFG_BASE* ParamCfgList[];
...@@ -116,17 +116,17 @@ Changing extension to .brd." ), ...@@ -116,17 +116,17 @@ Changing extension to .brd." ),
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;
SetTopWindow( frame ); SetTopWindow( frame );
frame->Show( TRUE ); frame->Show( true );
if( CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER ) ) if( CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER ) )
{ {
SetupServerFunction( RemoteCommand ); SetupServerFunction( RemoteCommand );
} }
frame->Zoom_Automatique( TRUE );
Read_Config( fn.GetFullPath() ); Read_Config( fn.GetFullPath() );
frame->Zoom_Automatique( true );
/* Load file specified in the command line. */ /* Load file specified in the command line. */
if( fn.IsOk() ) if( fn.IsOk() )
{ {
...@@ -135,5 +135,5 @@ Changing extension to .brd." ), ...@@ -135,5 +135,5 @@ Changing extension to .brd." ),
frame->ReCreateLayerBox( NULL ); frame->ReCreateLayerBox( NULL );
} }
return TRUE; return true;
} }
...@@ -111,8 +111,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -111,8 +111,7 @@ 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_TrackAndViasSizesList_Changed = true;
m_SelViaSizeBox_Changed = TRUE;
GetScreen()->SetModify(); GetScreen()->SetModify();
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
...@@ -128,7 +127,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -128,7 +127,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
Affiche_Message( wxString( _("Session file imported and merged OK.")) ); Affiche_Message( wxString( _("Session file imported and merged OK.")) );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true );
} }
......
...@@ -75,25 +75,25 @@ void WinEDA_PcbFrame::PrepareLayerIndicator() ...@@ -75,25 +75,25 @@ void WinEDA_PcbFrame::PrepareLayerIndicator()
if( previous_active_layer_color != active_layer_color ) if( previous_active_layer_color != active_layer_color )
{ {
previous_active_layer_color = active_layer_color; previous_active_layer_color = active_layer_color;
change = TRUE; change = true;
} }
Route_Layer_TOP_color = g_DesignSettings.m_LayerColor[((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP]; Route_Layer_TOP_color = g_DesignSettings.m_LayerColor[((PCB_SCREEN*)GetScreen())->m_Route_Layer_TOP];
if( previous_Route_Layer_TOP_color != Route_Layer_TOP_color ) if( previous_Route_Layer_TOP_color != Route_Layer_TOP_color )
{ {
previous_Route_Layer_TOP_color = Route_Layer_TOP_color; previous_Route_Layer_TOP_color = Route_Layer_TOP_color;
change = TRUE; change = true;
} }
Route_Layer_BOTTOM_color = g_DesignSettings.m_LayerColor[((PCB_SCREEN*)GetScreen())->m_Route_Layer_BOTTOM]; Route_Layer_BOTTOM_color = g_DesignSettings.m_LayerColor[((PCB_SCREEN*)GetScreen())->m_Route_Layer_BOTTOM];
if( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color ) if( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color )
{ {
previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color; previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color;
change = TRUE; change = true;
} }
via_color = g_DesignSettings.m_ViaColor[g_DesignSettings.m_CurrentViaType ]; via_color = g_DesignSettings.m_ViaColor[g_DesignSettings.m_CurrentViaType ];
if( previous_via_color != via_color ) if( previous_via_color != via_color )
{ {
previous_via_color = via_color; previous_via_color = via_color;
change = TRUE; change = true;
} }
if( !change && (LayerPairBitmap != NULL) ) if( !change && (LayerPairBitmap != NULL) )
...@@ -193,7 +193,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar() ...@@ -193,7 +193,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
} }
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_HToolBar->SetRows( 1 ); m_HToolBar->SetRows( 1 );
SetToolBar( m_HToolBar ); SetToolBar( m_HToolBar );
...@@ -422,7 +422,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -422,7 +422,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
// Set up toolbar // Set up toolbar
m_VToolBar->AddTool( ID_NO_SELECT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_NO_SELECT_BUTT, wxEmptyString,
wxBitmap( cursor_xpm ), wxEmptyString, wxITEM_CHECK ); wxBitmap( cursor_xpm ), wxEmptyString, wxITEM_CHECK );
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE ); m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, true );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_HIGHLIGHT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_HIGHLIGHT_BUTT, wxEmptyString,
...@@ -553,7 +553,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -553,7 +553,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
if( m_AuxiliaryToolBar == NULL ) if( m_AuxiliaryToolBar == NULL )
{ {
m_AuxiliaryToolBar = new WinEDA_Toolbar( TOOLBAR_AUX, this, m_AuxiliaryToolBar = new WinEDA_Toolbar( TOOLBAR_AUX, this,
ID_AUX_TOOLBAR, TRUE ); ID_AUX_TOOLBAR, true );
// Set up toolbar // Set up toolbar
m_AuxiliaryToolBar->AddSeparator(); m_AuxiliaryToolBar->AddSeparator();
...@@ -562,7 +562,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -562,7 +562,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
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_TrackAndViasSizesList_Changed = true;
m_ClearanceBox = new wxTextCtrl( m_AuxiliaryToolBar, m_ClearanceBox = new wxTextCtrl( m_AuxiliaryToolBar,
-1, -1,
wxEmptyString, wxEmptyString,
...@@ -655,9 +655,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -655,9 +655,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
m_SelGridBox->Append( msg ); m_SelGridBox->Append( msg );
} }
m_SelViaSizeBox_Changed = TRUE; m_TrackAndViasSizesList_Changed = true;
m_SelTrackWidthBox_Changed = TRUE;
ReCreateLayerBox( NULL ); ReCreateLayerBox( NULL );
SetToolbars(); SetToolbars();
......
...@@ -62,48 +62,47 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_DesignRules_Update_UI( ) ...@@ -62,48 +62,47 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_DesignRules_Update_UI( )
} }
/** /**
* Function AuxiliaryToolBar_Update_UI * Function AuxiliaryToolBar_Update_UI
* update the displayed values on auxiliary horizontal toolbar * update the displayed values on auxiliary horizontal toolbar
* (track width, via sizes, clearance ... * (track width, via sizes, clearance ...
* Display format for track and via lists
* first item = current selected class value
* next items (if any) = ordered list of sizes (extra sizes).
* So the current selected class value can be same as an other extra value
*/ */
void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( ) void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( )
{ {
wxString msg; wxString msg;
m_AuxiliaryToolBar->ToggleTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, m_AuxiliaryToolBar->ToggleTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
g_DesignSettings.m_UseConnectedTrackWidth ); g_DesignSettings.m_UseConnectedTrackWidth );
if( m_SelTrackWidthBox && m_SelTrackWidthBox_Changed )
AuxiliaryToolBar_DesignRules_Update_UI( );
if( m_SelTrackWidthBox && m_TrackAndViasSizesList_Changed )
{ {
m_SelTrackWidthBox_Changed = false;
m_SelTrackWidthBox->Clear(); m_SelTrackWidthBox->Clear();
for( unsigned ii = 0; ii < GetBoard()->m_TrackWidthHistory.size(); ii++ ) for( unsigned ii = 0; ii < GetBoard()->m_TrackWidthHistory.size(); ii++ )
{ {
msg = _( "Track" ) + ReturnStringValue(GetBoard()->m_TrackWidthHistory[ii]); msg = _( "Track" ) + ReturnStringValue(GetBoard()->m_TrackWidthHistory[ii]);
m_SelTrackWidthBox->Append( msg ); m_SelTrackWidthBox->Append( msg );
if( GetBoard()->m_TrackWidthHistory[ii] == g_DesignSettings.m_CurrentTrackWidth )
m_SelTrackWidthBox->SetSelection( ii );
} }
if( GetBoard()->m_TrackWidthSelector >= (int)GetBoard()->m_TrackWidthHistory.size() )
GetBoard()->m_TrackWidthSelector = 0;
m_SelTrackWidthBox->SetSelection( GetBoard()->m_TrackWidthSelector );
} }
AuxiliaryToolBar_DesignRules_Update_UI( ); if( m_SelViaSizeBox && m_TrackAndViasSizesList_Changed )
if( m_SelViaSizeBox && m_SelViaSizeBox_Changed )
{ {
m_SelViaSizeBox_Changed = false;
m_SelViaSizeBox->Clear(); m_SelViaSizeBox->Clear();
for( unsigned ii = 0; ii < GetBoard()->m_ViaSizeHistory.size(); ii++ ) for( unsigned ii = 0; ii < GetBoard()->m_ViaSizeHistory.size(); ii++ )
{ {
msg = _( "Via" ) + ReturnStringValue(GetBoard()->m_ViaSizeHistory[ii]); msg = _( "Via" ) + ReturnStringValue(GetBoard()->m_ViaSizeHistory[ii]);
m_SelViaSizeBox->Append( msg ); m_SelViaSizeBox->Append( msg );
if( GetBoard()->m_ViaSizeHistory[ii] == g_DesignSettings.m_CurrentViaSize )
m_SelViaSizeBox->SetSelection( ii );
} }
if( GetBoard()->m_ViaSizeSelector >= (int)GetBoard()->m_ViaSizeHistory.size() )
GetBoard()->m_ViaSizeSelector = 0;
m_SelViaSizeBox->SetSelection( GetBoard()->m_ViaSizeSelector );
} }
if( m_SelZoomBox ) if( m_SelZoomBox )
...@@ -122,7 +121,7 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( ) ...@@ -122,7 +121,7 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( )
m_SelZoomBox->SetSelection( -1 ); m_SelZoomBox->SetSelection( -1 );
} }
if( m_SelGridBox && GetScreen() ) if( m_SelGridBox )
{ {
int kk = m_SelGridBox->GetChoice(); int kk = m_SelGridBox->GetChoice();
...@@ -137,6 +136,8 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( ) ...@@ -137,6 +136,8 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( )
} }
} }
} }
m_TrackAndViasSizesList_Changed = false;
} }
......
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