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
0409bc8d
Commit
0409bc8d
authored
Oct 18, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix very minor issues and code cleaning
parent
153b1bd0
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
197 additions
and
264 deletions
+197
-264
dialog_lib_edit_pin.cpp
eeschema/dialogs/dialog_lib_edit_pin.cpp
+2
-0
dialog_edit_module_text.cpp
pcbnew/dialogs/dialog_edit_module_text.cpp
+71
-69
dialog_graphic_item_properties.cpp
pcbnew/dialogs/dialog_graphic_item_properties.cpp
+4
-3
menubar_modedit.cpp
pcbnew/menubar_modedit.cpp
+120
-192
No files found.
eeschema/dialogs/dialog_lib_edit_pin.cpp
View file @
0409bc8d
...
...
@@ -125,6 +125,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
int
pinOrient
=
LIB_PIN
::
GetOrientationCode
(
GetOrientation
()
);
int
pinLength
=
ReturnValueFromString
(
g_UserUnit
,
GetLength
(),
units
);
int
pinShape
=
LIB_PIN
::
GetStyleCode
(
GetStyle
()
);
int
pinType
=
GetElectricalType
();
m_dummyPin
->
SetName
(
GetName
()
);
m_dummyPin
->
SetNameTextSize
(
pinNameSize
);
...
...
@@ -134,6 +135,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
m_dummyPin
->
SetLength
(
pinLength
);
m_dummyPin
->
SetShape
(
pinShape
);
m_dummyPin
->
SetVisible
(
GetVisible
()
);
m_dummyPin
->
SetType
(
pinType
);
m_panelShowPin
->
Refresh
();
}
...
...
pcbnew/dialogs/dialog_edit_module_text.cpp
View file @
0409bc8d
...
...
@@ -30,17 +30,17 @@ extern wxPoint MoveVector; // Move vector for move edge, imported from edtxtmod
class
DialogEditModuleText
:
public
DialogEditModuleText_base
{
private
:
PCB_BASE_FRAME
*
m_
P
arent
;
wxDC
*
m_
DC
;
MODULE
*
m_
M
odule
;
TEXTE_MODULE
*
m_
CurrentTextMod
;
PCB_BASE_FRAME
*
m_
p
arent
;
wxDC
*
m_
dc
;
MODULE
*
m_
m
odule
;
TEXTE_MODULE
*
m_
currentText
;
public
:
DialogEditModuleText
(
PCB_BASE_FRAME
*
parent
,
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
);
DialogEditModuleText
(
PCB_BASE_FRAME
*
aParent
,
TEXTE_MODULE
*
aTextMod
,
wxDC
*
a
DC
);
~
DialogEditModuleText
()
{};
private
:
void
Init
(
);
void
initDlg
(
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
};
...
...
@@ -56,24 +56,26 @@ void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC
}
DialogEditModuleText
::
DialogEditModuleText
(
PCB_BASE_FRAME
*
p
arent
,
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
)
:
DialogEditModuleText_base
(
parent
)
DialogEditModuleText
::
DialogEditModuleText
(
PCB_BASE_FRAME
*
aP
arent
,
TEXTE_MODULE
*
aTextMod
,
wxDC
*
a
DC
)
:
DialogEditModuleText_base
(
aParent
)
{
m_
Parent
=
p
arent
;
m_
DC
=
DC
;
m_
M
odule
=
NULL
;
m_
CurrentTextMod
=
TextMod
;
m_
parent
=
aP
arent
;
m_
dc
=
a
DC
;
m_
m
odule
=
NULL
;
m_
currentText
=
a
TextMod
;
if
(
m_
CurrentTextMod
)
m_
Module
=
(
MODULE
*
)
m_CurrentTextMod
->
GetParent
();
if
(
m_
currentText
)
m_
module
=
(
MODULE
*
)
m_currentText
->
GetParent
();
Init
(
);
initDlg
(
);
m_buttonOK
->
SetDefault
();
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
}
...
...
@@ -84,20 +86,20 @@ void DialogEditModuleText::OnCancelClick( wxCommandEvent& event )
/********************************************************/
void
DialogEditModuleText
::
Init
(
)
void
DialogEditModuleText
::
initDlg
(
)
/********************************************************/
{
SetFocus
();
wxString
msg
;
if
(
m_
M
odule
)
if
(
m_
m
odule
)
{
wxString
format
=
m_ModuleInfoText
->
GetLabel
();
msg
.
Printf
(
format
,
GetChars
(
m_
M
odule
->
m_Reference
->
m_Text
),
GetChars
(
m_
M
odule
->
m_Value
->
m_Text
),
(
float
)
m_
M
odule
->
m_Orient
/
10
);
GetChars
(
m_
m
odule
->
m_Reference
->
m_Text
),
GetChars
(
m_
m
odule
->
m_Value
->
m_Text
),
(
float
)
m_
m
odule
->
m_Orient
/
10
);
}
else
...
...
@@ -106,43 +108,43 @@ void DialogEditModuleText::Init( )
m_ModuleInfoText
->
SetLabel
(
msg
);
if
(
m_
CurrentTextMod
->
m_Type
==
TEXT_is_VALUE
)
if
(
m_
currentText
->
m_Type
==
TEXT_is_VALUE
)
m_TextDataTitle
->
SetLabel
(
_
(
"Value:"
)
);
else
if
(
m_
CurrentTextMod
->
m_Type
==
TEXT_is_DIVERS
)
else
if
(
m_
currentText
->
m_Type
==
TEXT_is_DIVERS
)
m_TextDataTitle
->
SetLabel
(
_
(
"Text:"
)
);
else
if
(
m_
CurrentTextMod
->
m_Type
!=
TEXT_is_REFERENCE
)
else
if
(
m_
currentText
->
m_Type
!=
TEXT_is_REFERENCE
)
m_TextDataTitle
->
SetLabel
(
wxT
(
"???"
)
);
m_Name
->
SetValue
(
m_
CurrentTextMod
->
m_Text
);
m_Name
->
SetValue
(
m_
currentText
->
m_Text
);
m_Style
->
SetSelection
(
m_
CurrentTextMod
->
m_Italic
?
1
:
0
);
m_Style
->
SetSelection
(
m_
currentText
->
m_Italic
?
1
:
0
);
AddUnitSymbol
(
*
m_SizeXTitle
);
PutValueInLocalUnits
(
*
m_TxtSizeCtrlX
,
m_
CurrentTextMod
->
m_Size
.
x
,
m_
P
arent
->
m_InternalUnits
);
PutValueInLocalUnits
(
*
m_TxtSizeCtrlX
,
m_
currentText
->
m_Size
.
x
,
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_SizeYTitle
);
PutValueInLocalUnits
(
*
m_TxtSizeCtrlY
,
m_
CurrentTextMod
->
m_Size
.
y
,
m_
P
arent
->
m_InternalUnits
);
PutValueInLocalUnits
(
*
m_TxtSizeCtrlY
,
m_
currentText
->
m_Size
.
y
,
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_PosXTitle
);
PutValueInLocalUnits
(
*
m_TxtPosCtrlX
,
m_
CurrentTextMod
->
m_Pos0
.
x
,
m_
P
arent
->
m_InternalUnits
);
PutValueInLocalUnits
(
*
m_TxtPosCtrlX
,
m_
currentText
->
m_Pos0
.
x
,
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_PosYTitle
);
PutValueInLocalUnits
(
*
m_TxtPosCtrlY
,
m_
CurrentTextMod
->
m_Pos0
.
y
,
m_
P
arent
->
m_InternalUnits
);
PutValueInLocalUnits
(
*
m_TxtPosCtrlY
,
m_
currentText
->
m_Pos0
.
y
,
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_WidthTitle
);
PutValueInLocalUnits
(
*
m_TxtWidthCtlr
,
m_
CurrentTextMod
->
m_Thickness
,
m_
P
arent
->
m_InternalUnits
);
PutValueInLocalUnits
(
*
m_TxtWidthCtlr
,
m_
currentText
->
m_Thickness
,
m_
p
arent
->
m_InternalUnits
);
int
text_orient
=
m_
CurrentTextMod
->
m_Orient
;
int
text_orient
=
m_
currentText
->
m_Orient
;
NORMALIZE_ANGLE_90
(
text_orient
)
if
(
(
text_orient
!=
0
)
)
m_Orient
->
SetSelection
(
1
);
if
(
m_
CurrentTextMod
->
m_NoShow
)
if
(
m_
currentText
->
m_NoShow
)
m_Show
->
SetSelection
(
1
);;
}
...
...
@@ -154,65 +156,65 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
{
wxString
msg
;
if
(
m_
M
odule
)
m_
Parent
->
SaveCopyInUndoList
(
m_M
odule
,
UR_CHANGED
);
if
(
m_
DC
)
//Erase old text on screen
if
(
m_
m
odule
)
m_
parent
->
SaveCopyInUndoList
(
m_m
odule
,
UR_CHANGED
);
if
(
m_
dc
)
//Erase old text on screen
{
m_
CurrentTextMod
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_XOR
,
(
m_
CurrentTextMod
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
m_
currentText
->
Draw
(
m_parent
->
DrawPanel
,
m_dc
,
GR_XOR
,
(
m_
currentText
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
}
m_
CurrentTextMod
->
m_Text
=
m_Name
->
GetValue
();
m_
currentText
->
m_Text
=
m_Name
->
GetValue
();
m_
CurrentTextMod
->
m_Italic
=
m_Style
->
GetSelection
()
==
1
?
true
:
false
;
m_
currentText
->
m_Italic
=
m_Style
->
GetSelection
()
==
1
?
true
:
false
;
msg
=
m_TxtPosCtrlX
->
GetValue
();
m_
CurrentTextMod
->
m_Pos0
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
currentText
->
m_Pos0
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
p
arent
->
m_InternalUnits
);
msg
=
m_TxtPosCtrlY
->
GetValue
();
m_
CurrentTextMod
->
m_Pos0
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
currentText
->
m_Pos0
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
p
arent
->
m_InternalUnits
);
msg
=
m_TxtSizeCtrlX
->
GetValue
();
m_
CurrentTextMod
->
m_Size
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
currentText
->
m_Size
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
p
arent
->
m_InternalUnits
);
msg
=
m_TxtSizeCtrlY
->
GetValue
();
m_
CurrentTextMod
->
m_Size
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
currentText
->
m_Size
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
p
arent
->
m_InternalUnits
);
// Test for a reasonnable size:
if
(
m_
CurrentTextMod
->
m_Size
.
x
<
TEXTS_MIN_SIZE
)
m_
CurrentTextMod
->
m_Size
.
x
=
TEXTS_MIN_SIZE
;
if
(
m_
CurrentTextMod
->
m_Size
.
y
<
TEXTS_MIN_SIZE
)
m_
CurrentTextMod
->
m_Size
.
y
=
TEXTS_MIN_SIZE
;
if
(
m_
currentText
->
m_Size
.
x
<
TEXTS_MIN_SIZE
)
m_
currentText
->
m_Size
.
x
=
TEXTS_MIN_SIZE
;
if
(
m_
currentText
->
m_Size
.
y
<
TEXTS_MIN_SIZE
)
m_
currentText
->
m_Size
.
y
=
TEXTS_MIN_SIZE
;
msg
=
m_TxtWidthCtlr
->
GetValue
();
int
width
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
int
width
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
p
arent
->
m_InternalUnits
);
// Test for a reasonnable width:
if
(
width
<=
1
)
width
=
1
;
int
maxthickness
=
Clamp_Text_PenSize
(
width
,
m_
CurrentTextMod
->
m_Size
);
int
maxthickness
=
Clamp_Text_PenSize
(
width
,
m_
currentText
->
m_Size
);
if
(
width
>
maxthickness
)
{
DisplayError
(
NULL
,
_
(
"The text thickness is too large for the text size. It will be clamped"
));
width
=
maxthickness
;
}
m_
CurrentTextMod
->
SetThickness
(
width
);
m_
currentText
->
SetThickness
(
width
);
m_
CurrentTextMod
->
m_NoShow
=
(
m_Show
->
GetSelection
()
==
0
)
?
0
:
1
;
m_
currentText
->
m_NoShow
=
(
m_Show
->
GetSelection
()
==
0
)
?
0
:
1
;
int
text_orient
=
(
m_Orient
->
GetSelection
()
==
0
)
?
0
:
900
;
m_
CurrentTextMod
->
m_Orient
=
text_orient
;
m_
currentText
->
m_Orient
=
text_orient
;
m_
CurrentTextMod
->
SetDrawCoord
();
if
(
m_
DC
)
// Display new text
m_
currentText
->
SetDrawCoord
();
if
(
m_
dc
)
// Display new text
{
m_
CurrentTextMod
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_XOR
,
(
m_
CurrentTextMod
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
m_
currentText
->
Draw
(
m_parent
->
DrawPanel
,
m_dc
,
GR_XOR
,
(
m_
currentText
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
}
m_
P
arent
->
OnModify
();
if
(
m_
M
odule
)
m_
M
odule
->
m_LastEdit_Time
=
time
(
NULL
);
m_
p
arent
->
OnModify
();
if
(
m_
m
odule
)
m_
m
odule
->
m_LastEdit_Time
=
time
(
NULL
);
EndModal
(
1
);
}
pcbnew/dialogs/dialog_graphic_item_properties.cpp
View file @
0409bc8d
...
...
@@ -40,7 +40,7 @@ public:
~
DialogGraphicItemProperties
()
{};
private
:
void
Init
(
);
void
initDlg
(
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnLayerChoice
(
wxCommandEvent
&
event
);
...
...
@@ -54,9 +54,10 @@ DialogGraphicItemProperties::DialogGraphicItemProperties( PCB_EDIT_FRAME* aParen
m_DC
=
aDC
;
m_Item
=
aItem
;
m_BrdSettings
=
m_Parent
->
GetBoard
()
->
GetBoardDesignSettings
();
Init
();
initDlg
();
Layout
();
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
}
...
...
@@ -78,7 +79,7 @@ void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxD
}
/**************************************************************************/
void
DialogGraphicItemProperties
::
Init
(
)
void
DialogGraphicItemProperties
::
initDlg
(
)
/**************************************************************************/
/* Initialize messages and values in text control,
* according to the item parameters values
...
...
pcbnew/menubar_modedit.cpp
View file @
0409bc8d
This diff is collapsed.
Click to expand it.
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