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
9ebb4afa
Commit
9ebb4afa
authored
Apr 06, 2013
by
Lorenzo Marcantonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed arbitrary MAX_LAYER_ROWS limit (only used in one assertion, anyway)
parent
150cfebb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
3d_draw.cpp
3d-viewer/3d_draw.cpp
+2
-2
layer_widget.cpp
pcbnew/layer_widget.cpp
+5
-5
layer_widget.h
pcbnew/layer_widget.h
+8
-4
No files found.
3d-viewer/3d_draw.cpp
View file @
9ebb4afa
...
@@ -1084,8 +1084,8 @@ bool Is3DLayerEnabled( LAYER_NUM aLayer )
...
@@ -1084,8 +1084,8 @@ bool Is3DLayerEnabled( LAYER_NUM aLayer )
break
;
break
;
default
:
default
:
// the layer was not a layer with a flag, so show it
// the layer was not a layer with a flag, so show it
return
true
;
return
true
;
}
}
// if the layer has a flag, return the flag
// if the layer has a flag, return the flag
...
...
pcbnew/layer_widget.cpp
View file @
9ebb4afa
...
@@ -174,7 +174,7 @@ int LAYER_WIDGET::encodeId( int aColumn, int aId )
...
@@ -174,7 +174,7 @@ int LAYER_WIDGET::encodeId( int aColumn, int aId )
}
}
int
LAYER_WIDGET
::
getDecodedId
(
int
aControlId
)
LAYER_NUM
LAYER_WIDGET
::
getDecodedId
(
int
aControlId
)
{
{
int
id
=
aControlId
/
LYR_COLUMN_COUNT
;
// rounding is OK.
int
id
=
aControlId
/
LYR_COLUMN_COUNT
;
// rounding is OK.
return
id
;
return
id
;
...
@@ -319,7 +319,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
...
@@ -319,7 +319,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
wxBitmap
bm
=
makeBitmap
(
newColor
);
wxBitmap
bm
=
makeBitmap
(
newColor
);
eventSource
->
SetBitmapLabel
(
bm
);
eventSource
->
SetBitmapLabel
(
bm
);
int
id
=
getDecodedId
(
eventSource
->
GetId
()
);
LAYER_NUM
id
=
getDecodedId
(
eventSource
->
GetId
()
);
// tell the client code.
// tell the client code.
OnRenderColorChange
(
id
,
newColor
);
OnRenderColorChange
(
id
,
newColor
);
...
@@ -331,7 +331,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
...
@@ -331,7 +331,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
void
LAYER_WIDGET
::
OnRenderCheckBox
(
wxCommandEvent
&
event
)
void
LAYER_WIDGET
::
OnRenderCheckBox
(
wxCommandEvent
&
event
)
{
{
wxCheckBox
*
eventSource
=
(
wxCheckBox
*
)
event
.
GetEventObject
();
wxCheckBox
*
eventSource
=
(
wxCheckBox
*
)
event
.
GetEventObject
();
int
id
=
getDecodedId
(
eventSource
->
GetId
()
);
LAYER_NUM
id
=
getDecodedId
(
eventSource
->
GetId
()
);
OnRenderEnable
(
id
,
eventSource
->
IsChecked
()
);
OnRenderEnable
(
id
,
eventSource
->
IsChecked
()
);
passOnFocus
();
passOnFocus
();
}
}
...
@@ -398,7 +398,7 @@ int LAYER_WIDGET::findRenderRow( int aId ) const
...
@@ -398,7 +398,7 @@ int LAYER_WIDGET::findRenderRow( int aId ) const
void
LAYER_WIDGET
::
insertLayerRow
(
int
aRow
,
const
ROW
&
aSpec
)
void
LAYER_WIDGET
::
insertLayerRow
(
int
aRow
,
const
ROW
&
aSpec
)
{
{
wxASSERT
(
aRow
>=
0
&&
aRow
<
MAX_LAYER_ROWS
);
wxASSERT
(
aRow
>=
0
);
int
col
;
int
col
;
int
index
=
aRow
*
LYR_COLUMN_COUNT
;
int
index
=
aRow
*
LYR_COLUMN_COUNT
;
...
@@ -440,7 +440,7 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
...
@@ -440,7 +440,7 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
void
LAYER_WIDGET
::
insertRenderRow
(
int
aRow
,
const
ROW
&
aSpec
)
void
LAYER_WIDGET
::
insertRenderRow
(
int
aRow
,
const
ROW
&
aSpec
)
{
{
wxASSERT
(
aRow
>=
0
&&
aRow
<
MAX_LAYER_ROWS
);
wxASSERT
(
aRow
>=
0
);
int
col
;
int
col
;
int
index
=
aRow
*
RND_COLUMN_COUNT
;
int
index
=
aRow
*
RND_COLUMN_COUNT
;
...
...
pcbnew/layer_widget.h
View file @
9ebb4afa
...
@@ -62,6 +62,10 @@
...
@@ -62,6 +62,10 @@
* <p> void OnLayerVisible( int aLayer, bool isVisible );
* <p> void OnLayerVisible( int aLayer, bool isVisible );
* <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 );
*
* Please note that even if designed toward layers, it is used to
* contain other stuff, too (the second page in pcbnew contains render
* items, for example)
*/
*/
class
LAYER_WIDGET
:
public
wxPanel
class
LAYER_WIDGET
:
public
wxPanel
{
{
...
@@ -133,9 +137,11 @@ protected:
...
@@ -133,9 +137,11 @@ protected:
/**
/**
* Function getDecodedId
* Function getDecodedId
* decodes \a aControlId to original un-encoded value.
* decodes \a aControlId to original un-encoded value. This of
* course holds iff encodedId was called with a LAYER_NUM (this box
* is used for other things than layers, too)
*/
*/
static
int
getDecodedId
(
int
aControlId
);
static
LAYER_NUM
getDecodedId
(
int
aControlId
);
/**
/**
* Function makeColorButton
* Function makeColorButton
...
@@ -243,8 +249,6 @@ public:
...
@@ -243,8 +249,6 @@ public:
*/
*/
void
AppendLayerRow
(
const
ROW
&
aRow
);
void
AppendLayerRow
(
const
ROW
&
aRow
);
#define MAX_LAYER_ROWS 64 ///< cannot append more than this number of rows
/**
/**
* Function AppendLayerRows
* Function AppendLayerRows
* appends new rows in the layer portion of the widget. The user must
* appends new rows in the layer portion of the widget. The user must
...
...
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