Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
6518139b
Commit
6518139b
authored
Jan 24, 2010
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more layer widget work
parent
84d82cf2
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
714 additions
and
1022 deletions
+714
-1022
CHANGELOG.txt
CHANGELOG.txt
+20
-0
TODO.txt
TODO.txt
+12
-7
wxPcbStruct.h
include/wxPcbStruct.h
+54
-52
CMakeLists.txt
pcbnew/CMakeLists.txt
+0
-2
deltrack.cpp
pcbnew/deltrack.cpp
+2
-2
edit.cpp
pcbnew/edit.cpp
+17
-28
editrack-part2.cpp
pcbnew/editrack-part2.cpp
+17
-27
layer_panel_base.cpp
pcbnew/layer_panel_base.cpp
+0
-88
layer_panel_base.h
pcbnew/layer_panel_base.h
+0
-59
layer_widget.cpp
pcbnew/layer_widget.cpp
+98
-131
layer_widget.h
pcbnew/layer_widget.h
+52
-16
onleftclick.cpp
pcbnew/onleftclick.cpp
+3
-3
panel_layer_select.fbp
pcbnew/panel_layer_select.fbp
+0
-357
pcbframe.cpp
pcbnew/pcbframe.cpp
+412
-226
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+21
-19
toolbars_update_user_interface.cpp
pcbnew/toolbars_update_user_interface.cpp
+2
-1
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+4
-4
No files found.
CHANGELOG.txt
View file @
6518139b
...
@@ -4,6 +4,26 @@ KiCad ChangeLog 2010
...
@@ -4,6 +4,26 @@ KiCad ChangeLog 2010
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.
2010-Jan-23 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew's PCB_LAYER_WIDGET
Removed wxformbuilder dependency from LAYER_WIDGET, thus killing off
layer_widget_base.* and panel_layer_select.fbp.
Added aPointSize to LAYER_WIDGET constructor so it uses that font size.
Removed layer_widget.h from wxPcbStruct.h for faster compiles with less
dependencies, and this meant moving the class LYRS out of
class WinEDA_PcbFrame. While doing that I renamed it to PCB_LAYER_WIDGET.
Integration of PCB_LAYER_WIDGET into WinEDA_PcbFrame to fully support
the layer change logic. Added syncLayerWidget(),
* WinEDA_PcbFrame:
Added syncLayerWidget(), syncLayerBox() (via a rename), setActiveLayer(),
and getActiveLayer().
Use a font size in PCB_LAYER_WIDGET 80% of the system font size for systems
with screen resolution height <= 900, or 100% if not. See WinEDA_PcbFrame
constructor.
* See TODO.txt for more things that need to be done.
2010-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
2010-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
================================================================================
++ Pcbnew:
++ Pcbnew:
...
...
TODO.txt
View file @
6518139b
...
@@ -72,19 +72,24 @@ PCBNew
...
@@ -72,19 +72,24 @@ PCBNew
* Need to add polygon aperture type.
* Need to add polygon aperture type.
Then example 2 in RS274xrevd_e.pdf will draw properly.
Then example 2 in RS274xrevd_e.pdf will draw properly.
Dick:
* Get the nested quote support for DSNLEXER fixed up and committed.
LAYER_WIDGET for PCBNEW
LAYER_WIDGET for PCBNEW
-----------------------
-----------------------
L2) Hook in bool WinEDA_PcbFrame::LYRS::OnLayerSelect( int aLayer )
L4) Move popup menu code from class LAYER_WIDGET into WinEDA_PcbFrame::LYRS so as
to keep LAYER_WIDGET fully usage agnostic. Remove #include "pcbstruct.h" // IsValidCopperLayerIndex()
from layer_widget.cpp.
L5) Add to moved popu menu code the ability to save the current layer widget
L5) Add to moved popu menu code the ability to save the current layer widget
color and enable settings with an additional menu item.
color and enable settings with an additional menu item.
L6) Test, and fix up any remaining issues with the PCB_VISIBLE support, several
L6) Test, and fix up any remaining issues with the PCB_VISIBLE support, several
items which are stored on globals could and should be stored in
items which are stored on globals could and should be stored in
EDA_Settings.m_VisibleElements using enum PCB_VISIBLE.
EDA_Settings.m_VisibleElements using enum PCB_VISIBLE. Initial Render
checkbox settings are probably not correct, for example grid.
L7) make the bitmapbutton a staticbitmap, and make its size dependent on
the point size.
L8) LAYER_WIDGET::GetBestSize() needs platform independence.
Dick:
L9) still thinking about background colors, easier now without wxformbuilder.
include/wxPcbStruct.h
View file @
6518139b
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#include "wxstruct.h"
#include "wxstruct.h"
#include "base_struct.h"
#include "base_struct.h"
#include "layer_widget.h"
#ifndef PCB_INTERNAL_UNIT
#ifndef PCB_INTERNAL_UNIT
#define PCB_INTERNAL_UNIT 10000
#define PCB_INTERNAL_UNIT 10000
...
@@ -36,6 +35,7 @@ class ZONE_CONTAINER;
...
@@ -36,6 +35,7 @@ class ZONE_CONTAINER;
class
DRAWSEGMENT
;
class
DRAWSEGMENT
;
class
GENERAL_COLLECTOR
;
class
GENERAL_COLLECTOR
;
class
GENERAL_COLLECTORS_GUIDE
;
class
GENERAL_COLLECTORS_GUIDE
;
class
PCB_LAYER_WIDGET
;
/**
/**
...
@@ -49,34 +49,64 @@ class GENERAL_COLLECTORS_GUIDE;
...
@@ -49,34 +49,64 @@ class GENERAL_COLLECTORS_GUIDE;
/*****************************************************/
/*****************************************************/
class
WinEDA_PcbFrame
:
public
WinEDA_BasePcbFrame
class
WinEDA_PcbFrame
:
public
WinEDA_BasePcbFrame
{
{
friend
class
PCB_LAYER_WIDGET
;
protected
:
protected
:
PCB_LAYER_WIDGET
*
m_Layers
;
DRC
*
m_drc
;
///< the DRC controller, see drc.cpp
// we'll use lower case function names for private member functions.
void
createPopUpMenuForZones
(
ZONE_CONTAINER
*
edge_zone
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForFootprints
(
MODULE
*
aModule
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForFpTexts
(
TEXTE_MODULE
*
aText
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForFpPads
(
D_PAD
*
aPad
,
wxMenu
*
aPopMenu
);
void
createPopupMenuForTracks
(
TRACK
*
aTrack
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForTexts
(
TEXTE_PCB
*
Text
,
wxMenu
*
menu
);
void
createPopUpBlockMenu
(
wxMenu
*
menu
);
void
createPopUpMenuForMarkers
(
MARKER_PCB
*
aMarker
,
wxMenu
*
aPopMenu
);
/**
/**
*
Class LYRS
*
Function setActiveLayer
*
is here to implement the abtract functions of LAYER_WIDGET so they
*
will change the currently active layer to \a aLayer and also
*
may be tied into this frame's data
.
*
update the PCB_LAYER_WIDGET
.
*/
*/
class
LYRS
:
public
LAYER_WIDGET
void
setActiveLayer
(
int
aLayer
,
bool
doLayerWidgetUpdate
=
true
)
{
{
WinEDA_PcbFrame
*
myframe
;
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
aLayer
;
if
(
doLayerWidgetUpdate
)
syncLayerWidget
();
}
public
:
/**
LYRS
(
WinEDA_PcbFrame
*
aParent
,
wxWindow
*
aFocusOwner
)
:
* Function getActiveLayer
LAYER_WIDGET
(
aParent
,
aFocusOwner
),
* returns the active layer
myframe
(
aParent
)
*/
int
getActiveLayer
()
{
{
return
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
;
}
}
//-----<implement LAYER_WIDGET abstract callback functions>-----------
/**
void
OnLayerColorChange
(
int
aLayer
,
int
aColor
);
* Function syncLayerWidget
bool
OnLayerSelect
(
int
aLayer
);
* updates the currently "selected" layer within the PCB_LAYER_WIDGET.
void
OnLayerVisible
(
int
aLayer
,
bool
isVisible
,
bool
isFinal
);
* The currently active layer is defined by the return value of getActiveLayer().
void
OnRenderColorChange
(
int
aId
,
int
aColor
);
* <p>
void
OnRenderEnable
(
int
aId
,
bool
isEnabled
);
* This function cannot be inline without including layer_widget.h in
//-----</implement LAYER_WIDGET abstract callback functions>----------
* here and we do not want to do that.
};
*/
void
syncLayerWidget
();
/**
* Function syncLayerBox
* updates the currently "selected" layer within m_SelLayerBox
* The currently active layer, as defined by the return value of
* getActiveLayer(). And updates the colored icon in the toolbar.
*/
void
syncLayerBox
();
LYRS
*
m_Layers
;
// established in constructor
public
:
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
// a combo box to display and
WinEDAChoiceBox
*
m_SelLayerBox
;
// a combo box to display and
...
@@ -95,19 +125,6 @@ public:
...
@@ -95,19 +125,6 @@ public:
bool
m_show_microwave_tools
;
bool
m_show_microwave_tools
;
bool
m_show_layer_manager_tools
;
bool
m_show_layer_manager_tools
;
private
:
DRC
*
m_drc
;
///< the DRC controller, see drc.cpp
// we'll use lower case function names for private member functions.
void
createPopUpMenuForZones
(
ZONE_CONTAINER
*
edge_zone
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForFootprints
(
MODULE
*
aModule
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForFpTexts
(
TEXTE_MODULE
*
aText
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForFpPads
(
D_PAD
*
aPad
,
wxMenu
*
aPopMenu
);
void
createPopupMenuForTracks
(
TRACK
*
aTrack
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForTexts
(
TEXTE_PCB
*
Text
,
wxMenu
*
menu
);
void
createPopUpBlockMenu
(
wxMenu
*
menu
);
void
createPopUpMenuForMarkers
(
MARKER_PCB
*
aMarker
,
wxMenu
*
aPopMenu
);
public
:
public
:
WinEDA_PcbFrame
(
wxWindow
*
father
,
const
wxString
&
title
,
WinEDA_PcbFrame
(
wxWindow
*
father
,
const
wxString
&
title
,
...
@@ -183,13 +200,6 @@ public:
...
@@ -183,13 +200,6 @@ public:
/* toolbars update UI functions: */
/* toolbars update UI functions: */
/**
* Function UpdateToolbarLayerInfo
* updates the currently selected layer in the layer listbox and
* the colored icon in the toolbar.
*/
void
UpdateToolbarLayerInfo
();
void
PrepareLayerIndicator
();
void
PrepareLayerIndicator
();
/**
/**
...
@@ -206,14 +216,6 @@ public:
...
@@ -206,14 +216,6 @@ public:
*/
*/
void
AuxiliaryToolBar_DesignRules_Update_UI
();
void
AuxiliaryToolBar_DesignRules_Update_UI
();
/** Function SynchronizeLayersManager( )
* Must be called when info displayed in the layer manager Toolbar
* as been changed in the main window ( by hotkey or a tool option.
* Mainly when the active layer as changed.
* @param aFlag = flag giving the type of data (layers, checkboxes...)
*/
void
SynchronizeLayersManager
(
int
aFlag
);
/* mouse functions events: */
/* mouse functions events: */
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
...
...
pcbnew/CMakeLists.txt
View file @
6518139b
...
@@ -111,7 +111,6 @@ set(PCBNEW_SRCS
...
@@ -111,7 +111,6 @@ set(PCBNEW_SRCS
ioascii.cpp
ioascii.cpp
print_board_functions.cpp
print_board_functions.cpp
printout_controler.cpp
printout_controler.cpp
layer_panel_base.cpp
layer_widget.cpp
layer_widget.cpp
librairi.cpp
librairi.cpp
loadcmp.cpp
loadcmp.cpp
...
@@ -243,7 +242,6 @@ endif(NOT MSVC)
...
@@ -243,7 +242,6 @@ endif(NOT MSVC)
# This one gets made only when testing.
# This one gets made only when testing.
add_executable
(
layer_widget_test WIN32 EXCLUDE_FROM_ALL
add_executable
(
layer_widget_test WIN32 EXCLUDE_FROM_ALL
layer_panel_base.cpp
layer_widget.cpp
layer_widget.cpp
)
)
target_link_libraries
(
layer_widget_test common
${
wxWidgets_LIBRARIES
}
)
target_link_libraries
(
layer_widget_test common
${
wxWidgets_LIBRARIES
}
)
pcbnew/deltrack.cpp
View file @
6518139b
...
@@ -36,7 +36,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
...
@@ -36,7 +36,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
{
{
if
(
g_CurrentTrackList
.
GetCount
()
>
0
)
if
(
g_CurrentTrackList
.
GetCount
()
>
0
)
{
{
int
previous_layer
=
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
;
int
previous_layer
=
getActiveLayer
()
;
D
(
g_CurrentTrackList
.
VerifyListIntegrity
();
)
D
(
g_CurrentTrackList
.
VerifyListIntegrity
();
)
...
@@ -71,7 +71,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
...
@@ -71,7 +71,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack )
// Correct active layer which could change if a via
// Correct active layer which could change if a via
// has been erased
// has been erased
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
previous_layer
;
setActiveLayer
(
previous_layer
)
;
UpdateStatusBar
();
UpdateStatusBar
();
if
(
g_TwoSegmentTrackBuild
)
// We must have 2 segments or more,
if
(
g_TwoSegmentTrackBuild
)
// We must have 2 segments or more,
...
...
pcbnew/edit.cpp
View file @
6518139b
...
@@ -738,12 +738,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -738,12 +738,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
case
ID_POPUP_PCB_SELECT_LAYER
:
case
ID_POPUP_PCB_SELECT_LAYER
:
itmp
=
SelectLayer
(
itmp
=
SelectLayer
(
getActiveLayer
(),
-
1
,
-
1
);
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
,
-
1
,
-
1
);
if
(
itmp
>=
0
)
if
(
itmp
>=
0
)
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
itmp
;
setActiveLayer
(
itmp
)
;
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
SynchronizeLayersManager
(
1
);
break
;
break
;
case
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR
:
case
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR
:
...
@@ -751,23 +749,16 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -751,23 +749,16 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
case
ID_POPUP_PCB_SELECT_NO_CU_LAYER
:
case
ID_POPUP_PCB_SELECT_NO_CU_LAYER
:
itmp
=
SelectLayer
(
itmp
=
SelectLayer
(
getActiveLayer
(),
FIRST_NO_COPPER_LAYER
,
-
1
);
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
,
FIRST_NO_COPPER_LAYER
,
-
1
);
if
(
itmp
>=
0
)
if
(
itmp
>=
0
)
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
itmp
;
setActiveLayer
(
itmp
)
;
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
SynchronizeLayersManager
(
1
);
break
;
break
;
case
ID_POPUP_PCB_SELECT_CU_LAYER
:
case
ID_POPUP_PCB_SELECT_CU_LAYER
:
itmp
=
SelectLayer
(
itmp
=
SelectLayer
(
getActiveLayer
(),
-
1
,
LAST_COPPER_LAYER
);
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
,
-
1
,
LAST_COPPER_LAYER
);
if
(
itmp
>=
0
)
if
(
itmp
>=
0
)
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
itmp
;
setActiveLayer
(
itmp
);
SynchronizeLayersManager
(
1
);
break
;
break
;
case
ID_POPUP_PCB_SELECT_LAYER_PAIR
:
case
ID_POPUP_PCB_SELECT_LAYER_PAIR
:
...
@@ -777,9 +768,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -777,9 +768,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_TOOLBARH_PCB_SELECT_LAYER
:
case
ID_TOOLBARH_PCB_SELECT_LAYER
:
itmp
=
m_SelLayerBox
->
GetChoice
();
itmp
=
m_SelLayerBox
->
GetChoice
();
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
setActiveLayer
(
(
size_t
)
m_SelLayerBox
->
GetClientData
(
itmp
)
);
(
int
)
(
(
size_t
)
m_SelLayerBox
->
GetClientData
(
itmp
)
);
SynchronizeLayersManager
(
1
);
// Ensure Layer manager synchronization
if
(
DisplayOpt
.
ContrastModeDisplay
)
if
(
DisplayOpt
.
ContrastModeDisplay
)
DrawPanel
->
Refresh
(
true
);
DrawPanel
->
Refresh
(
true
);
break
;
break
;
...
@@ -1076,10 +1065,10 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
...
@@ -1076,10 +1065,10 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
void
WinEDA_PcbFrame
::
SwitchLayer
(
wxDC
*
DC
,
int
layer
)
void
WinEDA_PcbFrame
::
SwitchLayer
(
wxDC
*
DC
,
int
layer
)
{
{
int
preslayer
=
GetScreen
()
->
m_Active_Layer
;
int
curLayer
=
getActiveLayer
()
;
// Check if the specified layer matches the present layer
// Check if the specified layer matches the present layer
if
(
layer
==
presl
ayer
)
if
(
layer
==
curL
ayer
)
return
;
return
;
// Copper layers cannot be selected unconditionally; how many
// Copper layers cannot be selected unconditionally; how many
...
@@ -1087,7 +1076,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
...
@@ -1087,7 +1076,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
if
(
IsValidCopperLayerIndex
(
layer
)
)
if
(
IsValidCopperLayerIndex
(
layer
)
)
{
{
// If only one copper layer is enabled, the only such layer
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "
Copper
" layer (so the
// that can be selected to is the "
Back
" layer (so the
// selection of any other copper layer is disregarded).
// selection of any other copper layer is disregarded).
if
(
GetBoard
()
->
m_BoardSettings
->
GetCopperLayerCount
()
<
2
)
if
(
GetBoard
()
->
m_BoardSettings
->
GetCopperLayerCount
()
<
2
)
{
{
...
@@ -1129,9 +1118,10 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
...
@@ -1129,9 +1118,10 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// Want to set the routing layers so that it switches properly -
// Want to set the routing layers so that it switches properly -
// see the implementation of Other_Layer_Route - the working
// see the implementation of Other_Layer_Route - the working
// layer is used to 'start' the via and set the layer masks appropriately.
// layer is used to 'start' the via and set the layer masks appropriately.
GetScreen
()
->
m_Route_Layer_TOP
=
presl
ayer
;
GetScreen
()
->
m_Route_Layer_TOP
=
curL
ayer
;
GetScreen
()
->
m_Route_Layer_BOTTOM
=
layer
;
GetScreen
()
->
m_Route_Layer_BOTTOM
=
layer
;
GetScreen
()
->
m_Active_Layer
=
preslayer
;
setActiveLayer
(
curLayer
);
if
(
Other_Layer_Route
(
(
TRACK
*
)
GetScreen
()
->
GetCurItem
(),
DC
)
)
if
(
Other_Layer_Route
(
(
TRACK
*
)
GetScreen
()
->
GetCurItem
(),
DC
)
)
{
{
...
@@ -1140,7 +1130,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
...
@@ -1140,7 +1130,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
}
}
// if the via was allowed by DRC, then the layer swap has already
// if the via was allowed by DRC, then the layer swap has already
// been done by Other_Layer_Route(). if via not allowed, then
// been done by Other_Layer_Route(). if via not allowed, then
// return now so assignment to
m_Active_Layer
below doesn't happen.
// return now so assignment to
setActiveLayer()
below doesn't happen.
return
;
return
;
}
}
}
}
...
@@ -1151,8 +1141,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
...
@@ -1151,8 +1141,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// and a non-copper layer, or vice-versa?
// and a non-copper layer, or vice-versa?
// ...
// ...
GetScreen
()
->
m_Active_Layer
=
layer
;
setActiveLayer
(
layer
);
SynchronizeLayersManager
(
1
);
// Ensure Layer manager synchronization
if
(
DisplayOpt
.
ContrastModeDisplay
)
if
(
DisplayOpt
.
ContrastModeDisplay
)
GetScreen
()
->
SetRefreshReq
();
GetScreen
()
->
SetRefreshReq
();
...
...
pcbnew/editrack-part2.cpp
View file @
6518139b
...
@@ -128,17 +128,14 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
...
@@ -128,17 +128,14 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
if
(
aTrack
==
NULL
)
if
(
aTrack
==
NULL
)
{
{
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
!=
if
(
getActiveLayer
()
!=
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
setActiveLayer
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
);
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
;
else
else
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
setActiveLayer
(((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_BOTTOM
);
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_BOTTOM
;
UpdateStatusBar
();
UpdateStatusBar
();
SetToolbars
();
SetToolbars
();
SynchronizeLayersManager
(
1
);
return
true
;
return
true
;
}
}
...
@@ -185,39 +182,34 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
...
@@ -185,39 +182,34 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
via
->
m_Width
=
GetBoard
()
->
GetCurrentViaSize
();
via
->
m_Width
=
GetBoard
()
->
GetCurrentViaSize
();
via
->
SetNet
(
g_HightLigth_NetCode
);
via
->
SetNet
(
g_HightLigth_NetCode
);
via
->
m_Start
=
via
->
m_End
=
g_CurrentTrackSegment
->
m_End
;
via
->
m_Start
=
via
->
m_End
=
g_CurrentTrackSegment
->
m_End
;
int
old_layer
=
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
;
int
old_layer
=
getActiveLayer
()
;
// swap the layers.
// swap the layers.
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
!=
if
(
getActiveLayer
()
!=
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
setActiveLayer
(((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
);
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_TOP
;
else
else
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
setActiveLayer
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_BOTTOM
);
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Route_Layer_BOTTOM
;
/* Adjust the via layer pair */
/* Adjust the via layer pair */
switch
(
via
->
Shape
()
)
switch
(
via
->
Shape
()
)
{
{
case
VIA_BLIND_BURIED
:
case
VIA_BLIND_BURIED
:
via
->
SetLayerPair
(
old_layer
,
via
->
SetLayerPair
(
old_layer
,
getActiveLayer
()
);
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
);
via
->
SetDrillValue
(
GetBoard
()
->
GetCurrentViaDrill
()
);
via
->
SetDrillValue
(
GetBoard
()
->
GetCurrentViaDrill
()
);
break
;
break
;
case
VIA_MICROVIA
:
// from external to the near neighbor inner layer
case
VIA_MICROVIA
:
// from external to the near neighbor inner layer
if
(
old_layer
==
LAYER_N_BACK
)
if
(
old_layer
==
LAYER_N_BACK
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
LAYER_N_2
;
setActiveLayer
(
LAYER_N_2
)
;
else
if
(
old_layer
==
LAYER_N_FRONT
)
else
if
(
old_layer
==
LAYER_N_FRONT
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
setActiveLayer
(
GetBoard
()
->
m_BoardSettings
->
GetCopperLayerCount
()
-
2
);
GetBoard
()
->
m_BoardSettings
->
GetCopperLayerCount
()
-
2
;
else
if
(
old_layer
==
LAYER_N_2
)
else
if
(
old_layer
==
LAYER_N_2
)
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
LAYER_N_BACK
;
setActiveLayer
(
LAYER_N_BACK
)
;
else
if
(
old_layer
==
GetBoard
()
->
m_BoardSettings
->
GetCopperLayerCount
()
-
2
)
else
if
(
old_layer
==
GetBoard
()
->
m_BoardSettings
->
GetCopperLayerCount
()
-
2
)
;
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
LAYER_N_FRONT
;
setActiveLayer
(
LAYER_N_FRONT
)
;
// else error
// else error
via
->
SetLayerPair
(
old_layer
,
via
->
SetLayerPair
(
old_layer
,
getActiveLayer
()
);
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
);
{
{
NETINFO_ITEM
*
net
=
GetBoard
()
->
FindNet
(
via
->
GetNet
()
);
NETINFO_ITEM
*
net
=
GetBoard
()
->
FindNet
(
via
->
GetNet
()
);
via
->
m_Width
=
net
->
GetMicroViaSize
();
via
->
m_Width
=
net
->
GetMicroViaSize
();
...
@@ -236,7 +228,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
...
@@ -236,7 +228,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
/* DRC fault: the Via cannot be placed here ... */
/* DRC fault: the Via cannot be placed here ... */
delete
via
;
delete
via
;
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
=
old_layer
;
setActiveLayer
(
old_layer
)
;
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
FALSE
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
FALSE
);
...
@@ -274,7 +266,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
...
@@ -274,7 +266,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
*/
*/
// set the layer to the new value
// set the layer to the new value
track
->
SetLayer
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
);
track
->
SetLayer
(
getActiveLayer
()
);
/* the start point is the via position and the end point is the cursor
/* the start point is the via position and the end point is the cursor
* which also is on the via (will change when moving mouse)
* which also is on the via (will change when moving mouse)
...
@@ -294,7 +286,6 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
...
@@ -294,7 +286,6 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
UpdateStatusBar
();
UpdateStatusBar
();
SetToolbars
();
SetToolbars
();
SynchronizeLayersManager
(
1
);
return
true
;
return
true
;
}
}
...
@@ -307,8 +298,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
...
@@ -307,8 +298,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
void
WinEDA_PcbFrame
::
Affiche_Status_Net
(
wxDC
*
DC
)
void
WinEDA_PcbFrame
::
Affiche_Status_Net
(
wxDC
*
DC
)
{
{
TRACK
*
pt_segm
;
TRACK
*
pt_segm
;
int
masquelayer
=
int
masquelayer
=
(
1
<<
getActiveLayer
());
g_TabOneLayerMask
[((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
];
pt_segm
=
Locate_Pistes
(
GetBoard
()
->
m_Track
,
masquelayer
,
pt_segm
=
Locate_Pistes
(
GetBoard
()
->
m_Track
,
masquelayer
,
CURSEUR_OFF_GRILLE
);
CURSEUR_OFF_GRILLE
);
...
...
pcbnew/layer_panel_base.cpp
deleted
100644 → 0
View file @
84d82cf2
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 29 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "layer_panel_base.h"
#include <wx/settings.h>
///////////////////////////////////////////////////////////////////////////
LAYER_PANEL_BASE
::
LAYER_PANEL_BASE
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
wxPanel
(
parent
,
id
,
pos
,
size
,
style
)
{
wxBoxSizer
*
boxSizer
;
boxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
// m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_notebook
=
new
wxAuiNotebook
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxAUI_NB_TOP
);
// wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
wxFont
font
=
m_notebook
->
GetFont
();
font
.
SetPointSize
(
(
font
.
GetPointSize
()
*
8
)
/
10
);
m_notebook
->
SetFont
(
font
);
m_notebook
->
SetNormalFont
(
font
);
m_notebook
->
SetSelectedFont
(
font
);
m_notebook
->
SetMeasuringFont
(
font
);
m_LayerPanel
=
new
wxPanel
(
m_notebook
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxTAB_TRAVERSAL
);
wxBoxSizer
*
bSizer3
;
bSizer3
=
new
wxBoxSizer
(
wxVERTICAL
);
m_LayerScrolledWindow
=
new
wxScrolledWindow
(
m_LayerPanel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxNO_BORDER
);
m_LayerScrolledWindow
->
SetScrollRate
(
5
,
5
);
m_LayersFlexGridSizer
=
new
wxFlexGridSizer
(
0
,
4
,
0
,
1
);
m_LayersFlexGridSizer
->
SetFlexibleDirection
(
wxHORIZONTAL
);
m_LayersFlexGridSizer
->
SetNonFlexibleGrowMode
(
wxFLEX_GROWMODE_SPECIFIED
);
m_LayerScrolledWindow
->
SetSizer
(
m_LayersFlexGridSizer
);
m_LayerScrolledWindow
->
Layout
();
m_LayersFlexGridSizer
->
Fit
(
m_LayerScrolledWindow
);
bSizer3
->
Add
(
m_LayerScrolledWindow
,
1
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxTOP
,
2
);
m_LayerPanel
->
SetSizer
(
bSizer3
);
m_LayerPanel
->
Layout
();
bSizer3
->
Fit
(
m_LayerPanel
);
m_notebook
->
AddPage
(
m_LayerPanel
,
_
(
"Layer"
),
true
);
m_RenderingPanel
=
new
wxPanel
(
m_notebook
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxTAB_TRAVERSAL
);
wxBoxSizer
*
bSizer4
;
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
m_RenderScrolledWindow
=
new
wxScrolledWindow
(
m_RenderingPanel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxNO_BORDER
);
m_RenderScrolledWindow
->
SetScrollRate
(
5
,
5
);
m_RenderFlexGridSizer
=
new
wxFlexGridSizer
(
0
,
2
,
0
,
1
);
m_RenderFlexGridSizer
->
SetFlexibleDirection
(
wxHORIZONTAL
);
m_RenderFlexGridSizer
->
SetNonFlexibleGrowMode
(
wxFLEX_GROWMODE_NONE
);
m_RenderScrolledWindow
->
SetSizer
(
m_RenderFlexGridSizer
);
m_RenderScrolledWindow
->
Layout
();
m_RenderFlexGridSizer
->
Fit
(
m_RenderScrolledWindow
);
bSizer4
->
Add
(
m_RenderScrolledWindow
,
1
,
wxALL
|
wxEXPAND
,
5
);
m_RenderingPanel
->
SetSizer
(
bSizer4
);
m_RenderingPanel
->
Layout
();
bSizer4
->
Fit
(
m_RenderingPanel
);
m_notebook
->
AddPage
(
m_RenderingPanel
,
_
(
"Render"
),
false
);
boxSizer
->
Add
(
m_notebook
,
1
,
wxEXPAND
|
wxALL
,
5
);
this
->
SetSizer
(
boxSizer
);
this
->
Layout
();
// Connect Events
m_LayerScrolledWindow
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_PANEL_BASE
::
OnLeftDownLayers
),
NULL
,
this
);
m_LayerScrolledWindow
->
Connect
(
wxEVT_RIGHT_DOWN
,
wxMouseEventHandler
(
LAYER_PANEL_BASE
::
OnRightDownLayers
),
NULL
,
this
);
}
LAYER_PANEL_BASE
::~
LAYER_PANEL_BASE
()
{
// Disconnect Events
m_LayerScrolledWindow
->
Disconnect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_PANEL_BASE
::
OnLeftDownLayers
),
NULL
,
this
);
m_LayerScrolledWindow
->
Disconnect
(
wxEVT_RIGHT_DOWN
,
wxMouseEventHandler
(
LAYER_PANEL_BASE
::
OnRightDownLayers
),
NULL
,
this
);
}
pcbnew/layer_panel_base.h
deleted
100644 → 0
View file @
84d82cf2
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 29 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __layer_panel_base__
#define __layer_panel_base__
#include <wx/intl.h>
#include <wx/sizer.h>
#include <wx/gdicmn.h>
#include <wx/scrolwin.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
//#include <wx/notebook.h>
#include <wx/aui/auibook.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class LAYER_PANEL_BASE
///////////////////////////////////////////////////////////////////////////////
class
LAYER_PANEL_BASE
:
public
wxPanel
{
private
:
protected
:
// wxNotebook* m_notebook;
wxAuiNotebook
*
m_notebook
;
wxPanel
*
m_LayerPanel
;
wxScrolledWindow
*
m_LayerScrolledWindow
;
wxFlexGridSizer
*
m_LayersFlexGridSizer
;
wxPanel
*
m_RenderingPanel
;
wxScrolledWindow
*
m_RenderScrolledWindow
;
wxFlexGridSizer
*
m_RenderFlexGridSizer
;
// Virtual event handlers, overide them in your derived class
virtual
void
OnLeftDownLayers
(
wxMouseEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnRightDownLayers
(
wxMouseEvent
&
event
){
event
.
Skip
();
}
public
:
LAYER_PANEL_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
200
,
200
),
long
style
=
wxTAB_TRAVERSAL
);
~
LAYER_PANEL_BASE
();
};
#endif //__layer_panel_base__
pcbnew/layer_widget.cpp
View file @
6518139b
This diff is collapsed.
Click to expand it.
pcbnew/layer_widget.h
View file @
6518139b
...
@@ -25,7 +25,26 @@
...
@@ -25,7 +25,26 @@
#ifndef LAYERWIDGET_H_
#ifndef LAYERWIDGET_H_
#define LAYERWIDGET_H_
#define LAYERWIDGET_H_
#include "layer_panel_base.h"
#include <wx/intl.h>
#include <wx/wx.h>
#include <wx/statbmp.h>
#include <wx/string.h>
#include <wx/aui/auibook.h>
#include <wx/notebook.h>
#include <wx/sizer.h>
#include <wx/gdicmn.h>
#include <wx/scrolwin.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#define LYR_COLUMN_COUNT 4 ///< Layer tab column count
#define RND_COLUMN_COUNT 2 ///< Rendering tab column count
/**
/**
...
@@ -44,7 +63,7 @@
...
@@ -44,7 +63,7 @@
* <p> void OnRenderColorChange( int id, int aColor );
* <p> void OnRenderColorChange( int id, int aColor );
* <p> void OnRenderEnable( int id, bool isEnabled );
* <p> void OnRenderEnable( int id, bool isEnabled );
*/
*/
class
LAYER_WIDGET
:
public
LAYER_PANEL_BASE
class
LAYER_WIDGET
:
public
wxPanel
{
{
public
:
public
:
/**
/**
...
@@ -74,14 +93,37 @@ public:
...
@@ -74,14 +93,37 @@ public:
protected
:
protected
:
wxAuiNotebook
*
m_notebook
;
wxPanel
*
m_LayerPanel
;
wxScrolledWindow
*
m_LayerScrolledWindow
;
wxFlexGridSizer
*
m_LayersFlexGridSizer
;
wxPanel
*
m_RenderingPanel
;
wxScrolledWindow
*
m_RenderScrolledWindow
;
wxFlexGridSizer
*
m_RenderFlexGridSizer
;
wxWindow
*
m_FocusOwner
;
wxWindow
*
m_FocusOwner
;
wxBitmap
*
m_BlankBitmap
;
wxBitmap
*
m_BlankBitmap
;
wxBitmap
*
m_RightArrowBitmap
;
wxBitmap
*
m_RightArrowBitmap
;
wxSize
m_BitmapSize
;
wxSize
m_BitmapSize
;
int
m_CurrentRow
;
///< selected row of layer list
int
m_CurrentRow
;
///< selected row of layer list
int
m_PointSize
;
static
wxBitmap
makeBitmap
(
int
aColor
);
static
wxBitmap
makeBitmap
(
int
aColor
);
/**
* Function encodeId
* is here to allow saving a layer index within a control as its wxControl id,
* but to do so in a way that all child wxControl ids within a wxWindow are unique,
* since this is required by Windows.
* @see getDecodedId()
*/
static
int
encodeId
(
int
aColumn
,
int
aId
);
/**
* Function getDecodedId
* decodes \a aControlId to original un-encoded value.
*/
static
int
getDecodedId
(
int
aControlId
);
/**
/**
* Function makeColorButton
* Function makeColorButton
...
@@ -97,14 +139,6 @@ protected:
...
@@ -97,14 +139,6 @@ protected:
*/
*/
void
OnMiddleDownLayerColor
(
wxMouseEvent
&
event
);
void
OnMiddleDownLayerColor
(
wxMouseEvent
&
event
);
/**
* Function OnRightDownLayers
* puts up a popup menu for the layer panel.
*/
void
OnRightDownLayers
(
wxMouseEvent
&
event
);
void
OnPopupSelection
(
wxCommandEvent
&
event
);
/**
/**
* Function OnLayerCheckBox
* Function OnLayerCheckBox
* handles the "is layer visible" checkbox and propogates the
* handles the "is layer visible" checkbox and propogates the
...
@@ -155,7 +189,9 @@ public:
...
@@ -155,7 +189,9 @@ public:
* @param aFocusOwner is the window that should be sent the focus after
* @param aFocusOwner is the window that should be sent the focus after
* every operation.
* every operation.
*/
*/
LAYER_WIDGET
(
wxWindow
*
aParent
,
wxWindow
*
aFocusOwner
);
LAYER_WIDGET
(
wxWindow
*
aParent
,
wxWindow
*
aFocusOwner
,
int
aPointSize
,
wxWindowID
id
=
wxID_ANY
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
long
style
=
wxTAB_TRAVERSAL
);
/**
/**
* Function GetBestSize
* Function GetBestSize
...
...
pcbnew/onleftclick.cpp
View file @
6518139b
...
@@ -196,7 +196,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -196,7 +196,7 @@ 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
(
getActiveLayer
()
<=
LAST_COPPER_LAYER
)
{
{
DisplayError
(
this
,
_
(
"Graphic not authorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Graphic not authorized on Copper layers"
)
);
break
;
break
;
...
@@ -219,7 +219,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -219,7 +219,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
(
getActiveLayer
()
>
LAST_COPPER_LAYER
)
{
{
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
break
;
break
;
...
@@ -328,7 +328,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -328,7 +328,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
(
getActiveLayer
()
<=
LAST_COPPER_LAYER
)
{
{
DisplayError
(
this
,
_
(
"Cotation not authorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Cotation not authorized on Copper layers"
)
);
break
;
break
;
...
...
pcbnew/panel_layer_select.fbp
deleted
100644 → 0
View file @
84d82cf2
This diff is collapsed.
Click to expand it.
pcbnew/pcbframe.cpp
View file @
6518139b
This diff is collapsed.
Click to expand it.
pcbnew/tool_pcb.cpp
View file @
6518139b
...
@@ -68,7 +68,7 @@ void WinEDA_PcbFrame::PrepareLayerIndicator()
...
@@ -68,7 +68,7 @@ void WinEDA_PcbFrame::PrepareLayerIndicator()
previous_Route_Layer_BOTTOM_color
,
previous_via_color
;
previous_Route_Layer_BOTTOM_color
,
previous_via_color
;
/* get colors, and redraw bitmap button only on changes */
/* get colors, and redraw bitmap button only on changes */
active_layer_color
=
g_DesignSettings
.
m_LayerColor
[
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
];
active_layer_color
=
g_DesignSettings
.
m_LayerColor
[
getActiveLayer
()
];
if
(
previous_active_layer_color
!=
active_layer_color
)
if
(
previous_active_layer_color
!=
active_layer_color
)
{
{
previous_active_layer_color
=
active_layer_color
;
previous_active_layer_color
=
active_layer_color
;
...
@@ -664,20 +664,22 @@ an existing track use its width\notherwise, use current width setting" ),
...
@@ -664,20 +664,22 @@ an existing track use its width\notherwise, use current width setting" ),
}
}
void
WinEDA_PcbFrame
::
UpdateToolbarLayerInfo
()
void
WinEDA_PcbFrame
::
syncLayerBox
()
{
{
wxASSERT
(
m_SelLayerBox
);
wxASSERT
(
m_SelLayerBox
);
// Enable the display on the correct layer
// Enable the display on the correct layer
// To avoid reentrancy ( Bug wxGTK Linux version? ), the selection is
// To avoid reentrancy ( Bug wxGTK Linux version? ), the selection is
// made
where it is bad
( corrected on wxGTK 2.6.0 )
// made
only if it needs changing
( corrected on wxGTK 2.6.0 )
int
count
=
m_SelLayerBox
->
GetCount
();
int
count
=
m_SelLayerBox
->
GetCount
();
int
choice
=
m_SelLayerBox
->
GetChoice
();
int
choice
=
m_SelLayerBox
->
GetChoice
();
int
layer
=
GetScreen
()
->
m_Active_Layer
;
int
layer
=
getActiveLayer
()
;
for
(
int
listNdx
=
0
;
listNdx
<
count
;
++
listNdx
)
for
(
int
listNdx
=
0
;
listNdx
<
count
;
++
listNdx
)
{
{
if
(
(
int
)
(
size_t
)
m_SelLayerBox
->
GetClientData
(
listNdx
)
==
layer
)
int
clientData
=
(
int
)
(
size_t
)
m_SelLayerBox
->
GetClientData
(
listNdx
);
if
(
clientData
==
layer
)
{
{
if
(
listNdx
!=
choice
)
if
(
listNdx
!=
choice
)
m_SelLayerBox
->
SetSelection
(
listNdx
);
m_SelLayerBox
->
SetSelection
(
listNdx
);
...
@@ -766,7 +768,7 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
...
@@ -766,7 +768,7 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
UpdateToolbarLayerInfo
();
syncLayerBox
();
return
m_SelLayerBox
;
return
m_SelLayerBox
;
}
}
pcbnew/toolbars_update_user_interface.cpp
View file @
6518139b
...
@@ -285,7 +285,8 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -285,7 +285,8 @@ void WinEDA_PcbFrame::SetToolbars()
if
(
m_AuxiliaryToolBar
)
if
(
m_AuxiliaryToolBar
)
AuxiliaryToolBar_Update_UI
();
AuxiliaryToolBar_Update_UI
();
UpdateToolbarLayerInfo
();
syncLayerBox
();
PrepareLayerIndicator
();
PrepareLayerIndicator
();
DisplayUnitsMsg
();
DisplayUnitsMsg
();
#if defined(KICAD_AUIMANAGER)
#if defined(KICAD_AUIMANAGER)
...
...
pcbnew/zones_by_polygon.cpp
View file @
6518139b
...
@@ -500,7 +500,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
...
@@ -500,7 +500,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
{
{
int
diag
;
int
diag
;
// Init zone params to reasonnable values
// Init zone params to reasonnable values
zone
->
SetLayer
(
GetScreen
()
->
m_Active_Layer
);
zone
->
SetLayer
(
getActiveLayer
()
);
// Prompt user for parameters:
// Prompt user for parameters:
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
...
@@ -535,12 +535,12 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
...
@@ -535,12 +535,12 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
return
0
;
return
0
;
// Switch active layer to the selectec zonz layer
// Switch active layer to the selectec zonz layer
GetScreen
()
->
m_Active_Layer
=
g_Zone_Default_Setting
.
m_CurrentZone_Layer
;
setActiveLayer
(
g_Zone_Default_Setting
.
m_CurrentZone_Layer
)
;
}
}
else
// Start a new contour: init zone params (net and layer) from an existing zone (add cutout or similar zone)
else
// Start a new contour: init zone params (net and layer) from an existing zone (add cutout or similar zone)
{
{
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
g_Zone_Default_Setting
.
m_CurrentZone_Layer
=
g_Zone_Default_Setting
.
m_CurrentZone_Layer
=
s_CurrentZone
->
GetLayer
();
s_CurrentZone
->
GetLayer
(
);
setActiveLayer
(
s_CurrentZone
->
GetLayer
()
);
g_Zone_Default_Setting
.
ImportSetting
(
*
s_CurrentZone
);
g_Zone_Default_Setting
.
ImportSetting
(
*
s_CurrentZone
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment