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
0a6de2e1
Commit
0a6de2e1
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FOOTPRINT_VIEWER_FRAME handles events from toolbar buttons and hot keys.
parent
2f7706e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
modview_frame.cpp
pcbnew/modview_frame.cpp
+26
-8
No files found.
pcbnew/modview_frame.cpp
View file @
0a6de2e1
...
@@ -55,6 +55,11 @@
...
@@ -55,6 +55,11 @@
#include <wildcards_and_files_ext.h>
#include <wildcards_and_files_ext.h>
#include <pcbnew_config.h>
#include <pcbnew_config.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include "tools/pcbnew_control.h"
#include "tools/common_actions.h"
#include <boost/bind.hpp>
#include <boost/bind.hpp>
...
@@ -144,14 +149,6 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
...
@@ -144,14 +149,6 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
m_footprintList
=
new
wxListBox
(
this
,
ID_MODVIEW_FOOTPRINT_LIST
,
m_footprintList
=
new
wxListBox
(
this
,
ID_MODVIEW_FOOTPRINT_LIST
,
wxDefaultPosition
,
wxDefaultSize
,
0
,
NULL
,
wxLB_HSCROLL
);
wxDefaultPosition
,
wxDefaultSize
,
0
,
NULL
,
wxLB_HSCROLL
);
// Create GAL canvas
EDA_DRAW_FRAME
*
drawFrame
=
static_cast
<
EDA_DRAW_FRAME
*>
(
aParent
);
PCB_DRAW_PANEL_GAL
*
drawPanel
=
new
PCB_DRAW_PANEL_GAL
(
this
,
-
1
,
wxPoint
(
0
,
0
),
m_FrameSize
,
drawFrame
->
GetGalCanvas
()
->
GetBackend
()
);
SetGalCanvas
(
drawPanel
);
SetBoard
(
new
BOARD
()
);
// Ensure all layers and items are visible:
// Ensure all layers and items are visible:
GetBoard
()
->
SetVisibleAlls
();
GetBoard
()
->
SetVisibleAlls
();
SetScreen
(
new
PCB_SCREEN
(
GetPageSizeIU
()
)
);
SetScreen
(
new
PCB_SCREEN
(
GetPageSizeIU
()
)
);
...
@@ -169,6 +166,23 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
...
@@ -169,6 +166,23 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
ReCreateLibraryList
();
ReCreateLibraryList
();
UpdateTitle
();
UpdateTitle
();
EDA_DRAW_FRAME
*
drawFrame
=
static_cast
<
EDA_DRAW_FRAME
*>
(
aParent
);
// Create GAL canvas
PCB_DRAW_PANEL_GAL
*
drawPanel
=
new
PCB_DRAW_PANEL_GAL
(
this
,
-
1
,
wxPoint
(
0
,
0
),
m_FrameSize
,
drawFrame
->
GetGalCanvas
()
->
GetBackend
()
);
SetGalCanvas
(
drawPanel
);
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager
=
new
TOOL_MANAGER
;
m_toolManager
->
SetEnvironment
(
GetBoard
(),
drawPanel
->
GetView
(),
drawPanel
->
GetViewControls
(),
this
);
m_toolDispatcher
=
new
TOOL_DISPATCHER
(
m_toolManager
);
drawPanel
->
SetEventDispatcher
(
m_toolDispatcher
);
m_toolManager
->
RegisterTool
(
new
PCBNEW_CONTROL
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
RUN
);
// If a footprint was previously loaded, reload it
// If a footprint was previously loaded, reload it
if
(
getCurNickname
().
size
()
&&
getCurFootprintName
().
size
()
)
if
(
getCurNickname
().
size
()
&&
getCurFootprintName
().
size
()
)
{
{
...
@@ -277,6 +291,10 @@ const wxChar* FOOTPRINT_VIEWER_FRAME::GetFootprintViewerFrameName()
...
@@ -277,6 +291,10 @@ const wxChar* FOOTPRINT_VIEWER_FRAME::GetFootprintViewerFrameName()
void
FOOTPRINT_VIEWER_FRAME
::
OnCloseWindow
(
wxCloseEvent
&
Event
)
void
FOOTPRINT_VIEWER_FRAME
::
OnCloseWindow
(
wxCloseEvent
&
Event
)
{
{
DBG
(
printf
(
"%s:
\n
"
,
__func__
);)
DBG
(
printf
(
"%s:
\n
"
,
__func__
);)
if
(
IsGalCanvasActive
()
)
GetGalCanvas
()
->
StopDrawing
();
if
(
IsModal
()
)
if
(
IsModal
()
)
{
{
// Only dismiss a modal frame once, so that the return values set by
// Only dismiss a modal frame once, so that the return values set by
...
...
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