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
920186dd
Commit
920186dd
authored
Jan 21, 2010
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more layer widget incorporation
parent
2bae7624
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
436 additions
and
209 deletions
+436
-209
class_board_design_settings.h
include/class_board_design_settings.h
+11
-14
pcbstruct.h
include/pcbstruct.h
+33
-17
wxPcbStruct.h
include/wxPcbStruct.h
+9
-13
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+3
-3
class_board.cpp
pcbnew/class_board.cpp
+52
-0
class_board.h
pcbnew/class_board.h
+18
-2
class_board_design_settings.cpp
pcbnew/class_board_design_settings.cpp
+1
-1
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+3
-3
class_track.cpp
pcbnew/class_track.cpp
+1
-1
dialog_general_options.cpp
pcbnew/dialog_general_options.cpp
+1
-1
dialog_layers_setup.cpp
pcbnew/dialog_layers_setup.cpp
+1
-0
layer_panel_base.cpp
pcbnew/layer_panel_base.cpp
+2
-2
layer_widget.cpp
pcbnew/layer_widget.cpp
+30
-10
layer_widget.h
pcbnew/layer_widget.h
+23
-0
panel_layer_select.fbp
pcbnew/panel_layer_select.fbp
+2
-2
pcbframe.cpp
pcbnew/pcbframe.cpp
+141
-26
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+6
-6
set_color.h
pcbnew/set_color.h
+6
-6
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+91
-100
toolbars_update_user_interface.cpp
pcbnew/toolbars_update_user_interface.cpp
+2
-2
No files found.
include/class_board_design_settings.h
View file @
920186dd
...
@@ -78,7 +78,7 @@ public:
...
@@ -78,7 +78,7 @@ public:
return
false
;
return
false
;
// If a layer is disabled, it is automatically invisible
// If a layer is disabled, it is automatically invisible
return
(
bool
)
(
m_VisibleLayers
&
m_EnabledLayers
&
1
<<
aLayerIndex
);
return
(
bool
)
(
m_VisibleLayers
&
m_EnabledLayers
&
(
1
<<
aLayerIndex
)
);
}
}
...
@@ -111,28 +111,27 @@ public:
...
@@ -111,28 +111,27 @@ public:
m_VisibleElements
=
aMask
;
m_VisibleElements
=
aMask
;
}
}
/**
/**
* Function IsElementVisible
* Function IsElementVisible
* tests whether a given element category is visible
* tests whether a given element category is visible. Keep this as an
* @param aCategoryIndex = The index of the element category to be tested.
* inline function.
* @param aPCB_VISIBLE is from the enum by the same name
* @return bool - true if the element is visible.
* @return bool - true if the element is visible.
* @see enum PCB_VISIBLE
*/
*/
bool
IsElementVisible
(
int
a
CategoryIndex
)
const
bool
IsElementVisible
(
int
a
PCB_VISIBLE
)
const
{
{
if
(
aCategoryIndex
<
0
||
aCategoryIndex
>
PAD_CMP_VISIBLE
)
return
bool
(
m_VisibleElements
&
(
1
<<
aPCB_VISIBLE
)
);
return
false
;
return
(
bool
)
(
m_VisibleElements
&
(
1
<<
aCategoryIndex
)
);
}
}
/**
/**
* Function SetElementVisibility
* Function SetElementVisibility
* changes the visibility of an element category
* changes the visibility of an element category
* @param a
CategoryIndex = The index of the element category to be changed
* @param a
PCB_VISIBLE is from the enum by the same name
* @param aNewState = The new visibility state of the element category
* @param aNewState = The new visibility state of the element category
* @see enum PCB_VISIBLE
*/
*/
void
SetElementVisibility
(
int
a
CategoryIndex
,
bool
aNewState
);
void
SetElementVisibility
(
int
a
PCB_VISIBLE
,
bool
aNewState
);
/**
/**
* Function GetEnabledLayers
* Function GetEnabledLayers
...
@@ -144,7 +143,6 @@ public:
...
@@ -144,7 +143,6 @@ public:
return
m_EnabledLayers
;
return
m_EnabledLayers
;
}
}
/**
/**
* Function SetEnabledLayers
* Function SetEnabledLayers
* changes the bit-mask of enabled layers
* changes the bit-mask of enabled layers
...
@@ -152,7 +150,6 @@ public:
...
@@ -152,7 +150,6 @@ public:
*/
*/
void
SetEnabledLayers
(
int
aMask
);
void
SetEnabledLayers
(
int
aMask
);
/**
/**
* Function IsLayerEnabled
* Function IsLayerEnabled
* tests whether a given layer is enabled
* tests whether a given layer is enabled
...
@@ -161,7 +158,7 @@ public:
...
@@ -161,7 +158,7 @@ public:
*/
*/
bool
IsLayerEnabled
(
int
aLayerIndex
)
bool
IsLayerEnabled
(
int
aLayerIndex
)
{
{
return
(
bool
)
(
m_EnabledLayers
&
1
<<
aLayerIndex
);
return
bool
(
m_EnabledLayers
&
(
1
<<
aLayerIndex
)
);
}
}
...
...
include/pcbstruct.h
View file @
920186dd
...
@@ -93,14 +93,14 @@
...
@@ -93,14 +93,14 @@
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define LAYER_FRONT (1 << LAYER_N_FRONT) ///< bit mask for component layer
#define LAYER_FRONT (1 << LAYER_N_FRONT) ///< bit mask for component layer
#define ADHESIVE_LAYER_BACK
(1 << ADHESIVE_N_BACK)
#define ADHESIVE_LAYER_BACK (1 << ADHESIVE_N_BACK)
#define ADHESIVE_LAYER_FRONT
(1 << ADHESIVE_N_FRONT)
#define ADHESIVE_LAYER_FRONT (1 << ADHESIVE_N_FRONT)
#define SOLDERPASTE_LAYER_BACK
(1 << SOLDERPASTE_N_BACK)
#define SOLDERPASTE_LAYER_BACK (1 << SOLDERPASTE_N_BACK)
#define SOLDERPASTE_LAYER_FRONT
(1 << SOLDERPASTE_N_FRONT)
#define SOLDERPASTE_LAYER_FRONT (1 << SOLDERPASTE_N_FRONT)
#define SILKSCREEN_LAYER_BACK
(1 << SILKSCREEN_N_BACK)
#define SILKSCREEN_LAYER_BACK (1 << SILKSCREEN_N_BACK)
#define SILKSCREEN_LAYER_FRONT
(1 << SILKSCREEN_N_FRONT)
#define SILKSCREEN_LAYER_FRONT (1 << SILKSCREEN_N_FRONT)
#define SOLDERMASK_LAYER_BACK
(1 << SOLDERMASK_N_BACK)
#define SOLDERMASK_LAYER_BACK (1 << SOLDERMASK_N_BACK)
#define SOLDERMASK_LAYER_FRONT
(1 << SOLDERMASK_N_FRONT)
#define SOLDERMASK_LAYER_FRONT (1 << SOLDERMASK_N_FRONT)
#define DRAW_LAYER (1 << DRAW_N)
#define DRAW_LAYER (1 << DRAW_N)
#define COMMENT_LAYER (1 << COMMENT_N)
#define COMMENT_LAYER (1 << COMMENT_N)
#define ECO1_LAYER (1 << ECO1_N)
#define ECO1_LAYER (1 << ECO1_N)
...
@@ -152,21 +152,37 @@ class RATSNEST_ITEM;
...
@@ -152,21 +152,37 @@ class RATSNEST_ITEM;
/* Class to handle a board */
/* Class to handle a board */
#include "class_board.h"
#include "class_board.h"
enum
ELEMENTS_NUMBERS
/**
* Enum PCB_VISIBLE
* is a set of visible PCB elements.
* @see BOARD::SetVisibleElementColor()
* @see BOARD::SetVisibleElement()
*/
enum
PCB_VISIBLE
{
{
VIAS_VISIBLE
=
0
,
VIAS_VISIBLE
,
VIA_NOT_DEFINED_VISIBLE
=
VIAS_VISIBLE
,
VIA_MICROVIA_VISIBLE
,
VIA_MICROVIA_VISIBLE
,
VIA_B
LIND_BURIE
D_VISIBLE
,
VIA_B
BLIN
D_VISIBLE
,
VIA_THROUGH_VISIBLE
,
VIA_THROUGH_VISIBLE
,
MOD
ULE_TEXT_CMP
_VISIBLE
,
MOD
_TEXT_FR
_VISIBLE
,
MOD
ULE_TEXT_CU
_VISIBLE
,
MOD
_TEXT_BK
_VISIBLE
,
MOD
ULE_TEXT_NOV_VISIBLE
,
MOD
_TEXT_INVISIBLE
,
///< text marked as invisible
ANCHOR_VISIBLE
,
ANCHOR_VISIBLE
,
PAD_CU_VISIBLE
,
PAD_FR_VISIBLE
,
PAD_CMP_VISIBLE
PAD_BK_VISIBLE
,
RATSNEST_VISIBLE
,
GRID_VISIBLE
,
// the rest of these do not currently support color changes:
NO_CONNECTS_VISIBLE
,
///< show a marker on pads with no nets
MOD_FR_VISIBLE
,
///< show modules on front
MOD_BK_VISIBLE
,
///< show modules on back
END_VISIBLE
// sentinel
};
};
/**
/**
* Function IsValidLayerIndex
* Function IsValidLayerIndex
* tests whether a given integer is a valid layer index
* tests whether a given integer is a valid layer index
...
...
include/wxPcbStruct.h
View file @
920186dd
...
@@ -67,28 +67,17 @@ protected:
...
@@ -67,28 +67,17 @@ protected:
{
{
}
}
//-----<implement LAYER_WIDGET abstract
functions>
---
//-----<implement LAYER_WIDGET abstract
callback functions>--------
---
void
OnLayerColorChange
(
int
aLayer
,
int
aColor
);
void
OnLayerColorChange
(
int
aLayer
,
int
aColor
);
bool
OnLayerSelect
(
int
aLayer
);
bool
OnLayerSelect
(
int
aLayer
);
void
OnLayerVisible
(
int
aLayer
,
bool
isVisible
,
bool
isFinal
);
void
OnLayerVisible
(
int
aLayer
,
bool
isVisible
,
bool
isFinal
);
void
OnRenderColorChange
(
int
aId
,
int
aColor
);
void
OnRenderColorChange
(
int
aId
,
int
aColor
);
void
OnRenderEnable
(
int
aId
,
bool
isEnabled
);
void
OnRenderEnable
(
int
aId
,
bool
isEnabled
);
//-----</implement LAYER_WIDGET abstract
functions>-----
----------
//-----</implement LAYER_WIDGET abstract
callback functions>
----------
};
};
/// render rows are fixed, layer rows are dynamically determined.
static
LAYER_WIDGET
::
ROW
renderRows
[];
LYRS
*
m_Layers
;
// established in constructor
LYRS
*
m_Layers
;
// established in constructor
/**
* Function ReFillLayerWidget
* changes out all the layers in m_Layers and may be called upon
* loading a new BOARD.
*/
void
ReFillLayerWidget
();
public
:
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
// a combo box to display and
WinEDAChoiceBox
*
m_SelLayerBox
;
// a combo box to display and
// select active layer
// select active layer
...
@@ -177,6 +166,13 @@ public:
...
@@ -177,6 +166,13 @@ public:
void
ReCreateMenuBar
();
void
ReCreateMenuBar
();
WinEDAChoiceBox
*
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
);
WinEDAChoiceBox
*
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
);
/**
* Function ReFillLayerWidget
* changes out all the layers in m_Layers and may be called upon
* loading a new BOARD.
*/
void
ReFillLayerWidget
();
void
Show3D_Frame
(
wxCommandEvent
&
event
);
void
Show3D_Frame
(
wxCommandEvent
&
event
);
void
GeneralControle
(
wxDC
*
DC
,
wxPoint
Mouse
);
void
GeneralControle
(
wxDC
*
DC
,
wxPoint
Mouse
);
...
...
pcbnew/basepcbframe.cpp
View file @
920186dd
...
@@ -277,9 +277,9 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide()
...
@@ -277,9 +277,9 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide()
(
(
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
);
(
(
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
);
// account for the globals
// account for the globals
guide
.
SetIgnoreMTextsMarkedNoShow
(
!
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_NOV_
VISIBLE
));
guide
.
SetIgnoreMTextsMarkedNoShow
(
!
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_IN
VISIBLE
));
guide
.
SetIgnoreMTextsOnCopper
(
!
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_CU
_VISIBLE
));
guide
.
SetIgnoreMTextsOnCopper
(
!
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_BK
_VISIBLE
));
guide
.
SetIgnoreMTextsOnCmp
(
!
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_CMP
_VISIBLE
));
guide
.
SetIgnoreMTextsOnCmp
(
!
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_FR
_VISIBLE
));
guide
.
SetIgnoreModulesOnCu
(
!
DisplayOpt
.
Show_Modules_Cu
);
guide
.
SetIgnoreModulesOnCu
(
!
DisplayOpt
.
Show_Modules_Cu
);
guide
.
SetIgnoreModulesOnCmp
(
!
DisplayOpt
.
Show_Modules_Cmp
);
guide
.
SetIgnoreModulesOnCmp
(
!
DisplayOpt
.
Show_Modules_Cmp
);
...
...
pcbnew/class_board.cpp
View file @
920186dd
...
@@ -396,11 +396,63 @@ int BOARD::GetVisibleElements() const
...
@@ -396,11 +396,63 @@ int BOARD::GetVisibleElements() const
return
m_BoardSettings
->
GetVisibleElements
();
return
m_BoardSettings
->
GetVisibleElements
();
}
}
int
BOARD
::
GetVisibleElementColor
(
int
aPCB_VISIBLE
)
{
int
color
=
-
1
;
// @todo move these globals into the board.
switch
(
aPCB_VISIBLE
)
{
case
VIAS_VISIBLE
:
color
=
m_BoardSettings
->
m_ViaColor
[
VIA_THROUGH
];
break
;
case
VIA_MICROVIA_VISIBLE
:
color
=
m_BoardSettings
->
m_ViaColor
[
VIA_MICROVIA
];
break
;
case
VIA_BBLIND_VISIBLE
:
color
=
m_BoardSettings
->
m_ViaColor
[
VIA_BLIND_BURIED
];
break
;
case
VIA_THROUGH_VISIBLE
:
color
=
g_ModuleTextCUColor
;
break
;
case
MOD_TEXT_FR_VISIBLE
:
color
=
g_ModuleTextCUColor
;
break
;
case
MOD_TEXT_BK_VISIBLE
:
color
=
g_ModuleTextCUColor
;
break
;
case
MOD_TEXT_INVISIBLE
:
color
=
g_ModuleTextNOVColor
;
break
;
case
ANCHOR_VISIBLE
:
color
=
g_AnchorColor
;
break
;
case
PAD_FR_VISIBLE
:
color
=
g_PadCMPColor
;
break
;
case
PAD_BK_VISIBLE
:
color
=
g_PadCUColor
;
break
;
case
RATSNEST_VISIBLE
:
color
=
m_BoardSettings
->
m_RatsnestColor
;
break
;
case
GRID_VISIBLE
:
color
=
g_GridColor
;
break
;
default
:
wxLogDebug
(
"BOARD::GetVisibleElementColor(): bad arg %d"
,
aPCB_VISIBLE
);
}
return
color
;
}
void
BOARD
::
SetVisibleElementColor
(
int
aPCB_VISIBLE
,
int
aColor
)
{
// @todo move these globals into the board.
switch
(
aPCB_VISIBLE
)
{
case
VIAS_VISIBLE
:
m_BoardSettings
->
m_ViaColor
[
VIA_THROUGH
]
=
aColor
;
break
;
case
VIA_MICROVIA_VISIBLE
:
m_BoardSettings
->
m_ViaColor
[
VIA_MICROVIA
]
=
aColor
;
break
;
case
VIA_BBLIND_VISIBLE
:
m_BoardSettings
->
m_ViaColor
[
VIA_BLIND_BURIED
]
=
aColor
;
break
;
case
VIA_THROUGH_VISIBLE
:
g_ModuleTextCUColor
=
aColor
;
break
;
case
MOD_TEXT_FR_VISIBLE
:
g_ModuleTextCUColor
=
aColor
;
break
;
case
MOD_TEXT_BK_VISIBLE
:
g_ModuleTextCUColor
=
aColor
;
break
;
case
MOD_TEXT_INVISIBLE
:
g_ModuleTextNOVColor
=
aColor
;
break
;
case
ANCHOR_VISIBLE
:
g_AnchorColor
=
aColor
;
break
;
case
PAD_FR_VISIBLE
:
g_PadCMPColor
=
aColor
;
break
;
case
PAD_BK_VISIBLE
:
g_PadCUColor
=
aColor
;
break
;
case
RATSNEST_VISIBLE
:
m_BoardSettings
->
m_RatsnestColor
=
aColor
;
break
;
case
GRID_VISIBLE
:
g_GridColor
=
aColor
;
break
;
default
:
wxLogDebug
(
"BOARD::SetVisibleElementColor(): bad arg %d"
,
aPCB_VISIBLE
);
}
}
void
BOARD
::
SetLayerColor
(
int
aLayer
,
int
aColor
)
void
BOARD
::
SetLayerColor
(
int
aLayer
,
int
aColor
)
{
{
m_BoardSettings
->
SetLayerColor
(
aLayer
,
aColor
);
m_BoardSettings
->
SetLayerColor
(
aLayer
,
aColor
);
}
}
int
BOARD
::
GetLayerColor
(
int
aLayer
)
int
BOARD
::
GetLayerColor
(
int
aLayer
)
{
{
return
m_BoardSettings
->
GetLayerColor
(
aLayer
);
return
m_BoardSettings
->
GetLayerColor
(
aLayer
);
...
...
pcbnew/class_board.h
View file @
920186dd
...
@@ -287,7 +287,8 @@ public:
...
@@ -287,7 +287,8 @@ public:
* Function GetVisibleElements
* Function GetVisibleElements
* is a proxy function that calls the correspondent function in m_BoardSettings
* is a proxy function that calls the correspondent function in m_BoardSettings
* returns a bit-mask of all the element categories that are visible
* returns a bit-mask of all the element categories that are visible
* @return int - the visible element categories in bit-mapped form.
* @return int - the visible element bitmap or-ed from enum PCB_VISIBLE
* @see enum PCB_VISIBLE
*/
*/
int
GetVisibleElements
()
const
;
int
GetVisibleElements
()
const
;
...
@@ -295,10 +296,20 @@ public:
...
@@ -295,10 +296,20 @@ public:
* Function SetVisibleElements
* Function SetVisibleElements
* is a proxy function that calls the correspondent function in m_BoardSettings
* is a proxy function that calls the correspondent function in m_BoardSettings
* changes the bit-mask of visible element categories
* changes the bit-mask of visible element categories
* @param aMask = The new bit-mask of visible element categories
* @param aMask = The new bit-mask of visible element bitmap or-ed from enum PCB_VISIBLE
* @see enum PCB_VISIBLE
*/
*/
void
SetVisibleElements
(
int
aMask
);
void
SetVisibleElements
(
int
aMask
);
/**
* Function GetVisibleElementColor
* returns the color of a pcb visible element.
* @see enum PCB_VISIBLE
*/
int
GetVisibleElementColor
(
int
aPCB_VISIBLE
);
void
SetVisibleElementColor
(
int
aPCB_VISIBLE
,
int
aColor
);
/**
/**
* Function GetLayerName
* Function GetLayerName
* returns the name of the layer given by aLayerIndex.
* returns the name of the layer given by aLayerIndex.
...
@@ -345,8 +356,13 @@ public:
...
@@ -345,8 +356,13 @@ public:
*/
*/
void
SetLayerColor
(
int
aLayer
,
int
aColor
);
void
SetLayerColor
(
int
aLayer
,
int
aColor
);
/**
* Function GetLayerColor
* gets a layer color for any valid layer, including non-copper ones.
*/
int
GetLayerColor
(
int
aLayer
);
int
GetLayerColor
(
int
aLayer
);
/* Functions to get some items count */
/* Functions to get some items count */
int
GetNumSegmTrack
();
int
GetNumSegmTrack
();
int
GetNumSegmZone
();
int
GetNumSegmZone
();
...
...
pcbnew/class_board_design_settings.cpp
View file @
920186dd
...
@@ -104,7 +104,7 @@ void EDA_BoardDesignSettings::SetLayerVisibility( int aLayerIndex, bool aNewStat
...
@@ -104,7 +104,7 @@ void EDA_BoardDesignSettings::SetLayerVisibility( int aLayerIndex, bool aNewStat
void
EDA_BoardDesignSettings
::
SetElementVisibility
(
int
aElementCategory
,
bool
aNewState
)
void
EDA_BoardDesignSettings
::
SetElementVisibility
(
int
aElementCategory
,
bool
aNewState
)
{
{
if
(
aElementCategory
<
0
||
aElementCategory
>
PAD_CMP
_VISIBLE
)
if
(
aElementCategory
<
0
||
aElementCategory
>
=
END
_VISIBLE
)
return
;
return
;
if
(
aNewState
)
if
(
aNewState
)
m_VisibleElements
|=
1
<<
aElementCategory
;
m_VisibleElements
|=
1
<<
aElementCategory
;
...
...
pcbnew/class_text_mod.cpp
View file @
920186dd
...
@@ -378,20 +378,20 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
...
@@ -378,20 +378,20 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
if
(
Module
->
GetLayer
()
==
LAYER_N_BACK
)
if
(
Module
->
GetLayer
()
==
LAYER_N_BACK
)
{
{
if
(
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_CU
_VISIBLE
)
==
false
)
if
(
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_BK
_VISIBLE
)
==
false
)
return
;
return
;
color
=
g_ModuleTextCUColor
;
color
=
g_ModuleTextCUColor
;
}
}
else
if
(
Module
->
GetLayer
()
==
LAYER_N_FRONT
)
else
if
(
Module
->
GetLayer
()
==
LAYER_N_FRONT
)
{
{
if
(
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_CMP
_VISIBLE
)
==
false
)
if
(
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_FR
_VISIBLE
)
==
false
)
return
;
return
;
color
=
g_ModuleTextCMPColor
;
color
=
g_ModuleTextCMPColor
;
}
}
if
(
m_NoShow
)
if
(
m_NoShow
)
{
{
if
(
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_NOV_
VISIBLE
)
==
false
)
if
(
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_IN
VISIBLE
)
==
false
)
return
;
return
;
color
=
g_ModuleTextNOVColor
;
color
=
g_ModuleTextNOVColor
;
}
}
...
...
pcbnew/class_track.cpp
View file @
920186dd
...
@@ -725,7 +725,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
...
@@ -725,7 +725,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
color
=
g_DesignSettings
.
m_ViaColor
[
m_Shape
];
color
=
g_DesignSettings
.
m_ViaColor
[
m_Shape
];
if
(
g_DesignSettings
.
IsElementVisible
(
VIAS_VISIBLE
+
m_Shape
)
==
false
if
(
g_DesignSettings
.
IsElementVisible
(
PCB_VISIBLE
(
VIAS_VISIBLE
+
m_Shape
)
)
==
false
&&
(
color
&
HIGHT_LIGHT_FLAG
)
!=
HIGHT_LIGHT_FLAG
)
&&
(
color
&
HIGHT_LIGHT_FLAG
)
!=
HIGHT_LIGHT_FLAG
)
return
;
return
;
...
...
pcbnew/dialog_general_options.cpp
View file @
920186dd
...
@@ -250,7 +250,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
...
@@ -250,7 +250,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
break
;
break
;
case
ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE
:
case
ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE
:
g_DesignSettings
.
SetElementVisibility
(
MOD
ULE_TEXT_NOV_
VISIBLE
,
g_DesignSettings
.
SetElementVisibility
(
MOD
_TEXT_IN
VISIBLE
,
m_OptionsToolBar
->
GetToolState
(
id
)
);
m_OptionsToolBar
->
GetToolState
(
id
)
);
DrawPanel
->
Refresh
();
DrawPanel
->
Refresh
();
break
;
break
;
...
...
pcbnew/dialog_layers_setup.cpp
View file @
920186dd
...
@@ -547,6 +547,7 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
...
@@ -547,6 +547,7 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
m_Parent
->
GetScreen
()
->
SetModify
();
m_Parent
->
GetScreen
()
->
SetModify
();
m_Parent
->
ReCreateLayerBox
(
NULL
);
m_Parent
->
ReCreateLayerBox
(
NULL
);
m_Parent
->
ReFillLayerWidget
();
EndModal
(
wxID_OK
);
EndModal
(
wxID_OK
);
}
}
...
...
pcbnew/layer_panel_base.cpp
View file @
920186dd
...
@@ -19,7 +19,7 @@ LAYER_PANEL_BASE::LAYER_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoi
...
@@ -19,7 +19,7 @@ LAYER_PANEL_BASE::LAYER_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoi
wxBoxSizer
*
bSizer3
;
wxBoxSizer
*
bSizer3
;
bSizer3
=
new
wxBoxSizer
(
wxVERTICAL
);
bSizer3
=
new
wxBoxSizer
(
wxVERTICAL
);
m_LayerScrolledWindow
=
new
wxScrolledWindow
(
m_LayerPanel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxNO_BORDER
|
wxVSCROLL
);
m_LayerScrolledWindow
=
new
wxScrolledWindow
(
m_LayerPanel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxNO_BORDER
);
m_LayerScrolledWindow
->
SetScrollRate
(
5
,
5
);
m_LayerScrolledWindow
->
SetScrollRate
(
5
,
5
);
m_LayersFlexGridSizer
=
new
wxFlexGridSizer
(
0
,
4
,
1
,
3
);
m_LayersFlexGridSizer
=
new
wxFlexGridSizer
(
0
,
4
,
1
,
3
);
m_LayersFlexGridSizer
->
SetFlexibleDirection
(
wxHORIZONTAL
);
m_LayersFlexGridSizer
->
SetFlexibleDirection
(
wxHORIZONTAL
);
...
@@ -38,7 +38,7 @@ LAYER_PANEL_BASE::LAYER_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoi
...
@@ -38,7 +38,7 @@ LAYER_PANEL_BASE::LAYER_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoi
wxBoxSizer
*
bSizer4
;
wxBoxSizer
*
bSizer4
;
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
m_RenderScrolledWindow
=
new
wxScrolledWindow
(
m_RenderingPanel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxNO_BORDER
|
wxVSCROLL
);
m_RenderScrolledWindow
=
new
wxScrolledWindow
(
m_RenderingPanel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxNO_BORDER
);
m_RenderScrolledWindow
->
SetScrollRate
(
5
,
5
);
m_RenderScrolledWindow
->
SetScrollRate
(
5
,
5
);
m_RenderFlexGridSizer
=
new
wxFlexGridSizer
(
0
,
2
,
1
,
3
);
m_RenderFlexGridSizer
=
new
wxFlexGridSizer
(
0
,
2
,
1
,
3
);
m_RenderFlexGridSizer
->
SetFlexibleDirection
(
wxHORIZONTAL
);
m_RenderFlexGridSizer
->
SetFlexibleDirection
(
wxHORIZONTAL
);
...
...
pcbnew/layer_widget.cpp
View file @
920186dd
...
@@ -210,6 +210,8 @@ void LAYER_WIDGET::OnLeftDownLayers( wxMouseEvent& event )
...
@@ -210,6 +210,8 @@ void LAYER_WIDGET::OnLeftDownLayers( wxMouseEvent& event )
if
(
OnLayerSelect
(
row
)
)
// if client allows this change.
if
(
OnLayerSelect
(
row
)
)
// if client allows this change.
SelectLayerRow
(
row
);
SelectLayerRow
(
row
);
passOnFocus
();
}
}
...
@@ -234,6 +236,8 @@ void LAYER_WIDGET::OnMiddleDownLayerColor( wxMouseEvent& event )
...
@@ -234,6 +236,8 @@ void LAYER_WIDGET::OnMiddleDownLayerColor( wxMouseEvent& event )
// tell the client code.
// tell the client code.
OnLayerColorChange
(
layer
,
newColor
);
OnLayerColorChange
(
layer
,
newColor
);
}
}
passOnFocus
();
}
}
...
@@ -250,6 +254,8 @@ void LAYER_WIDGET::OnRightDownLayers( wxMouseEvent& event )
...
@@ -250,6 +254,8 @@ void LAYER_WIDGET::OnRightDownLayers( wxMouseEvent& event )
_
(
"Hide All Cu"
)
)
);
_
(
"Hide All Cu"
)
)
);
PopupMenu
(
&
menu
);
PopupMenu
(
&
menu
);
passOnFocus
();
}
}
void
LAYER_WIDGET
::
OnPopupSelection
(
wxCommandEvent
&
event
)
void
LAYER_WIDGET
::
OnPopupSelection
(
wxCommandEvent
&
event
)
...
@@ -307,6 +313,7 @@ void LAYER_WIDGET::OnLayerCheckBox( wxCommandEvent& event )
...
@@ -307,6 +313,7 @@ void LAYER_WIDGET::OnLayerCheckBox( wxCommandEvent& event )
wxCheckBox
*
eventSource
=
(
wxCheckBox
*
)
event
.
GetEventObject
();
wxCheckBox
*
eventSource
=
(
wxCheckBox
*
)
event
.
GetEventObject
();
int
layer
=
getDecodedId
(
eventSource
->
GetId
()
);
int
layer
=
getDecodedId
(
eventSource
->
GetId
()
);
OnLayerVisible
(
layer
,
eventSource
->
IsChecked
()
);
OnLayerVisible
(
layer
,
eventSource
->
IsChecked
()
);
passOnFocus
();
}
}
...
@@ -331,6 +338,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
...
@@ -331,6 +338,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
// tell the client code.
// tell the client code.
OnRenderColorChange
(
id
,
newColor
);
OnRenderColorChange
(
id
,
newColor
);
}
}
passOnFocus
();
}
}
void
LAYER_WIDGET
::
OnRenderCheckBox
(
wxCommandEvent
&
event
)
void
LAYER_WIDGET
::
OnRenderCheckBox
(
wxCommandEvent
&
event
)
...
@@ -338,6 +346,7 @@ void LAYER_WIDGET::OnRenderCheckBox( wxCommandEvent& event )
...
@@ -338,6 +346,7 @@ void LAYER_WIDGET::OnRenderCheckBox( wxCommandEvent& event )
wxCheckBox
*
eventSource
=
(
wxCheckBox
*
)
event
.
GetEventObject
();
wxCheckBox
*
eventSource
=
(
wxCheckBox
*
)
event
.
GetEventObject
();
int
id
=
getDecodedId
(
eventSource
->
GetId
()
);
int
id
=
getDecodedId
(
eventSource
->
GetId
()
);
OnRenderEnable
(
id
,
eventSource
->
IsChecked
()
);
OnRenderEnable
(
id
,
eventSource
->
IsChecked
()
);
passOnFocus
();
}
}
...
@@ -437,6 +446,7 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
...
@@ -437,6 +446,7 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
col
=
1
;
col
=
1
;
wxCheckBox
*
cb
=
new
wxCheckBox
(
m_RenderScrolledWindow
,
encodeId
(
col
,
aSpec
.
id
),
wxCheckBox
*
cb
=
new
wxCheckBox
(
m_RenderScrolledWindow
,
encodeId
(
col
,
aSpec
.
id
),
aSpec
.
rowName
,
wxDefaultPosition
,
wxDefaultSize
,
wxALIGN_LEFT
);
aSpec
.
rowName
,
wxDefaultPosition
,
wxDefaultSize
,
wxALIGN_LEFT
);
cb
->
SetValue
(
aSpec
.
state
);
cb
->
Connect
(
wxEVT_COMMAND_CHECKBOX_CLICKED
,
cb
->
Connect
(
wxEVT_COMMAND_CHECKBOX_CLICKED
,
wxCommandEventHandler
(
LAYER_WIDGET
::
OnRenderCheckBox
),
NULL
,
this
);
wxCommandEventHandler
(
LAYER_WIDGET
::
OnRenderCheckBox
),
NULL
,
this
);
cb
->
SetToolTip
(
aSpec
.
tooltip
);
cb
->
SetToolTip
(
aSpec
.
tooltip
);
...
@@ -444,11 +454,22 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
...
@@ -444,11 +454,22 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
}
}
void
LAYER_WIDGET
::
passOnFocus
()
{
wxWindow
*
parent
=
GetParent
();
parent
->
SetFocus
();
// printf( "passOnFocus() %p %p\n", parent, m_OriginalParent );
}
//-----<public>-------------------------------------------------------
//-----<public>-------------------------------------------------------
LAYER_WIDGET
::
LAYER_WIDGET
(
wxWindow
*
parent
)
:
LAYER_WIDGET
::
LAYER_WIDGET
(
wxWindow
*
parent
)
:
LAYER_PANEL_BASE
(
parent
)
LAYER_PANEL_BASE
(
parent
)
{
{
m_OriginalParent
=
parent
;
m_CurrentRow
=
-
1
;
m_CurrentRow
=
-
1
;
m_RightArrowBitmap
=
new
wxBitmap
(
rightarrow_xpm
);
m_RightArrowBitmap
=
new
wxBitmap
(
rightarrow_xpm
);
...
@@ -601,18 +622,16 @@ void LAYER_WIDGET::SelectLayerRow( int aRow )
...
@@ -601,18 +622,16 @@ void LAYER_WIDGET::SelectLayerRow( int aRow )
{
{
newbm
->
SetBitmap
(
*
m_RightArrowBitmap
);
newbm
->
SetBitmap
(
*
m_RightArrowBitmap
);
// Change the focus to the wxBitmapButton in column 1 for this row.
// We really do not need or want the focus, but because we get focus
// and it changes the appearance of these wxBitmapButtons, if any focused
// button is going to look different, we want it to be the current
// row.
getLayerComp
(
newNdx
+
1
/* 1 is column */
)
->
SetFocus
();
// Make sure the desired layer row is visible.
// Make sure the desired layer row is visible.
// It seems that as of 2.8.2, setting the focus
// It seems that as of 2.8.2, setting the focus does this.
// does this and generally I don't expect the scrolling to be needed at all because
// I don't expect the scrolling to be needed at all because
// the minimum window size may end up being established by the number of layers.
// the minimum window size may end up being established so that the
// scroll bars will not be visible.
getLayerComp
(
newNdx
+
1
/* 1 is column */
)
->
SetFocus
();
}
}
// give the focus back to the app.
passOnFocus
();
}
}
...
@@ -649,6 +668,7 @@ void LAYER_WIDGET::UpdateLayouts()
...
@@ -649,6 +668,7 @@ void LAYER_WIDGET::UpdateLayouts()
{
{
m_LayersFlexGridSizer
->
Layout
();
m_LayersFlexGridSizer
->
Layout
();
m_RenderFlexGridSizer
->
Layout
();
m_RenderFlexGridSizer
->
Layout
();
FitInside
();
}
}
#if defined(STAND_ALONE)
#if defined(STAND_ALONE)
...
...
pcbnew/layer_widget.h
View file @
920186dd
...
@@ -74,6 +74,7 @@ public:
...
@@ -74,6 +74,7 @@ public:
protected
:
protected
:
wxWindow
*
m_OriginalParent
;
wxBitmap
*
m_BlankBitmap
;
wxBitmap
*
m_BlankBitmap
;
wxBitmap
*
m_RightArrowBitmap
;
wxBitmap
*
m_RightArrowBitmap
;
wxSize
m_BitmapSize
;
wxSize
m_BitmapSize
;
...
@@ -139,6 +140,12 @@ protected:
...
@@ -139,6 +140,12 @@ protected:
void
insertRenderRow
(
int
aRow
,
const
ROW
&
aSpec
);
void
insertRenderRow
(
int
aRow
,
const
ROW
&
aSpec
);
/**
* Function passOnFocus
* gives away the keyboard focus up to the main parent window.
*/
void
passOnFocus
();
public
:
public
:
/** Constructor */
/** Constructor */
...
@@ -241,6 +248,22 @@ public:
...
@@ -241,6 +248,22 @@ public:
void
UpdateLayouts
();
void
UpdateLayouts
();
/* did not help:
void Freeze()
{
LAYER_PANEL_BASE::Freeze();
m_LayerScrolledWindow->Freeze();
m_RenderScrolledWindow->Freeze();
}
void Thaw()
{
m_RenderScrolledWindow->Thaw();
m_LayerScrolledWindow->Thaw();
LAYER_PANEL_BASE::Thaw();
}
*/
//-----<abstract functions>-------------------------------------------
//-----<abstract functions>-------------------------------------------
/**
/**
...
...
pcbnew/panel_layer_select.fbp
View file @
920186dd
...
@@ -190,7 +190,7 @@
...
@@ -190,7 +190,7 @@
<property
name=
"tooltip"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
>
wxNO_BORDER
|wxVSCROLL
</property>
<property
name=
"window_style"
>
wxNO_BORDER
</property>
<event
name=
"OnChar"
></event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnEraseBackground"
></event>
...
@@ -307,7 +307,7 @@
...
@@ -307,7 +307,7 @@
<property
name=
"tooltip"
></property>
<property
name=
"tooltip"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
>
wxNO_BORDER
|wxVSCROLL
</property>
<property
name=
"window_style"
>
wxNO_BORDER
</property>
<event
name=
"OnChar"
></event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnEraseBackground"
></event>
...
...
pcbnew/pcbframe.cpp
View file @
920186dd
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include "confirm.h"
#include "confirm.h"
#include "pcbnew.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "wxPcbStruct.h"
#include "pcbstruct.h" // enum PCB_VISIBLE
#include "collectors.h"
#include "collectors.h"
#include "bitmaps.h"
#include "bitmaps.h"
#include "protos.h"
#include "protos.h"
...
@@ -210,24 +211,6 @@ END_EVENT_TABLE()
...
@@ -210,24 +211,6 @@ END_EVENT_TABLE()
///////****************************///////////:
///////****************************///////////:
// the fixed "Rendering" tab rows within the LAYER_WIDGET:
LAYER_WIDGET
::
ROW
WinEDA_PcbFrame
::
renderRows
[]
=
{
// text id color tooltip checked
LAYER_WIDGET
::
ROW
(
_
(
"Through Via"
),
0
,
LIGHTBLUE
,
_
(
"Show through vias"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Blind/Buried Via"
),
1
,
YELLOW
,
_
(
"Show blind or buried vias"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Micro Via"
),
2
,
BROWN
,
_
(
"Show micro vias"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Ratsnets"
),
3
,
BLUE
,
_
(
"Show the ratsnest"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Mod Text Back"
),
4
,
WHITE
,
_
(
"Show footprint text residing on board's back"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Mod Text Front"
),
5
,
WHITE
,
_
(
"Show footprint text residing on board's front"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Mod Text Hide"
),
6
,
WHITE
,
_
(
"TBD"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Anchors"
),
7
,
WHITE
,
_
(
"TBD"
)
),
// LAYER_WIDGET::ROW( _( "Grid" ), 8, WHITE, _("Show grid") ),
LAYER_WIDGET
::
ROW
(
_
(
"Not Connecteds"
),
9
,
-
1
,
_
(
"TBD"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Modules Front"
),
10
,
-
1
,
_
(
"TBD"
)
),
LAYER_WIDGET
::
ROW
(
_
(
"Modules Back"
),
11
,
-
1
,
_
(
"TBD"
)
),
};
WinEDA_PcbFrame
::
WinEDA_PcbFrame
(
wxWindow
*
father
,
WinEDA_PcbFrame
::
WinEDA_PcbFrame
(
wxWindow
*
father
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
...
@@ -246,9 +229,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
...
@@ -246,9 +229,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
m_show_layer_manager_tools
=
true
;
m_show_layer_manager_tools
=
true
;
m_Layers
=
new
LYRS
(
this
);
m_Layers
=
new
LYRS
(
this
);
m_Layers
->
AppendRenderRows
(
renderRows
,
DIM
(
renderRows
)
);
SetBoard
(
new
BOARD
(
NULL
,
this
)
);
SetBoard
(
new
BOARD
(
NULL
,
this
)
);
m_TrackAndViasSizesList_Changed
=
true
;
m_TrackAndViasSizesList_Changed
=
true
;
m_drc
=
new
DRC
(
this
);
// these 2 objects point to each other
m_drc
=
new
DRC
(
this
);
// these 2 objects point to each other
...
@@ -282,6 +265,47 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
...
@@ -282,6 +265,47 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
ReCreateAuxVToolbar
();
ReCreateAuxVToolbar
();
// Fixed "Rendering" tab rows within the LAYER_WIDGET, only the initial color
// is changed before appending to the LAYER_WIDGET. This is an automatic variable
// not a static variable, change the color & state after copying from code to renderRows
// on the stack.
LAYER_WIDGET
::
ROW
renderRows
[
14
]
=
{
#define RR LAYER_WIDGET::ROW // Render Row abreviation to reduce source width
// text id color tooltip checked
RR
(
_
(
"Through Via"
),
VIAS_VISIBLE
,
WHITE
,
_
(
"Show through vias"
)
),
RR
(
_
(
"Bl/Buried Via"
),
VIA_MICROVIA_VISIBLE
,
WHITE
,
_
(
"Show blind or buried vias"
)
),
RR
(
_
(
"Micro Via"
),
VIA_BBLIND_VISIBLE
,
WHITE
,
_
(
"Show micro vias"
)
),
RR
(
_
(
"Ratsnest"
),
RATSNEST_VISIBLE
,
WHITE
,
_
(
"Show unconnected nets as a ratsnest"
)
),
RR
(
_
(
"Pads Front"
),
PAD_FR_VISIBLE
,
WHITE
,
_
(
"Show footprint pads on board's front"
)
),
RR
(
_
(
"Pads Back"
),
PAD_BK_VISIBLE
,
WHITE
,
_
(
"Show footprint pads on board's back"
)
),
RR
(
_
(
"Text Front"
),
MOD_TEXT_FR_VISIBLE
,
WHITE
,
_
(
"Show footprint text on board's back"
)
),
RR
(
_
(
"Text Back"
),
MOD_TEXT_BK_VISIBLE
,
WHITE
,
_
(
"Show footprint text on board's back"
)
),
RR
(
_
(
"Hidden Text"
),
MOD_TEXT_INVISIBLE
,
WHITE
,
_
(
"Show footprint text marked as invisible"
)
),
RR
(
_
(
"Anchors"
),
ANCHOR_VISIBLE
,
WHITE
,
_
(
"Show footprint and text origins as a cross"
)
),
RR
(
_
(
"Grid"
),
GRID_VISIBLE
,
WHITE
,
_
(
"Show the (x,y) grid dots"
)
),
RR
(
_
(
"No-Connects"
),
NO_CONNECTS_VISIBLE
,
-
1
,
_
(
"Show a marker on pads which have no net connected"
)
),
RR
(
_
(
"Modules Front"
),
MOD_FR_VISIBLE
,
-
1
,
_
(
"Show footprints that are on board's front"
)
),
RR
(
_
(
"Modules Back"
),
MOD_BK_VISIBLE
,
-
1
,
_
(
"Show footprints that are on board's back"
)
),
};
for
(
unsigned
row
=
0
;
row
<
DIM
(
renderRows
);
++
row
)
{
if
(
renderRows
[
row
].
color
!=
-
1
)
// does this row show a color?
{
// this window frame must have an established BOARD, i.e. after SetBoard()
renderRows
[
row
].
color
=
GetBoard
()
->
GetVisibleElementColor
(
renderRows
[
row
].
id
);
}
// @todo
// renderRows[row].state = GetBoard()->IsElementVisible( renderRows[row].id );
}
m_Layers
->
AppendRenderRows
(
renderRows
,
DIM
(
renderRows
)
);
#if defined(KICAD_AUIMANAGER)
#if defined(KICAD_AUIMANAGER)
m_auimgr
.
SetManagedWindow
(
this
);
m_auimgr
.
SetManagedWindow
(
this
);
...
@@ -395,19 +419,64 @@ void WinEDA_PcbFrame::LYRS::OnLayerVisible( int aLayer, bool isVisible, bool isF
...
@@ -395,19 +419,64 @@ void WinEDA_PcbFrame::LYRS::OnLayerVisible( int aLayer, bool isVisible, bool isF
void
WinEDA_PcbFrame
::
LYRS
::
OnRenderColorChange
(
int
aId
,
int
aColor
)
void
WinEDA_PcbFrame
::
LYRS
::
OnRenderColorChange
(
int
aId
,
int
aColor
)
{
{
// @todo
myframe
->
GetBoard
()
->
SetVisibleElementColor
(
aId
,
aColor
);
//myframe->GetBoard()->SetLayerColor( aId, aColor );
myframe
->
DrawPanel
->
Refresh
();
//myframe->DrawPanel->Refresh();
}
}
void
WinEDA_PcbFrame
::
LYRS
::
OnRenderEnable
(
int
aId
,
bool
isEnabled
)
void
WinEDA_PcbFrame
::
LYRS
::
OnRenderEnable
(
int
aId
,
bool
isEnabled
)
{
{
// @todo
BOARD
*
brd
=
myframe
->
GetBoard
();
// mframe->GetBoard()->Set
/* @todo:
1) move:
RATSNEST_VISIBLE,
GRID_VISIBLE, ? maybe not this one
NO_CONNECTS_VISIBLE,
MOD_FR_VISIBLE,
MOD_BK_VISIBLE,
into m_VisibleElements and get rid of globals.
2) Add IsElementVisible() & SetVisibleElement() to class BOARD
*/
switch
(
aId
)
{
// see todo above, don't really want anything except IsElementVisible() here.
case
GRID_VISIBLE
:
myframe
->
m_Draw_Grid
=
isEnabled
;
break
;
case
MOD_FR_VISIBLE
:
DisplayOpt
.
Show_Modules_Cmp
=
isEnabled
;
break
;
case
MOD_BK_VISIBLE
:
DisplayOpt
.
Show_Modules_Cu
=
isEnabled
;
break
;
default
:
int
visibleElements
=
brd
->
GetVisibleElements
();
if
(
isEnabled
)
visibleElements
|=
(
1
<<
aId
);
else
visibleElements
&=
~
(
1
<<
aId
);
brd
->
SetVisibleElements
(
visibleElements
);
}
myframe
->
DrawPanel
->
Refresh
();
}
}
//-----</LAYER_WIDGET callbacks>------------------------------------------
//-----</LAYER_WIDGET callbacks>------------------------------------------
void
WinEDA_PcbFrame
::
ReFillLayerWidget
()
void
WinEDA_PcbFrame
::
ReFillLayerWidget
()
{
{
BOARD
*
brd
=
GetBoard
();
BOARD
*
brd
=
GetBoard
();
...
@@ -415,7 +484,7 @@ void WinEDA_PcbFrame::ReFillLayerWidget()
...
@@ -415,7 +484,7 @@ void WinEDA_PcbFrame::ReFillLayerWidget()
int
enabledLayers
=
brd
->
GetEnabledLayers
();
int
enabledLayers
=
brd
->
GetEnabledLayers
();
m_Layers
->
Freeze
();
// no screen updates until done modifying
//
m_Layers->Freeze(); // no screen updates until done modifying
m_Layers
->
ClearLayerRows
();
m_Layers
->
ClearLayerRows
();
...
@@ -446,7 +515,52 @@ void WinEDA_PcbFrame::ReFillLayerWidget()
...
@@ -446,7 +515,52 @@ void WinEDA_PcbFrame::ReFillLayerWidget()
m_Layers
->
SelectLayer
(
LAYER_N_FRONT
);
m_Layers
->
SelectLayer
(
LAYER_N_FRONT
);
m_Layers
->
Thaw
();
// technical layers are shown in this order:
static
const
struct
{
int
layerId
;
wxString
tooltip
;
}
techLayerSeq
[]
=
{
{
ADHESIVE_N_FRONT
,
_
(
"Adhesive on board's front"
)
},
{
ADHESIVE_N_BACK
,
_
(
"Adhesive on board's back"
)
},
{
SOLDERPASTE_N_FRONT
,
_
(
"Solder paste on board's front"
)
},
{
SOLDERPASTE_N_BACK
,
_
(
"Solder paste on board's back"
)
},
{
SILKSCREEN_N_FRONT
,
_
(
"Silkscreen on board's front"
)
},
{
SILKSCREEN_N_BACK
,
_
(
"Silkscreen on board's back"
)
},
{
SOLDERMASK_N_FRONT
,
_
(
"Solder mask on board's front"
)
},
{
SOLDERMASK_N_BACK
,
_
(
"Solder mask on board's back"
)
},
{
DRAW_N
,
_
(
"Explanatory drawings"
)
},
{
COMMENT_N
,
_
(
"Explanatory comments"
)
},
{
ECO1_N
,
_
(
"TDB"
)
},
{
ECO2_N
,
_
(
"TBD"
)
},
{
EDGE_N
,
_
(
"Board's perimeter definition"
)
},
};
for
(
unsigned
i
=
0
;
i
<
DIM
(
techLayerSeq
);
++
i
)
{
layer
=
techLayerSeq
[
i
].
layerId
;
if
(
!
(
enabledLayers
&
(
1
<<
layer
))
)
continue
;
m_Layers
->
AppendLayerRow
(
LAYER_WIDGET
::
ROW
(
brd
->
GetLayerName
(
layer
),
layer
,
brd
->
GetLayerColor
(
layer
),
techLayerSeq
[
i
].
tooltip
,
true
)
);
}
// m_Layers->Thaw();
wxAuiPaneInfo
&
lyrs
=
m_auimgr
.
GetPane
(
m_Layers
);
wxSize
bestz
=
m_Layers
->
GetBestSize
();
lyrs
.
MinSize
(
bestz
);
lyrs
.
BestSize
(
bestz
);
lyrs
.
FloatingSize
(
bestz
);
if
(
lyrs
.
IsDocked
()
)
m_auimgr
.
Update
();
else
m_Layers
->
SetSize
(
bestz
);
}
}
...
@@ -522,6 +636,7 @@ void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event )
...
@@ -522,6 +636,7 @@ void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event )
if
(
returncode
==
wxID_OK
)
// New rules, or others changes.
if
(
returncode
==
wxID_OK
)
// New rules, or others changes.
{
{
ReCreateLayerBox
(
NULL
);
ReCreateLayerBox
(
NULL
);
// ReFillLayerWidget(); why?
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
}
}
}
}
...
...
pcbnew/pcbnew_config.cpp
View file @
920186dd
...
@@ -189,13 +189,13 @@ bool WinEDA_PcbFrame::Read_Config( const wxString& projectFileName )
...
@@ -189,13 +189,13 @@ bool WinEDA_PcbFrame::Read_Config( const wxString& projectFileName )
DisplayOpt
.
Show_Modules_Cmp
=
true
;
DisplayOpt
.
Show_Modules_Cmp
=
true
;
DisplayOpt
.
Show_Modules_Cu
=
true
;
DisplayOpt
.
Show_Modules_Cu
=
true
;
g_DesignSettings
.
SetElementVisibility
(
MOD
ULE_TEXT_NOV_
VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
MOD
_TEXT_IN
VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
MOD
ULE_TEXT_CMP
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
MOD
_TEXT_FR
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
MOD
ULE_TEXT_CU
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
MOD
_TEXT_BK
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
PAD_
CMP
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
PAD_
BK
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
PAD_
CU
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
PAD_
BK
_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
VIA_THROUGH_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
VIA_THROUGH_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
VIA_B
LIND_BURIE
D_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
VIA_B
BLIN
D_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
VIA_MICROVIA_VISIBLE
,
true
);
g_DesignSettings
.
SetElementVisibility
(
VIA_MICROVIA_VISIBLE
,
true
);
// Items that can remain not visible: comment them if you want.
// Items that can remain not visible: comment them if you want.
...
...
pcbnew/set_color.h
View file @
920186dd
...
@@ -373,7 +373,7 @@ static ColorButton Pad_Cu_Butt =
...
@@ -373,7 +373,7 @@ static ColorButton Pad_Cu_Butt =
{
{
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
_
(
"Pad Back"
),
// Title
_
(
"Pad Back"
),
// Title
PAD_
CU
_VISIBLE
,
PAD_
BK
_VISIBLE
,
&
g_PadCUColor
// Address of optional parameter
&
g_PadCUColor
// Address of optional parameter
};
};
...
@@ -381,7 +381,7 @@ static ColorButton Pad_Cmp_Butt =
...
@@ -381,7 +381,7 @@ static ColorButton Pad_Cmp_Butt =
{
{
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
_
(
"Pad Front"
),
// Title
_
(
"Pad Front"
),
// Title
PAD_
CMP
_VISIBLE
,
PAD_
FR
_VISIBLE
,
&
g_PadCMPColor
// Address of optional parameter
&
g_PadCMPColor
// Address of optional parameter
};
};
...
@@ -389,7 +389,7 @@ static ColorButton Text_Mod_Cu_Butt =
...
@@ -389,7 +389,7 @@ static ColorButton Text_Mod_Cu_Butt =
{
{
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
_
(
"Text Module Back"
),
// Title
_
(
"Text Module Back"
),
// Title
MOD
ULE_TEXT_CU
_VISIBLE
,
MOD
_TEXT_BK
_VISIBLE
,
&
g_ModuleTextCUColor
// Address of optional parameter
&
g_ModuleTextCUColor
// Address of optional parameter
};
};
...
@@ -397,7 +397,7 @@ static ColorButton Text_Mod_Cmp_Butt =
...
@@ -397,7 +397,7 @@ static ColorButton Text_Mod_Cmp_Butt =
{
{
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
_
(
"Text Module Front"
),
// Title
_
(
"Text Module Front"
),
// Title
MOD
ULE_TEXT_CMP
_VISIBLE
,
MOD
_TEXT_FR
_VISIBLE
,
&
g_ModuleTextCMPColor
// Address of optional parameter
&
g_ModuleTextCMPColor
// Address of optional parameter
};
};
...
@@ -405,13 +405,13 @@ static ColorButton Text_Mod_NoVisible_Butt =
...
@@ -405,13 +405,13 @@ static ColorButton Text_Mod_NoVisible_Butt =
{
{
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
_
(
"Text Module invisible"
),
// Title
_
(
"Text Module invisible"
),
// Title
MOD
ULE_TEXT_NOV_
VISIBLE
,
MOD
_TEXT_IN
VISIBLE
,
&
g_ModuleTextNOVColor
// Address of optional parameter
&
g_ModuleTextNOVColor
// Address of optional parameter
};
};
static
ColorButton
Anchors_Butt
=
static
ColorButton
Anchors_Butt
=
{
{
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
type_element
,
// Toggle ITEM_NOT_SHOW bit of the color variable
g_ModuleTextNOVColor
_
(
"Anchors"
),
// Title
_
(
"Anchors"
),
// Title
ANCHOR_VISIBLE
,
ANCHOR_VISIBLE
,
&
g_AnchorColor
// Address of optional parameter
&
g_AnchorColor
// Address of optional parameter
...
...
pcbnew/tool_pcb.cpp
View file @
920186dd
This diff is collapsed.
Click to expand it.
pcbnew/toolbars_update_user_interface.cpp
View file @
920186dd
...
@@ -267,9 +267,9 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -267,9 +267,9 @@ void WinEDA_PcbFrame::SetToolbars()
_
(
"High contrast display mode"
)
);
_
(
"High contrast display mode"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE
,
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_NOV_
VISIBLE
)
);
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_IN
VISIBLE
)
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE
,
g_DesignSettings
.
IsElementVisible
(
MOD
ULE_TEXT_NOV_
VISIBLE
)
?
g_DesignSettings
.
IsElementVisible
(
MOD
_TEXT_IN
VISIBLE
)
?
_
(
"Hide invisible text"
)
:
_
(
"Hide invisible text"
)
:
_
(
"Show invisible text"
)
);
_
(
"Show invisible text"
)
);
...
...
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