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
1173add9
Commit
1173add9
authored
Feb 04, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gerbview: finishing layer_widget integration to manage gerber layers colors and visibility
parent
9b57038c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
11 deletions
+80
-11
CHANGELOG.txt
CHANGELOG.txt
+6
-1
class_gerbview_layer_widget.cpp
gerbview/class_gerbview_layer_widget.cpp
+2
-2
edit.cpp
gerbview/edit.cpp
+1
-1
files.cpp
gerbview/files.cpp
+10
-6
gerberframe.cpp
gerbview/gerberframe.cpp
+20
-0
tool_gerber.cpp
gerbview/tool_gerber.cpp
+1
-1
wxGerberFrame.h
gerbview/wxGerberFrame.h
+40
-0
No files found.
CHANGELOG.txt
View file @
1173add9
...
...
@@ -4,13 +4,18 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2010-Feb-04 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++ gerbview:
Use layer_widget to manage gerber layers colors and visibility.
2010-Jan-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++ pcbnew:
More about work on color selection and items visibility:
removed global variables and a lot of redundancies
Now Modedit does not uses the visiblity options of the board editor
(That can create a problem i
d
hide modules is activated)
(That can create a problem i
f
hide modules is activated)
work in progress but almost finished
...
...
gerbview/class_gerbview_layer_widget.cpp
View file @
1173add9
...
...
@@ -202,8 +202,8 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
{
// the layer change from the GERBER_LAYER_WIDGET can be denied by returning
// false from this function.
//
myframe->setActiveLayer( aLayer, false );
//
myframe->syncLayerBox();
myframe
->
setActiveLayer
(
aLayer
,
false
);
myframe
->
syncLayerBox
();
if
(
DisplayOpt
.
ContrastModeDisplay
)
myframe
->
DrawPanel
->
Refresh
();
...
...
gerbview/edit.cpp
View file @
1173add9
...
...
@@ -157,7 +157,7 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_TOOLBARH_GERBVIEW_SELECT_LAYER
:
GetScreen
()
->
m_Active_Layer
=
m_SelLayerBox
->
GetChoice
(
);
setActiveLayer
(
m_SelLayerBox
->
GetChoice
()
);
DrawPanel
->
Refresh
(
TRUE
);
break
;
...
...
gerbview/files.cpp
View file @
1173add9
...
...
@@ -47,14 +47,18 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
case
ID_MENU_INC_LAYER_AND_APPEND_FILE
:
case
ID_INC_LAYER_AND_APPEND_FILE
:
{
int
origLayer
=
GetScreen
()
->
m_Active_Layer
;
GetScreen
()
->
m_Active_Layer
++
;
int
origLayer
=
getActiveLayer
();
if
(
origLayer
<
NB_LAYERS
)
{
setActiveLayer
(
origLayer
+
1
);
if
(
!
LoadOneGerberFile
(
wxEmptyString
,
0
)
)
GetScreen
()
->
m_Active_Layer
=
origLayer
;
if
(
!
LoadOneGerberFile
(
wxEmptyString
,
0
)
)
setActiveLayer
(
origLayer
)
;
SetToolbars
();
SetToolbars
();
}
else
wxMessageBox
(
_
(
"Cannot increment layer number: max count reached"
)
);
}
break
;
...
...
gerbview/gerberframe.cpp
View file @
1173add9
...
...
@@ -415,6 +415,8 @@ void WinEDA_GerberFrame::ReFillLayerWidget()
m_auimgr
.
Update
();
else
m_LayersManager
->
SetSize
(
bestz
);
syncLayerWidget
(
);
}
/** Function IsGridVisible() , virtual
...
...
@@ -463,3 +465,21 @@ void WinEDA_GerberFrame::SetElementVisibility( int aGERBER_VISIBLE, bool aNewSta
GetBoard
()
->
SetElementVisibility
(
aGERBER_VISIBLE
,
aNewState
);
m_LayersManager
->
SetRenderState
(
aGERBER_VISIBLE
,
aNewState
);
}
void
WinEDA_GerberFrame
::
syncLayerWidget
(
)
{
m_LayersManager
->
SelectLayer
(
getActiveLayer
()
);
}
/**
* 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
WinEDA_GerberFrame
::
syncLayerBox
()
{
m_SelLayerBox
->
SetSelection
(
getActiveLayer
()
);
}
gerbview/tool_gerber.cpp
View file @
1173add9
...
...
@@ -214,7 +214,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
ID_TOOLBARH_GERBVIEW_SELECT_LAYER
,
wxDefaultPosition
,
wxSize
(
150
,
-
1
),
choices
);
m_SelLayerBox
->
SetSelection
(
GetScreen
()
->
m_Active_Layer
);
m_SelLayerBox
->
SetSelection
(
getActiveLayer
()
);
m_HToolBar
->
AddControl
(
m_SelLayerBox
);
m_HToolBar
->
AddSeparator
();
...
...
gerbview/wxGerberFrame.h
View file @
1173add9
...
...
@@ -117,6 +117,46 @@ public:
*/
void
ReFillLayerWidget
();
/**
* Function setActiveLayer
* will change the currently active layer to \a aLayer and also
* update the PCB_LAYER_WIDGET.
*/
void
setActiveLayer
(
int
aLayer
,
bool
doLayerWidgetUpdate
=
true
)
{
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
=
aLayer
;
if
(
doLayerWidgetUpdate
)
syncLayerWidget
();
}
/**
* Function getActiveLayer
* returns the active layer
*/
int
getActiveLayer
()
{
return
(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
;
}
/**
* Function syncLayerWidget
* updates the currently "selected" layer within the PCB_LAYER_WIDGET.
* The currently active layer is defined by the return value of getActiveLayer().
* <p>
* This function cannot be inline without including layer_widget.h in
* 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
();
/**
* Load applications settings specific to the PCBNew.
*
...
...
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