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
d1b73df4
Commit
d1b73df4
authored
May 31, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cvpcb: code cleaning and minot fix
parent
c5869705
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
42 deletions
+46
-42
class_DisplayFootprintsFrame.h
cvpcb/class_DisplayFootprintsFrame.h
+8
-0
setvisu.cpp
cvpcb/setvisu.cpp
+38
-42
No files found.
cvpcb/class_DisplayFootprintsFrame.h
View file @
d1b73df4
...
...
@@ -34,6 +34,14 @@ public:
void
OnUpdateTextDrawMode
(
wxUpdateUIEvent
&
aEvent
);
void
OnUpdateLineDrawMode
(
wxUpdateUIEvent
&
aEvent
);
/**
* Function InitDisplay
* Refresh the full display for this frame:
* Set the title, the status line and redraw the canvas
* Must be called after the footprint to display is modifed
*/
void
InitDisplay
();
/**
* Function IsGridVisible() , virtual
* @return true if the grid must be shown
...
...
cvpcb/setvisu.cpp
View file @
d1b73df4
...
...
@@ -30,82 +30,78 @@
*/
void
CVPCB_MAINFRAME
::
CreateScreenCmp
()
{
wxString
msg
,
FootprintName
;
bool
IsNew
=
false
;
FootprintName
=
m_FootprintList
->
GetSelectedFootprint
();
if
(
m_DisplayFootprintFrame
==
NULL
)
{
m_DisplayFootprintFrame
=
new
DISPLAY_FOOTPRINTS_FRAME
(
this
,
_
(
"Module"
),
wxPoint
(
0
,
0
),
wxSize
(
600
,
400
),
KICAD_DEFAULT_DRAWFRAME_STYLE
);
IsNew
=
true
;
m_DisplayFootprintFrame
->
Show
(
true
);
}
else
{
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if
(
m_DisplayFootprintFrame
->
IsIconized
()
)
m_DisplayFootprintFrame
->
Iconize
(
false
);
m_DisplayFootprintFrame
->
Raise
();
// Raising the window does not set the focus on Linux. This should work on any platform.
if
(
wxWindow
::
FindFocus
()
!=
m_DisplayFootprintFrame
)
m_DisplayFootprintFrame
->
SetFocus
();
}
if
(
!
FootprintName
.
IsEmpty
()
)
m_DisplayFootprintFrame
->
InitDisplay
();
}
/* Refresh the full display for this frame:
* Set the title, the status line and redraw the canvas
* Must be called after the footprint to display is modifed
*/
void
DISPLAY_FOOTPRINTS_FRAME
::
InitDisplay
()
{
wxString
msg
;
CVPCB_MAINFRAME
*
parentframe
=
(
CVPCB_MAINFRAME
*
)
GetParent
();
wxString
footprintName
=
parentframe
->
m_FootprintList
->
GetSelectedFootprint
();
if
(
!
footprintName
.
IsEmpty
()
)
{
msg
=
_
(
"Footprint: "
)
+
F
ootprintName
;
m_DisplayFootprintFrame
->
SetTitle
(
msg
);
FOOTPRINT_INFO
*
Module
=
m_footprints
.
GetModuleInfo
(
F
ootprintName
);
msg
=
_
(
"Footprint: "
)
+
f
ootprintName
;
SetTitle
(
msg
);
FOOTPRINT_INFO
*
module_info
=
parentframe
->
m_footprints
.
GetModuleInfo
(
f
ootprintName
);
msg
=
_
(
"Lib: "
);
if
(
Module
)
msg
+=
Module
->
m_LibName
;
if
(
module_info
)
msg
+=
module_info
->
m_LibName
;
else
msg
+=
wxT
(
"???"
);
m_DisplayFootprintFrame
->
SetStatusText
(
msg
,
0
);
SetStatusText
(
msg
,
0
);
if
(
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
GetCount
()
)
if
(
GetBoard
()
->
m_Modules
.
GetCount
()
)
{
// there is only one module in the list
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
DeleteAll
();
GetBoard
()
->
m_Modules
.
DeleteAll
();
}
MODULE
*
mod
=
m_DisplayFootprintFrame
->
Get_Module
(
FootprintName
);
if
(
mod
)
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
PushBack
(
mod
);
MODULE
*
module
=
Get_Module
(
footprintName
);
m_DisplayFootprintFrame
->
Zoom_Automatique
(
false
);
m_DisplayFootprintFrame
->
GetCanvas
()
->
Refresh
(
);
if
(
module
)
GetBoard
()
->
m_Modules
.
PushBack
(
module
);
// Display new cursor coordinates and zoom value:
m_DisplayFootprintFrame
->
UpdateStatusBar
();
Zoom_Automatique
(
false
);
if
(
m_DisplayFootprintFrame
->
m_Draw3DFrame
)
m_DisplayFootprintFrame
->
m_Draw3DFrame
->
NewDisplay
();
}
else
if
(
!
IsNew
)
// No footprint to display. Erase old footprint, if any
else
// No footprint to display. Erase old footprint, if any
{
if
(
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
GetCount
()
)
if
(
GetBoard
()
->
m_Modules
.
GetCount
()
)
{
m_DisplayFootprintFrame
->
GetBoard
()
->
m_Modules
.
DeleteAll
();
m_DisplayFootprintFrame
->
Zoom_Automatique
(
false
);
m_DisplayFootprintFrame
->
SetStatusText
(
wxEmptyString
,
0
);
m_DisplayFootprintFrame
->
UpdateStatusBar
();
GetBoard
()
->
m_Modules
.
DeleteAll
();
Zoom_Automatique
(
false
);
SetStatusText
(
wxEmptyString
,
0
);
}
}
m_DisplayFootprintFrame
->
Refresh
();
// Display new cursor coordinates and zoom value:
UpdateStatusBar
();
if
(
m_DisplayFootprintFrame
->
m_Draw3DFrame
)
m_DisplayFootprintFrame
->
m_Draw3DFrame
->
NewDisplay
();
}
GetCanvas
()
->
Refresh
();
if
(
m_Draw3DFrame
)
m_Draw3DFrame
->
NewDisplay
();
}
/*
...
...
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