Commit 323a7000 authored by dickelbeck's avatar dickelbeck

SMD pads in high-contrast mode refinements

parent b8a449e0
......@@ -5,6 +5,17 @@ Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
* D_PAD::Draw() refinements.
* WinEDA_DrawFrame::SetToolID() will redraw the DrawPanel if the track
button is selected or de-selected and the high-contrast mode is in play.
* If high-contrast mode is in play, the Select Layer Pair dialog completion
will redraw the DisplayPanel, now that SMD pads' colors are so dependent
on these variables.
2007-Oct-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
......
......@@ -333,13 +333,31 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
// 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.
// when routing tracks
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) )
int routeTop = screen->m_Route_Layer_TOP;
int routeBot = screen->m_Route_Layer_BOTTOM;
// if routing between copper and component layers,
// or the current layer is one of said 2 external copper layers,
// then highlight only the current layer.
if( ((1<<routeTop) | (1<<routeBot)) == (CUIVRE_LAYER | CMP_LAYER)
|| ((1<<screen->m_Active_Layer) & (CUIVRE_LAYER | CMP_LAYER)) )
{
if( !IsOnLayer( screen->m_Active_Layer ) )
{
color &= ~MASKCOLOR;
color |= DARKDARKGRAY;
}
}
// else routing between an internal signal layer and some other layer.
// grey out all SMD pads not on current or the single selected
// external layer.
else if( !IsOnLayer( screen->m_Active_Layer )
&& !IsOnLayer( routeTop )
&& !IsOnLayer( routeBot ) )
{
color &= ~MASKCOLOR;
color |= DARKDARKGRAY;
......
......@@ -131,8 +131,8 @@ wxClientDC dc(DrawPanel);
m_AuxVToolBar = NULL;
}
{
wxSizeEvent SizeEv(GetSize());
OnSize(SizeEv);
wxSizeEvent SizeEv(GetSize());
OnSize(SizeEv);
}
break;
......@@ -259,25 +259,28 @@ void WinEDA_PcbGeneralOptionsFrame::CreateControls()
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
wxString m_PolarDisplayStrings[] = {
static const wxString m_PolarDisplayStrings[] = {
_("No Display"),
_("Display")
};
m_PolarDisplay = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Display Polar Coord"), wxDefaultPosition, wxDefaultSize, 2, m_PolarDisplayStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_PolarDisplay, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_BoxUnitsStrings[] = {
static const wxString m_BoxUnitsStrings[] = {
_("Inches"),
_("millimeters")
};
m_BoxUnits = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Units"), wxDefaultPosition,
wxDefaultSize, 2, m_BoxUnitsStrings, 1,wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_BoxUnits, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_CursorShapeStrings[] = {
static const wxString m_CursorShapeStrings[] = {
_("Small"),
_("Big")
};
m_CursorShape = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Cursor"), wxDefaultPosition, wxDefaultSize, 2,
m_CursorShapeStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_CursorShape, 0, wxALIGN_LEFT|wxALL, 5);
......@@ -348,11 +351,12 @@ void WinEDA_PcbGeneralOptionsFrame::CreateControls()
m_Track_DoubleSegm_Ctrl->SetForegroundColour(wxColour(0, 144, 0));
itemStaticBoxSizer15->Add(m_Track_DoubleSegm_Ctrl, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_MagneticPadOptCtrlStrings[] = {
static const wxString m_MagneticPadOptCtrlStrings[] = {
_("Never"),
_("When creating tracks"),
_("Always")
};
m_MagneticPadOptCtrl = new wxRadioBox( itemDialog1, ID_MAGNETIC_PAD_CTRL, _("Magnetic Pads"), wxDefaultPosition, wxDefaultSize, 3, m_MagneticPadOptCtrlStrings, 1, wxRA_SPECIFY_COLS );
if (ShowToolTips())
m_MagneticPadOptCtrl->SetToolTip(_("control the capture of the pcb cursor when the mouse cursor enters a pad area"));
......
......@@ -151,7 +151,9 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
{
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
}
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
if( m_ID_current_state != id )
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
break;
}
......@@ -286,7 +288,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_PCB_COTATION_BUTT:
SetToolID( id, wxCURSOR_PENCIL, _( "Add Cotation" ) );
SetToolID( id, wxCURSOR_PENCIL, _( "Add Dimension" ) );
break;
case ID_NO_SELECT_BUTT:
......
......@@ -244,10 +244,17 @@ void WinEDA_BasePcbFrame::SelectLayerPair()
WinEDA_SelLayerPairFrame* frame =
new WinEDA_SelLayerPairFrame( this );
frame->ShowModal();
int result = frame->ShowModal();
frame->Destroy();
DrawPanel->MouseToCursorSchema();
SetToolbars();
// if user changed colors and we are in high contrast mode, then redraw
// because the SMD pads may change color.
if( result >= 0 && DisplayOpt.ContrastModeDisplay )
{
ReDrawPanel();
}
}
......
......@@ -504,11 +504,22 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id,
if( id < 0 )
return;
#ifdef PCBNEW
// handle color changes for transitions in and out of ID_TRACK_BUTT
if( (m_ID_current_state==ID_TRACK_BUTT && id!=ID_TRACK_BUTT)
|| (m_ID_current_state!=ID_TRACK_BUTT && id==ID_TRACK_BUTT) )
{
if( DisplayOpt.ContrastModeDisplay )
ReDrawPanel();
}
#endif
// Old Tool Inactif ou ID_NO_SELECT_BUTT actif si pas de nouveau Tool
if( m_ID_current_state )
{
if( m_VToolBar )
m_VToolBar->ToggleTool( m_ID_current_state, FALSE );
if( m_AuxVToolBar )
m_AuxVToolBar->ToggleTool( m_ID_current_state, FALSE );
}
......@@ -518,6 +529,7 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id,
{
if( m_VToolBar )
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, FALSE );
if( m_AuxVToolBar )
m_AuxVToolBar->ToggleTool( m_ID_current_state, FALSE );
}
......@@ -530,6 +542,7 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id,
{
if( m_VToolBar )
m_VToolBar->ToggleTool( id, TRUE );
if( m_AuxVToolBar )
m_AuxVToolBar->ToggleTool( id, TRUE );
}
......
......@@ -951,7 +951,6 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
}
}
if( event.ButtonUp( 1 ) || event.ButtonUp( 2 ) )
{
/* Relachement du bouton: fin de delimitation de block.
......
......@@ -63,4 +63,13 @@ as zoom changes, the effective real size of the MARKER changes.
@todo: compensate for the zoom. right now it is difficult to select marker when zoomed out.
*** Establish consistent policy on UI text upper vs. lower case usage. My
suggestions are below, but the important thing is consistency, not the actual
choices.
Window Titles: all nouns and verbs capitalized.
Tooltips: all words lower case except first word. (This is a sentence fragment, not a title).
others (what are they?):
:
:
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