]> git.sesse.net Git - vlc/blob - modules/gui/wxwidgets/dialogs.cpp
6ec4145670b5c1e33de97ef0c2ef8e1c31ea6542
[vlc] / modules / gui / wxwidgets / dialogs.cpp
1 /*****************************************************************************
2  * dialogs.cpp : wxWidgets plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000-2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Gildas Bazin <gbazin@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <stdlib.h>                                      /* malloc(), free() */
28 #include <errno.h>                                                 /* ENOMEM */
29 #include <string.h>                                            /* strerror() */
30 #include <stdio.h>
31
32 #include <vlc/vlc.h>
33 #include <vlc/aout.h>
34 #include <vlc/intf.h>
35
36 #include "charset.h"
37
38 #include "dialogs/vlm/vlm_panel.hpp"
39 #include "dialogs/bookmarks.hpp"
40 #include "dialogs/wizard.hpp"
41 #include "dialogs/playlist.hpp"
42 #include "dialogs/open.hpp"
43 #include "dialogs/updatevlc.hpp"
44 #include "dialogs/fileinfo.hpp"
45 #include "dialogs/iteminfo.hpp"
46 #include "dialogs/preferences.hpp"
47 #include "dialogs/messages.hpp"
48 #include "dialogs/interaction.hpp"
49 #include "interface.hpp"
50
51 /* include the icon graphic */
52 #include "../../../share/vlc32x32.xpm"
53
54 /* Dialogs Provider */
55 class DialogsProvider: public wxFrame
56 {
57 public:
58     /* Constructor */
59     DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
60     virtual ~DialogsProvider();
61
62 private:
63     void Open( int i_access_method, int i_arg );
64
65     /* Event handlers (these functions should _not_ be virtual) */
66     void OnUpdateVLC( wxCommandEvent& event );
67     void OnVLM( wxCommandEvent& event );
68     void OnInteraction( wxCommandEvent& event );
69     void OnExit( wxCommandEvent& event );
70     void OnPlaylist( wxCommandEvent& event );
71     void OnMessages( wxCommandEvent& event );
72     void OnFileInfo( wxCommandEvent& event );
73     void OnPreferences( wxCommandEvent& event );
74     void OnWizardDialog( wxCommandEvent& event );
75     void OnBookmarks( wxCommandEvent& event );
76
77     void OnOpenFileGeneric( wxCommandEvent& event );
78     void OnOpenFileSimple( wxCommandEvent& event );
79     void OnOpenDirectory( wxCommandEvent& event );
80     void OnOpenFile( wxCommandEvent& event );
81     void OnOpenDisc( wxCommandEvent& event );
82     void OnOpenNet( wxCommandEvent& event );
83     void OnOpenCapture( wxCommandEvent& event );
84     void OnOpenSat( wxCommandEvent& event );
85
86     void OnPopupMenu( wxCommandEvent& event );
87     void OnAudioPopupMenu( wxCommandEvent& event );
88     void OnVideoPopupMenu( wxCommandEvent& event );
89     void OnMiscPopupMenu( wxCommandEvent& event );
90
91     void OnIdle( wxIdleEvent& event );
92
93     void OnExitThread( wxCommandEvent& event );
94
95     DECLARE_EVENT_TABLE();
96
97     intf_thread_t *p_intf;
98
99 public:
100     /* Secondary windows */
101     OpenDialog          *p_open_dialog;
102     wxFileDialog        *p_file_dialog;
103     wxDirDialog         *p_dir_dialog;
104     Playlist            *p_playlist_dialog;
105     Messages            *p_messages_dialog;
106     FileInfo            *p_fileinfo_dialog;
107     WizardDialog        *p_wizard_dialog;
108     wxFrame             *p_prefs_dialog;
109     wxFrame             *p_bookmarks_dialog;
110     wxFileDialog        *p_file_generic_dialog;
111     UpdateVLC           *p_updatevlc_dialog;
112     VLMFrame            *p_vlm_dialog;
113 };
114
115 DEFINE_LOCAL_EVENT_TYPE( wxEVT_DIALOG );
116
117 BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
118     /* Idle loop used to update some of the dialogs */
119     EVT_IDLE(DialogsProvider::OnIdle)
120
121     /* Custom wxDialog events */
122     EVT_COMMAND(INTF_DIALOG_FILE, wxEVT_DIALOG, DialogsProvider::OnOpenFile)
123     EVT_COMMAND(INTF_DIALOG_DISC, wxEVT_DIALOG, DialogsProvider::OnOpenDisc)
124     EVT_COMMAND(INTF_DIALOG_NET, wxEVT_DIALOG, DialogsProvider::OnOpenNet)
125     EVT_COMMAND(INTF_DIALOG_CAPTURE, wxEVT_DIALOG,
126                 DialogsProvider::OnOpenCapture)
127     EVT_COMMAND(INTF_DIALOG_FILE_SIMPLE, wxEVT_DIALOG,
128                 DialogsProvider::OnOpenFileSimple)
129     EVT_COMMAND(INTF_DIALOG_FILE_GENERIC, wxEVT_DIALOG,
130                 DialogsProvider::OnOpenFileGeneric)
131     EVT_COMMAND(INTF_DIALOG_DIRECTORY, wxEVT_DIALOG,
132                 DialogsProvider::OnOpenDirectory)
133
134     EVT_COMMAND(INTF_DIALOG_PLAYLIST, wxEVT_DIALOG,
135                 DialogsProvider::OnPlaylist)
136     EVT_COMMAND(INTF_DIALOG_MESSAGES, wxEVT_DIALOG,
137                 DialogsProvider::OnMessages)
138     EVT_COMMAND(INTF_DIALOG_PREFS, wxEVT_DIALOG,
139                 DialogsProvider::OnPreferences)
140     EVT_COMMAND(INTF_DIALOG_WIZARD, wxEVT_DIALOG,
141                 DialogsProvider::OnWizardDialog)
142     EVT_COMMAND(INTF_DIALOG_FILEINFO, wxEVT_DIALOG,
143                 DialogsProvider::OnFileInfo)
144     EVT_COMMAND(INTF_DIALOG_BOOKMARKS, wxEVT_DIALOG,
145                 DialogsProvider::OnBookmarks)
146
147     EVT_COMMAND(INTF_DIALOG_POPUPMENU, wxEVT_DIALOG,
148                 DialogsProvider::OnPopupMenu)
149     EVT_COMMAND(INTF_DIALOG_AUDIOPOPUPMENU, wxEVT_DIALOG,
150                 DialogsProvider::OnAudioPopupMenu)
151     EVT_COMMAND(INTF_DIALOG_VIDEOPOPUPMENU, wxEVT_DIALOG,
152                 DialogsProvider::OnVideoPopupMenu)
153     EVT_COMMAND(INTF_DIALOG_MISCPOPUPMENU, wxEVT_DIALOG,
154                 DialogsProvider::OnMiscPopupMenu)
155
156     EVT_COMMAND(INTF_DIALOG_EXIT, wxEVT_DIALOG,
157                 DialogsProvider::OnExitThread)
158     EVT_COMMAND(INTF_DIALOG_UPDATEVLC, wxEVT_DIALOG,
159                 DialogsProvider::OnUpdateVLC)
160     EVT_COMMAND(INTF_DIALOG_VLM, wxEVT_DIALOG,
161                 DialogsProvider::OnVLM)
162     EVT_COMMAND( INTF_DIALOG_INTERACTION, wxEVT_DIALOG,
163                 DialogsProvider::OnInteraction )
164 END_EVENT_TABLE()
165
166 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent )
167 {
168     return new DialogsProvider( p_intf, p_parent );
169 }
170
171 /*****************************************************************************
172  * Constructor.
173  *****************************************************************************/
174 DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent )
175   :  wxFrame( p_parent, -1, wxT("") )
176 {
177     /* Initializations */
178     p_intf = _p_intf;
179     p_open_dialog = NULL;
180     p_file_dialog = NULL;
181     p_playlist_dialog = NULL;
182     p_messages_dialog = NULL;
183     p_fileinfo_dialog = NULL;
184     p_prefs_dialog = NULL;
185     p_file_generic_dialog = NULL;
186     p_wizard_dialog = NULL;
187     p_bookmarks_dialog = NULL;
188     p_dir_dialog = NULL;
189     p_updatevlc_dialog = NULL;
190     p_vlm_dialog = NULL;
191
192     /* Give our interface a nice little icon */
193     p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
194
195     /* Create the messages dialog so it can begin storing logs */
196     p_messages_dialog = new Messages( p_intf, p_parent ? p_parent : this );
197
198     /* Check if user wants to show the bookmarks dialog by default */
199     wxCommandEvent dummy_event;
200     if( config_GetInt( p_intf, "wx-bookmarks" ) )
201         OnBookmarks( dummy_event );
202
203     /* Intercept all menu events in our custom event handler */
204     PushEventHandler( new MenuEvtHandler( p_intf, NULL ) );
205
206
207     WindowSettings *ws = p_intf->p_sys->p_window_settings;
208     wxPoint p;
209     wxSize  s;
210     bool    b_shown;
211
212 #define INIT( id, w, N, S ) \
213     if( ws->GetSettings( WindowSettings::id, b_shown, p, s ) && b_shown ) \
214     {                           \
215         if( !w )                \
216             w = N;              \
217         w->SetSize( s );        \
218         w->Move( p );           \
219         w->S( true );           \
220     }
221
222     INIT( ID_PLAYLIST, p_playlist_dialog, new Playlist(p_intf,this), ShowPlaylist );
223     INIT( ID_MESSAGES, p_messages_dialog, new Messages(p_intf,this), Show );
224     INIT( ID_FILE_INFO, p_fileinfo_dialog, new FileInfo(p_intf,this), Show );
225     INIT( ID_BOOKMARKS, p_bookmarks_dialog, new BookmarksDialog(p_intf,this), Show);
226 #undef INIT
227 }
228
229 DialogsProvider::~DialogsProvider()
230 {
231     WindowSettings *ws = p_intf->p_sys->p_window_settings;
232
233 #define UPDATE(id,w)                                        \
234   {                                                         \
235     if( w && w->IsShown() && !w->IsIconized() )             \
236         ws->SetSettings(  WindowSettings::id, true,         \
237                           w->GetPosition(), w->GetSize() ); \
238     else                                                    \
239         ws->SetSettings(  WindowSettings::id, false );      \
240   }
241
242     UPDATE( ID_PLAYLIST,  p_playlist_dialog );
243     UPDATE( ID_MESSAGES,  p_messages_dialog );
244     UPDATE( ID_FILE_INFO, p_fileinfo_dialog );
245     UPDATE( ID_BOOKMARKS, p_bookmarks_dialog );
246
247 #undef UPDATE
248
249     PopEventHandler(true);
250
251     /* Clean up */
252     if( p_open_dialog )     delete p_open_dialog;
253     if( p_prefs_dialog )    p_prefs_dialog->Destroy();
254     if( p_file_dialog )     delete p_file_dialog;
255     if( p_playlist_dialog ) delete p_playlist_dialog;
256     if( p_messages_dialog ) delete p_messages_dialog;
257     if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
258     if( p_file_generic_dialog ) delete p_file_generic_dialog;
259     if( p_wizard_dialog ) delete p_wizard_dialog;
260     if( p_bookmarks_dialog ) delete p_bookmarks_dialog;
261     if( p_updatevlc_dialog ) delete p_updatevlc_dialog;
262     if( p_vlm_dialog ) delete p_vlm_dialog;
263
264
265     if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon;
266
267     /* We must set this here because on win32 this destructor will be
268      * automatically called so we must not call it again on wxApp->OnExit().
269      * There shouldn't be any race conditions as all this should be done
270      * from the same thread. */
271     p_intf->p_sys->p_wxwindow = NULL;
272 }
273
274 void DialogsProvider::OnIdle( wxIdleEvent& WXUNUSED(event) )
275 {
276     /* Update the log window */
277     if( p_messages_dialog )
278         p_messages_dialog->UpdateLog();
279
280     /* Update the playlist */
281     if( p_playlist_dialog )
282         p_playlist_dialog->UpdatePlaylist();
283
284     /* Update the fileinfo windows */
285     if( p_fileinfo_dialog )
286         p_fileinfo_dialog->Update();
287 }
288
289 void DialogsProvider::OnPlaylist( wxCommandEvent& WXUNUSED(event) )
290 {
291     /* Show/hide the playlist window */
292     if( !p_playlist_dialog )
293         p_playlist_dialog = new Playlist( p_intf, this );
294
295     if( p_playlist_dialog )
296     {
297         p_playlist_dialog->ShowPlaylist( !p_playlist_dialog->IsShown() );
298     }
299 }
300
301 void DialogsProvider::OnMessages( wxCommandEvent& WXUNUSED(event) )
302 {
303     /* Show/hide the log window */
304     if( !p_messages_dialog )
305         p_messages_dialog = new Messages( p_intf, this );
306
307     if( p_messages_dialog )
308     {
309         p_messages_dialog->Show( !p_messages_dialog->IsShown() );
310     }
311 }
312
313 void DialogsProvider::OnFileInfo( wxCommandEvent& WXUNUSED(event) )
314 {
315     /* Show/hide the file info window */
316     if( !p_fileinfo_dialog )
317         p_fileinfo_dialog = new FileInfo( p_intf, this );
318
319     if( p_fileinfo_dialog )
320     {
321         p_fileinfo_dialog->Show( !p_fileinfo_dialog->IsShown() );
322     }
323 }
324
325 void DialogsProvider::OnPreferences( wxCommandEvent& WXUNUSED(event) )
326 {
327     /* Show/hide the open dialog */
328     if( !p_prefs_dialog )
329         p_prefs_dialog = new PrefsDialog( p_intf, this );
330
331     if( p_prefs_dialog )
332     {
333         p_prefs_dialog->Show( !p_prefs_dialog->IsShown() );
334     }
335 }
336
337 void DialogsProvider::OnWizardDialog( wxCommandEvent& WXUNUSED(event) )
338 {
339     p_wizard_dialog = new WizardDialog( p_intf, this, NULL, 0, 0 );
340
341     if( p_wizard_dialog )
342     {
343         p_wizard_dialog->Run();
344         delete p_wizard_dialog;
345     }
346
347     p_wizard_dialog = NULL;
348 }
349
350 void DialogsProvider::OnBookmarks( wxCommandEvent& WXUNUSED(event) )
351 {
352     /* Show/hide the open dialog */
353     if( !p_bookmarks_dialog )
354         p_bookmarks_dialog = new BookmarksDialog( p_intf, this );
355
356     if( p_bookmarks_dialog )
357     {
358         p_bookmarks_dialog->Show( !p_bookmarks_dialog->IsShown() );
359     }
360 }
361
362 void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event )
363 {
364     intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData();
365
366     if( p_arg == NULL )
367     {
368         msg_Dbg( p_intf, "OnOpenFileGeneric() called with NULL arg" );
369         return;
370     }
371
372     if( p_file_generic_dialog == NULL )
373         p_file_generic_dialog = new wxFileDialog( NULL );
374
375     if( p_file_generic_dialog )
376     {
377         p_file_generic_dialog->SetMessage( wxU(p_arg->psz_title) );
378         p_file_generic_dialog->SetWildcard( wxU(p_arg->psz_extensions) );
379         p_file_generic_dialog->SetStyle( (p_arg->b_save ? wxSAVE : wxOPEN) |
380                                          (p_arg->b_multiple ? wxMULTIPLE:0) );
381     }
382
383     if( p_file_generic_dialog &&
384         p_file_generic_dialog->ShowModal() == wxID_OK )
385     {
386         wxArrayString paths;
387
388         p_file_generic_dialog->GetPaths( paths );
389
390         p_arg->i_results = paths.GetCount();
391         p_arg->psz_results = (char **)malloc( p_arg->i_results *
392                                               sizeof(char *) );
393         for( size_t i = 0; i < paths.GetCount(); i++ )
394         {
395             p_arg->psz_results[i] = strdup( paths[i].mb_str() );
396         }
397     }
398
399     /* Callback */
400     if( p_arg->pf_callback )
401     {
402         p_arg->pf_callback( p_arg );
403     }
404
405     if( p_arg->psz_results )
406     {
407         for( int i = 0; i < p_arg->i_results; i++ )
408         {
409             free( p_arg->psz_results[i] );
410         }
411         free( p_arg->psz_results );
412     }
413     if( p_arg->psz_title ) free( p_arg->psz_title );
414     if( p_arg->psz_extensions ) free( p_arg->psz_extensions );
415
416     free( p_arg );
417 }
418
419 void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event )
420 {
421     playlist_t *p_playlist =
422         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
423                                        FIND_ANYWHERE );
424     if( p_playlist == NULL )
425     {
426         return;
427     }
428
429     if( p_file_dialog == NULL )
430         p_file_dialog = new wxFileDialog( NULL, wxU(_("Open File")),
431             wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE );
432
433         p_file_dialog->SetWildcard(wxU(_("All Files (*.*)|*"
434         "|Sound Files (*.mp3, *.ogg, etc.)|" EXTENSIONS_AUDIO 
435         "|Video Files (*.avi, *.mpg, etc.)|" EXTENSIONS_VIDEO 
436         "|Playlist Files (*.m3u, *.pls, etc.)|" EXTENSIONS_PLAYLIST 
437         "|Subtitle Files (*.srt, *.sub, etc.)|" EXTENSIONS_SUBTITLE)));
438
439     if( p_file_dialog && p_file_dialog->ShowModal() == wxID_OK )
440     {
441         wxArrayString paths;
442
443         p_file_dialog->GetPaths( paths );
444
445         for( size_t i = 0; i < paths.GetCount(); i++ )
446         {
447             char *psz_utf8 = wxFromLocale( paths[i] );
448             if( event.GetInt() )
449                 playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
450                               PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
451                               (i ? PLAYLIST_PREPARSE : 0 ),
452                               PLAYLIST_END );
453             else
454                 playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
455                               PLAYLIST_APPEND | PLAYLIST_PREPARSE , PLAYLIST_END );
456             wxLocaleFree( psz_utf8 );
457         }
458     }
459
460     vlc_object_release( p_playlist );
461 }
462
463 void DialogsProvider::OnOpenDirectory( wxCommandEvent& event )
464 {
465     playlist_t *p_playlist =
466         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
467                                        FIND_ANYWHERE );
468     if( p_playlist == NULL )
469     {
470         return;
471     }
472
473     if( p_dir_dialog == NULL )
474         p_dir_dialog = new wxDirDialog( NULL, wxU(_("Select a directory")) );
475
476     if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK )
477     {
478         wxString path = p_dir_dialog->GetPath();
479         char *psz_utf8 = wxFromLocale( path );
480         playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
481                       PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0),
482                       PLAYLIST_END );
483         wxLocaleFree( psz_utf8 );
484     }
485
486     vlc_object_release( p_playlist );
487 }
488
489 void DialogsProvider::OnOpenFile( wxCommandEvent& event )
490 {
491     Open( FILE_ACCESS, event.GetInt() );
492 }
493
494 void DialogsProvider::OnOpenDisc( wxCommandEvent& event )
495 {
496     Open( DISC_ACCESS, event.GetInt() );
497 }
498
499 void DialogsProvider::OnOpenNet( wxCommandEvent& event )
500 {
501     Open( NET_ACCESS, event.GetInt() );
502 }
503
504 void DialogsProvider::OnOpenCapture( wxCommandEvent& event )
505 {
506     Open( CAPTURE_ACCESS, event.GetInt() );
507 }
508
509 void DialogsProvider::Open( int i_access_method, int i_arg )
510 {
511     /* Show/hide the open dialog */
512     if( !p_open_dialog )
513         p_open_dialog = new OpenDialog( p_intf, this, i_access_method, i_arg,
514                                         OPEN_NORMAL );
515
516     if( p_open_dialog )
517     {
518         p_open_dialog->Show( i_access_method, i_arg );
519     }
520 }
521
522 void DialogsProvider::OnPopupMenu( wxCommandEvent& event )
523 {
524     wxPoint mousepos = ScreenToClient( wxGetMousePosition() );
525     ::PopupMenu( p_intf, this, mousepos );
526 }
527
528 void DialogsProvider::OnAudioPopupMenu( wxCommandEvent& event )
529 {
530     wxPoint mousepos = ScreenToClient( wxGetMousePosition() );
531     ::AudioPopupMenu( p_intf, this, mousepos );
532 }
533 void DialogsProvider::OnVideoPopupMenu( wxCommandEvent& event )
534 {
535     wxPoint mousepos = ScreenToClient( wxGetMousePosition() );
536     ::VideoPopupMenu( p_intf, this, mousepos );
537 }
538 void DialogsProvider::OnMiscPopupMenu( wxCommandEvent& event )
539 {
540     wxPoint mousepos = ScreenToClient( wxGetMousePosition() );
541     ::MiscPopupMenu( p_intf, this, mousepos );
542 }
543
544 void DialogsProvider::OnExitThread( wxCommandEvent& WXUNUSED(event) )
545 {
546     wxTheApp->ExitMainLoop();
547 }
548
549 void DialogsProvider::OnUpdateVLC( wxCommandEvent& WXUNUSED(event) )
550 {
551     /* Show/hide the file info window */
552     if( !p_updatevlc_dialog )
553         p_updatevlc_dialog = new UpdateVLC( p_intf, this );
554
555     if( p_updatevlc_dialog )
556     {
557         p_updatevlc_dialog->Show( !p_updatevlc_dialog->IsShown() );
558     }
559 }
560
561 void DialogsProvider::OnVLM( wxCommandEvent& WXUNUSED(event) )
562 {
563     /* Show/hide the file info window */
564     if( !p_vlm_dialog )
565         p_vlm_dialog = new VLMFrame( p_intf, this );
566
567     if( p_vlm_dialog )
568     {
569         p_vlm_dialog->Show( !p_vlm_dialog->IsShown() );
570     }
571 }
572
573 void DialogsProvider::OnInteraction( wxCommandEvent& event )
574 {
575     intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData();
576     interaction_dialog_t *p_dialog;
577     InteractionDialog *p_wxdialog;
578
579     return;
580
581     if( p_arg == NULL )
582     {
583         msg_Dbg( p_intf, "OnInteraction() called with NULL arg" );
584         return;
585     }
586     p_dialog = p_arg->p_dialog;
587
588     /** \bug We store the interface object for the dialog in the p_private
589      * field of the core dialog object. This is not safe if we change
590      * interface while a dialog is loaded */
591
592     switch( p_dialog->i_action )
593     {
594     case INTERACT_NEW:
595         p_wxdialog = new InteractionDialog( p_intf, this, p_dialog );
596         p_dialog->p_private = (void*)p_wxdialog;
597         p_wxdialog->Show();
598         break;
599     case INTERACT_UPDATE:
600         p_wxdialog = (InteractionDialog*)(p_dialog->p_private);
601         if( p_wxdialog)
602             p_wxdialog->Update();
603         break;
604     case INTERACT_HIDE:
605         p_wxdialog = (InteractionDialog*)(p_dialog->p_private);
606         if( p_wxdialog )
607             p_wxdialog->Hide();
608         p_dialog->i_status = HIDDEN_DIALOG;
609         break;
610     case INTERACT_DESTROY:
611         p_wxdialog = (InteractionDialog*)(p_dialog->p_private);
612         /// \todo
613         p_dialog->i_status = DESTROYED_DIALOG;
614         break;
615     }
616 }