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
ccb910eb
Commit
ccb910eb
authored
Dec 18, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cvpcb: fix incorrect behavior when clicking on a component
parent
e50d18bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
37 deletions
+58
-37
cvframe.cpp
cvpcb/cvframe.cpp
+39
-15
cvpcb_mainframe.h
cvpcb/cvpcb_mainframe.h
+8
-0
setvisu.cpp
cvpcb/setvisu.cpp
+11
-22
No files found.
cvpcb/cvframe.cpp
View file @
ccb910eb
...
...
@@ -500,36 +500,47 @@ void CVPCB_MAINFRAME::OnLeftDClick( wxListEvent& event )
}
/* Called when clicking on a component in component list window
* * Updates the filtered foorprint list, if the filtered list option is selected
* * Updates the current selected footprint in footprint list
* * Updates the footprint shown in footprint display window (if opened)
*/
void
CVPCB_MAINFRAME
::
OnSelectComponent
(
wxListEvent
&
event
)
{
int
selection
;
#define REDRAW_LIST true
#define SELECT_FULL_LIST true
int
selection
=
-
1
;
if
(
!
m_mainToolBar
->
GetToolToggled
(
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST
)
)
m_FootprintList
->
SetActiveFootprintList
(
SELECT_FULL_LIST
,
REDRAW_LIST
);
else
{
m_FootprintList
->
SetActiveFootprintList
(
true
,
true
);
return
;
selection
=
m_ListCmp
->
GetSelection
();
if
(
selection
<
0
)
m_FootprintList
->
SetActiveFootprintList
(
SELECT_FULL_LIST
,
REDRAW_LIST
);
else
{
if
(
&
m_components
[
selection
]
==
NULL
)
m_FootprintList
->
SetActiveFootprintList
(
SELECT_FULL_LIST
,
REDRAW_LIST
);
else
m_FootprintList
->
SetFootprintFilteredList
(
&
m_components
[
selection
],
m_footprints
);
}
}
selection
=
m_ListCmp
->
GetSelection
();
if
(
selection
<
0
)
{
m_FootprintList
->
SetActiveFootprintList
(
true
,
true
);
return
;
}
if
(
&
m_components
[
selection
]
==
NULL
)
{
m_FootprintList
->
SetActiveFootprintList
(
true
,
true
);
return
;
}
m_FootprintList
->
SetFootprintFilteredList
(
&
m_components
[
selection
],
m_footprints
);
// Preview of the already assigned footprint.
// Find the footprint that was already choosen for this component and select it.
wxString
module
=
*
(
&
m_components
[
selection
].
m_Module
);
bool
found
=
false
;
for
(
int
ii
=
0
;
ii
<
m_FootprintList
->
GetCount
();
ii
++
)
{
wxString
footprintName
;
...
...
@@ -539,11 +550,24 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
footprintName
=
msg
.
AfterFirst
(
wxChar
(
' '
)
);
if
(
module
.
Cmp
(
footprintName
)
==
0
)
{
m_FootprintList
->
SetSelection
(
ii
,
true
);
else
found
=
true
;
break
;
}
}
if
(
!
found
)
{
int
ii
=
m_FootprintList
->
GetSelection
();
if
(
ii
>=
0
)
m_FootprintList
->
SetSelection
(
ii
,
false
);
if
(
m_DisplayFootprintFrame
)
{
CreateScreenCmp
();
}
}
SendMessageToEESCHEMA
();
DisplayStatus
();
}
...
...
cvpcb/cvpcb_mainframe.h
View file @
ccb910eb
...
...
@@ -54,6 +54,14 @@ public:
void
OnLeftClick
(
wxListEvent
&
event
);
void
OnLeftDClick
(
wxListEvent
&
event
);
/**
* Function OnSelectComponent
* Called when clicking on a component in component list window
* * Updates the filtered foorprint list, if the filtered list option is selected
* * Updates the current selected footprint in footprint list
* * Updates the footprint shown in footprint display window (if opened)
*/
void
OnSelectComponent
(
wxListEvent
&
event
);
void
OnQuit
(
wxCommandEvent
&
event
);
...
...
cvpcb/setvisu.cpp
View file @
ccb910eb
...
...
@@ -84,13 +84,22 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
m_DisplayFootprintFrame
->
Zoom_Automatique
(
false
);
m_DisplayFootprintFrame
->
DrawPanel
->
Refresh
();
m_DisplayFootprintFrame
->
UpdateStatusBar
();
/* Display new cursor coordinates and zoom value */
// Display new cursor coordinates and zoom value:
m_DisplayFootprintFrame
->
UpdateStatusBar
();
if
(
m_DisplayFootprintFrame
->
m_Draw3DFrame
)
m_DisplayFootprintFrame
->
m_Draw3DFrame
->
NewDisplay
();
}
else
if
(
!
IsNew
)
else
if
(
!
IsNew
)
// No footprint to display. Erase old footprint, if any
{
if
(
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
GetCount
()
)
{
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
DeleteAll
();
m_DisplayFootprintFrame
->
Zoom_Automatique
(
false
);
m_DisplayFootprintFrame
->
SetStatusText
(
wxEmptyString
,
0
);
m_DisplayFootprintFrame
->
UpdateStatusBar
();
}
m_DisplayFootprintFrame
->
Refresh
();
if
(
m_DisplayFootprintFrame
->
m_Draw3DFrame
)
...
...
@@ -98,8 +107,6 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
}
}
/*
* Draws the current highlighted footprint.
*/
...
...
@@ -131,21 +138,3 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
m_Modules
->
Draw
(
aPanel
,
aDC
,
GR_COPY
);
}
}
/* dummy_functions:
*
* These functions are used in some classes.
* they are useful in Pcbnew, but have no meaning or are never used
* in CvPcb or GerbView.
* but they must exist because they appear in some classes.
* Do nothing in CvPcb.
*/
TRACK
*
MarkTrace
(
BOARD
*
aPcb
,
TRACK
*
aStartSegm
,
int
*
aSegmCount
,
int
*
aTrackLen
,
int
*
aLenDie
,
bool
aReorder
)
{
return
NULL
;
}
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