Commit b8a449e0 authored by dickelbeck's avatar dickelbeck

smd pad in high-contrast mode enhancement

parent 2d4d4271
...@@ -4,6 +4,17 @@ Started 2007-June-11 ...@@ -4,6 +4,17 @@ Started 2007-June-11
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.
2007-Oct-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
* D_PAD::Draw() so that it shows SMD pads as greyed out when in high contrast
mode and not on current layer. Slight variation on this when laying down
tracks: m_Route_Layer_BOTTOM or m_Route_Layer_TOP layers' SMD pads are
not greyed out.
* Changed English UI text for "Cotation" to "Dimension".
2007-Oct-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au> 2007-Oct-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================ ================================================================================
+ pcbnew + pcbnew
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
/* Constantes utiles */ /* Constantes utiles */
#define GR_COPY 0 #define GR_COPY 0
#define GR_OR 0x1000000 #define GR_OR 0x01000000
#define GR_XOR 0x2000000 #define GR_XOR 0x02000000
#define GR_AND 0x4000000 #define GR_AND 0x04000000
#define GR_NXOR 0x8000000 #define GR_NXOR 0x08000000
#define GR_SURBRILL 0x80000000 #define GR_SURBRILL 0x80000000
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "trigo.h" #include "trigo.h"
#include "id.h" // ID_TRACK_BUTT
#ifdef PCBNEW #ifdef PCBNEW
#include "drag.h" #include "drag.h"
...@@ -238,11 +239,14 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -238,11 +239,14 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
wxPoint coord[4]; wxPoint coord[4];
int zoom; int zoom;
int fillpad = 0; int fillpad = 0;
PCB_SCREEN* screen;
WinEDA_BasePcbFrame* frame; WinEDA_BasePcbFrame* frame;
wxPoint shape_pos; wxPoint shape_pos;
screen = panel ? (PCB_SCREEN*) panel->m_Parent->m_CurrentScreen : (PCB_SCREEN*) ActiveScreen; PCB_SCREEN* screen = panel ?
(PCB_SCREEN*) panel->m_Parent->m_CurrentScreen :
(PCB_SCREEN*) ActiveScreen;
// @todo: if panel could have been NULL above, how can we dereference it here safely?
frame = (WinEDA_BasePcbFrame*) panel->m_Parent; frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
/* Calcul de l'aspect du pad */ /* Calcul de l'aspect du pad */
...@@ -255,8 +259,10 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -255,8 +259,10 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
if( m_Flags & IS_MOVED ) if( m_Flags & IS_MOVED )
fillpad = 0; fillpad = 0;
#endif #endif
if( m_Masque_Layer & CMP_LAYER ) if( m_Masque_Layer & CMP_LAYER )
color = g_PadCMPColor; color = g_PadCMPColor;
if( m_Masque_Layer & CUIVRE_LAYER ) if( m_Masque_Layer & CUIVRE_LAYER )
color |= g_PadCUColor; color |= g_PadCUColor;
...@@ -322,6 +328,37 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -322,6 +328,37 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
} }
} }
//-----<test this>-----
// if SMD pad and high contrast mode
if( m_Attribut==SMD && DisplayOpt.ContrastModeDisplay )
{
// when editing tracks show SMD components on either of the routing
// layers as normal, not greyed out.
if( frame->m_ID_current_state == ID_TRACK_BUTT )
{
if( !IsOnLayer( screen->m_Active_Layer )
&& !IsOnLayer( screen->m_Route_Layer_TOP)
&& !IsOnLayer( screen->m_Route_Layer_BOTTOM) )
{
color &= ~MASKCOLOR;
color |= DARKDARKGRAY;
}
}
// when not edting tracks, show SMD components not on active layer as greyed out
else
{
if( !IsOnLayer( screen->m_Active_Layer ) )
{
color &= ~MASKCOLOR;
color |= DARKDARKGRAY;
}
}
}
//-----</test this>----
if( draw_mode & GR_SURBRILL ) if( draw_mode & GR_SURBRILL )
{ {
if( draw_mode & GR_AND ) if( draw_mode & GR_AND )
...@@ -329,6 +366,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -329,6 +366,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
else else
color |= HIGHT_LIGHT_FLAG; color |= HIGHT_LIGHT_FLAG;
} }
if( color & HIGHT_LIGHT_FLAG ) if( color & HIGHT_LIGHT_FLAG )
color = ColorRefs[color & MASKCOLOR].m_LightColor; color = ColorRefs[color & MASKCOLOR].m_LightColor;
...@@ -347,6 +385,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -347,6 +385,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
dy = dy0 = m_Size.y >> 1; /* demi dim dx et dy */ dy = dy0 = m_Size.y >> 1; /* demi dim dx et dy */
angle = m_Orient; angle = m_Orient;
bool DisplayIsol = DisplayOpt.DisplayPadIsol; bool DisplayIsol = DisplayOpt.DisplayPadIsol;
if( ( m_Masque_Layer & ALL_CU_LAYERS ) == 0 ) if( ( m_Masque_Layer & ALL_CU_LAYERS ) == 0 )
DisplayIsol = FALSE; DisplayIsol = FALSE;
...@@ -375,12 +414,14 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -375,12 +414,14 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
/* calcul de l'entraxe de l'ellipse */ /* calcul de l'entraxe de l'ellipse */
if( dx > dy ) /* ellipse horizontale */ if( dx > dy ) /* ellipse horizontale */
{ {
delta_cx = dx - dy; delta_cy = 0; delta_cx = dx - dy;
delta_cy = 0;
rotdx = m_Size.y; rotdx = m_Size.y;
} }
else /* ellipse verticale */ else /* ellipse verticale */
{ {
delta_cx = 0; delta_cy = dy - dx; delta_cx = 0;
delta_cy = dy - dx;
rotdx = m_Size.x; rotdx = m_Size.x;
} }
RotatePoint( &delta_cx, &delta_cy, angle ); RotatePoint( &delta_cx, &delta_cy, angle );
...@@ -476,6 +517,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -476,6 +517,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
if( fillpad && hole ) if( fillpad && hole )
{ {
color = g_IsPrinting ? WHITE : BLACK; // ou DARKGRAY; color = g_IsPrinting ? WHITE : BLACK; // ou DARKGRAY;
if( draw_mode != GR_XOR ) if( draw_mode != GR_XOR )
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
else else
...@@ -491,6 +533,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -491,6 +533,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
case OVALE: case OVALE:
dx = m_Drill.x >> 1; dx = m_Drill.x >> 1;
dy = m_Drill.y >> 1; /* demi dim dx et dy */ dy = m_Drill.y >> 1; /* demi dim dx et dy */
/* calcul de l'entraxe de l'ellipse */ /* calcul de l'entraxe de l'ellipse */
if( m_Drill.x > m_Drill.y ) /* ellipse horizontale */ if( m_Drill.x > m_Drill.y ) /* ellipse horizontale */
{ {
...@@ -521,6 +564,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -521,6 +564,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
{ {
dx0 = MIN( dx0, dy0 ); dx0 = MIN( dx0, dy0 );
int nc_color = BLUE; int nc_color = BLUE;
if( m_Masque_Layer & CMP_LAYER ) /* Trace forme \ */ if( m_Masque_Layer & CMP_LAYER ) /* Trace forme \ */
GRLine( &panel->m_ClipBox, DC, cx0 - dx0, cy0 - dx0, GRLine( &panel->m_ClipBox, DC, cx0 - dx0, cy0 - dx0,
cx0 + dx0, cy0 + dx0, 0, nc_color ); cx0 + dx0, cy0 + dx0, 0, nc_color );
......
...@@ -561,7 +561,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode ) ...@@ -561,7 +561,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode )
int rayon; int rayon;
int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
if( Type() == TYPEZONE && (!DisplayOpt.DisplayZones) ) if( Type() == TYPEZONE && !DisplayOpt.DisplayZones )
return; return;
GRSetDrawMode( DC, draw_mode ); GRSetDrawMode( DC, draw_mode );
......
...@@ -82,7 +82,7 @@ END_EVENT_TABLE() ...@@ -82,7 +82,7 @@ END_EVENT_TABLE()
WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent, WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent,
COTATION* Cotation, wxDC* DC, COTATION* Cotation, wxDC* DC,
const wxPoint& framepos ) : const wxPoint& framepos ) :
wxDialog( parent, -1, _( "Cotation properties" ), framepos, wxSize( 340, 270 ), wxDialog( parent, -1, _( "Dimension properties" ), framepos, wxSize( 340, 270 ),
DIALOG_STYLE ) DIALOG_STYLE )
{ {
wxButton* Button; wxButton* Button;
......
...@@ -317,10 +317,10 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -317,10 +317,10 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( !flags ) if( !flags )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_COTATION, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_COTATION,
_( "Edit Cotation" ), edit_xpm ); _( "Edit Dimension" ), edit_xpm );
} }
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_COTATION, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_COTATION,
_( "Delete Cotation" ), delete_xpm ); _( "Delete Dimension" ), delete_xpm );
break; break;
case TYPEMIRE: case TYPEMIRE:
......
...@@ -422,11 +422,11 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -422,11 +422,11 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_TRACK_BUTT, wxEmptyString,
BITMAP( add_tracks_xpm ), BITMAP( add_tracks_xpm ),
_( "Add Tracks an vias" ), wxITEM_CHECK ); _( "Add tracks and vias" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString,
BITMAP( add_zone_xpm ), BITMAP( add_zone_xpm ),
_( "Add Zones" ), wxITEM_CHECK ); _( "Add zones" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_LINE_COMMENT_BUTT, wxEmptyString,
...@@ -443,12 +443,12 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -443,12 +443,12 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_TEXT_COMMENT_BUTT, wxEmptyString,
BITMAP( add_text_xpm ), BITMAP( add_text_xpm ),
_( "Add Text" ), wxITEM_CHECK ); _( "Add text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_COTATION_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_COTATION_BUTT, wxEmptyString,
BITMAP( add_cotation_xpm ), BITMAP( add_cotation_xpm ),
_( "Add Cotation" ), wxITEM_CHECK ); _( "Add dimension" ), wxITEM_CHECK );
m_VToolBar->AddTool( ID_PCB_MIRE_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_MIRE_BUTT, wxEmptyString,
BITMAP( add_mires_xpm ), BITMAP( add_mires_xpm ),
......
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