diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4e259c23d7..16451ab031 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,12 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with email address. +2010-Jan-28 UPDATE Jean-Pierre Charras +================================================================================ + *fixed eeschema crash when using the hotkey m (move) command. +* Pcbnew :added option to show/hide footprints values and/or references + See if show/hide footprints texts option is now always useful. + 2010-Jan-27 UPDATE Jean-Pierre Charras ================================================================================ ++ Pcbnew: diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index c583c98b42..bbd0b9a406 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -83,7 +83,6 @@ set(PCB_COMMON_SRCS ../pcbnew/classpcb.cpp ../pcbnew/collectors.cpp ../pcbnew/sel_layer.cpp - ../pcbnew/tracemod.cpp ) add_library(pcbcommon ${PCB_COMMON_SRCS}) diff --git a/eeschema/eelayer.cpp b/eeschema/eelayer.cpp index f6e0f6ba25..ae47f9f805 100644 --- a/eeschema/eelayer.cpp +++ b/eeschema/eelayer.cpp @@ -5,10 +5,6 @@ /* Set up color Layers for EESchema */ -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma implementation "eelayer.h" -#endif - #include "fctsys.h" #include "gr_basic.h" #include "common.h" diff --git a/eeschema/eelayer.h b/eeschema/eelayer.h index befef7d6e6..7e5bfc5cfa 100644 --- a/eeschema/eelayer.h +++ b/eeschema/eelayer.h @@ -5,10 +5,6 @@ #ifndef _EELAYER_H_ #define _EELAYER_H_ -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma interface "eelayer.cpp" -#endif - #include "wx/statline.h" class wxBoxSizer; diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 015d03d21d..6fe1324b99 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -468,6 +468,8 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, break; if( DrawStruct->Type() == TYPE_SCH_COMPONENT ) DrawStruct = LocateSmallestComponent( GetScreen() ); + if( DrawStruct == NULL ) + break; if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ){ // If it's a sheet, then check if a pinsheet is under the cursor SCH_SHEET_PIN* slabel = LocateSheetLabel( (SCH_SHEET*) DrawStruct, @@ -477,10 +479,8 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } if (DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE){ // If it's a junction, pick the underlying wire instead - DrawStruct = PickStruct( GetScreen()->m_Curseur, - GetScreen(), WIREITEM); + DrawStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM); } - if( DrawStruct == NULL ) break; } diff --git a/include/pcbstruct.h b/include/pcbstruct.h index dc92e4174a..d46da3d98a 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -178,6 +178,8 @@ enum PCB_VISIBLE NO_CONNECTS_VISIBLE, ///< show a marker on pads with no nets MOD_FR_VISIBLE, ///< show modules on front MOD_BK_VISIBLE, ///< show modules on back + MOD_VALUES_VISIBLE, ///< show modules values (when texts are visibles) + MOD_REFERENCES_VISIBLE, ///< show modules references (when texts are visibles) END_VISIBLE // sentinel }; diff --git a/internat/fr/kicad.mo b/internat/fr/kicad.mo index f8e9806c61..2c333bf102 100644 Binary files a/internat/fr/kicad.mo and b/internat/fr/kicad.mo differ diff --git a/internat/fr/kicad.po b/internat/fr/kicad.po index b8d5885267..5a6d2ed0f0 100644 --- a/internat/fr/kicad.po +++ b/internat/fr/kicad.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: kicad\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-01-27 21:22+0100\n" -"PO-Revision-Date: 2010-01-27 21:23+0100\n" +"PO-Revision-Date: 2010-01-28 11:33+0100\n" "Last-Translator: \n" "Language-Team: kicad team \n" "MIME-Version: 1.0\n" @@ -7484,7 +7484,7 @@ msgstr "Pin" #: eeschema/class_pin.cpp:1609 msgid "Number" -msgstr "Nombre" +msgstr "Numéro" #: eeschema/database.cpp:49 msgid "No components found matching " diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index 6c548a9a85..bef35c7419 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -97,30 +97,29 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) cmp* comp = NULL; CmpList::iterator iter; int i = 1; - for( ; Module != NULL; Module = Module->Next() ) + while (Module != NULL) { bool valExist = false; - if( comp != NULL ) + // try to find component in existing list + for( iter = list.begin(); iter != list.end(); iter++ ) { - for( iter = list.begin(); iter != list.end(); iter++ ) + cmp* current = *iter; + if( (current->m_Val == Module->m_Value->m_Text) && (current->m_Pkg == Module->m_LibRef) ) { - cmp* current = *iter; - if( (current->m_Val == Module->m_Value->m_Text) && (current->m_Pkg == Module->m_LibRef) ) - { - current->m_Ref.Append( wxT( ", " ), 1 ); - current->m_Ref.Append( Module->m_Reference->m_Text ); - comp->m_CmpCount++; + current->m_Ref.Append( wxT( ", " ), 1 ); + current->m_Ref.Append( Module->m_Reference->m_Text ); + current->m_CmpCount++; - valExist = true; - break; - } + valExist = true; + break; } } - if( !valExist || (comp == NULL) ) + // If component does not exist yet, create new one and append it to the list. + if( valExist == false ) { - comp = new cmp(); + comp = new cmp(); comp->m_Id = i++; comp->m_Val = Module->m_Value->m_Text; comp->m_Ref = Module->m_Reference->m_Text; @@ -128,6 +127,9 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) comp->m_CmpCount = 1; list.Append( comp ); } + + // increment module + Module = Module->Next(); } // Print list diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 22f907022f..432eba5c78 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -70,7 +70,7 @@ void MODULE::DrawAncre( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset GRSetDrawMode( DC, draw_mode ); - if( g_DesignSettings.IsElementVisible( ANCHOR_VISIBLE ) ) + if( ((BOARD*)m_Parent)->IsElementVisible( ANCHOR_VISIBLE ) ) { GRLine( &panel->m_ClipBox, DC, m_Pos.x - offset.x - anchor_size, m_Pos.y - offset.y, @@ -190,15 +190,22 @@ void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, pad->Draw( panel, DC, draw_mode, offset ); } + // Draws footprint anchor DrawAncre( panel, DC, offset, DIM_ANCRE_MODULE, draw_mode ); /* Draw graphic items */ - if( !(m_Reference->m_Flags & IS_MOVED) ) - m_Reference->Draw( panel, DC, draw_mode, offset ); + if( ((BOARD*)m_Parent)->IsElementVisible( MOD_REFERENCES_VISIBLE ) ) + { + if( !(m_Reference->m_Flags & IS_MOVED) ) + m_Reference->Draw( panel, DC, draw_mode, offset ); + } - if( !(m_Value->m_Flags & IS_MOVED) ) - m_Value->Draw( panel, DC, draw_mode, offset ); + if( ((BOARD*)m_Parent)->IsElementVisible( MOD_VALUES_VISIBLE ) ) + { + if( !(m_Value->m_Flags & IS_MOVED) ) + m_Value->Draw( panel, DC, draw_mode, offset ); + } for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() ) { diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 48ddb15b5a..c3dc453a2d 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -106,7 +106,7 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw // is changed before appending to the LAYER_WIDGET. This is an automatic variable // not a static variable, change the color & state after copying from code to renderRows // on the stack. - LAYER_WIDGET::ROW renderRows[14] = { + LAYER_WIDGET::ROW renderRows[16] = { #define RR LAYER_WIDGET::ROW // Render Row abreviation to reduce source width @@ -128,6 +128,8 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw RR( _( "No-Connects" ), NO_CONNECTS_VISIBLE, -1, _( "Show a marker on pads which have no net connected" ) ), RR( _( "Modules Front" ), MOD_FR_VISIBLE, -1, _( "Show footprints that are on board's front") ), RR( _( "Modules Back" ), MOD_BK_VISIBLE, -1, _( "Show footprints that are on board's back") ), + RR( _( "Values" ), MOD_VALUES_VISIBLE, -1, _( "Show footprints values") ), + RR( _( "References" ), MOD_REFERENCES_VISIBLE, -1, _( "Show footprints references") ), }; for( unsigned row=0; rowGetScreen(); - frame = (WinEDA_BasePcbFrame*) panel->GetParent(); - - tmp = frame->m_DisplayPadFill; - frame->m_DisplayPadFill = FALSE; - - /* Draw pads. */ - for( D_PAD* pad = Module->m_Pads; pad; pad = pad->Next() ) - { - if( (pad->m_Masque_Layer & MasqueLayer) == 0 ) - continue; - - pad->Draw( panel, DC, draw_mode, wxPoint( ox, oy ) ); - } - - frame->m_DisplayPadFill = tmp; -} diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index ebf169a2f6..24e43d7a99 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -18,6 +18,15 @@ #include "pcbplot.h" #include "protos.h" +// Local functions: +/* Trace the pads of a module in sketch mode. + * Used to display pads when when the module visibility is set to not visible + * and we want to see pad through. + * The pads must appear on the layers selected in MasqueLayer + */ +static void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, + int ox, int oy, int MasqueLayer, int draw_mode ); + /* Draw the footprint editor BOARD, and others elements : axis, grid .. */ @@ -235,3 +244,35 @@ void BOARD::DrawHighLight( WinEDA_DrawPanel* aDrawPanel, wxDC* DC, int aNetCode } } } + + +/* Trace the pads of a module in sketch mode. + * Used to display pads when when the module visibility is set to not visible + * and we want to see pad through. + * The pads must appear on the layers selected in MasqueLayer + */ +void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, + int ox, int oy, int MasqueLayer, int draw_mode ) +{ + int tmp; + PCB_SCREEN* screen; + WinEDA_BasePcbFrame* frame; + + screen = (PCB_SCREEN*) panel->GetScreen(); + frame = (WinEDA_BasePcbFrame*) panel->GetParent(); + + tmp = frame->m_DisplayPadFill; + frame->m_DisplayPadFill = FALSE; + + /* Draw pads. */ + for( D_PAD* pad = Module->m_Pads; pad; pad = pad->Next() ) + { + if( (pad->m_Masque_Layer & MasqueLayer) == 0 ) + continue; + + pad->Draw( panel, DC, draw_mode, wxPoint( ox, oy ) ); + } + + frame->m_DisplayPadFill = tmp; +} +