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
162492ef
Commit
162492ef
authored
Dec 30, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change dialog to edit fields in libedit (see CHANGELOG.txt)
parent
930a777e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
10 deletions
+36
-10
dialog_edit_libentry_fields_in_lib.cpp
eeschema/dialog_edit_libentry_fields_in_lib.cpp
+28
-2
dialog_edit_libentry_fields_in_lib_base.cpp
eeschema/dialog_edit_libentry_fields_in_lib_base.cpp
+6
-6
dialog_edit_libentry_fields_in_lib_base.fbp
eeschema/dialog_edit_libentry_fields_in_lib_base.fbp
+1
-1
dialog_edit_libentry_fields_in_lib_base.h
eeschema/dialog_edit_libentry_fields_in_lib_base.h
+1
-1
No files found.
eeschema/dialog_edit_libentry_fields_in_lib.cpp
View file @
162492ef
...
@@ -84,7 +84,7 @@ void EDA_LibComponentStruct::SetFields( const std::vector <LibDrawField> aFields
...
@@ -84,7 +84,7 @@ void EDA_LibComponentStruct::SetFields( const std::vector <LibDrawField> aFields
/* for a user field (FieldId >= FIELD1), if a field value is void,
/* for a user field (FieldId >= FIELD1), if a field value is void,
* fill it with "~" because for a library component a void field is not a very good idea
* fill it with "~" because for a library component a void field is not a very good idea
* (we do not see anything...) and in schematic this text is like a void text
* (we do not see anything...) and in schematic this text is like a void text
* and for no
t editable names, remove the name (thar is the default name
* and for no
n editable names, remove the name (set to the default name)
*/
*/
for
(
LibDrawField
*
Field
=
Fields
;
Field
;
Field
=
Field
->
Next
()
)
for
(
LibDrawField
*
Field
=
Fields
;
Field
;
Field
=
Field
->
Next
()
)
{
{
...
@@ -148,7 +148,6 @@ private:
...
@@ -148,7 +148,6 @@ private:
*/
*/
void
copySelectedFieldToPanel
();
void
copySelectedFieldToPanel
();
/**
/**
* Function copyPanelToSelectedField
* Function copyPanelToSelectedField
* copies the values displayed on the panel fields to the currently selected field
* copies the values displayed on the panel fields to the currently selected field
...
@@ -535,6 +534,14 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
...
@@ -535,6 +534,14 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
style
|=
2
;
style
|=
2
;
m_StyleRadioBox
->
SetSelection
(
style
);
m_StyleRadioBox
->
SetSelection
(
style
);
// Copy the text justification
if
(
field
.
m_HJustify
==
GR_TEXT_HJUSTIFY_LEFT
)
m_FieldHJustifyCtrl
->
SetSelection
(
0
);
else
if
(
field
.
m_HJustify
==
GR_TEXT_HJUSTIFY_RIGHT
)
m_FieldHJustifyCtrl
->
SetSelection
(
2
);
else
m_FieldHJustifyCtrl
->
SetSelection
(
1
);
fieldNameTextCtrl
->
SetValue
(
field
.
m_Name
);
fieldNameTextCtrl
->
SetValue
(
field
.
m_Name
);
// if fieldNdx == REFERENCE, VALUE, FOOTPRINT, or DATASHEET, then disable editing
// if fieldNdx == REFERENCE, VALUE, FOOTPRINT, or DATASHEET, then disable editing
...
@@ -600,6 +607,25 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
...
@@ -600,6 +607,25 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
else
else
field
.
m_Orient
=
TEXT_ORIENT_HORIZ
;
field
.
m_Orient
=
TEXT_ORIENT_HORIZ
;
// Copy the text justification
GRTextHorizJustifyType
hjustify
[
3
]
=
{
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_HJUSTIFY_RIGHT
};
GRTextVertJustifyType
vjustify
[
3
]
=
{
GR_TEXT_VJUSTIFY_BOTTOM
,
GR_TEXT_VJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_TOP
};
field
.
m_HJustify
=
hjustify
[
m_FieldHJustifyCtrl
->
GetSelection
()];
field
.
m_VJustify
=
vjustify
[
m_FieldVJustifyCtrl
->
GetSelection
()];
if
(
field
.
m_VJustify
==
GR_TEXT_VJUSTIFY_BOTTOM
)
m_FieldVJustifyCtrl
->
SetSelection
(
0
);
else
if
(
field
.
m_VJustify
==
GR_TEXT_VJUSTIFY_TOP
)
m_FieldVJustifyCtrl
->
SetSelection
(
2
);
else
m_FieldVJustifyCtrl
->
SetSelection
(
1
);
rotateCheckBox
->
SetValue
(
field
.
m_Orient
==
TEXT_ORIENT_VERT
);
rotateCheckBox
->
SetValue
(
field
.
m_Orient
==
TEXT_ORIENT_VERT
);
/* Void fields for REFERENCE and VALUE are not allowed
/* Void fields for REFERENCE and VALUE are not allowed
...
...
eeschema/dialog_edit_libentry_fields_in_lib_base.cpp
View file @
162492ef
...
@@ -51,13 +51,13 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
...
@@ -51,13 +51,13 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
wxBoxSizer
*
orientationSizer
;
wxBoxSizer
*
orientationSizer
;
orientationSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
orientationSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxString
m_Field
Position
CtrlChoices
[]
=
{
_
(
"Align left"
),
_
(
"Align center"
),
_
(
"Align right"
)
};
wxString
m_Field
HJustify
CtrlChoices
[]
=
{
_
(
"Align left"
),
_
(
"Align center"
),
_
(
"Align right"
)
};
int
m_Field
PositionCtrlNChoices
=
sizeof
(
m_FieldPosition
CtrlChoices
)
/
sizeof
(
wxString
);
int
m_Field
HJustifyCtrlNChoices
=
sizeof
(
m_FieldHJustify
CtrlChoices
)
/
sizeof
(
wxString
);
m_Field
PositionCtrl
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Horiz. Justify"
),
wxDefaultPosition
,
wxDefaultSize
,
m_FieldPositionCtrlNChoices
,
m_FieldPosition
CtrlChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_Field
HJustifyCtrl
=
new
wxRadioBox
(
this
,
wxID_ANY
,
_
(
"Horiz. Justify"
),
wxDefaultPosition
,
wxDefaultSize
,
m_FieldHJustifyCtrlNChoices
,
m_FieldHJustify
CtrlChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_Field
Position
Ctrl
->
SetSelection
(
1
);
m_Field
HJustify
Ctrl
->
SetSelection
(
1
);
m_Field
Position
Ctrl
->
SetToolTip
(
_
(
"Select if the component is to be rotated when drawn"
)
);
m_Field
HJustify
Ctrl
->
SetToolTip
(
_
(
"Select if the component is to be rotated when drawn"
)
);
orientationSizer
->
Add
(
m_Field
Position
Ctrl
,
1
,
wxALL
,
8
);
orientationSizer
->
Add
(
m_Field
HJustify
Ctrl
,
1
,
wxALL
,
8
);
optionsSizer
->
Add
(
orientationSizer
,
1
,
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxEXPAND
|
wxALIGN_CENTER_VERTICAL
,
0
);
optionsSizer
->
Add
(
orientationSizer
,
1
,
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxEXPAND
|
wxALIGN_CENTER_VERTICAL
,
0
);
...
...
eeschema/dialog_edit_libentry_fields_in_lib_base.fbp
View file @
162492ef
...
@@ -373,7 +373,7 @@
...
@@ -373,7 +373,7 @@
<property
name=
"majorDimension"
>
1
</property>
<property
name=
"majorDimension"
>
1
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"maximum_size"
></property>
<property
name=
"minimum_size"
></property>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
m_Field
Position
Ctrl
</property>
<property
name=
"name"
>
m_Field
HJustify
Ctrl
</property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"permission"
>
protected
</property>
<property
name=
"pos"
></property>
<property
name=
"pos"
></property>
<property
name=
"selection"
>
1
</property>
<property
name=
"selection"
>
1
</property>
...
...
eeschema/dialog_edit_libentry_fields_in_lib_base.h
View file @
162492ef
...
@@ -40,7 +40,7 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE : public wxDialog
...
@@ -40,7 +40,7 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE : public wxDialog
wxButton
*
addFieldButton
;
wxButton
*
addFieldButton
;
wxButton
*
deleteFieldButton
;
wxButton
*
deleteFieldButton
;
wxButton
*
moveUpButton
;
wxButton
*
moveUpButton
;
wxRadioBox
*
m_Field
Position
Ctrl
;
wxRadioBox
*
m_Field
HJustify
Ctrl
;
wxRadioBox
*
m_FieldVJustifyCtrl
;
wxRadioBox
*
m_FieldVJustifyCtrl
;
wxCheckBox
*
showCheckBox
;
wxCheckBox
*
showCheckBox
;
wxCheckBox
*
rotateCheckBox
;
wxCheckBox
*
rotateCheckBox
;
...
...
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