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
a8d5e068
Commit
a8d5e068
authored
Nov 04, 2010
by
Marco Serantoni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gerbview: Added new LayerBox
parent
7873b46e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
8 deletions
+49
-8
CMakeLists.txt
common/CMakeLists.txt
+1
-0
class_layerchoicebox.cpp
common/class_layerchoicebox.cpp
+39
-3
toolbars_gerber.cpp
gerbview/toolbars_gerber.cpp
+2
-2
wxGerberFrame.h
gerbview/wxGerberFrame.h
+2
-2
class_layerchoicebox.h
include/class_layerchoicebox.h
+4
-0
CMakeLists.txt
pcbnew/CMakeLists.txt
+0
-1
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+1
-0
No files found.
common/CMakeLists.txt
View file @
a8d5e068
...
@@ -20,6 +20,7 @@ set(COMMON_SRCS
...
@@ -20,6 +20,7 @@ set(COMMON_SRCS
block_commande.cpp
block_commande.cpp
build_version.cpp
build_version.cpp
class_colors_design_settings.cpp
class_colors_design_settings.cpp
class_layerchoicebox.cpp
class_marker_base.cpp
class_marker_base.cpp
class_plotter.cpp
class_plotter.cpp
class_undoredo_container.cpp
class_undoredo_container.cpp
...
...
pcbnew
/class_layerchoicebox.cpp
→
common
/class_layerchoicebox.cpp
View file @
a8d5e068
...
@@ -29,6 +29,10 @@ WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID i
...
@@ -29,6 +29,10 @@ WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID i
{
{
m_layerorder
=
true
;
m_layerorder
=
true
;
m_layerhotkeys
=
true
;
m_layerhotkeys
=
true
;
m_hotkeys
=
NULL
;
if
(
choices
!=
NULL
)
ResyncBitmapOnly
();
}
}
...
@@ -40,6 +44,10 @@ WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID i
...
@@ -40,6 +44,10 @@ WinEDALayerChoiceBox::WinEDALayerChoiceBox( WinEDA_Toolbar* parent, wxWindowID i
{
{
m_layerorder
=
true
;
m_layerorder
=
true
;
m_layerhotkeys
=
true
;
m_layerhotkeys
=
true
;
m_hotkeys
=
NULL
;
if
(
!
choices
.
IsEmpty
()
)
ResyncBitmapOnly
();
}
}
...
@@ -136,10 +144,38 @@ void WinEDALayerChoiceBox::Resync()
...
@@ -136,10 +144,38 @@ void WinEDALayerChoiceBox::Resync()
layername
=
board
->
GetLayerName
(
layerid
);
layername
=
board
->
GetLayerName
(
layerid
);
if
(
m_layerhotkeys
)
if
(
m_layerhotkeys
&&
m_hotkeys
!=
NULL
)
layername
=
AddHotkeyName
(
layername
,
s_Board_Editor_Hokeys_Descr
,
layername
=
AddHotkeyName
(
layername
,
m_hotkeys
,
layerhk
[
layerid
],
false
);
layerhk
[
layerid
],
false
);
Append
(
layername
,
layerbmp
,
(
void
*
)
layerid
);
Append
(
layername
,
layerbmp
,
(
void
*
)
layerid
);
}
}
}
}
void
WinEDALayerChoiceBox
::
ResyncBitmapOnly
()
{
WinEDA_BasePcbFrame
*
pcbFrame
=
(
WinEDA_BasePcbFrame
*
)
GetParent
()
->
GetParent
();
BOARD
*
board
=
pcbFrame
->
GetBoard
();
int
elements
=
GetCount
();
for
(
int
i
=
0
;
i
<
elements
;
i
++
)
{
wxBitmap
layerbmp
(
14
,
14
);
wxMemoryDC
bmpDC
;
wxBrush
brush
;
wxString
layername
;
int
layerid
=
i
;
// Prepare Bitmap
bmpDC
.
SelectObject
(
layerbmp
);
brush
.
SetColour
(
MakeColour
(
board
->
GetLayerColor
(
layerid
)
)
);
brush
.
SetStyle
(
wxSOLID
);
bmpDC
.
SetBrush
(
brush
);
bmpDC
.
DrawRectangle
(
0
,
0
,
layerbmp
.
GetWidth
(),
layerbmp
.
GetHeight
()
);
bmpDC
.
SetBrush
(
*
wxTRANSPARENT_BRUSH
);
bmpDC
.
SetPen
(
*
wxBLACK_PEN
);
bmpDC
.
DrawRectangle
(
0
,
0
,
layerbmp
.
GetWidth
(),
layerbmp
.
GetHeight
()
);
SetItemBitmap
(
i
,
layerbmp
);
}
}
gerbview/toolbars_gerber.cpp
View file @
a8d5e068
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#include "gerbview_id.h"
#include "gerbview_id.h"
#include "hotkeys.h"
#include "hotkeys.h"
#include "class_GERBER.h"
#include "class_GERBER.h"
#include "class_layerchoicebox.h"
void
WinEDA_GerberFrame
::
ReCreateHToolbar
(
void
)
void
WinEDA_GerberFrame
::
ReCreateHToolbar
(
void
)
{
{
...
@@ -89,7 +89,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
...
@@ -89,7 +89,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
choices
.
Add
(
msg
);
choices
.
Add
(
msg
);
}
}
m_SelLayerBox
=
new
WinEDAChoiceBox
(
m_HToolBar
,
m_SelLayerBox
=
new
WinEDA
Layer
ChoiceBox
(
m_HToolBar
,
ID_TOOLBARH_GERBVIEW_SELECT_LAYER
,
ID_TOOLBARH_GERBVIEW_SELECT_LAYER
,
wxDefaultPosition
,
wxSize
(
150
,
-
1
),
wxDefaultPosition
,
wxSize
(
150
,
-
1
),
choices
);
choices
);
...
...
gerbview/wxGerberFrame.h
View file @
a8d5e068
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include "id.h"
#include "id.h"
#include "class_gerbview_layer_widget.h"
#include "class_gerbview_layer_widget.h"
#include "class_layerchoicebox.h"
/**
/**
* Command IDs for the gerber file viewer.
* Command IDs for the gerber file viewer.
...
@@ -44,7 +44,7 @@ protected:
...
@@ -44,7 +44,7 @@ protected:
GERBER_LAYER_WIDGET
*
m_LayersManager
;
GERBER_LAYER_WIDGET
*
m_LayersManager
;
public
:
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
WinEDA
Layer
ChoiceBox
*
m_SelLayerBox
;
WinEDAChoiceBox
*
m_SelLayerTool
;
WinEDAChoiceBox
*
m_SelLayerTool
;
wxTextCtrl
*
m_TextInfo
;
// a wxTextCtrl used to display some info about
wxTextCtrl
*
m_TextInfo
;
// a wxTextCtrl used to display some info about
// gerber data (format..)
// gerber data (format..)
...
...
include/class_layerchoicebox.h
View file @
a8d5e068
#ifndef CLASS_LAYERCHOICEBOX_H
#ifndef CLASS_LAYERCHOICEBOX_H
#define CLASS_LAYERCHOICEBOX_H 1
#define CLASS_LAYERCHOICEBOX_H 1
#include "hotkeys_basic.h"
#include <wx/bmpcbox.h>
#include <wx/bmpcbox.h>
/* class to display a layer list.
/* class to display a layer list.
...
@@ -33,9 +34,12 @@ public:
...
@@ -33,9 +34,12 @@ public:
// Reload the Layers
// Reload the Layers
void
Resync
();
void
Resync
();
void
ResyncBitmapOnly
();
bool
SetLayersOrdered
(
bool
value
);
bool
SetLayersOrdered
(
bool
value
);
bool
SetLayersHotkeys
(
bool
value
);
bool
SetLayersHotkeys
(
bool
value
);
// Hotkey Info
struct
Ki_HotkeyInfoSectionDescriptor
*
m_hotkeys
;
};
};
#define DECLARE_LAYERS_HOTKEY(list) int list[LAYER_COUNT] = \
#define DECLARE_LAYERS_HOTKEY(list) int list[LAYER_COUNT] = \
...
...
pcbnew/CMakeLists.txt
View file @
a8d5e068
...
@@ -32,7 +32,6 @@ set(PCBNEW_SRCS
...
@@ -32,7 +32,6 @@ set(PCBNEW_SRCS
block.cpp
block.cpp
block_module_editor.cpp
block_module_editor.cpp
build_BOM_from_board.cpp
build_BOM_from_board.cpp
class_layerchoicebox.cpp
class_pcb_layer_widget.cpp
class_pcb_layer_widget.cpp
clean.cpp
clean.cpp
# cleaningoptions_dialog.cpp
# cleaningoptions_dialog.cpp
...
...
pcbnew/tool_pcb.cpp
View file @
a8d5e068
...
@@ -700,6 +700,7 @@ WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent
...
@@ -700,6 +700,7 @@ WinEDALayerChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent
if
(
m_SelLayerBox
==
NULL
)
if
(
m_SelLayerBox
==
NULL
)
return
NULL
;
return
NULL
;
m_SelLayerBox
->
m_hotkeys
=
s_Board_Editor_Hokeys_Descr
;
m_SelLayerBox
->
Resync
();
m_SelLayerBox
->
Resync
();
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
...
...
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