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
ede208f3
Commit
ede208f3
authored
Sep 03, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: use pcb layer box selector in dialog graphic item properties and pcb text properties.
parent
b7b972d8
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
101 additions
and
101 deletions
+101
-101
class_layer_box_selector.cpp
common/class_layer_box_selector.cpp
+3
-0
dialog_dimension_editor_base.fbp
pcbnew/dialogs/dialog_dimension_editor_base.fbp
+2
-2
dialog_dimension_editor_base.h
pcbnew/dialogs/dialog_dimension_editor_base.h
+2
-2
dialog_graphic_item_properties.cpp
pcbnew/dialogs/dialog_graphic_item_properties.cpp
+13
-15
dialog_graphic_item_properties_base.cpp
pcbnew/dialogs/dialog_graphic_item_properties_base.cpp
+12
-7
dialog_graphic_item_properties_base.fbp
pcbnew/dialogs/dialog_graphic_item_properties_base.fbp
+10
-7
dialog_graphic_item_properties_base.h
pcbnew/dialogs/dialog_graphic_item_properties_base.h
+6
-3
dialog_graphic_item_properties_for_Modedit.cpp
...ew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp
+12
-29
dialog_pcb_text_properties.cpp
pcbnew/dialogs/dialog_pcb_text_properties.cpp
+9
-16
dialog_pcb_text_properties_base.cpp
pcbnew/dialogs/dialog_pcb_text_properties_base.cpp
+13
-8
dialog_pcb_text_properties_base.fbp
pcbnew/dialogs/dialog_pcb_text_properties_base.fbp
+12
-9
dialog_pcb_text_properties_base.h
pcbnew/dialogs/dialog_pcb_text_properties_base.h
+7
-3
No files found.
common/class_layer_box_selector.cpp
View file @
ede208f3
...
...
@@ -84,6 +84,9 @@ int LAYER_BOX_SELECTOR::GetChoice()
// Get Current Layer
LAYER_NUM
LAYER_BOX_SELECTOR
::
GetLayerSelection
()
const
{
if
(
GetSelection
()
<
0
)
return
UNDEFINED_LAYER
;
return
(
LAYER_NUM
)(
intptr_t
)
GetClientData
(
GetSelection
()
);
}
...
...
pcbnew/dialogs/dialog_dimension_editor_base.fbp
View file @
ede208f3
...
...
@@ -42,7 +42,7 @@
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
DIALOG_DIMENSION_EDITOR_BASE
</property>
<property
name=
"pos"
></property>
<property
name=
"size"
>
378
,328
</property>
<property
name=
"size"
>
417
,328
</property>
<property
name=
"style"
>
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
</property>
<property
name=
"subclass"
>
DIALOG_SHIM; dialog_shim.h
</property>
<property
name=
"title"
>
Dimension Properties
</property>
...
...
@@ -1341,7 +1341,7 @@
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wxBOTTOM|wxRIGHT|wxLEFT
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wxComboBox"
expanded=
"1"
>
<object
class=
"wx
Bitmap
ComboBox"
expanded=
"1"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
...
...
pcbnew/dialogs/dialog_dimension_editor_base.h
View file @
ede208f3
...
...
@@ -24,7 +24,7 @@ class PCB_LAYER_BOX_SELECTOR;
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/
combo
box.h>
#include <wx/
bmpc
box.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
...
...
@@ -67,7 +67,7 @@ class DIALOG_DIMENSION_EDITOR_BASE : public DIALOG_SHIM
public
:
DIALOG_DIMENSION_EDITOR_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Dimension Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
378
,
328
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
DIALOG_DIMENSION_EDITOR_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Dimension Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
417
,
328
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_DIMENSION_EDITOR_BASE
();
};
...
...
pcbnew/dialogs/dialog_graphic_item_properties.cpp
View file @
ede208f3
...
...
@@ -24,6 +24,7 @@
#include <class_drawsegment.h>
#include <dialog_graphic_item_properties_base.h>
#include <class_pcb_layer_box_selector.h>
class
DIALOG_GRAPHIC_ITEM_PROPERTIES
:
public
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE
{
...
...
@@ -159,20 +160,17 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::initDlg( )
PutValueInLocalUnits
(
*
m_DefaultThicknessCtrl
,
thickness
);
for
(
LAYER_NUM
layer
=
FIRST_NON_COPPER_LAYER
;
layer
<=
LAST_NON_COPPER_LAYER
;
++
layer
)
// Configure the layers list selector
m_LayerSelectionCtrl
->
SetLayersHotkeys
(
false
);
m_LayerSelectionCtrl
->
SetLayerMask
(
ALL_CU_LAYERS
);
m_LayerSelectionCtrl
->
SetBoardFrame
(
m_parent
);
m_LayerSelectionCtrl
->
Resync
();
if
(
m_LayerSelectionCtrl
->
SetLayerSelection
(
m_Item
->
GetLayer
()
)
<
0
)
{
m_LayerSelectionCtrl
->
Append
(
m_parent
->
GetBoard
()
->
GetLayerName
(
layer
)
);
wxMessageBox
(
_
(
"This item has an illegal layer id.
\n
"
"Now, forced on the drawings layer. Please, fix it"
)
);
m_LayerSelectionCtrl
->
SetLayerSelection
(
DRAW_N
);
}
LAYER_NUM
layer
=
m_Item
->
GetLayer
();
// It has to be an aux layer
if
(
layer
<
FIRST_NON_COPPER_LAYER
)
layer
=
FIRST_NON_COPPER_LAYER
;
if
(
layer
>
LAST_NON_COPPER_LAYER
)
layer
=
LAST_NON_COPPER_LAYER
;
m_LayerSelectionCtrl
->
SetSelection
(
layer
-
FIRST_NON_COPPER_LAYER
);
}
...
...
@@ -182,7 +180,7 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::OnLayerChoice( wxCommandEvent& event )
{
int
thickness
;
if
(
(
m_LayerSelectionCtrl
->
GetCurrentSelection
()
+
FIRST_NON_COPPER_LAYER
)
==
EDGE_N
)
if
(
m_LayerSelectionCtrl
->
GetLayerSelection
(
)
==
EDGE_N
)
thickness
=
m_brdSettings
.
m_EdgeSegmentWidth
;
else
thickness
=
m_brdSettings
.
m_DrawSegmentWidth
;
...
...
@@ -221,7 +219,7 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event )
msg
=
m_DefaultThicknessCtrl
->
GetValue
();
int
thickness
=
ReturnValueFromString
(
g_UserUnit
,
msg
);
m_Item
->
SetLayer
(
FIRST_NON_COPPER_LAYER
+
m_LayerSelectionCtrl
->
GetCurrent
Selection
()
);
m_Item
->
SetLayer
(
m_LayerSelectionCtrl
->
GetLayer
Selection
()
);
if
(
m_Item
->
GetLayer
()
==
EDGE_N
)
m_brdSettings
.
m_EdgeSegmentWidth
=
thickness
;
...
...
pcbnew/dialogs/dialog_graphic_item_properties_base.cpp
View file @
ede208f3
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version
Apr 10
2012)
// C++ code generated with wxFormBuilder (version
Oct 8
2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "class_pcb_layer_box_selector.h"
#include "dialog_graphic_item_properties_base.h"
///////////////////////////////////////////////////////////////////////////
...
...
@@ -30,6 +32,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperLeftGridSizer
->
Add
(
m_StartPointXLabel
,
0
,
wxALIGN_RIGHT
|
wxTOP
|
wxLEFT
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_Center_StartXCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_Center_StartXCtrl
->
SetMaxLength
(
0
);
fgUpperLeftGridSizer
->
Add
(
m_Center_StartXCtrl
,
0
,
wxEXPAND
|
wxALL
,
5
);
m_StartPointXUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Unit"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -41,6 +44,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperLeftGridSizer
->
Add
(
m_StartPointYLabel
,
0
,
wxALIGN_RIGHT
|
wxTOP
|
wxLEFT
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_Center_StartYCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_Center_StartYCtrl
->
SetMaxLength
(
0
);
fgUpperLeftGridSizer
->
Add
(
m_Center_StartYCtrl
,
0
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxRIGHT
,
5
);
m_StartPointYUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Unit"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -52,6 +56,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperLeftGridSizer
->
Add
(
m_EndPointXLabel
,
0
,
wxALIGN_RIGHT
|
wxTOP
|
wxLEFT
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_EndX_Radius_Ctrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_EndX_Radius_Ctrl
->
SetMaxLength
(
0
);
fgUpperLeftGridSizer
->
Add
(
m_EndX_Radius_Ctrl
,
0
,
wxEXPAND
|
wxALL
,
5
);
m_EndPointXUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Unit"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -63,6 +68,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperLeftGridSizer
->
Add
(
m_EndPointYLabel
,
0
,
wxALIGN_RIGHT
|
wxTOP
|
wxLEFT
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_EndY_Ctrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_EndY_Ctrl
->
SetMaxLength
(
0
);
fgUpperLeftGridSizer
->
Add
(
m_EndY_Ctrl
,
0
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxRIGHT
,
5
);
m_EndPointYUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Unit"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -89,6 +95,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperRightGridSizer
->
Add
(
m_Angle_Text
,
0
,
wxALIGN_RIGHT
|
wxALIGN_CENTER_VERTICAL
|
wxTOP
|
wxBOTTOM
|
wxLEFT
,
5
);
m_Angle_Ctrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_Angle_Ctrl
->
SetMaxLength
(
0
);
fgUpperRightGridSizer
->
Add
(
m_Angle_Ctrl
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
m_AngleUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"0.1 degree"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -100,6 +107,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperRightGridSizer
->
Add
(
m_ThicknessLabel
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALIGN_RIGHT
|
wxTOP
|
wxBOTTOM
|
wxLEFT
,
5
);
m_ThicknessCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_ThicknessCtrl
->
SetMaxLength
(
0
);
fgUpperRightGridSizer
->
Add
(
m_ThicknessCtrl
,
0
,
wxEXPAND
|
wxALIGN_CENTER_VERTICAL
|
wxALL
,
5
);
m_ThicknessTextUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Unit"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -111,6 +119,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperRightGridSizer
->
Add
(
m_DefaultThicknessLabel
,
0
,
wxTOP
|
wxBOTTOM
|
wxLEFT
,
5
);
m_DefaultThicknessCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_DefaultThicknessCtrl
->
SetMaxLength
(
0
);
fgUpperRightGridSizer
->
Add
(
m_DefaultThicknessCtrl
,
0
,
wxALL
|
wxEXPAND
,
5
);
m_DefaulThicknessTextUnit
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Unit"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
...
...
@@ -130,12 +139,8 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
m_LayerLabel
->
Wrap
(
-
1
);
fgLowerRightSizer
->
Add
(
m_LayerLabel
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALIGN_RIGHT
|
wxTOP
|
wxBOTTOM
|
wxLEFT
,
5
);
wxArrayString
m_LayerSelectionCtrlChoices
;
m_LayerSelectionCtrl
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_LayerSelectionCtrlChoices
,
0
);
m_LayerSelectionCtrl
->
SetSelection
(
0
);
m_LayerSelectionCtrl
->
SetToolTip
(
_
(
"Select the layer on which text should lay."
)
);
fgLowerRightSizer
->
Add
(
m_LayerSelectionCtrl
,
0
,
wxEXPAND
|
wxALL
,
5
);
m_LayerSelectionCtrl
=
new
PCB_LAYER_BOX_SELECTOR
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
,
NULL
,
0
);
fgLowerRightSizer
->
Add
(
m_LayerSelectionCtrl
,
0
,
wxALL
,
5
);
bUpperRightSizer
->
Add
(
fgLowerRightSizer
,
1
,
wxEXPAND
,
5
);
...
...
pcbnew/dialogs/dialog_graphic_item_properties_base.fbp
View file @
ede208f3
...
...
@@ -2124,11 +2124,11 @@
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"
0
"
>
<object
class=
"sizeritem"
expanded=
"
1
"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wx
EXPAND|wx
ALL
</property>
<property
name=
"flag"
>
wxALL
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wx
Choice"
expanded=
"0
"
>
<object
class=
"wx
BitmapComboBox"
expanded=
"1
"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
...
...
@@ -2172,22 +2172,23 @@
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"selection"
>
0
</property>
<property
name=
"selection"
>
-1
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"subclass"
>
PCB_LAYER_BOX_SELECTOR; class_pcb_layer_box_selector.h
</property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
>
Select the layer on which text should lay.
</property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"value"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnChar"
></event>
<event
name=
"OnC
hoice
"
></event>
<event
name=
"OnC
ombobox
"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
...
...
@@ -2209,6 +2210,8 @@
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnText"
></event>
<event
name=
"OnTextEnter"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
...
...
pcbnew/dialogs/dialog_graphic_item_properties_base.h
View file @
ede208f3
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version
Apr 10
2012)
// C++ code generated with wxFormBuilder (version
Oct 8
2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
...
...
@@ -11,6 +11,9 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class
DIALOG_SHIM
;
class
PCB_LAYER_BOX_SELECTOR
;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
...
...
@@ -21,7 +24,7 @@
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/
choice
.h>
#include <wx/
bmpcbox
.h>
#include <wx/button.h>
#include <wx/dialog.h>
...
...
@@ -59,7 +62,7 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM
wxTextCtrl
*
m_DefaultThicknessCtrl
;
wxStaticText
*
m_DefaulThicknessTextUnit
;
wxStaticText
*
m_LayerLabel
;
wxChoice
*
m_LayerSelectionCtrl
;
PCB_LAYER_BOX_SELECTOR
*
m_LayerSelectionCtrl
;
wxStaticLine
*
m_staticline1
;
wxStdDialogButtonSizer
*
m_StandardButtonsSizer
;
wxButton
*
m_StandardButtonsSizerOK
;
...
...
pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp
View file @
ede208f3
...
...
@@ -24,6 +24,7 @@
#include <class_edge_mod.h>
#include <dialog_graphic_item_properties_base.h>
#include <class_pcb_layer_box_selector.h>
class
DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES
:
public
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE
{
...
...
@@ -32,7 +33,6 @@ private:
EDGE_MODULE
*
m_item
;
BOARD_DESIGN_SETTINGS
m_brdSettings
;
MODULE
*
m_module
;
std
::
vector
<
LAYER_NUM
>
m_layerId
;
// the layer Id with the same order as m_LayerSelectionCtrl widget
public
:
DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES
(
FOOTPRINT_EDIT_FRAME
*
aParent
,
...
...
@@ -154,27 +154,16 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::initDlg()
PutValueInLocalUnits
(
*
m_DefaultThicknessCtrl
,
m_brdSettings
.
m_ModuleSegmentWidth
);
m_LayerSelectionCtrl
->
Append
(
m_parent
->
GetBoard
()
->
GetLayerName
(
LAYER_N_BACK
)
);
m_layerId
.
push_back
(
LAYER_N_BACK
);
m_LayerSelectionCtrl
->
Append
(
m_parent
->
GetBoard
()
->
GetLayerName
(
LAYER_N_FRONT
)
);
m_layerId
.
push_back
(
LAYER_N_FRONT
);
for
(
LAYER_NUM
layer
=
FIRST_NON_COPPER_LAYER
;
layer
<=
LAST_NON_COPPER_LAYER
;
++
layer
)
// Configure the layers list selector
m_LayerSelectionCtrl
->
SetLayersHotkeys
(
false
);
m_LayerSelectionCtrl
->
SetLayerMask
(
INTERNAL_CU_LAYERS
|
EDGE_LAYER
);
m_LayerSelectionCtrl
->
SetBoardFrame
(
m_parent
);
m_LayerSelectionCtrl
->
Resync
();
if
(
m_LayerSelectionCtrl
->
SetLayerSelection
(
m_item
->
GetLayer
()
)
<
0
)
{
if
(
layer
==
EDGE_N
)
// Do not use pcb edge layer for footprints, this is a special layer
// So skip it in list
continue
;
m_LayerSelectionCtrl
->
Append
(
m_parent
->
GetBoard
()
->
GetLayerName
(
layer
)
);
m_layerId
.
push_back
(
layer
);
}
for
(
unsigned
ii
=
0
;
ii
<
m_layerId
.
size
();
ii
++
)
{
if
(
m_layerId
[
ii
]
==
m_item
->
GetLayer
()
)
{
m_LayerSelectionCtrl
->
SetSelection
(
ii
);
break
;
}
wxMessageBox
(
_
(
"This item has an illegal layer id.
\n
"
"Now, forced on the front silk screen layer. Please, fix it"
)
);
m_LayerSelectionCtrl
->
SetLayerSelection
(
SILKSCREEN_N_FRONT
);
}
}
...
...
@@ -191,14 +180,8 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event )
/* Copy values in text control to the item parameters
*/
{
int
idx
=
m_LayerSelectionCtrl
->
GetCurrentSelection
();
if
(
idx
<
0
)
{
wxMessageBox
(
_
(
"No valid layer selected for this item. Please, select a layer"
)
);
return
;
}
LAYER_NUM
layer
=
m_LayerSelectionCtrl
->
GetLayerSelection
();
LAYER_NUM
layer
=
m_layerId
[
idx
];
if
(
IsCopperLayer
(
layer
)
)
{
/* an edge is put on a copper layer: this it is very dangerous. a
...
...
pcbnew/dialogs/dialog_pcb_text_properties.cpp
View file @
ede208f3
...
...
@@ -41,6 +41,7 @@
#include <vector>
#include <wx/wx.h>
#include <dialog_pcb_text_properties_base.h>
#include <class_pcb_layer_box_selector.h>
class
PCB_EDIT_FRAME
;
...
...
@@ -56,7 +57,6 @@ private:
PCB_EDIT_FRAME
*
m_Parent
;
wxDC
*
m_DC
;
TEXTE_PCB
*
m_SelectedPCBText
;
std
::
vector
<
LAYER_NUM
>
layerList
;
void
MyInit
();
...
...
@@ -126,20 +126,13 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
PutValueInLocalUnits
(
*
m_PositionXCtrl
,
m_SelectedPCBText
->
GetTextPosition
().
x
);
PutValueInLocalUnits
(
*
m_PositionYCtrl
,
m_SelectedPCBText
->
GetTextPosition
().
y
);
LAYER_MSK
enabledLayers
=
m_Parent
->
GetBoard
()
->
GetEnabledLayers
();
for
(
LAYER_NUM
layer
=
FIRST_LAYER
;
layer
<
NB_PCB_LAYERS
;
++
layer
)
{
if
(
enabledLayers
&
GetLayerMask
(
layer
)
)
{
layerList
.
push_back
(
layer
);
int
itemIndex
=
m_LayerSelectionCtrl
->
Append
(
m_Parent
->
GetBoard
()
->
GetLayerName
(
layer
)
);
if
(
m_SelectedPCBText
->
GetLayer
()
==
layer
)
m_LayerSelectionCtrl
->
SetSelection
(
itemIndex
);
}
}
// Configure the layers list selector
m_LayerSelectionCtrl
->
SetLayersHotkeys
(
false
);
// A text has no sense on edge cut layer
m_LayerSelectionCtrl
->
SetLayerMask
(
EDGE_LAYER
);
m_LayerSelectionCtrl
->
SetBoardFrame
(
m_Parent
);
m_LayerSelectionCtrl
->
Resync
();
m_LayerSelectionCtrl
->
SetLayerSelection
(
m_SelectedPCBText
->
GetLayer
()
);
wxString
orientationStr
;
orientationStr
<<
m_SelectedPCBText
->
GetOrientation
();
...
...
@@ -245,7 +238,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
}
// Set the layer on which the PCB text is laying
m_SelectedPCBText
->
SetLayer
(
layerList
[
m_LayerSelectionCtrl
->
GetSelection
()]
);
m_SelectedPCBText
->
SetLayer
(
m_LayerSelectionCtrl
->
GetLayerSelection
()
);
// Set whether the PCB text is mirrored (faced down from layer face perspective)
m_SelectedPCBText
->
SetMirrored
(
m_DisplayCtrl
->
GetSelection
()
==
1
);
...
...
pcbnew/dialogs/dialog_pcb_text_properties_base.cpp
View file @
ede208f3
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version
Apr 11
2012)
// C++ code generated with wxFormBuilder (version
Oct 8
2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "class_pcb_layer_box_selector.h"
#include "dialog_pcb_text_properties_base.h"
///////////////////////////////////////////////////////////////////////////
...
...
@@ -24,13 +26,14 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare
bSizer9
->
Add
(
m_TextLabel
,
0
,
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
m_TextContentCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
wxTE_MULTILINE
);
m_TextContentCtrl
->
SetMaxLength
(
0
);
m_TextContentCtrl
->
SetToolTip
(
_
(
"Enter the text placed on selected layer."
)
);
m_TextContentCtrl
->
SetMinSize
(
wxSize
(
400
,
60
)
);
bSizer9
->
Add
(
m_TextContentCtrl
,
1
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
wxFlexGridSizer
*
fgSizer1
;
fgSizer1
=
new
wxFlexGridSizer
(
6
,
4
,
0
,
0
);
fgSizer1
=
new
wxFlexGridSizer
(
0
,
4
,
0
,
0
);
fgSizer1
->
AddGrowableCol
(
0
);
fgSizer1
->
AddGrowableCol
(
1
);
fgSizer1
->
AddGrowableCol
(
2
);
...
...
@@ -55,17 +58,15 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare
fgSizer1
->
Add
(
m_staticText10
,
0
,
wxLEFT
|
wxRIGHT
|
wxTOP
,
5
);
m_SizeXCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_SizeXCtrl
->
SetMaxLength
(
0
);
fgSizer1
->
Add
(
m_SizeXCtrl
,
0
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxRIGHT
,
5
);
m_PositionXCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_PositionXCtrl
->
SetMaxLength
(
0
);
fgSizer1
->
Add
(
m_PositionXCtrl
,
0
,
wxEXPAND
|
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
wxArrayString
m_LayerSelectionCtrlChoices
;
m_LayerSelectionCtrl
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_LayerSelectionCtrlChoices
,
0
);
m_LayerSelectionCtrl
->
SetSelection
(
0
);
m_LayerSelectionCtrl
->
SetToolTip
(
_
(
"Select the layer on which text should lay."
)
);
fgSizer1
->
Add
(
m_LayerSelectionCtrl
,
0
,
wxEXPAND
|
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
m_LayerSelectionCtrl
=
new
PCB_LAYER_BOX_SELECTOR
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
,
NULL
,
0
);
fgSizer1
->
Add
(
m_LayerSelectionCtrl
,
0
,
wxALL
,
5
);
wxString
m_DisplayCtrlChoices
[]
=
{
_
(
"Normal"
),
_
(
"Mirrored"
)
};
int
m_DisplayCtrlNChoices
=
sizeof
(
m_DisplayCtrlChoices
)
/
sizeof
(
wxString
);
...
...
@@ -90,9 +91,11 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare
fgSizer1
->
Add
(
m_staticText11
,
0
,
wxLEFT
|
wxRIGHT
|
wxTOP
,
5
);
m_SizeYCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_SizeYCtrl
->
SetMaxLength
(
0
);
fgSizer1
->
Add
(
m_SizeYCtrl
,
0
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxRIGHT
,
5
);
m_PositionYCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_PositionYCtrl
->
SetMaxLength
(
0
);
fgSizer1
->
Add
(
m_PositionYCtrl
,
0
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxRIGHT
,
5
);
wxString
m_StyleCtrlChoices
[]
=
{
_
(
"Normal"
),
_
(
"Italic"
)
};
...
...
@@ -122,9 +125,11 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare
fgSizer1
->
Add
(
0
,
0
,
1
,
wxEXPAND
,
5
);
m_ThicknessCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_ThicknessCtrl
->
SetMaxLength
(
0
);
fgSizer1
->
Add
(
m_ThicknessCtrl
,
0
,
wxBOTTOM
|
wxEXPAND
|
wxLEFT
|
wxRIGHT
,
5
);
m_OrientationCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_OrientationCtrl
->
SetMaxLength
(
0
);
fgSizer1
->
Add
(
m_OrientationCtrl
,
0
,
wxEXPAND
|
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
...
...
pcbnew/dialogs/dialog_pcb_text_properties_base.fbp
View file @
ede208f3
...
...
@@ -42,7 +42,7 @@
<property
name=
"minimum_size"
>
-1,-1
</property>
<property
name=
"name"
>
DIALOG_PCB_TEXT_PROPERTIES_BASE
</property>
<property
name=
"pos"
></property>
<property
name=
"size"
>
4
3
3,450
</property>
<property
name=
"size"
>
4
8
3,450
</property>
<property
name=
"style"
>
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU
</property>
<property
name=
"subclass"
>
DIALOG_SHIM; dialog_shim.h
</property>
<property
name=
"title"
>
Text Properties
</property>
...
...
@@ -288,7 +288,7 @@
<property
name=
"name"
>
fgSizer1
</property>
<property
name=
"non_flexible_grow_mode"
>
wxFLEX_GROWMODE_SPECIFIED
</property>
<property
name=
"permission"
>
none
</property>
<property
name=
"rows"
>
6
</property>
<property
name=
"rows"
>
0
</property>
<property
name=
"vgap"
>
0
</property>
<object
class=
"sizeritem"
expanded=
"0"
>
<property
name=
"border"
>
5
</property>
...
...
@@ -804,11 +804,11 @@
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
<object
class=
"sizeritem"
expanded=
"
0
"
>
<object
class=
"sizeritem"
expanded=
"
1
"
>
<property
name=
"border"
>
5
</property>
<property
name=
"flag"
>
wx
EXPAND|wxBOTTOM|wxRIGHT|wxLEFT
</property>
<property
name=
"flag"
>
wx
ALL
</property>
<property
name=
"proportion"
>
0
</property>
<object
class=
"wx
Choice"
expanded=
"0
"
>
<object
class=
"wx
BitmapComboBox"
expanded=
"1
"
>
<property
name=
"BottomDockable"
>
1
</property>
<property
name=
"LeftDockable"
>
1
</property>
<property
name=
"RightDockable"
>
1
</property>
...
...
@@ -852,22 +852,23 @@
<property
name=
"pin_button"
>
1
</property>
<property
name=
"pos"
></property>
<property
name=
"resize"
>
Resizable
</property>
<property
name=
"selection"
>
0
</property>
<property
name=
"selection"
>
-1
</property>
<property
name=
"show"
>
1
</property>
<property
name=
"size"
></property>
<property
name=
"style"
></property>
<property
name=
"subclass"
></property>
<property
name=
"subclass"
>
PCB_LAYER_BOX_SELECTOR; class_pcb_layer_box_selector.h
</property>
<property
name=
"toolbar_pane"
>
0
</property>
<property
name=
"tooltip"
>
Select the layer on which text should lay.
</property>
<property
name=
"tooltip"
></property>
<property
name=
"validator_data_type"
></property>
<property
name=
"validator_style"
>
wxFILTER_NONE
</property>
<property
name=
"validator_type"
>
wxDefaultValidator
</property>
<property
name=
"validator_variable"
></property>
<property
name=
"value"
></property>
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnChar"
></event>
<event
name=
"OnC
hoice
"
></event>
<event
name=
"OnC
ombobox
"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnKeyDown"
></event>
...
...
@@ -889,6 +890,8 @@
<event
name=
"OnRightUp"
></event>
<event
name=
"OnSetFocus"
></event>
<event
name=
"OnSize"
></event>
<event
name=
"OnText"
></event>
<event
name=
"OnTextEnter"
></event>
<event
name=
"OnUpdateUI"
></event>
</object>
</object>
...
...
pcbnew/dialogs/dialog_pcb_text_properties_base.h
View file @
ede208f3
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version
Apr 11
2012)
// C++ code generated with wxFormBuilder (version
Oct 8
2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
...
...
@@ -11,6 +11,9 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class
DIALOG_SHIM
;
class
PCB_LAYER_BOX_SELECTOR
;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
...
...
@@ -19,6 +22,7 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/bmpcbox.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/button.h>
...
...
@@ -43,7 +47,7 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText
*
m_staticText10
;
wxTextCtrl
*
m_SizeXCtrl
;
wxTextCtrl
*
m_PositionXCtrl
;
wxChoice
*
m_LayerSelectionCtrl
;
PCB_LAYER_BOX_SELECTOR
*
m_LayerSelectionCtrl
;
wxChoice
*
m_DisplayCtrl
;
wxStaticText
*
m_SizeYLabel
;
wxStaticText
*
m_PositionYLabel
;
...
...
@@ -69,7 +73,7 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
public
:
DIALOG_PCB_TEXT_PROPERTIES_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Text Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
4
3
3
,
450
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
|
wxSYSTEM_MENU
);
DIALOG_PCB_TEXT_PROPERTIES_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Text Properties"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
4
8
3
,
450
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
|
wxSYSTEM_MENU
);
~
DIALOG_PCB_TEXT_PROPERTIES_BASE
();
};
...
...
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