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
5a4c16dc
Commit
5a4c16dc
authored
Jul 04, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew, Gerbview : fix crash when updating the layer manager.
parent
89f14906
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
layer_widget.cpp
pcbnew/layer_widget.cpp
+8
-8
layer_widget.h
pcbnew/layer_widget.h
+4
-0
No files found.
pcbnew/layer_widget.cpp
View file @
5a4c16dc
...
@@ -418,24 +418,24 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
...
@@ -418,24 +418,24 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
sbm
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnLeftDownLayers
),
NULL
,
this
);
sbm
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnLeftDownLayers
),
NULL
,
this
);
m_LayersFlexGridSizer
->
wxSizer
::
Insert
(
index
+
col
,
sbm
,
0
,
flags
);
m_LayersFlexGridSizer
->
wxSizer
::
Insert
(
index
+
col
,
sbm
,
0
,
flags
);
// column 1
// column 1
(COLUMN_COLORBM)
col
=
1
;
col
=
COLUMN_COLORBM
;
wxBitmapButton
*
bmb
=
makeColorButton
(
m_LayerScrolledWindow
,
aSpec
.
color
,
encodeId
(
col
,
aSpec
.
id
)
);
wxBitmapButton
*
bmb
=
makeColorButton
(
m_LayerScrolledWindow
,
aSpec
.
color
,
encodeId
(
col
,
aSpec
.
id
)
);
bmb
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnLeftDownLayers
),
NULL
,
this
);
bmb
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnLeftDownLayers
),
NULL
,
this
);
bmb
->
Connect
(
wxEVT_MIDDLE_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnMiddleDownLayerColor
),
NULL
,
this
);
bmb
->
Connect
(
wxEVT_MIDDLE_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnMiddleDownLayerColor
),
NULL
,
this
);
bmb
->
SetToolTip
(
_
(
"Left click to select, middle click for color change, right click for menu"
)
);
bmb
->
SetToolTip
(
_
(
"Left click to select, middle click for color change, right click for menu"
)
);
m_LayersFlexGridSizer
->
wxSizer
::
Insert
(
index
+
col
,
bmb
,
0
,
flags
);
m_LayersFlexGridSizer
->
wxSizer
::
Insert
(
index
+
col
,
bmb
,
0
,
flags
);
// column 2
// column 2
(COLUMN_COLOR_LYR_CB)
col
=
2
;
col
=
COLUMN_COLOR_LYR_CB
;
wxCheckBox
*
cb
=
new
wxCheckBox
(
m_LayerScrolledWindow
,
encodeId
(
col
,
aSpec
.
id
),
wxEmptyString
);
wxCheckBox
*
cb
=
new
wxCheckBox
(
m_LayerScrolledWindow
,
encodeId
(
col
,
aSpec
.
id
),
wxEmptyString
);
cb
->
SetValue
(
aSpec
.
state
);
cb
->
SetValue
(
aSpec
.
state
);
cb
->
Connect
(
wxEVT_COMMAND_CHECKBOX_CLICKED
,
wxCommandEventHandler
(
LAYER_WIDGET
::
OnLayerCheckBox
),
NULL
,
this
);
cb
->
Connect
(
wxEVT_COMMAND_CHECKBOX_CLICKED
,
wxCommandEventHandler
(
LAYER_WIDGET
::
OnLayerCheckBox
),
NULL
,
this
);
cb
->
SetToolTip
(
_
(
"Enable this for visibility"
)
);
cb
->
SetToolTip
(
_
(
"Enable this for visibility"
)
);
m_LayersFlexGridSizer
->
wxSizer
::
Insert
(
index
+
col
,
cb
,
0
,
flags
);
m_LayersFlexGridSizer
->
wxSizer
::
Insert
(
index
+
col
,
cb
,
0
,
flags
);
// column 3
// column 3
(COLUMN_COLOR_LYRNAME)
col
=
3
;
col
=
COLUMN_COLOR_LYRNAME
;
wxStaticText
*
st
=
new
wxStaticText
(
m_LayerScrolledWindow
,
encodeId
(
col
,
aSpec
.
id
),
aSpec
.
rowName
);
wxStaticText
*
st
=
new
wxStaticText
(
m_LayerScrolledWindow
,
encodeId
(
col
,
aSpec
.
id
),
aSpec
.
rowName
);
shrinkFont
(
st
,
m_PointSize
);
shrinkFont
(
st
,
m_PointSize
);
st
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnLeftDownLayers
),
NULL
,
this
);
st
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
LAYER_WIDGET
::
OnLeftDownLayers
),
NULL
,
this
);
...
@@ -726,7 +726,7 @@ void LAYER_WIDGET::SetLayerVisible( LAYER_NUM aLayer, bool isVisible )
...
@@ -726,7 +726,7 @@ void LAYER_WIDGET::SetLayerVisible( LAYER_NUM aLayer, bool isVisible )
int
row
=
findLayerRow
(
aLayer
);
int
row
=
findLayerRow
(
aLayer
);
if
(
row
>=
0
)
if
(
row
>=
0
)
{
{
wxCheckBox
*
cb
=
(
wxCheckBox
*
)
getLayerComp
(
row
,
3
);
wxCheckBox
*
cb
=
(
wxCheckBox
*
)
getLayerComp
(
row
,
2
);
wxASSERT
(
cb
);
wxASSERT
(
cb
);
cb
->
SetValue
(
isVisible
);
// does not fire an event
cb
->
SetValue
(
isVisible
);
// does not fire an event
}
}
...
@@ -738,7 +738,7 @@ bool LAYER_WIDGET::IsLayerVisible( LAYER_NUM aLayer )
...
@@ -738,7 +738,7 @@ bool LAYER_WIDGET::IsLayerVisible( LAYER_NUM aLayer )
int
row
=
findLayerRow
(
aLayer
);
int
row
=
findLayerRow
(
aLayer
);
if
(
row
>=
0
)
if
(
row
>=
0
)
{
{
wxCheckBox
*
cb
=
(
wxCheckBox
*
)
getLayerComp
(
row
,
3
);
wxCheckBox
*
cb
=
(
wxCheckBox
*
)
getLayerComp
(
row
,
COLUMN_COLOR_LYR_CB
);
wxASSERT
(
cb
);
wxASSERT
(
cb
);
return
cb
->
GetValue
();
return
cb
->
GetValue
();
}
}
...
...
pcbnew/layer_widget.h
View file @
5a4c16dc
...
@@ -47,6 +47,10 @@
...
@@ -47,6 +47,10 @@
#define LYR_COLUMN_COUNT 4 ///< Layer tab column count
#define LYR_COLUMN_COUNT 4 ///< Layer tab column count
#define RND_COLUMN_COUNT 2 ///< Rendering tab column count
#define RND_COLUMN_COUNT 2 ///< Rendering tab column count
#define COLUMN_COLORBM 1
#define COLUMN_COLOR_LYR_CB 2
#define COLUMN_COLOR_LYRNAME 3
/**
/**
* Class LAYER_WIDGET
* Class LAYER_WIDGET
...
...
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