+
+/*****************************************************************************
+ * Instance::OnExit: called when the interface execution stops
+ *****************************************************************************/
+int Instance::OnExit()
+{
+ if( p_intf->pf_show_dialog )
+ {
+ /* We need to manually clean up the dialogs class */
+ if( p_intf->p_sys->p_wxwindow ) delete p_intf->p_sys->p_wxwindow;
+ }
+ return 0;
+}
+
+static void ShowDialog( intf_thread_t *p_intf, int i_dialog_event, int i_arg,
+ intf_dialog_args_t *p_arg )
+{
+ wxCommandEvent event( wxEVT_DIALOG, i_dialog_event );
+ event.SetInt( i_arg );
+ event.SetClientData( p_arg );
+
+#ifdef WIN32
+ SendMessage( (HWND)p_intf->p_sys->p_wxwindow->GetHandle(),
+ WM_CANCELMODE, 0, 0 );
+#endif
+ if( i_dialog_event == INTF_DIALOG_POPUPMENU && i_arg == 0 ) return;
+
+ /* Hack to prevent popup events to be enqueued when
+ * one is already active */
+ if( i_dialog_event != INTF_DIALOG_POPUPMENU ||
+ !p_intf->p_sys->p_popup_menu )
+ {
+ p_intf->p_sys->p_wxwindow->AddPendingEvent( event );
+ }
+}