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
f16f248b
Commit
f16f248b
authored
May 04, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change order of headers for wx 2.8, use wxWindowDisabler not ENABLE_DISABLE.
parent
25d1ab40
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
55 deletions
+65
-55
kiway.cpp
common/kiway.cpp
+3
-2
kiway_player.cpp
common/kiway_player.cpp
+27
-47
dialog_edit_component_in_schematic.cpp
eeschema/dialogs/dialog_edit_component_in_schematic.cpp
+33
-2
kiway_player.h
include/kiway_player.h
+1
-1
modedit.cpp
pcbnew/modedit.cpp
+1
-3
No files found.
common/kiway.cpp
View file @
f16f248b
...
@@ -23,8 +23,6 @@
...
@@ -23,8 +23,6 @@
*/
*/
#include <string.h>
#include <string.h>
#include <wx/debug.h>
#include <wx/stdpaths.h>
#include <macros.h>
#include <macros.h>
#include <kiway.h>
#include <kiway.h>
...
@@ -34,6 +32,9 @@
...
@@ -34,6 +32,9 @@
#include <config.h>
#include <config.h>
#include <id.h>
#include <id.h>
#include <wx/stdpaths.h>
#include <wx/debug.h>
KIFACE
*
KIWAY
::
m_kiface
[
KIWAY_FACE_COUNT
];
KIFACE
*
KIWAY
::
m_kiface
[
KIWAY_FACE_COUNT
];
int
KIWAY
::
m_kiface_version
[
KIWAY_FACE_COUNT
];
int
KIWAY
::
m_kiface_version
[
KIWAY_FACE_COUNT
];
...
...
common/kiway_player.cpp
View file @
f16f248b
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <kiway_player.h>
#include <kiway_player.h>
...
@@ -5,6 +29,7 @@
...
@@ -5,6 +29,7 @@
#include <kiway.h>
#include <kiway.h>
#include <id.h>
#include <id.h>
#include <typeinfo>
#include <typeinfo>
#include <wx/utils.h>
BEGIN_EVENT_TABLE
(
KIWAY_PLAYER
,
EDA_BASE_FRAME
)
BEGIN_EVENT_TABLE
(
KIWAY_PLAYER
,
EDA_BASE_FRAME
)
...
@@ -46,51 +71,6 @@ void KIWAY_PLAYER::KiwayMailIn( KIWAY_EXPRESS& aEvent )
...
@@ -46,51 +71,6 @@ void KIWAY_PLAYER::KiwayMailIn( KIWAY_EXPRESS& aEvent )
}
}
static
void
makeModal
(
wxFrame
*
aFrame
,
bool
IsModal
)
{
// disable or enable all other top level windows
#if wxCHECK_VERSION(2, 9, 4)
wxWindowList
::
compatibility_iterator
node
=
wxTopLevelWindows
.
GetFirst
();
while
(
node
)
{
wxWindow
*
win
=
node
->
GetData
();
if
(
win
!=
aFrame
)
win
->
Enable
(
!
IsModal
);
node
=
node
->
GetNext
();
}
#else
// Deprecated since wxWidgets 2.9.4
aFrame
->
MakeModal
(
IsModal
);
#endif
}
/**
* toggle global wxFrame enable/disable state, does the re-enable part even
* if an exception is thrown.
*/
struct
ENABLE_DISABLE
{
wxFrame
*
m_frame
;
ENABLE_DISABLE
(
wxFrame
*
aFrame
)
:
m_frame
(
aFrame
)
{
makeModal
(
aFrame
,
true
);
}
~
ENABLE_DISABLE
()
{
// Re-enable all frames, (oops, even if they were previously inactive).
// This is probably why this function was deprecated in wx.
makeModal
(
m_frame
,
false
);
}
};
bool
KIWAY_PLAYER
::
ShowModal
(
wxString
*
aResult
)
bool
KIWAY_PLAYER
::
ShowModal
(
wxString
*
aResult
)
{
{
/*
/*
...
@@ -103,10 +83,10 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult )
...
@@ -103,10 +83,10 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult )
vtable and therefore cross-module capable.
vtable and therefore cross-module capable.
*/
*/
volatile
bool
dismissed
=
false
;
volatile
bool
dismissed
=
false
;
// disable all frames except the modal one, re-enable on exit, exception safe.
// disable all frames except the modal one, re-enable on exit, exception safe.
ENABLE_DISABLE
toggle
(
this
);
wxWindowDisabler
toggle
(
this
);
m_modal_dismissed
=
&
dismissed
;
m_modal_dismissed
=
&
dismissed
;
...
...
eeschema/dialogs/dialog_edit_component_in_schematic.cpp
View file @
f16f248b
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <fctsys.h>
#include <fctsys.h>
#include <pgm_base.h>
#include <pgm_base.h>
#include <kiway.h>
#include <gr_basic.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <confirm.h>
...
@@ -435,8 +436,38 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::deleteFieldButtonHandler( wxCommandEven
...
@@ -435,8 +436,38 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::deleteFieldButtonHandler( wxCommandEven
void
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
showButtonHandler
(
wxCommandEvent
&
event
)
void
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC
::
showButtonHandler
(
wxCommandEvent
&
event
)
{
{
wxString
datasheet_uri
=
fieldValueTextCtrl
->
GetValue
();
#if 1
::
wxLaunchDefaultBrowser
(
datasheet_uri
);
wxString
datasheet_uri
=
fieldValueTextCtrl
->
GetValue
();
::
wxLaunchDefaultBrowser
(
datasheet_uri
);
#else
unsigned
fieldNdx
=
getSelectedFieldNdx
();
/*
if( fieldNdx == DATASHEET )
{
wxString datasheet_uri = fieldValueTextCtrl->GetValue();
::wxLaunchDefaultBrowser( datasheet_uri );
}
else if( fieldNdx == FOOTPRINT )
*/
{
// pick a footprint
wxString
fpid
;
KIWAY_PLAYER
*
frame
=
Kiway
().
Player
(
FRAME_PCB_MODULE_VIEWER_MODAL
,
true
);
if
(
frame
->
ShowModal
(
&
fpid
)
)
{
printf
(
"%s: %s
\n
"
,
__func__
,
TO_UTF8
(
fpid
)
);
}
frame
->
Show
(
false
);
// keep the frame open, but hidden.
Raise
();
}
#endif
}
}
...
...
include/kiway_player.h
View file @
f16f248b
...
@@ -180,7 +180,7 @@ public:
...
@@ -180,7 +180,7 @@ public:
* @return bool - true if frame implementation called KIWAY_PLAYER::DismissModal()
* @return bool - true if frame implementation called KIWAY_PLAYER::DismissModal()
* with aRetVal of true.
* with aRetVal of true.
*/
*/
VTBL_ENTRY
bool
ShowModal
(
wxString
*
aResult
);
VTBL_ENTRY
bool
ShowModal
(
wxString
*
aResult
=
NULL
);
//----</Cross Module API>----------------------------------------------------
//----</Cross Module API>----------------------------------------------------
...
...
pcbnew/modedit.cpp
View file @
f16f248b
...
@@ -324,9 +324,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -324,9 +324,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
wizard
->
Zoom_Automatique
(
false
);
wizard
->
Zoom_Automatique
(
false
);
wxString
not_used
;
if
(
wizard
->
ShowModal
()
)
if
(
wizard
->
ShowModal
(
&
not_used
)
)
{
{
// Creates the new footprint from python script wizard
// Creates the new footprint from python script wizard
MODULE
*
module
=
wizard
->
GetBuiltFootprint
();
MODULE
*
module
=
wizard
->
GetBuiltFootprint
();
...
...
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