Commit d5b353ac authored by g_harland's avatar g_harland

Assorted changes; see change_log.txt

parent e1ff958a
......@@ -4,6 +4,25 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ pcbnew
* The previously provided "Exit" button within the "Colors:" dialog box has been
replaced with "OK", "Cancel", and "Apply" buttons, and the code for editing the
visibility of the Grid layer from that dialog now is "cleaner" than before.
Details associated with buttons within that dialog box moved from set_color.cpp
to set_color.h (matching implementation for GerbView's corresponding dialog box).
* Fixed bug which previously prevented the Copper layer from being selected as the
current layer when only one copper layer is enabled (and made some modifications
to the code for selecting the next copper layer and previous copper layer).
+ gerbview
* The code for editing the visibility of the Grid layer from the "GerbView Layer
Colors:" dialog box is "cleaner" than before, and assorted other beautification.
+ eeschema
* The options.cpp file (which is no longer used) has been removed, and replaced
with options.cpp.notused
2007-Oct-10 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
......
......@@ -154,20 +154,47 @@ void WinEDA_BasePcbFrame::GetComponentFromRedoList( void )
void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
/*****************************************************************/
//Note: virtual, overridden in WinEDA_PcbFrame;
// Note: virtual, overridden in WinEDA_PcbFrame;
{
int preslayer = GetScreen()->m_Active_Layer;
//if there is only one layer, don't switch.
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 )
layer = COPPER_LAYER_N; // Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible
if( layer != LAYER_CMP_N && layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
// Check if the specified layer matches the present layer
if( layer == preslayer )
return;
if( preslayer == layer )
return;
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
if( (layer >= COPPER_LAYER_N) && (layer <= CMP_N) )
{
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the
// selection of any other copper layer is disregarded).
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 )
{
if( layer != COPPER_LAYER_N )
{
return;
}
}
// If more than one copper layer is enabled, the "Copper"
// and "Component" layers can be selected, but the total
// number of copper layers determines which internal
// layers are also capable of being selected.
else
{
if( (layer != COPPER_LAYER_N) && (layer != LAYER_CMP_N)
&& (layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1) )
{
return;
}
}
}
// Is yet more checking required? E.g. when the layer to be selected
// is a non-copper layer, or when switching between a copper layer
// and a non-copper layer, or vice-versa?
// ...
GetScreen()->m_Active_Layer = layer;
......
......@@ -13,6 +13,8 @@
#include "id.h"
#include "protos.h"
// Uncomment following line to enable wxBell() command (which beeps speaker)
// #include <wx/utils.h>
static void Process_Move_Item( WinEDA_PcbFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC );
......@@ -621,7 +623,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
itmp = SelectLayer( GetScreen()->m_Active_Layer, CMP_N + 1, -1 );
itmp = SelectLayer( GetScreen()->m_Active_Layer, FIRST_NO_COPPER_LAYER, -1 );
if( itmp >= 0 )
GetScreen()->m_Active_Layer = itmp;
DrawPanel->MouseToCursorSchema();
......@@ -982,36 +984,73 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
{
int preslayer = GetScreen()->m_Active_Layer;
//if there is only one layer, don't switch.
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 )
// Check if the specified layer matches the present layer
if( layer == preslayer )
return;
//otherwise, must be at least 2 layers. see if it is possible.
if( layer == COPPER_LAYER_N || layer == LAYER_CMP_N
|| layer < m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
if( (layer >= COPPER_LAYER_N) && (layer <= CMP_N) )
{
if( preslayer == layer )
return;
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the
// selection of any other copper layer is disregarded).
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 )
{
if( layer != COPPER_LAYER_N )
{
// Uncomment following command (and line 17) to beep
// the speaker. (Doing that would provide feedback to
// the user that the (layer-switching) command has been
// "acknowledged", but is unable to be acted upon.)
// wxBell();
return;
}
}
// If more than one copper layer is enabled, the "Copper"
// and "Component" layers can be selected, but the total
// number of copper layers determines which internal
// layers are also capable of being selected.
else
{
if( (layer != COPPER_LAYER_N) && (layer != LAYER_CMP_N)
&& (layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1) )
{
// Uncomment following command (and line 17) to beep
// the speaker. (Doing that would provide feedback to
// the user that the (layer-switching) command has been
// "acknowledged", but is unable to be acted upon.)
// wxBell();
return;
}
}
EDA_BaseStruct* current = GetScreen()->GetCurItem();
//see if we are drawing a segment; if so, add a via?
// See if we are drawing a segment; if so, add a via?
if( m_ID_current_state == ID_TRACK_BUTT && current != NULL )
{
if( current->Type() == TYPETRACK && (current->m_Flags & IS_NEW) )
{
//want to set the routing layers so that it switches properly -
//see the implementation of Other_Layer_Route - the working
//layer is used to 'start' the via and set the layer masks appropriately.
// Want to set the routing layers so that it switches properly -
// see the implementation of Other_Layer_Route - the working
// layer is used to 'start' the via and set the layer masks appropriately.
GetScreen()->m_Route_Layer_TOP = preslayer;
GetScreen()->m_Route_Layer_BOTTOM = layer;
GetScreen()->m_Active_Layer = preslayer;
Other_Layer_Route( (TRACK*) GetScreen()->GetCurItem(), DC );
}
}
}
GetScreen()->m_Active_Layer = layer;
// Is yet more checking required? E.g. when the layer to be selected
// is a non-copper layer, or when switching between a copper layer
// and a non-copper layer, or vice-versa?
// ...
if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq();
}
GetScreen()->m_Active_Layer = layer;
if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq();
}
......@@ -23,7 +23,7 @@
* add the HkMyNewEntry pointer in the s_board_edit_Hotkey_List list ( or/and the s_module_edit_Hotkey_List list)
* Add the new code in the switch in OnHotKey() function.
* when the variable PopupOn is true, an item is currently edited.
* This can be usefull if the new function cannot be executed while an item is currently being edited
* This can be useful if the new function cannot be executed while an item is currently being edited
* ( For example, one cannot start a new wire when a component is moving.)
*
* Note: If an hotkey is a special key, be sure the corresponding wxWidget keycode (WXK_XXXX)
......@@ -202,28 +202,27 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_SWITCH_LAYER_TO_PREVIOUS:
ll = GetScreen()->m_Active_Layer;
if( ll > CMP_N )
if( (ll <= COPPER_LAYER_N) || (ll > CMP_N) )
break;
if( ll <= COPPER_LAYER_N )
break;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 ) // Single layer
ll = COPPER_LAYER_N;
if( ll == CMP_N )
else if( ll == CMP_N )
ll = MAX( COPPER_LAYER_N, m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 );
else if( ll > COPPER_LAYER_N )
else
ll--;
SwitchLayer( DC, ll );
break;
case HK_SWITCH_LAYER_TO_NEXT:
ll = GetScreen()->m_Active_Layer;
if( ll >= CMP_N )
if( (ll < COPPER_LAYER_N) || (ll >= CMP_N) )
break;
ll++;
if( ll >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
ll = CMP_N;
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 ) // Single layer
if( m_Pcb->m_BoardSettings->m_CopperLayerCount < 2 ) // Single layer
ll = COPPER_LAYER_N;
else if( ll >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 )
ll = CMP_N;
else
ll++;
SwitchLayer( DC, ll );
break;
......
This diff is collapsed.
This diff is collapsed.
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