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
4f1c1469
Commit
4f1c1469
authored
Nov 26, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done with "edit component in schematic editor"
parent
226648f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
106 additions
and
7 deletions
+106
-7
change_log.txt
change_log.txt
+1
-1
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+89
-2
dialog_edit_component_in_schematic.fbp
eeschema/dialog_edit_component_in_schematic.fbp
+3
-3
dialog_edit_component_in_schematic.h
eeschema/dialog_edit_component_in_schematic.h
+4
-1
dialog_edit_component_in_schematic_fbp.cpp
eeschema/dialog_edit_component_in_schematic_fbp.cpp
+6
-0
dialog_edit_component_in_schematic_fbp.h
eeschema/dialog_edit_component_in_schematic_fbp.h
+3
-0
No files found.
change_log.txt
View file @
4f1c1469
...
...
@@ -8,7 +8,7 @@ email address.
2008-Nov-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+eeschema
edit component in schematic editor. works
except for field add, remove, move up
.
edit component in schematic editor. works
pretty well, I'm done
.
2008-Nov-24 UPDATE Dick Hollenbeck <dick@softplc.com>
...
...
eeschema/dialog_edit_component_in_schematic.cpp
View file @
4f1c1469
...
...
@@ -52,6 +52,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow
m_Parent
=
(
WinEDA_SchematicFrame
*
)
parent
;
m_LibEntry
=
0
;
m_skipCopyFromPanel
=
false
;
wxListItem
columnLabel
;
...
...
@@ -86,8 +87,11 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemDeselected( wxListEvent& even
{
D
(
printf
(
"OnListItemDeselected()
\n
"
);)
if
(
!
copyPanelToSelectedField
()
)
event
.
Skip
();
// do not go to the next row
if
(
!
m_skipCopyFromPanel
)
{
if
(
!
copyPanelToSelectedField
()
)
event
.
Skip
();
// do not go to the next row
}
}
...
...
@@ -229,6 +233,89 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
}
void
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
addFieldButtonHandler
(
wxCommandEvent
&
event
)
{
// in case m_FieldsBuf[REFERENCE].m_Orient has changed on screen only, grab
// screen contents.
if
(
!
copyPanelToSelectedField
()
)
return
;
unsigned
fieldNdx
=
m_FieldsBuf
.
size
();
SCH_CMP_FIELD
blank
(
wxPoint
(),
fieldNdx
,
m_Cmp
);
blank
.
m_Orient
=
m_FieldsBuf
[
REFERENCE
].
m_Orient
;
m_FieldsBuf
.
push_back
(
blank
);
setRowItem
(
fieldNdx
,
m_FieldsBuf
[
fieldNdx
]
);
m_skipCopyFromPanel
=
true
;
setSelectedFieldNdx
(
fieldNdx
);
m_skipCopyFromPanel
=
false
;
}
void
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
deleteFieldButtonHandler
(
wxCommandEvent
&
event
)
{
unsigned
fieldNdx
=
getSelectedFieldNdx
();
if
(
fieldNdx
>=
m_FieldsBuf
.
size
()
)
// traps the -1 case too
return
;
if
(
fieldNdx
<
FIELD1
)
{
wxBell
();
return
;
}
m_FieldsBuf
.
erase
(
m_FieldsBuf
.
begin
()
+
fieldNdx
);
fieldListCtrl
->
DeleteItem
(
fieldNdx
);
if
(
fieldNdx
>=
m_FieldsBuf
.
size
()
)
--
fieldNdx
;
m_skipCopyFromPanel
=
true
;
setSelectedFieldNdx
(
fieldNdx
);
m_skipCopyFromPanel
=
false
;
}
void
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
moveUpButtonHandler
(
wxCommandEvent
&
event
)
{
unsigned
fieldNdx
=
getSelectedFieldNdx
();
if
(
fieldNdx
>=
m_FieldsBuf
.
size
()
)
// traps the -1 case too
return
;
if
(
fieldNdx
<=
FIELD1
)
{
wxBell
();
return
;
}
if
(
!
copyPanelToSelectedField
()
)
return
;
// swap the fieldNdx field with the one before it, in both the vector
// and in the fieldListCtrl
SCH_CMP_FIELD
tmp
=
m_FieldsBuf
[
fieldNdx
-
1
];
D
(
printf
(
"tmp.m_Text=
\"
%s
\"
tmp.m_Name=
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
tmp
.
m_Text
),
CONV_TO_UTF8
(
tmp
.
m_Name
)
);
)
m_FieldsBuf
[
fieldNdx
-
1
]
=
m_FieldsBuf
[
fieldNdx
];
setRowItem
(
fieldNdx
-
1
,
m_FieldsBuf
[
fieldNdx
]
);
m_FieldsBuf
[
fieldNdx
]
=
tmp
;
setRowItem
(
fieldNdx
,
tmp
);
m_skipCopyFromPanel
=
true
;
setSelectedFieldNdx
(
fieldNdx
-
1
);
m_skipCopyFromPanel
=
false
;
}
void
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
setSelectedFieldNdx
(
int
aFieldNdx
)
{
/* deselect old selection, but I think this is done by single selection flag within fieldListCtrl
...
...
eeschema/dialog_edit_component_in_schematic.fbp
View file @
4f1c1469
...
...
@@ -620,7 +620,7 @@
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnButtonClick"
></event>
<event
name=
"OnButtonClick"
>
addFieldButtonHandler
</event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
...
...
@@ -676,7 +676,7 @@
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnButtonClick"
></event>
<event
name=
"OnButtonClick"
>
deleteFieldButtonHandler
</event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
...
...
@@ -732,7 +732,7 @@
<property
name=
"window_extra_style"
></property>
<property
name=
"window_name"
></property>
<property
name=
"window_style"
></property>
<event
name=
"OnButtonClick"
></event>
<event
name=
"OnButtonClick"
>
moveUpButtonHandler
</event>
<event
name=
"OnChar"
></event>
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
...
...
eeschema/dialog_edit_component_in_schematic.h
View file @
4f1c1469
...
...
@@ -15,6 +15,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEM
WinEDA_SchematicFrame
*
m_Parent
;
SCH_COMPONENT
*
m_Cmp
;
EDA_LibComponentStruct
*
m_LibEntry
;
bool
m_skipCopyFromPanel
;
static
int
s_SelectedRow
;
...
...
@@ -53,7 +54,9 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEM
void
OnCancelButtonClick
(
wxCommandEvent
&
event
);
void
OnOKButtonClick
(
wxCommandEvent
&
event
);
void
SetInitCmp
(
wxCommandEvent
&
event
);
void
addFieldButtonHandler
(
wxCommandEvent
&
event
);
void
deleteFieldButtonHandler
(
wxCommandEvent
&
event
);
void
moveUpButtonHandler
(
wxCommandEvent
&
event
);
protected
:
...
...
eeschema/dialog_edit_component_in_schematic_fbp.cpp
View file @
4f1c1469
...
...
@@ -227,6 +227,9 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
// Connect Events
fieldListCtrl
->
Connect
(
wxEVT_COMMAND_LIST_ITEM_DESELECTED
,
wxListEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnListItemDeselected
),
NULL
,
this
);
fieldListCtrl
->
Connect
(
wxEVT_COMMAND_LIST_ITEM_SELECTED
,
wxListEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnListItemSelected
),
NULL
,
this
);
addFieldButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
addFieldButtonHandler
),
NULL
,
this
);
deleteFieldButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
deleteFieldButtonHandler
),
NULL
,
this
);
moveUpButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
moveUpButtonHandler
),
NULL
,
this
);
defaultsButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
SetInitCmp
),
NULL
,
this
);
stdDialogButtonSizerCancel
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnCancelButtonClick
),
NULL
,
this
);
stdDialogButtonSizerOK
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnOKButtonClick
),
NULL
,
this
);
...
...
@@ -237,6 +240,9 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
// Disconnect Events
fieldListCtrl
->
Disconnect
(
wxEVT_COMMAND_LIST_ITEM_DESELECTED
,
wxListEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnListItemDeselected
),
NULL
,
this
);
fieldListCtrl
->
Disconnect
(
wxEVT_COMMAND_LIST_ITEM_SELECTED
,
wxListEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnListItemSelected
),
NULL
,
this
);
addFieldButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
addFieldButtonHandler
),
NULL
,
this
);
deleteFieldButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
deleteFieldButtonHandler
),
NULL
,
this
);
moveUpButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
moveUpButtonHandler
),
NULL
,
this
);
defaultsButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
SetInitCmp
),
NULL
,
this
);
stdDialogButtonSizerCancel
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnCancelButtonClick
),
NULL
,
this
);
stdDialogButtonSizerOK
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
::
OnOKButtonClick
),
NULL
,
this
);
...
...
eeschema/dialog_edit_component_in_schematic_fbp.h
View file @
4f1c1469
...
...
@@ -69,6 +69,9 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public wxDialog
// Virtual event handlers, overide them in your derived class
virtual
void
OnListItemDeselected
(
wxListEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnListItemSelected
(
wxListEvent
&
event
){
event
.
Skip
();
}
virtual
void
addFieldButtonHandler
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
deleteFieldButtonHandler
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
moveUpButtonHandler
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
SetInitCmp
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnCancelButtonClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnOKButtonClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
...
...
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