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
21dbfef3
Commit
21dbfef3
authored
Sep 26, 2012
by
Felix Morgner
Committed by
Dick Hollenbeck
Sep 26, 2012
Browse files
Options
Browse Files
Download
Plain Diff
Added support for multi-selection and multi-editing in cvpcb.
parents
92f8f006
4fec2126
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
32 deletions
+56
-32
class_components_listbox.cpp
cvpcb/class_components_listbox.cpp
+1
-1
cvstruct.h
cvpcb/cvstruct.h
+2
-1
listboxes.cpp
cvpcb/listboxes.cpp
+4
-3
readwrite_dlgs.cpp
cvpcb/readwrite_dlgs.cpp
+49
-27
No files found.
cvpcb/class_components_listbox.cpp
View file @
21dbfef3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
COMPONENTS_LISTBOX
::
COMPONENTS_LISTBOX
(
CVPCB_MAINFRAME
*
parent
,
wxWindowID
id
,
COMPONENTS_LISTBOX
::
COMPONENTS_LISTBOX
(
CVPCB_MAINFRAME
*
parent
,
wxWindowID
id
,
const
wxPoint
&
loc
,
const
wxSize
&
size
,
const
wxPoint
&
loc
,
const
wxSize
&
size
,
int
nbitems
,
wxString
choice
[]
)
:
int
nbitems
,
wxString
choice
[]
)
:
ITEMS_LISTBOX_BASE
(
parent
,
id
,
loc
,
size
)
ITEMS_LISTBOX_BASE
(
parent
,
id
,
loc
,
size
,
~
wxLC_SINGLE_SEL
)
{
{
}
}
...
...
cvpcb/cvstruct.h
View file @
21dbfef3
...
@@ -18,7 +18,8 @@ class ITEMS_LISTBOX_BASE : public wxListView
...
@@ -18,7 +18,8 @@ class ITEMS_LISTBOX_BASE : public wxListView
{
{
public
:
public
:
ITEMS_LISTBOX_BASE
(
CVPCB_MAINFRAME
*
aParent
,
wxWindowID
aId
,
ITEMS_LISTBOX_BASE
(
CVPCB_MAINFRAME
*
aParent
,
wxWindowID
aId
,
const
wxPoint
&
aLocation
,
const
wxSize
&
aSize
);
const
wxPoint
&
aLocation
,
const
wxSize
&
aSize
,
long
aStyle
=
wxLC_SINGLE_SEL
);
~
ITEMS_LISTBOX_BASE
();
~
ITEMS_LISTBOX_BASE
();
...
...
cvpcb/listboxes.cpp
View file @
21dbfef3
...
@@ -19,11 +19,12 @@
...
@@ -19,11 +19,12 @@
******************************************************************************/
******************************************************************************/
#define LISTB_STYLE wxSUNKEN_BORDER | wxLC_NO_HEADER | \
#define LISTB_STYLE wxSUNKEN_BORDER | wxLC_NO_HEADER | \
wxLC_
SINGLE_SEL | wxLC_
REPORT | wxLC_VIRTUAL
wxLC_REPORT | wxLC_VIRTUAL
ITEMS_LISTBOX_BASE
::
ITEMS_LISTBOX_BASE
(
CVPCB_MAINFRAME
*
aParent
,
wxWindowID
aId
,
ITEMS_LISTBOX_BASE
::
ITEMS_LISTBOX_BASE
(
CVPCB_MAINFRAME
*
aParent
,
wxWindowID
aId
,
const
wxPoint
&
aLocation
,
const
wxSize
&
aSize
)
:
const
wxPoint
&
aLocation
,
const
wxSize
&
aSize
,
wxListView
(
aParent
,
aId
,
aLocation
,
aSize
,
LISTB_STYLE
)
long
aStyle
)
:
wxListView
(
aParent
,
aId
,
aLocation
,
aSize
,
LISTB_STYLE
|
aStyle
)
{
{
InsertColumn
(
0
,
wxEmptyString
);
InsertColumn
(
0
,
wxEmptyString
);
SetColumnWidth
(
0
,
wxLIST_AUTOSIZE
);
SetColumnWidth
(
0
,
wxLIST_AUTOSIZE
);
...
...
cvpcb/readwrite_dlgs.cpp
View file @
21dbfef3
...
@@ -39,52 +39,74 @@
...
@@ -39,52 +39,74 @@
#define titleComponentLibErr _( "Component Library Error" )
#define titleComponentLibErr _( "Component Library Error" )
void
CVPCB_MAINFRAME
::
SetNewPkg
(
const
wxString
&
aFootprintName
)
void
CVPCB_MAINFRAME
::
SetNewPkg
(
const
wxString
&
aFootprintName
)
{
{
COMPONENT_INFO
*
C
omponent
;
COMPONENT_INFO
*
c
omponent
;
bool
isUndefined
=
false
;
bool
hasFootprint
=
false
;
int
NumCmp
;
int
componentIndex
;
wxString
msg
;
wxString
description
;
if
(
m_components
.
empty
()
)
if
(
m_components
.
empty
()
)
return
;
return
;
NumCmp
=
m_ListCmp
->
GetSelection
();
// if no component is selected, select the first one
if
(
NumCmp
<
0
)
if
(
m_ListCmp
->
GetFirstSelected
()
<
0
)
{
{
NumCmp
=
0
;
componentIndex
=
0
;
m_ListCmp
->
SetSelection
(
NumCmp
,
true
);
m_ListCmp
->
SetSelection
(
componentIndex
,
true
);
}
}
Component
=
&
m_components
[
NumCmp
];
// iterate over the selection
while
(
m_ListCmp
->
GetFirstSelected
()
!=
-
1
)
{
// get the component for the current iteration
if
(
Component
==
NULL
)
componentIndex
=
m_ListCmp
->
GetFirstSelected
();
component
=
&
m_components
[
componentIndex
];
if
(
component
==
NULL
)
return
;
return
;
isUndefined
=
Component
->
m_Footprint
.
IsEmpty
();
// check to see if the component has allready a footprint set.
Component
->
m_Footprint
=
aFootprintName
;
hasFootprint
=
!
(
component
->
m_Footprint
.
IsEmpty
())
;
msg
.
Printf
(
CMP_FORMAT
,
NumCmp
+
1
,
component
->
m_Footprint
=
aFootprintName
;
GetChars
(
Component
->
m_Reference
),
GetChars
(
Component
->
m_Value
),
// create the new component description
GetChars
(
Component
->
m_Footprint
)
);
m_modified
=
true
;
if
(
isUndefined
)
description
.
Printf
(
CMP_FORMAT
,
componentIndex
+
1
,
GetChars
(
component
->
m_Reference
),
GetChars
(
component
->
m_Value
),
GetChars
(
component
->
m_Footprint
)
);
// if the component hasn't had a footprint associated with it
// it now has, so we decrement the count of components without
// a footprint assigned.
if
(
!
hasFootprint
)
{
hasFootprint
=
true
;
m_undefinedComponentCnt
-=
1
;
m_undefinedComponentCnt
-=
1
;
}
m_ListCmp
->
SetString
(
NumCmp
,
msg
);
// set the new description and deselect the processed component
m_ListCmp
->
SetSelection
(
NumCmp
,
false
);
m_ListCmp
->
SetString
(
componentIndex
,
description
);
m_ListCmp
->
SetSelection
(
componentIndex
,
false
);
}
// mark this "session" as modified
m_modified
=
true
;
//
We activate next component:
//
select the next component, if there is one
if
(
NumCmp
<
(
m_ListCmp
->
GetCount
()
-
1
)
)
if
(
componentIndex
<
(
m_ListCmp
->
GetCount
()
-
1
)
)
NumCmp
++
;
componentIndex
++
;
m_ListCmp
->
SetSelection
(
NumCmp
,
true
);
m_ListCmp
->
SetSelection
(
componentIndex
,
true
);
// update the statusbar
DisplayStatus
();
DisplayStatus
();
}
}
...
...
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