Commit 49538caf authored by Dick Hollenbeck's avatar Dick Hollenbeck
parent 9de02e88
This diff is collapsed.
...@@ -104,14 +104,7 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow ...@@ -104,14 +104,7 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow
// re-enables only those that were disabled on exit // re-enables only those that were disabled on exit
wxWindowDisabler toggle( this ); wxWindowDisabler toggle( this );
WX_EVENT_LOOP event_loop; WX_EVENT_LOOP event_loop;
#if wxCHECK_VERSION( 2, 9, 4 ) // 2.9.4 is only approximate.
// new code needs this, old code does it in wxEventLoop::Run() and cannot
// tolerate it here. Where that boundary is as a version number, I don't know.
// A closer look at the subversion repo for wx would tell.
wxEventLoopActivator event_loop_stacker( &event_loop );
#endif
m_modal_loop = &event_loop; m_modal_loop = &event_loop;
......
...@@ -148,6 +148,10 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) ...@@ -148,6 +148,10 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
// make sure the chipnameTextCtrl is wide enough to hold any unusually long chip names: // make sure the chipnameTextCtrl is wide enough to hold any unusually long chip names:
EnsureTextCtrlWidth( dlg->chipnameTextCtrl ); EnsureTextCtrlWidth( dlg->chipnameTextCtrl );
// This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal
// frame. Therefore this dialog as a modal frame parent, MUST be run under
// quasimodal mode for the quasimodal frame support to work. So don't use
// the QUASIMODAL macros here.
dlg->ShowQuasiModal(); dlg->ShowQuasiModal();
m_canvas->SetIgnoreMouseEvents( false ); m_canvas->SetIgnoreMouseEvents( false );
......
...@@ -142,6 +142,10 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event ) ...@@ -142,6 +142,10 @@ void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, GetCurPart() ); DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB dlg( this, GetCurPart() );
// This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal
// frame. Therefore this dialog as a modal frame parent, MUST be run under
// quasimodal mode for the quasimodal frame support to work. So don't use
// the QUASIMODAL macros here.
int abort = dlg.ShowQuasiModal(); int abort = dlg.ShowQuasiModal();
if( abort ) if( abort )
......
...@@ -35,14 +35,20 @@ ...@@ -35,14 +35,20 @@
#define DLGSHIM_USE_SETFOCUS 0 #define DLGSHIM_USE_SETFOCUS 0
#endif #endif
#if wxCHECK_VERSION( 2, 9, 4 ) class WDO_ENABLE_DISABLE;
#define WX_EVENT_LOOP wxGUIEventLoop class EVENT_LOOP;
// These macros are for DIALOG_SHIM only, NOT for KIWAY_PLAYER. KIWAY_PLAYER
// has its own support for quasi modal and its platform specific issues are different
// than for a wxDialog.
#if wxCHECK_VERSION( 3, 0, 0 )
#define SHOWQUASIMODAL ShowQuasiModal
#define ENDQUASIMODAL EndQuasiModal
#else #else
#define WX_EVENT_LOOP wxEventLoop #define SHOWQUASIMODAL ShowModal
#define ENDQUASIMODAL EndModal
#endif #endif
class WX_EVENT_LOOP;
/** /**
* Class DIALOG_SHIM * Class DIALOG_SHIM
...@@ -86,9 +92,9 @@ protected: ...@@ -86,9 +92,9 @@ protected:
std::string m_hash_key; // alternate for class_map when classname re-used. std::string m_hash_key; // alternate for class_map when classname re-used.
// variables for quasi-modal behavior support, only used by a few derivatives. // variables for quasi-modal behavior support, only used by a few derivatives.
WX_EVENT_LOOP* m_qmodal_loop; // points to nested event_loop, NULL means not qmodal and dismissed EVENT_LOOP* m_qmodal_loop; // points to nested event_loop, NULL means not qmodal and dismissed
bool m_qmodal_showing; bool m_qmodal_showing;
WDO_ENABLE_DISABLE* m_qmodal_parent_disabler;
#if DLGSHIM_USE_SETFOCUS #if DLGSHIM_USE_SETFOCUS
private: private:
......
...@@ -182,7 +182,7 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties() ...@@ -182,7 +182,7 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties()
void DIALOG_MODULE_BOARD_EDITOR::OnCancelClick( wxCommandEvent& event ) void DIALOG_MODULE_BOARD_EDITOR::OnCancelClick( wxCommandEvent& event )
{ {
EndModal( -1 ); ENDQUASIMODAL( -1 );
} }
...@@ -194,7 +194,7 @@ void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event ) ...@@ -194,7 +194,7 @@ void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event )
m_Parent->OnModify(); m_Parent->OnModify();
} }
EndModal( 2 ); ENDQUASIMODAL( 2 );
} }
...@@ -204,7 +204,7 @@ void DIALOG_MODULE_BOARD_EDITOR::ExchangeModule( wxCommandEvent& event ) ...@@ -204,7 +204,7 @@ void DIALOG_MODULE_BOARD_EDITOR::ExchangeModule( wxCommandEvent& event )
// Warning: m_CurrentModule was deleted by exchange module // Warning: m_CurrentModule was deleted by exchange module
m_Parent->SetCurItem( NULL ); m_Parent->SetCurItem( NULL );
EndModal( 0 ); ENDQUASIMODAL( 0 );
} }
...@@ -241,8 +241,6 @@ void DIALOG_MODULE_BOARD_EDITOR::ModuleOrientEvent( wxCommandEvent& event ) ...@@ -241,8 +241,6 @@ void DIALOG_MODULE_BOARD_EDITOR::ModuleOrientEvent( wxCommandEvent& event )
void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties() void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
{ {
SetFocus();
wxString default_path; wxString default_path;
wxGetEnv( wxT( KISYS3DMOD ), &default_path ); wxGetEnv( wxT( KISYS3DMOD ), &default_path );
#ifdef __WINDOWS__ #ifdef __WINDOWS__
...@@ -675,7 +673,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -675,7 +673,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
m_Parent->OnModify(); m_Parent->OnModify();
EndModal( 1 ); ENDQUASIMODAL( 1 );
if( m_DC ) if( m_DC )
{ {
......
...@@ -59,12 +59,12 @@ void PCB_EDIT_FRAME::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ) ...@@ -59,12 +59,12 @@ void PCB_EDIT_FRAME::InstallModuleOptionsFrame( MODULE* Module, wxDC* DC )
DIALOG_MODULE_BOARD_EDITOR* dialog = new DIALOG_MODULE_BOARD_EDITOR( this, Module, NULL ); DIALOG_MODULE_BOARD_EDITOR* dialog = new DIALOG_MODULE_BOARD_EDITOR( this, Module, NULL );
#endif #endif
int retvalue = dialog->ShowModal(); /* retvalue = int retvalue = dialog->SHOWQUASIMODAL(); /* retvalue =
* -1 if abort, * -1 if abort,
* 0 if exchange module, * 0 if exchange module,
* 1 for normal edition * 1 for normal edition
* and 2 for a goto editor command * and 2 for a goto editor command
*/ */
dialog->Destroy(); dialog->Destroy();
#ifdef __WXMAC__ #ifdef __WXMAC__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment