Commit f406e9d9 authored by dickelbeck's avatar dickelbeck

drc dialog fixes

parent 6bd9b7fc
...@@ -9,9 +9,12 @@ email address. ...@@ -9,9 +9,12 @@ email address.
2008-Feb-22 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Feb-22 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
specctra_export.cpp: added DSN 'outline' support from EDGE_MODULEs. * specctra_export.cpp: added DSN 'outline' support from EDGE_MODULEs.
lines and circles, not arcs. lines and circles, not arcs.
factored out EDGE_MODULE::ShowShape() from EDGE_MODULE::Show(). * factored out EDGE_MODULE::ShowShape() from EDGE_MODULE::Show().
* drc.cpp changed AsSecondItem to HasSecondItem and test it in generating
the file report and when making the popup menu in the dialog_drc and
when generating the html list item.
2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
......
...@@ -44,7 +44,7 @@ void MARKER::init() ...@@ -44,7 +44,7 @@ void MARKER::init()
m_Type = 0; m_Type = 0;
m_Color = RED; m_Color = RED;
m_Bitmap = Default_MarkerBitmap; m_Bitmap = Default_MarkerBitmap;
m_Size.x = Default_MarkerBitmap[0]; m_Size.x = Default_MarkerBitmap[0];
m_Size.y = Default_MarkerBitmap[1]; m_Size.y = Default_MarkerBitmap[1];
} }
...@@ -56,25 +56,25 @@ MARKER::MARKER( BOARD_ITEM* StructFather ) : ...@@ -56,25 +56,25 @@ MARKER::MARKER( BOARD_ITEM* StructFather ) :
} }
MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos, MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos, const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ) : const wxString& bText, const wxPoint& bPos ) :
BOARD_ITEM( NULL, TYPEMARKER ) // parent set during BOARD::Add() BOARD_ITEM( NULL, TYPEMARKER ) // parent set during BOARD::Add()
{ {
init(); init();
SetData( aErrorCode, aMarkerPos, SetData( aErrorCode, aMarkerPos,
aText, aPos, aText, aPos,
bText, bPos ); bText, bPos );
} }
MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos, MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ) : const wxString& aText, const wxPoint& aPos ) :
BOARD_ITEM( NULL, TYPEMARKER ) // parent set during BOARD::Add() BOARD_ITEM( NULL, TYPEMARKER ) // parent set during BOARD::Add()
{ {
init(); init();
SetData( aErrorCode, aMarkerPos, SetData( aErrorCode, aMarkerPos,
aText, aPos ); aText, aPos );
} }
...@@ -88,25 +88,25 @@ MARKER::~MARKER() ...@@ -88,25 +88,25 @@ MARKER::~MARKER()
} }
void MARKER::SetData( int aErrorCode, const wxPoint& aMarkerPos, void MARKER::SetData( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos, const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ) const wxString& bText, const wxPoint& bPos )
{ {
m_drc.SetData( aErrorCode, aMarkerPos, m_drc.SetData( aErrorCode, aMarkerPos,
aText, bText, aText, bText,
aPos, bPos ); aPos, bPos );
// @todo: switch on error code to set error code specific color, and possibly bitmap. // @todo: switch on error code to set error code specific color, and possibly bitmap.
m_Color = WHITE; m_Color = WHITE;
} }
void MARKER::SetData( int aErrorCode, const wxPoint& aMarkerPos, void MARKER::SetData( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ) const wxString& aText, const wxPoint& aPos )
{ {
m_drc.SetData( aErrorCode, aMarkerPos, m_drc.SetData( aErrorCode, aMarkerPos,
aText, aPos ); aText, aPos );
// @todo: switch on error code to set error code specific color, and possibly bitmap. // @todo: switch on error code to set error code specific color, and possibly bitmap.
m_Color = WHITE; m_Color = WHITE;
} }
...@@ -128,24 +128,24 @@ void MARKER::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -128,24 +128,24 @@ void MARKER::Display_Infos( WinEDA_DrawFrame* frame )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
const DRC_ITEM& rpt = m_drc; const DRC_ITEM& rpt = m_drc;
text_pos = 1; text_pos = 1;
Affiche_1_Parametre( frame, text_pos, _( "Type" ), _("Marker"), DARKCYAN ); Affiche_1_Parametre( frame, text_pos, _( "Type" ), _("Marker"), DARKCYAN );
wxString errorTxt; wxString errorTxt;
errorTxt << _("ErrType") << wxT("(") << rpt.GetErrorCode() << wxT(")- ") << rpt.GetErrorText() << wxT(":"); errorTxt << _("ErrType") << wxT("(") << rpt.GetErrorCode() << wxT(")- ") << rpt.GetErrorText() << wxT(":");
text_pos = 5; text_pos = 5;
Affiche_1_Parametre( frame, text_pos, errorTxt, wxEmptyString, RED ); Affiche_1_Parametre( frame, text_pos, errorTxt, wxEmptyString, RED );
wxString txtA; wxString txtA;
txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT(": ") << rpt.GetTextA(); txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT(": ") << rpt.GetTextA();
wxString txtB; wxString txtB;
if ( rpt.AsSecondItem() ) if ( rpt.HasSecondItem() )
txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB(); txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB();
text_pos = 25; text_pos = 25;
Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN ); Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN );
} }
...@@ -157,23 +157,23 @@ bool MARKER::HitTest( const wxPoint& refPos ) ...@@ -157,23 +157,23 @@ bool MARKER::HitTest( const wxPoint& refPos )
{ {
// the MARKER is 12 pixels by 12 pixels, but is not resized with zoom, so // the MARKER is 12 pixels by 12 pixels, but is not resized with zoom, so
// as zoom changes, the effective real size (in user units) of the MARKER changes. // as zoom changes, the effective real size (in user units) of the MARKER changes.
wxSize TrueSize = m_Size; wxSize TrueSize = m_Size;
if ( ActiveScreen ) if ( ActiveScreen )
{ {
TrueSize.x *= ActiveScreen->GetZoom(); TrueSize.x *= ActiveScreen->GetZoom();
TrueSize.y *= ActiveScreen->GetZoom(); TrueSize.y *= ActiveScreen->GetZoom();
} }
wxPoint pos = GetPosition(); wxPoint pos = GetPosition();
int dx = refPos.x - pos.x; int dx = refPos.x - pos.x;
int dy = refPos.y - pos.y; int dy = refPos.y - pos.y;
/* is refPos in the box: Marker size to right an bottom, /* is refPos in the box: Marker size to right an bottom,
or size/2 to left or top */ or size/2 to left or top */
if( dx <= TrueSize.x && dy <= TrueSize.y && if( dx <= TrueSize.x && dy <= TrueSize.y &&
dx >= -TrueSize.x/2 && dy >= -TrueSize.y/2 ) dx >= -TrueSize.x/2 && dy >= -TrueSize.y/2 )
return true; return true;
else else
return false; return false;
...@@ -201,11 +201,11 @@ void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode ) ...@@ -201,11 +201,11 @@ void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode )
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
px = GRMapX( GetPosition().x ); px = GRMapX( GetPosition().x );
py = GRMapY( GetPosition().y ); py = GRMapY( GetPosition().y );
/* Get the bitmap size */ /* Get the bitmap size */
m_Size.x = *(pt_bitmap++); m_Size.x = *(pt_bitmap++);
m_Size.y = *(pt_bitmap++); m_Size.y = *(pt_bitmap++);
/* Draw the bitmap */ /* Draw the bitmap */
......
This diff is collapsed.
...@@ -510,11 +510,16 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart ) ...@@ -510,11 +510,16 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart )
// This test seems necessary since the dialog box that displays the // This test seems necessary since the dialog box that displays the
// desired via hole size and width does not enforce a hole size smaller // desired via hole size and width does not enforce a hole size smaller
// than the via's diameter. // than the via's diameter.
if( !aRefSeg->GetDrillValue() > aRefSeg->m_Width ) if( aRefSeg->GetDrillValue() > aRefSeg->m_Width )
{ {
#if 0 // a temporary way to fix a bad board here, change for your values
if( aRefSeg->GetDrillValue()==120 && aRefSeg->m_Width==100 )
aRefSeg->m_Width = 180;
#else
m_currentMarker = fillMarker( aRefSeg, NULL, m_currentMarker = fillMarker( aRefSeg, NULL,
DRCE_VIA_HOLE_BIGGER, m_currentMarker ); DRCE_VIA_HOLE_BIGGER, m_currentMarker );
return false; return false;
#endif
} }
// For microvias: test if they are blindvias and only between 2 layers // For microvias: test if they are blindvias and only between 2 layers
......
...@@ -26,23 +26,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -26,23 +26,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
*/ */
{ {
BOARD_ITEM* DrawStruct = GetCurItem(); BOARD_ITEM* DrawStruct = GetCurItem();
bool exit = false; bool exit = false;
if( (m_ID_current_state == 0) || ( DrawStruct && DrawStruct->m_Flags ) ) if( (m_ID_current_state == 0) || ( DrawStruct && DrawStruct->m_Flags ) )
{ {
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress
{ {
DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = TRUE;
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case TYPEZONE_CONTAINER: case TYPEZONE_CONTAINER:
if ( (DrawStruct->m_Flags & IS_NEW) ) if ( (DrawStruct->m_Flags & IS_NEW) )
Begin_Zone( DC ); Begin_Zone( DC );
else else
End_Move_Zone_Corner_Or_Outlines( DC, (ZONE_CONTAINER *) DrawStruct ); End_Move_Zone_Corner_Or_Outlines( DC, (ZONE_CONTAINER *) DrawStruct );
exit = true; exit = true;
break; break;
...@@ -95,23 +95,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -95,23 +95,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
wxT( "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), DrawStruct->Type() ); wxT( "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), DrawStruct->Type() );
exit = true; exit = true;
} }
break; break;
} }
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = FALSE;
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
if ( exit ) return; if ( exit ) return;
} }
else if( !wxGetKeyState(WXK_SHIFT) && !wxGetKeyState(WXK_ALT) && else if( !wxGetKeyState(WXK_SHIFT) && !wxGetKeyState(WXK_ALT) &&
!wxGetKeyState(WXK_CONTROL) ) !wxGetKeyState(WXK_CONTROL) )
{ {
DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = PcbGeneralLocateAndDisplay();
if( DrawStruct ) if( DrawStruct )
SendMessageToEESCHEMA( DrawStruct ); SendMessageToEESCHEMA( DrawStruct );
} }
} }
switch( m_ID_current_state ) switch( m_ID_current_state )
{ {
case ID_MAIN_MENUBAR: case ID_MAIN_MENUBAR:
...@@ -130,19 +130,19 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -130,19 +130,19 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case ID_PCB_HIGHLIGHT_BUTT: case ID_PCB_HIGHLIGHT_BUTT:
{ {
int netcode = Select_High_Light( DC ); int netcode = Select_High_Light( DC );
if( netcode < 0 ) if( netcode < 0 )
m_Pcb->Display_Infos( this ); m_Pcb->Display_Infos( this );
else else
Affiche_Infos_Equipot( netcode, this ); Affiche_Infos_Equipot( netcode, this );
} }
break; break;
case ID_PCB_SHOW_1_RATSNEST_BUTT: case ID_PCB_SHOW_1_RATSNEST_BUTT:
DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = PcbGeneralLocateAndDisplay();
Show_1_Ratsnest( DrawStruct, DC ); Show_1_Ratsnest( DrawStruct, DC );
if( DrawStruct ) if( DrawStruct )
SendMessageToEESCHEMA( DrawStruct ); SendMessageToEESCHEMA( DrawStruct );
break; break;
...@@ -171,14 +171,14 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -171,14 +171,14 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( m_ID_current_state == ID_PCB_ARC_BUTT ) if( m_ID_current_state == ID_PCB_ARC_BUTT )
shape = S_ARC; shape = S_ARC;
if( ((PCB_SCREEN*)GetScreen())->m_Active_Layer <= LAST_COPPER_LAYER ) if( ((PCB_SCREEN*)GetScreen())->m_Active_Layer <= LAST_COPPER_LAYER )
{ {
DisplayError( this, _( "Graphic not authorized on Copper layers" ) ); DisplayError( this, _( "Graphic not authorized on Copper layers" ) );
break; break;
} }
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{ {
DrawStruct = Begin_DrawSegment( NULL, shape, DC ); DrawStruct = Begin_DrawSegment( NULL, shape, DC );
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = TRUE;
} }
...@@ -194,7 +194,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -194,7 +194,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
} }
case ID_TRACK_BUTT: case ID_TRACK_BUTT:
if( ((PCB_SCREEN*)GetScreen())->m_Active_Layer > LAST_COPPER_LAYER ) if( ((PCB_SCREEN*)GetScreen())->m_Active_Layer > LAST_COPPER_LAYER )
{ {
DisplayError( this, _( "Tracks on Copper layers only " ) ); DisplayError( this, _( "Tracks on Copper layers only " ) );
break; break;
...@@ -223,18 +223,18 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -223,18 +223,18 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT:
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{ {
if ( Begin_Zone( DC ) ) if ( Begin_Zone( DC ) )
{ {
DrawStruct = m_Pcb->m_CurrentZoneContour; DrawStruct = m_Pcb->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
} }
} }
else if( DrawStruct else if( DrawStruct
&& (DrawStruct->Type() == TYPEZONE_CONTAINER) && (DrawStruct->Type() == TYPEZONE_CONTAINER)
&& (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) )
{ {
Begin_Zone( DC ); Begin_Zone( DC );
DrawStruct = m_Pcb->m_CurrentZoneContour; DrawStruct = m_Pcb->m_CurrentZoneContour;
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
} }
else else
...@@ -261,7 +261,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -261,7 +261,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{ {
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
DrawStruct = Load_Module_From_Library( wxEmptyString, DC ); DrawStruct = Load_Module_From_Library( wxEmptyString, DC );
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
if( DrawStruct ) if( DrawStruct )
StartMove_Module( (MODULE*) DrawStruct, DC ); StartMove_Module( (MODULE*) DrawStruct, DC );
...@@ -276,7 +276,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -276,7 +276,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case ID_PCB_COTATION_BUTT: case ID_PCB_COTATION_BUTT:
if( ((PCB_SCREEN*)GetScreen())->m_Active_Layer <= LAST_COPPER_LAYER ) if( ((PCB_SCREEN*)GetScreen())->m_Active_Layer <= LAST_COPPER_LAYER )
{ {
DisplayError( this, _( "Cotation not authorized on Copper layers" ) ); DisplayError( this, _( "Cotation not authorized on Copper layers" ) );
break; break;
...@@ -291,7 +291,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -291,7 +291,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
&& (DrawStruct->Type() == TYPECOTATION) && (DrawStruct->Type() == TYPECOTATION)
&& (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) )
{ {
DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC ); DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC );
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = TRUE;
} }
...@@ -331,7 +331,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -331,7 +331,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/********************************************************************************/ /********************************************************************************/
/* handle the double click on the mouse left button /* handle the double click on the mouse left button
*/ */
{ {
BOARD_ITEM* DrawStruct = GetCurItem(); BOARD_ITEM* DrawStruct = GetCurItem();
...@@ -416,10 +416,10 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -416,10 +416,10 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT:
if ( End_Zone( DC ) ) if ( End_Zone( DC ) )
{ {
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
SetCurItem( NULL ); SetCurItem( NULL );
} }
break; break;
case ID_LINE_COMMENT_BUTT: case ID_LINE_COMMENT_BUTT:
......
...@@ -53,7 +53,10 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event ) ...@@ -53,7 +53,10 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
List->Append( Line ); List->Append( Line );
} }
ii = List->ShowModal(); List->Destroy(); ii = List->ShowModal();
List->Destroy();
if( ii < 0 ) if( ii < 0 )
return; return;
...@@ -64,6 +67,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event ) ...@@ -64,6 +67,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
/* calcul adr relative du nom de la pastille reference de la piste */ /* calcul adr relative du nom de la pastille reference de la piste */
if( !WildCompareString( msg, Equipot->m_Netname, FALSE ) ) if( !WildCompareString( msg, Equipot->m_Netname, FALSE ) )
continue; continue;
if( ii == jj ) if( ii == jj )
{ {
ii = Equipot->GetNet(); ii = Equipot->GetNet();
...@@ -78,6 +82,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event ) ...@@ -78,6 +82,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
if( g_HightLigt_Status ) if( g_HightLigt_Status )
Hight_Light( &dc ); Hight_Light( &dc );
g_HightLigth_NetCode = ii; g_HightLigth_NetCode = ii;
Hight_Light( &dc ); Hight_Light( &dc );
} }
...@@ -95,7 +100,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) ...@@ -95,7 +100,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
// use this scheme because of pad is higher priority than tracks in the // use this scheme because of pad is higher priority than tracks in the
// search, and finding a pad, instead of a track on a pad, // search, and finding a pad, instead of a track on a pad,
// allows us to fire a message to eescema. // allows us to fire a message to eeschema.
GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide();
...@@ -168,20 +173,16 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode ) ...@@ -168,20 +173,16 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
else else
draw_mode = GR_AND | GR_SURBRILL; draw_mode = GR_AND | GR_SURBRILL;
/* Redraw pads */ #if 0 // does not unhighlight properly
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() ) // redraw the zones with the NetCode
for( SEGZONE* zone = m_Pcb->m_Zone; zone; zone = zone->Next() )
{ {
Pad_Surbrillance( DrawPanel, DC, module, NetCode ); if( zone->GetNet() == NetCode )
}
/* Redraw track and vias: */
for( TRACK* pts = m_Pcb->m_Track; pts; pts = pts->Next() )
{
if( pts->GetNet() == NetCode )
{ {
pts->Draw( DrawPanel, DC, draw_mode ); zone->Draw( DrawPanel, DC, draw_mode );
} }
} }
#endif
wxPoint zero(0,0); // construct outside loop for speed wxPoint zero(0,0); // construct outside loop for speed
...@@ -194,6 +195,21 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode ) ...@@ -194,6 +195,21 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
(*zc)->Draw( DrawPanel, DC, zero, draw_mode ); (*zc)->Draw( DrawPanel, DC, zero, draw_mode );
} }
} }
/* Redraw pads */
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
{
Pad_Surbrillance( DrawPanel, DC, module, NetCode );
}
/* Redraw track and vias: */
for( TRACK* pts = m_Pcb->m_Track; pts; pts = pts->Next() )
{
if( pts->GetNet() == NetCode )
{
pts->Draw( DrawPanel, DC, draw_mode );
}
}
} }
......
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