Commit f6656e03 authored by charras's avatar charras

fixed eeschema crash when using the hotkey m (move) command.

Pcbnew :added option to show/hide footprints values and/or references
parent 3962e443
......@@ -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 <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
*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 <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++ Pcbnew:
......
......@@ -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})
......@@ -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"
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
};
......
No preview for this file type
......@@ -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 <jean-pierre.charras@ujf-grenoble.fr>\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 "
......
......@@ -97,12 +97,11 @@ 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++ )
{
cmp* current = *iter;
......@@ -110,15 +109,15 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
{
current->m_Ref.Append( wxT( ", " ), 1 );
current->m_Ref.Append( Module->m_Reference->m_Text );
comp->m_CmpCount++;
current->m_CmpCount++;
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->m_Id = i++;
......@@ -128,6 +127,9 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
comp->m_CmpCount = 1;
list.Append( comp );
}
// increment module
Module = Module->Next();
}
// Print list
......
......@@ -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( ((BOARD*)m_Parent)->IsElementVisible( MOD_REFERENCES_VISIBLE ) )
{
if( !(m_Reference->m_Flags & IS_MOVED) )
m_Reference->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() )
{
......
......@@ -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; row<DIM(renderRows); ++row )
......
......@@ -76,23 +76,6 @@ void Trace_Une_Piste( WinEDA_DrawPanel* panel,
int mode_color );
/****************/
/* TRACEMOD.C : */
/****************/
/* Trace the pads of a module in sketch mode.
* Used to display a module pads when it is not displayed by the display
* options Module.
* The pads must appear on the data layers by MasqueLayer
*/
void Trace_Pads_Only( WinEDA_DrawPanel* panel,
wxDC* DC,
MODULE* Module,
int ox,
int oy,
int MasqueLayer,
int mode_color );
/****************/
/* LOCATE.CPP : */
/****************/
......
/*******************/
/* Display modules */
/*******************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "trigo.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "drag.h"
/* Font of characters for the trace text routine. */
extern char* graphic_fonte_shape[];
#include "protos.h"
#define L_MIN_DESSIN 1 /* line width for segments other than traces. */
/* Trace the pads of a module in sketch mode.
* Used to display a module pads when it is not displayed by the display
* options Module setting.
*
* The pads posters must appear on the data layers by 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;
}
......@@ -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;
}
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