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
Show 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 )
...
@@ -125,6 +125,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
int
pinOrient
=
LIB_PIN
::
GetOrientationCode
(
GetOrientation
()
);
int
pinOrient
=
LIB_PIN
::
GetOrientationCode
(
GetOrientation
()
);
int
pinLength
=
ReturnValueFromString
(
g_UserUnit
,
GetLength
(),
units
);
int
pinLength
=
ReturnValueFromString
(
g_UserUnit
,
GetLength
(),
units
);
int
pinShape
=
LIB_PIN
::
GetStyleCode
(
GetStyle
()
);
int
pinShape
=
LIB_PIN
::
GetStyleCode
(
GetStyle
()
);
int
pinType
=
GetElectricalType
();
m_dummyPin
->
SetName
(
GetName
()
);
m_dummyPin
->
SetName
(
GetName
()
);
m_dummyPin
->
SetNameTextSize
(
pinNameSize
);
m_dummyPin
->
SetNameTextSize
(
pinNameSize
);
...
@@ -134,6 +135,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
...
@@ -134,6 +135,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
m_dummyPin
->
SetLength
(
pinLength
);
m_dummyPin
->
SetLength
(
pinLength
);
m_dummyPin
->
SetShape
(
pinShape
);
m_dummyPin
->
SetShape
(
pinShape
);
m_dummyPin
->
SetVisible
(
GetVisible
()
);
m_dummyPin
->
SetVisible
(
GetVisible
()
);
m_dummyPin
->
SetType
(
pinType
);
m_panelShowPin
->
Refresh
();
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
...
@@ -30,17 +30,17 @@ extern wxPoint MoveVector; // Move vector for move edge, imported from edtxtmod
class
DialogEditModuleText
:
public
DialogEditModuleText_base
class
DialogEditModuleText
:
public
DialogEditModuleText_base
{
{
private
:
private
:
PCB_BASE_FRAME
*
m_
P
arent
;
PCB_BASE_FRAME
*
m_
p
arent
;
wxDC
*
m_
DC
;
wxDC
*
m_
dc
;
MODULE
*
m_
M
odule
;
MODULE
*
m_
m
odule
;
TEXTE_MODULE
*
m_
CurrentTextMod
;
TEXTE_MODULE
*
m_
currentText
;
public
:
public
:
DialogEditModuleText
(
PCB_BASE_FRAME
*
parent
,
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
);
DialogEditModuleText
(
PCB_BASE_FRAME
*
aParent
,
TEXTE_MODULE
*
aTextMod
,
wxDC
*
a
DC
);
~
DialogEditModuleText
()
{};
~
DialogEditModuleText
()
{};
private
:
private
:
void
Init
(
);
void
initDlg
(
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
};
};
...
@@ -56,24 +56,26 @@ void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC
...
@@ -56,24 +56,26 @@ void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC
}
}
DialogEditModuleText
::
DialogEditModuleText
(
PCB_BASE_FRAME
*
p
arent
,
DialogEditModuleText
::
DialogEditModuleText
(
PCB_BASE_FRAME
*
aP
arent
,
TEXTE_MODULE
*
TextMod
,
wxDC
*
DC
)
:
TEXTE_MODULE
*
aTextMod
,
wxDC
*
a
DC
)
:
DialogEditModuleText_base
(
parent
)
DialogEditModuleText_base
(
aParent
)
{
{
m_
Parent
=
p
arent
;
m_
parent
=
aP
arent
;
m_
DC
=
DC
;
m_
dc
=
a
DC
;
m_
M
odule
=
NULL
;
m_
m
odule
=
NULL
;
m_
CurrentTextMod
=
TextMod
;
m_
currentText
=
a
TextMod
;
if
(
m_
CurrentTextMod
)
if
(
m_
currentText
)
m_
Module
=
(
MODULE
*
)
m_CurrentTextMod
->
GetParent
();
m_
module
=
(
MODULE
*
)
m_currentText
->
GetParent
();
Init
(
);
initDlg
(
);
m_buttonOK
->
SetDefault
();
m_buttonOK
->
SetDefault
();
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
}
}
...
@@ -84,20 +86,20 @@ void DialogEditModuleText::OnCancelClick( wxCommandEvent& event )
...
@@ -84,20 +86,20 @@ void DialogEditModuleText::OnCancelClick( wxCommandEvent& event )
/********************************************************/
/********************************************************/
void
DialogEditModuleText
::
Init
(
)
void
DialogEditModuleText
::
initDlg
(
)
/********************************************************/
/********************************************************/
{
{
SetFocus
();
SetFocus
();
wxString
msg
;
wxString
msg
;
if
(
m_
M
odule
)
if
(
m_
m
odule
)
{
{
wxString
format
=
m_ModuleInfoText
->
GetLabel
();
wxString
format
=
m_ModuleInfoText
->
GetLabel
();
msg
.
Printf
(
format
,
msg
.
Printf
(
format
,
GetChars
(
m_
M
odule
->
m_Reference
->
m_Text
),
GetChars
(
m_
m
odule
->
m_Reference
->
m_Text
),
GetChars
(
m_
M
odule
->
m_Value
->
m_Text
),
GetChars
(
m_
m
odule
->
m_Value
->
m_Text
),
(
float
)
m_
M
odule
->
m_Orient
/
10
);
(
float
)
m_
m
odule
->
m_Orient
/
10
);
}
}
else
else
...
@@ -106,43 +108,43 @@ void DialogEditModuleText::Init( )
...
@@ -106,43 +108,43 @@ void DialogEditModuleText::Init( )
m_ModuleInfoText
->
SetLabel
(
msg
);
m_ModuleInfoText
->
SetLabel
(
msg
);
if
(
m_
CurrentTextMod
->
m_Type
==
TEXT_is_VALUE
)
if
(
m_
currentText
->
m_Type
==
TEXT_is_VALUE
)
m_TextDataTitle
->
SetLabel
(
_
(
"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:"
)
);
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_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
);
AddUnitSymbol
(
*
m_SizeXTitle
);
PutValueInLocalUnits
(
*
m_TxtSizeCtrlX
,
m_
CurrentTextMod
->
m_Size
.
x
,
PutValueInLocalUnits
(
*
m_TxtSizeCtrlX
,
m_
currentText
->
m_Size
.
x
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_SizeYTitle
);
AddUnitSymbol
(
*
m_SizeYTitle
);
PutValueInLocalUnits
(
*
m_TxtSizeCtrlY
,
m_
CurrentTextMod
->
m_Size
.
y
,
PutValueInLocalUnits
(
*
m_TxtSizeCtrlY
,
m_
currentText
->
m_Size
.
y
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_PosXTitle
);
AddUnitSymbol
(
*
m_PosXTitle
);
PutValueInLocalUnits
(
*
m_TxtPosCtrlX
,
m_
CurrentTextMod
->
m_Pos0
.
x
,
PutValueInLocalUnits
(
*
m_TxtPosCtrlX
,
m_
currentText
->
m_Pos0
.
x
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_PosYTitle
);
AddUnitSymbol
(
*
m_PosYTitle
);
PutValueInLocalUnits
(
*
m_TxtPosCtrlY
,
m_
CurrentTextMod
->
m_Pos0
.
y
,
PutValueInLocalUnits
(
*
m_TxtPosCtrlY
,
m_
currentText
->
m_Pos0
.
y
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
AddUnitSymbol
(
*
m_WidthTitle
);
AddUnitSymbol
(
*
m_WidthTitle
);
PutValueInLocalUnits
(
*
m_TxtWidthCtlr
,
m_
CurrentTextMod
->
m_Thickness
,
PutValueInLocalUnits
(
*
m_TxtWidthCtlr
,
m_
currentText
->
m_Thickness
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
int
text_orient
=
m_
CurrentTextMod
->
m_Orient
;
int
text_orient
=
m_
currentText
->
m_Orient
;
NORMALIZE_ANGLE_90
(
text_orient
)
NORMALIZE_ANGLE_90
(
text_orient
)
if
(
(
text_orient
!=
0
)
)
if
(
(
text_orient
!=
0
)
)
m_Orient
->
SetSelection
(
1
);
m_Orient
->
SetSelection
(
1
);
if
(
m_
CurrentTextMod
->
m_NoShow
)
if
(
m_
currentText
->
m_NoShow
)
m_Show
->
SetSelection
(
1
);;
m_Show
->
SetSelection
(
1
);;
}
}
...
@@ -154,65 +156,65 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
...
@@ -154,65 +156,65 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
{
{
wxString
msg
;
wxString
msg
;
if
(
m_
M
odule
)
if
(
m_
m
odule
)
m_
Parent
->
SaveCopyInUndoList
(
m_M
odule
,
UR_CHANGED
);
m_
parent
->
SaveCopyInUndoList
(
m_m
odule
,
UR_CHANGED
);
if
(
m_
DC
)
//Erase old text on screen
if
(
m_
dc
)
//Erase old text on screen
{
{
m_
CurrentTextMod
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_XOR
,
m_
currentText
->
Draw
(
m_parent
->
DrawPanel
,
m_dc
,
GR_XOR
,
(
m_
CurrentTextMod
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
(
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
();
msg
=
m_TxtPosCtrlX
->
GetValue
();
m_
CurrentTextMod
->
m_Pos0
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
currentText
->
m_Pos0
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
msg
=
m_TxtPosCtrlY
->
GetValue
();
msg
=
m_TxtPosCtrlY
->
GetValue
();
m_
CurrentTextMod
->
m_Pos0
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
currentText
->
m_Pos0
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
msg
=
m_TxtSizeCtrlX
->
GetValue
();
msg
=
m_TxtSizeCtrlX
->
GetValue
();
m_
CurrentTextMod
->
m_Size
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
currentText
->
m_Size
.
x
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
msg
=
m_TxtSizeCtrlY
->
GetValue
();
msg
=
m_TxtSizeCtrlY
->
GetValue
();
m_
CurrentTextMod
->
m_Size
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
currentText
->
m_Size
.
y
=
ReturnValueFromString
(
g_UserUnit
,
msg
,
m_
P
arent
->
m_InternalUnits
);
m_
p
arent
->
m_InternalUnits
);
// Test for a reasonnable size:
// Test for a reasonnable size:
if
(
m_
CurrentTextMod
->
m_Size
.
x
<
TEXTS_MIN_SIZE
)
if
(
m_
currentText
->
m_Size
.
x
<
TEXTS_MIN_SIZE
)
m_
CurrentTextMod
->
m_Size
.
x
=
TEXTS_MIN_SIZE
;
m_
currentText
->
m_Size
.
x
=
TEXTS_MIN_SIZE
;
if
(
m_
CurrentTextMod
->
m_Size
.
y
<
TEXTS_MIN_SIZE
)
if
(
m_
currentText
->
m_Size
.
y
<
TEXTS_MIN_SIZE
)
m_
CurrentTextMod
->
m_Size
.
y
=
TEXTS_MIN_SIZE
;
m_
currentText
->
m_Size
.
y
=
TEXTS_MIN_SIZE
;
msg
=
m_TxtWidthCtlr
->
GetValue
();
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:
// Test for a reasonnable width:
if
(
width
<=
1
)
if
(
width
<=
1
)
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
)
if
(
width
>
maxthickness
)
{
{
DisplayError
(
NULL
,
_
(
"The text thickness is too large for the text size. It will be clamped"
));
DisplayError
(
NULL
,
_
(
"The text thickness is too large for the text size. It will be clamped"
));
width
=
maxthickness
;
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
;
int
text_orient
=
(
m_Orient
->
GetSelection
()
==
0
)
?
0
:
900
;
m_
CurrentTextMod
->
m_Orient
=
text_orient
;
m_
currentText
->
m_Orient
=
text_orient
;
m_
CurrentTextMod
->
SetDrawCoord
();
m_
currentText
->
SetDrawCoord
();
if
(
m_
DC
)
// Display new text
if
(
m_
dc
)
// Display new text
{
{
m_
CurrentTextMod
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
GR_XOR
,
m_
currentText
->
Draw
(
m_parent
->
DrawPanel
,
m_dc
,
GR_XOR
,
(
m_
CurrentTextMod
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
(
m_
currentText
->
m_Flags
&
IS_MOVED
)
?
MoveVector
:
wxPoint
(
0
,
0
)
);
}
}
m_
P
arent
->
OnModify
();
m_
p
arent
->
OnModify
();
if
(
m_
M
odule
)
if
(
m_
m
odule
)
m_
M
odule
->
m_LastEdit_Time
=
time
(
NULL
);
m_
m
odule
->
m_LastEdit_Time
=
time
(
NULL
);
EndModal
(
1
);
EndModal
(
1
);
}
}
pcbnew/dialogs/dialog_graphic_item_properties.cpp
View file @
0409bc8d
...
@@ -40,7 +40,7 @@ public:
...
@@ -40,7 +40,7 @@ public:
~
DialogGraphicItemProperties
()
{};
~
DialogGraphicItemProperties
()
{};
private
:
private
:
void
Init
(
);
void
initDlg
(
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnLayerChoice
(
wxCommandEvent
&
event
);
void
OnLayerChoice
(
wxCommandEvent
&
event
);
...
@@ -54,9 +54,10 @@ DialogGraphicItemProperties::DialogGraphicItemProperties( PCB_EDIT_FRAME* aParen
...
@@ -54,9 +54,10 @@ DialogGraphicItemProperties::DialogGraphicItemProperties( PCB_EDIT_FRAME* aParen
m_DC
=
aDC
;
m_DC
=
aDC
;
m_Item
=
aItem
;
m_Item
=
aItem
;
m_BrdSettings
=
m_Parent
->
GetBoard
()
->
GetBoardDesignSettings
();
m_BrdSettings
=
m_Parent
->
GetBoard
()
->
GetBoardDesignSettings
();
Init
();
initDlg
();
Layout
();
Layout
();
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
}
}
...
@@ -78,7 +79,7 @@ void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxD
...
@@ -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,
/* Initialize messages and values in text control,
* according to the item parameters values
* according to the item parameters values
...
...
pcbnew/menubar_modedit.cpp
View file @
0409bc8d
...
@@ -16,9 +16,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
...
@@ -16,9 +16,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
{
{
// Create and try to get the current menubar
// Create and try to get the current menubar
wxMenuBar
*
menuBar
=
GetMenuBar
();
wxMenuBar
*
menuBar
=
GetMenuBar
();
wxMenuItem
*
item
;
if
(
!
menuBar
)
if
(
!
menuBar
)
menuBar
=
new
wxMenuBar
();
menuBar
=
new
wxMenuBar
();
// Delete all existing menus so they can be rebuilt.
// Delete all existing menus so they can be rebuilt.
...
@@ -26,7 +25,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
...
@@ -26,7 +25,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
menuBar
->
Freeze
();
menuBar
->
Freeze
();
while
(
menuBar
->
GetMenuCount
()
)
while
(
menuBar
->
GetMenuCount
()
)
delete
menuBar
->
Remove
(
0
);
delete
menuBar
->
Remove
(
0
);
// Recreate all menus:
// Recreate all menus:
...
@@ -34,39 +33,30 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
...
@@ -34,39 +33,30 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
wxMenu
*
fileMenu
=
new
wxMenu
;
wxMenu
*
fileMenu
=
new
wxMenu
;
// New module
// New module
item
=
new
wxMenuItem
(
fileMenu
,
AddMenuItem
(
fileMenu
,
ID_MODEDIT_NEW_MODULE
,
ID_MODEDIT_NEW_MODULE
,
_
(
"New Module"
),
_
(
"Create new module"
),
_
(
"New Module"
),
KiBitmap
(
new_footprint_xpm
)
);
_
(
"Create new module"
)
);
SET_BITMAP
(
KiBitmap
(
new_footprint_xpm
)
);
fileMenu
->
Append
(
item
);
// Open submenu
// Open submenu
wxMenu
*
openSubmenu
=
new
wxMenu
;
wxMenu
*
openSubmenu
=
new
wxMenu
;
// from File
// from File
item
=
new
wxMenuItem
(
openSubmenu
,
AddMenuItem
(
openSubmenu
,
ID_MODEDIT_IMPORT_PART
,
ID_MODEDIT_IMPORT_PART
,
_
(
"Load from File (Import)"
),
_
(
"Load from File (Import)"
),
_
(
"Import a footprint from an existing file"
)
);
_
(
"Import a footprint from an existing file"
),
SET_BITMAP
(
KiBitmap
(
import_module_xpm
)
);
KiBitmap
(
import_module_xpm
)
);
openSubmenu
->
Append
(
item
);
// from Library
// from Library
item
=
new
wxMenuItem
(
openSubmenu
,
AddMenuItem
(
openSubmenu
,
ID_MODEDIT_LOAD_MODULE
,
ID_MODEDIT_LOAD_MODULE
,
_
(
"Load from Library"
),
_
(
"Load from Library"
),
_
(
"Open a footprint module from a Library"
)
);
_
(
"Open a footprint module from a Library"
),
SET_BITMAP
(
KiBitmap
(
module_xpm
)
);
KiBitmap
(
module_xpm
)
);
openSubmenu
->
Append
(
item
);
// from current Board
// from current Board
item
=
new
wxMenuItem
(
openSubmenu
,
AddMenuItem
(
openSubmenu
,
ID_MODEDIT_LOAD_MODULE_FROM_BOARD
,
ID_MODEDIT_LOAD_MODULE_FROM_BOARD
,
_
(
"Load from Current Board"
),
_
(
"Load from Current Board"
),
_
(
"Load a footprint module from the current loaded board"
)
);
_
(
"Load a footprint module from the current loaded board"
),
SET_BITMAP
(
KiBitmap
(
load_module_board_xpm
)
);
KiBitmap
(
load_module_board_xpm
)
);
openSubmenu
->
Append
(
item
);
/* Append openSubmenu to fileMenu */
/* Append openSubmenu to fileMenu */
AddMenuItem
(
fileMenu
,
openSubmenu
,
-
1
,
AddMenuItem
(
fileMenu
,
openSubmenu
,
-
1
,
...
@@ -75,115 +65,86 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
...
@@ -75,115 +65,86 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
KiBitmap
(
open_document_xpm
)
);
KiBitmap
(
open_document_xpm
)
);
// Save module
// Save module
item
=
new
wxMenuItem
(
fileMenu
,
AddMenuItem
(
fileMenu
,
ID_MODEDIT_SAVE_LIBMODULE
,
ID_MODEDIT_SAVE_LIBMODULE
,
_
(
"&Save Module in Active Library"
),
_
(
"&Save Module in Active Library"
),
_
(
"Save module in active library"
)
);
_
(
"Save module in active library"
),
SET_BITMAP
(
KiBitmap
(
save_library_xpm
)
);
KiBitmap
(
save_library_xpm
)
);
fileMenu
->
Append
(
item
);
// Save module in new lib
// Save module in new lib
item
=
new
wxMenuItem
(
fileMenu
,
AddMenuItem
(
fileMenu
,
ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART
,
ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART
,
_
(
"&Save Module in a New Lib"
),
_
(
"&Save Module in a New Lib"
),
_
(
"Create new library and save current module"
)
);
_
(
"Create new library and save current module"
),
SET_BITMAP
(
KiBitmap
(
new_library_xpm
)
);
KiBitmap
(
new_library_xpm
)
);
fileMenu
->
Append
(
item
);
// Export module
// Export module
item
=
new
wxMenuItem
(
fileMenu
,
AddMenuItem
(
fileMenu
,
ID_MODEDIT_EXPORT_PART
,
ID_MODEDIT_EXPORT_PART
,
_
(
"&Export Module"
),
_
(
"&Export Module"
),
_
(
"Save the current loaded module to a file"
)
);
_
(
"Save the current loaded module to a file"
),
SET_BITMAP
(
KiBitmap
(
export_module_xpm
)
);
KiBitmap
(
export_module_xpm
)
);
fileMenu
->
Append
(
item
);
// Separator
// Separator
fileMenu
->
AppendSeparator
();
fileMenu
->
AppendSeparator
();
// Print
// Print
item
=
new
wxMenuItem
(
fileMenu
,
AddMenuItem
(
fileMenu
,
wxID_PRINT
,
wxID_PRINT
,
_
(
"&Print"
),
_
(
"&Print
\t
Ctrl+P"
),
_
(
"Print the current module"
),
_
(
"Print the current module"
)
);
KiBitmap
(
plot_xpm
)
);
SET_BITMAP
(
KiBitmap
(
plot_xpm
)
);
fileMenu
->
Append
(
item
);
// Separator
// Separator
fileMenu
->
AppendSeparator
();
fileMenu
->
AppendSeparator
();
// Close editor
// Close editor
item
=
new
wxMenuItem
(
fileMenu
,
AddMenuItem
(
fileMenu
,
wxID_EXIT
,
wxID_EXIT
,
_
(
"Close"
),
_
(
"Close"
),
_
(
"Close the footprint editor"
)
);
_
(
"Close the footprint editor"
),
SET_BITMAP
(
KiBitmap
(
exit_xpm
)
);
KiBitmap
(
exit_xpm
)
);
fileMenu
->
Append
(
item
);
// Menu Edit:
// Menu Edit:
wxMenu
*
editMenu
=
new
wxMenu
;
wxMenu
*
editMenu
=
new
wxMenu
;
// Undo
// Undo
item
=
new
wxMenuItem
(
editMenu
,
AddMenuItem
(
editMenu
,
wxID_UNDO
,
wxID_UNDO
,
_
(
"Undo"
),
_
(
"Undo last edit"
),
_
(
"Undo"
),
KiBitmap
(
undo_xpm
)
);
_
(
"Undo last edit"
)
);
SET_BITMAP
(
KiBitmap
(
undo_xpm
)
);
editMenu
->
Append
(
item
);
// Redo
// Redo
item
=
new
wxMenuItem
(
editMenu
,
AddMenuItem
(
editMenu
,
wxID_REDO
,
wxID_REDO
,
_
(
"Redo"
),
_
(
"Redo the last undo action"
),
_
(
"Redo"
),
KiBitmap
(
redo_xpm
)
);
_
(
"Redo the last undo action"
)
);
SET_BITMAP
(
KiBitmap
(
redo_xpm
)
);
editMenu
->
Append
(
item
);
// Delete items
// Delete items
item
=
new
wxMenuItem
(
editMenu
,
AddMenuItem
(
editMenu
,
ID_MODEDIT_DELETE_TOOL
,
ID_MODEDIT_DELETE_TOOL
,
_
(
"Delete"
),
_
(
"Delete objects with the eraser"
),
_
(
"Delete"
),
KiBitmap
(
delete_body_xpm
)
);
_
(
"Delete objects with the eraser"
)
);
SET_BITMAP
(
KiBitmap
(
delete_body_xpm
)
);
editMenu
->
Append
(
item
);
// Separator
// Separator
editMenu
->
AppendSeparator
();
editMenu
->
AppendSeparator
();
// Properties
// Properties
item
=
new
wxMenuItem
(
editMenu
,
AddMenuItem
(
editMenu
,
ID_MODEDIT_EDIT_MODULE_PROPERTIES
,
ID_MODEDIT_EDIT_MODULE_PROPERTIES
,
_
(
"Properties"
),
_
(
"Properties"
),
_
(
"Edit module properties"
)
);
_
(
"Edit module properties"
),
SET_BITMAP
(
KiBitmap
(
module_options_xpm
)
);
KiBitmap
(
module_options_xpm
)
);
editMenu
->
Append
(
item
);
// Dimensions submenu
// Dimensions submenu
wxMenu
*
dimensions_Submenu
=
new
wxMenu
;
wxMenu
*
dimensions_Submenu
=
new
wxMenu
;
// Sizes and Widths
// Sizes and Widths
item
=
new
wxMenuItem
(
dimensions_Submenu
,
AddMenuItem
(
dimensions_Submenu
,
ID_PCB_DRAWINGS_WIDTHS_SETUP
,
ID_PCB_DRAWINGS_WIDTHS_SETUP
,
_
(
"Sizes and Widths"
),
_
(
"Sizes and Widths"
),
_
(
"Adjust width for texts and drawings"
)
);
_
(
"Adjust width for texts and drawings"
),
SET_BITMAP
(
KiBitmap
(
options_text_xpm
)
);
KiBitmap
(
options_text_xpm
)
);
dimensions_Submenu
->
Append
(
item
);
// Pad settings
// Pad settings
item
=
new
wxMenuItem
(
dimensions_Submenu
,
AddMenuItem
(
dimensions_Submenu
,
ID_MODEDIT_PAD_SETTINGS
,
ID_MODEDIT_PAD_SETTINGS
,
_
(
"Pad Settings"
),
_
(
"Edit the settings for new pads"
),
_
(
"Pad Settings"
),
KiBitmap
(
options_pad_xpm
)
);
_
(
"Edit the settings for new pads"
)
);
SET_BITMAP
(
KiBitmap
(
options_pad_xpm
)
);
dimensions_Submenu
->
Append
(
item
);
// User grid size
// User grid size
item
=
new
wxMenuItem
(
dimensions_Submenu
,
AddMenuItem
(
dimensions_Submenu
,
ID_PCB_USER_GRID_SETUP
,
ID_PCB_USER_GRID_SETUP
,
_
(
"User Grid Size"
),
_
(
"Adjust user grid"
),
_
(
"User Grid Size"
),
KiBitmap
(
grid_xpm
)
);
_
(
"Adjust user grid"
)
);
SET_BITMAP
(
KiBitmap
(
grid_xpm
)
);
dimensions_Submenu
->
Append
(
item
);
// Append dimensions_Submenu to editMenu
// Append dimensions_Submenu to editMenu
AddMenuItem
(
editMenu
,
AddMenuItem
(
editMenu
,
...
@@ -196,102 +157,71 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
...
@@ -196,102 +157,71 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
wxMenu
*
viewMenu
=
new
wxMenu
;
wxMenu
*
viewMenu
=
new
wxMenu
;
// Zoom In
// Zoom In
item
=
new
wxMenuItem
(
viewMenu
,
AddMenuItem
(
viewMenu
,
ID_ZOOM_IN
,
ID_ZOOM_IN
,
_
(
"Zoom In"
),
_
(
"Zoom in on the module"
),
_
(
"Zoom In"
),
KiBitmap
(
zoom_in_xpm
)
);
_
(
"Zoom in on the module"
)
);
SET_BITMAP
(
KiBitmap
(
zoom_in_xpm
)
);
viewMenu
->
Append
(
item
);
// Zoom Out
// Zoom Out
item
=
new
wxMenuItem
(
viewMenu
,
AddMenuItem
(
viewMenu
,
ID_ZOOM_OUT
,
ID_ZOOM_OUT
,
_
(
"Zoom Out"
),
_
(
"Zoom out on the module"
),
_
(
"Zoom Out"
),
KiBitmap
(
zoom_out_xpm
)
);
_
(
"Zoom out on the module"
)
);
SET_BITMAP
(
KiBitmap
(
zoom_out_xpm
)
);
viewMenu
->
Append
(
item
);
// Fit on Screen
// Fit on Screen
item
=
new
wxMenuItem
(
viewMenu
,
AddMenuItem
(
viewMenu
,
ID_ZOOM_PAGE
,
ID_ZOOM_PAGE
,
_
(
"Fit on Screen"
),
_
(
"Fit on Screen"
),
_
(
"Zoom and fit the module in the window"
)
);
_
(
"Zoom and fit the module in the window"
),
SET_BITMAP
(
KiBitmap
(
zoom_fit_in_page_xpm
)
);
KiBitmap
(
zoom_fit_in_page_xpm
)
);
viewMenu
->
Append
(
item
);
// Separator
viewMenu
->
AppendSeparator
();
viewMenu
->
AppendSeparator
();
// Redraw
// Redraw
item
=
new
wxMenuItem
(
viewMenu
,
AddMenuItem
(
viewMenu
,
ID_ZOOM_REDRAW
,
ID_ZOOM_REDRAW
,
_
(
"Redraw"
),
_
(
"Redraw the window's viewport"
),
_
(
"Redraw"
),
KiBitmap
(
zoom_redraw_xpm
)
);
_
(
"Redraw the window's viewport"
)
);
SET_BITMAP
(
KiBitmap
(
zoom_redraw_xpm
)
);
viewMenu
->
Append
(
item
);
// 3D view
// 3D view
item
=
new
wxMenuItem
(
viewMenu
,
AddMenuItem
(
viewMenu
,
ID_MENU_PCB_SHOW_3D_FRAME
,
ID_MENU_PCB_SHOW_3D_FRAME
,
_
(
"3D View"
),
_
(
"3D View"
),
_
(
"Show board in 3D viewer"
)
);
_
(
"Show board in 3D viewer"
),
SET_BITMAP
(
KiBitmap
(
three_d_xpm
)
);
KiBitmap
(
three_d_xpm
)
);
viewMenu
->
Append
(
item
);
// Menu Place:
// Menu Place:
wxMenu
*
placeMenu
=
new
wxMenu
;
wxMenu
*
placeMenu
=
new
wxMenu
;
// Pad
// Pad
item
=
new
wxMenuItem
(
placeMenu
,
AddMenuItem
(
placeMenu
,
ID_MODEDIT_PAD_TOOL
,
ID_MODEDIT_PAD_TOOL
,
_
(
"Pad"
),
_
(
"Add pad"
),
_
(
"Pad"
),
KiBitmap
(
pad_xpm
)
);
_
(
"Add pad"
)
);
SET_BITMAP
(
KiBitmap
(
pad_xpm
)
);
placeMenu
->
Append
(
item
);
// Separator
placeMenu
->
AppendSeparator
();
placeMenu
->
AppendSeparator
();
// Circle
// Circle
item
=
new
wxMenuItem
(
placeMenu
,
AddMenuItem
(
placeMenu
,
ID_MODEDIT_CIRCLE_TOOL
,
ID_MODEDIT_CIRCLE_TOOL
,
_
(
"Circle"
),
_
(
"Add graphic circle"
),
_
(
"Circle"
),
KiBitmap
(
add_circle_xpm
)
);
_
(
"Add graphic circle"
)
);
SET_BITMAP
(
KiBitmap
(
add_circle_xpm
)
);
placeMenu
->
Append
(
item
);
// Line or Polygon
// Line or Polygon
item
=
new
wxMenuItem
(
placeMenu
,
AddMenuItem
(
placeMenu
,
ID_MODEDIT_LINE_TOOL
,
ID_MODEDIT_LINE_TOOL
,
_
(
"Line or Polygon"
),
_
(
"Line or Polygon"
),
_
(
"Add graphic line or polygon"
)
);
_
(
"Add graphic line or polygon"
),
SET_BITMAP
(
KiBitmap
(
add_polygon_xpm
)
);
KiBitmap
(
add_polygon_xpm
)
);
placeMenu
->
Append
(
item
);
// Arc
// Arc
item
=
new
wxMenuItem
(
placeMenu
,
AddMenuItem
(
placeMenu
,
ID_MODEDIT_ARC_TOOL
,
ID_MODEDIT_ARC_TOOL
,
_
(
"Arc"
),
_
(
"Add graphic arc"
),
_
(
"Arc"
),
KiBitmap
(
add_arc_xpm
)
);
_
(
"Add graphic arc"
)
);
SET_BITMAP
(
KiBitmap
(
add_arc_xpm
)
);
placeMenu
->
Append
(
item
);
// Text
// Text
item
=
new
wxMenuItem
(
placeMenu
,
AddMenuItem
(
placeMenu
,
ID_MODEDIT_TEXT_TOOL
,
ID_MODEDIT_TEXT_TOOL
,
_
(
"Text"
),
_
(
"Add graphic text"
),
_
(
"Text"
),
KiBitmap
(
add_text_xpm
)
);
_
(
"Add graphic text"
)
);
SET_BITMAP
(
KiBitmap
(
add_text_xpm
)
);
placeMenu
->
Append
(
item
);
// Anchor
// Anchor
placeMenu
->
AppendSeparator
();
placeMenu
->
AppendSeparator
();
item
=
new
wxMenuItem
(
placeMenu
,
AddMenuItem
(
placeMenu
,
ID_MODEDIT_ANCHOR_TOOL
,
ID_MODEDIT_ANCHOR_TOOL
,
_
(
"Anchor"
),
_
(
"Anchor"
),
_
(
"Place the footprint module reference anchor"
)
);
_
(
"Place the footprint module reference anchor"
),
SET_BITMAP
(
KiBitmap
(
anchor_xpm
)
);
KiBitmap
(
anchor_xpm
)
);
placeMenu
->
Append
(
item
);
// Menu Help:
// Menu Help:
wxMenu
*
helpMenu
=
new
wxMenu
;
wxMenu
*
helpMenu
=
new
wxMenu
;
...
@@ -300,13 +230,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
...
@@ -300,13 +230,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry
(
helpMenu
);
AddHelpVersionInfoMenuEntry
(
helpMenu
);
// Contents
// Contents
AddMenuItem
(
helpMenu
,
AddMenuItem
(
helpMenu
,
wxID_HELP
,
wxID_HELP
,
_
(
"&Contents"
),
_
(
"&Contents"
),
_
(
"Open the Pcbnew handbook"
),
_
(
"Open the Pcbnew handbook"
),
KiBitmap
(
online_help_xpm
)
);
KiBitmap
(
online_help_xpm
)
);
AddMenuItem
(
helpMenu
,
AddMenuItem
(
helpMenu
,
wxID_INDEX
,
wxID_INDEX
,
_
(
"&Getting Started in KiCad"
),
_
(
"&Getting Started in KiCad"
),
_
(
"Open the
\"
Getting Started in KiCad
\"
guide for beginners"
),
_
(
"Open the
\"
Getting Started in KiCad
\"
guide for beginners"
),
KiBitmap
(
help_xpm
)
);
KiBitmap
(
help_xpm
)
);
...
...
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