Commit 34e4ec5c authored by jean-pierre charras's avatar jean-pierre charras

Fix Bug 784017 and 784140

parent 94372b81
...@@ -25,7 +25,7 @@ static ColorButton GeneralColorButtons[] = { ...@@ -25,7 +25,7 @@ static ColorButton GeneralColorButtons[] = {
{ _( "Global label" ), LAYER_GLOBLABEL }, { _( "Global label" ), LAYER_GLOBLABEL },
{ _( "Net name" ), LAYER_NETNAM }, { _( "Net name" ), LAYER_NETNAM },
{ _( "Notes" ), LAYER_NOTES }, { _( "Notes" ), LAYER_NOTES },
{ _( "No connection" ), LAYER_NOCONNECT }, { _( "No Connect Symbol" ), LAYER_NOCONNECT },
{ wxT( "" ), -1 } // Sentinel marking end of list. { wxT( "" ), -1 } // Sentinel marking end of list.
}; };
...@@ -281,26 +281,43 @@ void DIALOG_COLOR_CONFIG::SetColor( wxCommandEvent& event ) ...@@ -281,26 +281,43 @@ void DIALOG_COLOR_CONFIG::SetColor( wxCommandEvent& event )
} }
void DIALOG_COLOR_CONFIG::UpdateLayerSettings() bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
{ {
for( int i = 0; i < MAX_LAYERS; i++ )
g_LayerDescr.LayerColor[ i ] = currentColors[ i ];
// Update color of background // Update color of background
if( m_SelBgColor->GetSelection() == 0 ) if( m_SelBgColor->GetSelection() == 0 )
g_DrawBgColor = WHITE; g_DrawBgColor = WHITE;
else else
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
bool warning = false;
for( int ii = 0; ii < MAX_LAYERS; ii++ )
{
g_LayerDescr.LayerColor[ ii ] = currentColors[ ii ];
if( g_DrawBgColor == g_LayerDescr.LayerColor[ ii ] )
warning = true;
}
m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] ); m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] );
m_Parent->Refresh(); if( g_DrawBgColor == g_LayerDescr.LayerColor[ LAYER_GRID ] )
warning = true;
return warning;
} }
void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event ) void DIALOG_COLOR_CONFIG::OnOkClick( wxCommandEvent& event )
{ {
UpdateLayerSettings(); bool warning = UpdateColorsSettings();
// Prompt the user if an item has the same color as the background
// because this item cannot be seen:
if( warning )
wxMessageBox(
_("Warning:\nSome items have the same color as the background\nand they will not be seen on screen")
);
m_Parent->DrawPanel->Refresh(); m_Parent->DrawPanel->Refresh();
EndModal( 1 ); EndModal( 1 );
} }
...@@ -313,7 +330,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event ) ...@@ -313,7 +330,7 @@ void DIALOG_COLOR_CONFIG::OnCancelClick( wxCommandEvent& event )
void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event ) void DIALOG_COLOR_CONFIG::OnApplyClick( wxCommandEvent& event )
{ {
UpdateLayerSettings(); UpdateColorsSettings();
m_Parent->DrawPanel->Refresh(); m_Parent->DrawPanel->Refresh();
} }
......
...@@ -70,7 +70,7 @@ private: ...@@ -70,7 +70,7 @@ private:
wxIcon GetIconResource( const wxString& aName ); wxIcon GetIconResource( const wxString& aName );
static bool ShowToolTips(); static bool ShowToolTips();
void UpdateLayerSettings(); bool UpdateColorsSettings();
void SetColor( wxCommandEvent& aEvent ); void SetColor( wxCommandEvent& aEvent );
void OnOkClick( wxCommandEvent& aEvent ); void OnOkClick( wxCommandEvent& aEvent );
void OnCancelClick( wxCommandEvent& aEvent ); void OnCancelClick( wxCommandEvent& aEvent );
......
...@@ -59,8 +59,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aP ...@@ -59,8 +59,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aP
break; break;
case HK_RESET_LOCAL_COORD: /*Reset the relative coord */ case HK_RESET_LOCAL_COORD: /*Reset the relative coord */
if( !blockActive ) GetScreen()->m_O_Curseur = GetScreen()->GetCrossHairPosition();
GetScreen()->m_O_Curseur = GetScreen()->GetCrossHairPosition();
break; break;
case HK_SWITCH_UNITS: case HK_SWITCH_UNITS:
......
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