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
ec35a66f
Commit
ec35a66f
authored
Nov 03, 2010
by
Marco Serantoni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LayerBox little enhancements and adjust; fix bug #669495
parent
eb4a7dad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
13 deletions
+49
-13
class_layerchoicebox.h
include/class_layerchoicebox.h
+7
-1
class_layerchoicebox.cpp
pcbnew/class_layerchoicebox.cpp
+29
-4
edit.cpp
pcbnew/edit.cpp
+1
-2
tracepcb.cpp
pcbnew/tracepcb.cpp
+12
-6
No files found.
include/class_layerchoicebox.h
View file @
ec35a66f
...
...
@@ -9,6 +9,9 @@
class
WinEDALayerChoiceBox
:
public
wxBitmapComboBox
{
private
:
bool
m_layerhotkeys
;
bool
m_layerorder
;
public
:
WinEDALayerChoiceBox
(
WinEDA_Toolbar
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
...
...
@@ -23,13 +26,16 @@ public:
int
GetChoice
();
// Get Current Layer
int
GetLayer
Choice
();
int
GetLayer
Selection
();
// Set Layer #
int
SetLayerSelection
(
int
layer
);
// Reload the Layers
void
Resync
();
bool
SetLayersOrdered
(
bool
value
);
bool
SetLayersHotkeys
(
bool
value
);
};
#define DECLARE_LAYERS_HOTKEY(list) int list[LAYER_COUNT] = \
...
...
pcbnew/class_layerchoicebox.cpp
View file @
ec35a66f
...
...
@@ -27,6 +27,8 @@ WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID i
wxBitmapComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
n
,
choices
,
wxCB_READONLY
)
{
m_layerorder
=
true
;
m_layerhotkeys
=
true
;
}
...
...
@@ -36,6 +38,22 @@ WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID i
wxBitmapComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
choices
,
wxCB_READONLY
)
{
m_layerorder
=
true
;
m_layerhotkeys
=
true
;
}
bool
WinEDALayerChoiceBox
::
SetLayersOrdered
(
bool
value
)
{
m_layerorder
=
value
;
return
m_layerorder
;
}
bool
WinEDALayerChoiceBox
::
SetLayersHotkeys
(
bool
value
)
{
m_layerhotkeys
=
value
;
return
m_layerhotkeys
;
}
...
...
@@ -47,7 +65,7 @@ int WinEDALayerChoiceBox::GetChoice()
// Get Current Layer
int
WinEDALayerChoiceBox
::
GetLayer
Choice
()
int
WinEDALayerChoiceBox
::
GetLayer
Selection
()
{
return
(
long
)
GetClientData
(
GetSelection
()
);
}
...
...
@@ -97,9 +115,12 @@ void WinEDALayerChoiceBox::Resync()
wxMemoryDC
bmpDC
;
wxBrush
brush
;
wxString
layername
;
int
layerid
=
i
;
if
(
m_layerorder
)
layerid
=
layertranscode
[
i
];
int
layerid
=
layertranscode
[
i
];
if
(
!
board
->
IsLayerEnabled
(
layerid
)
)
if
(
!
board
->
IsLayerEnabled
(
layerid
)
)
continue
;
// Prepare Bitmap
...
...
@@ -114,7 +135,11 @@ void WinEDALayerChoiceBox::Resync()
bmpDC
.
DrawRectangle
(
0
,
0
,
layerbmp
.
GetWidth
(),
layerbmp
.
GetHeight
()
);
layername
=
board
->
GetLayerName
(
layerid
);
layername
=
AddHotkeyName
(
layername
,
s_Board_Editor_Hokeys_Descr
,
layerhk
[
layerid
],
false
);
if
(
m_layerhotkeys
)
layername
=
AddHotkeyName
(
layername
,
s_Board_Editor_Hokeys_Descr
,
layerhk
[
layerid
],
false
);
Append
(
layername
,
layerbmp
,
(
void
*
)
layerid
);
}
}
pcbnew/edit.cpp
View file @
ec35a66f
...
...
@@ -861,8 +861,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_TOOLBARH_PCB_SELECT_LAYER
:
itmp
=
m_SelLayerBox
->
GetChoice
();
setActiveLayer
(
(
size_t
)
m_SelLayerBox
->
wxItemContainer
::
GetClientData
(
itmp
)
);
setActiveLayer
(
(
size_t
)
m_SelLayerBox
->
GetLayerSelection
());
if
(
DisplayOpt
.
ContrastModeDisplay
)
DrawPanel
->
Refresh
(
true
);
break
;
...
...
pcbnew/tracepcb.cpp
View file @
ec35a66f
...
...
@@ -55,9 +55,12 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
}
#ifdef USE_WX_OVERLAY
DrawPanel
->
m_overlay
.
Reset
();
wxDCOverlay
overlaydc
(
DrawPanel
->
m_overlay
,
DC
);
overlaydc
.
Clear
();
if
(
IsShown
())
{
DrawPanel
->
m_overlay
.
Reset
();
wxDCOverlay
overlaydc
(
DrawPanel
->
m_overlay
,
DC
);
overlaydc
.
Clear
();
}
#endif
screen
->
ClrRefreshReq
();
...
...
@@ -91,9 +94,12 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawGeneralRatsnest
(
DC
);
#ifdef USE_WX_OVERLAY
DrawPanel
->
m_overlay
.
Reset
();
wxDCOverlay
overlaydc
(
DrawPanel
->
m_overlay
,
DC
);
overlaydc
.
Clear
();
if
(
IsShown
())
{
DrawPanel
->
m_overlay
.
Reset
();
wxDCOverlay
overlaydc
(
DrawPanel
->
m_overlay
,
DC
);
overlaydc
.
Clear
();
}
#endif
GetScreen
()
->
ClrRefreshReq
();
...
...
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