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
50afd515
Commit
50afd515
authored
Apr 30, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleaning.
parent
c4888afb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
41 deletions
+21
-41
draw_panel_gal.cpp
common/draw_panel_gal.cpp
+21
-41
No files found.
common/draw_panel_gal.cpp
View file @
50afd515
...
@@ -99,17 +99,10 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
...
@@ -99,17 +99,10 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
EDA_DRAW_PANEL_GAL
::~
EDA_DRAW_PANEL_GAL
()
EDA_DRAW_PANEL_GAL
::~
EDA_DRAW_PANEL_GAL
()
{
{
if
(
m_painter
)
delete
m_painter
;
delete
m_painter
;
delete
m_viewControls
;
delete
m_view
;
if
(
m_viewControls
)
delete
m_gal
;
delete
m_viewControls
;
if
(
m_view
)
delete
m_view
;
if
(
m_gal
)
delete
m_gal
;
}
}
...
@@ -194,42 +187,29 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
...
@@ -194,42 +187,29 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
m_eventDispatcher
=
aEventDispatcher
;
m_eventDispatcher
=
aEventDispatcher
;
#if wxCHECK_VERSION( 3, 0, 0 )
#if wxCHECK_VERSION( 3, 0, 0 )
if
(
m_eventDispatcher
)
const
wxEventType
eventTypes
[]
=
{
wxEVT_TOOL
};
{
m_parent
->
Connect
(
wxEVT_TOOL
,
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
NULL
,
m_eventDispatcher
);
}
else
{
// While loops are used to be sure, that we are removing all event handlers
while
(
m_parent
->
Disconnect
(
wxEVT_TOOL
,
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
NULL
,
m_eventDispatcher
)
);
}
#else
#else
const
wxEventType
eventTypes
[]
=
{
wxEVT_COMMAND_MENU_SELECTED
,
wxEVT_COMMAND_TOOL_CLICKED
};
#endif
if
(
m_eventDispatcher
)
if
(
m_eventDispatcher
)
{
{
m_parent
->
Connect
(
wxEVT_COMMAND_MENU_SELECTED
,
BOOST_FOREACH
(
wxEventType
type
,
eventTypes
)
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
{
NULL
,
m_eventDispatcher
);
m_parent
->
Connect
(
type
,
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
NULL
,
m_eventDispatcher
);
m_parent
->
Connect
(
wxEVT_COMMAND_TOOL_CLICKED
,
}
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
NULL
,
m_eventDispatcher
);
}
}
else
else
{
{
// While loops are used to be sure, that we are removing all event handlers
BOOST_FOREACH
(
wxEventType
type
,
eventTypes
)
while
(
m_parent
->
Disconnect
(
wxEVT_COMMAND_MENU_SELECTED
,
{
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
// While loop is used to be sure that all event handlers are removed.
NULL
,
m_eventDispatcher
)
);
while
(
m_parent
->
Disconnect
(
type
,
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
while
(
m_parent
->
Disconnect
(
wxEVT_COMMAND_TOOL_CLICKED
,
NULL
,
m_eventDispatcher
)
);
wxCommandEventHandler
(
TOOL_DISPATCHER
::
DispatchWxCommand
),
}
NULL
,
m_eventDispatcher
)
);
}
}
#endif
}
}
...
@@ -316,7 +296,7 @@ bool EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
...
@@ -316,7 +296,7 @@ bool EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
m_backend
=
aGalType
;
m_backend
=
aGalType
;
}
}
catch
(
std
::
runtime_error
&
err
)
catch
(
std
::
runtime_error
&
err
)
{
{
DisplayError
(
m_parent
,
wxString
(
err
.
what
()
)
);
DisplayError
(
m_parent
,
wxString
(
err
.
what
()
)
);
return
false
;
return
false
;
...
...
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