* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vlc_interface.h,v 1.2 2003/07/17 17:30:40 gbazin Exp $
+ * $Id: vlc_interface.h,v 1.3 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
#define INTF_DIALOG_MESSAGES 11
#define INTF_DIALOG_FILEINFO 12
#define INTF_DIALOG_PREFS 13
+
+#define INTF_DIALOG_POPUPMENU 20
* dialogs.cpp: Handles all the different dialog boxes we provide.
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: dialogs.cpp,v 1.10 2003/07/17 17:30:40 gbazin Exp $
+ * $Id: dialogs.cpp,v 1.11 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/* Initialize dialogs provider
* (returns as soon as initialization is done) */
if( p_provider->pf_run ) p_provider->pf_run( p_provider );
+
+ /* Register callback for the intf-popupmenu variable */
+ playlist_t *p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist != NULL )
+ {
+ var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB,
+ p_intf->p_sys->p_dialogs );
+ vlc_object_release( p_playlist );
+ }
}
Dialogs::~Dialogs()
void Dialogs::ShowPopup()
{
+ if( p_provider && p_provider->pf_show_dialog )
+ p_provider->pf_show_dialog( p_provider, INTF_DIALOG_POPUPMENU, 0 );
}
/*****************************************************************************
* dialogs.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: dialogs.cpp,v 1.1 2003/07/17 17:30:40 gbazin Exp $
+ * $Id: dialogs.cpp,v 1.2 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
DialogsProvider::OnPreferences)
EVT_COMMAND(INTF_DIALOG_FILEINFO, wxEVT_DIALOG,
DialogsProvider::OnFileInfo)
- //EVT_COMMAND(ShowPopup_Event, wxEVT_DIALOG, DialogsProvider::OnShowPopup)
+ EVT_COMMAND(INTF_DIALOG_POPUPMENU, wxEVT_DIALOG,
+ DialogsProvider::OnPopupMenu)
END_EVENT_TABLE()
/*****************************************************************************
/* Create the messages dialog so it can begin storing logs */
p_messages_dialog = new Messages( p_intf, p_parent ? p_parent : this );
+
+ /* Intercept all menu events in our custom event handler */
+ PushEventHandler( new MenuEvtHandler( p_intf, NULL ) );
}
DialogsProvider::~DialogsProvider()
p_open_dialog->Show( i_access_method, i_arg );
}
}
+
+void DialogsProvider::OnPopupMenu( wxCommandEvent& event )
+{
+ wxPoint mousepos = wxGetMousePosition();
+
+#if 0
+ wxMouseEvent event = wxMouseEvent( wxEVT_RIGHT_UP );
+ event.m_x = p_main_interface->ScreenToClient(mousepos).x;
+ event.m_y = p_main_interface->ScreenToClient(mousepos).y;
+#endif
+
+ ::PopupMenu( p_intf, this, mousepos );
+
+}
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: interface.cpp,v 1.46 2003/07/17 17:30:40 gbazin Exp $
+ * $Id: interface.cpp,v 1.47 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
void Interface::OnContextMenu2(wxContextMenuEvent& event)
{
- ::PopupMenu( p_intf, this, ScreenToClient(event.GetPosition()) );
+ if( p_intf->p_sys->pf_show_dialog )
+ p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU, 0 );
+ //::PopupMenu( p_intf, this, ScreenToClient(event.GetPosition()) );
}
#endif
void Interface::OnContextMenu(wxMouseEvent& event)
{
- ::PopupMenu( p_intf, this, event.GetPosition() );
+ if( p_intf->p_sys->pf_show_dialog )
+ p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU, 0 );
+ //::PopupMenu( p_intf, this, event.GetPosition() );
}
void Interface::OnExit( wxCommandEvent& WXUNUSED(event) )
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: timer.cpp,v 1.26 2003/07/17 17:30:40 gbazin Exp $
+ * $Id: timer.cpp,v 1.27 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/* If the "display popup" flag has changed */
if( p_intf->p_sys->b_popup_change )
{
+#if 0
wxPoint mousepos = wxGetMousePosition();
wxMouseEvent event = wxMouseEvent( wxEVT_RIGHT_UP );
event.m_y = p_main_interface->ScreenToClient(mousepos).y;
p_main_interface->AddPendingEvent(event);
+#endif
+ if( p_intf->p_sys->pf_show_dialog )
+ p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU, 0 );
p_intf->p_sys->b_popup_change = VLC_FALSE;
}
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.43 2003/07/17 17:30:40 gbazin Exp $
+ * $Id: wxwindows.h,v 1.44 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
void OnOpenNet( wxCommandEvent& event );
void OnOpenSat( wxCommandEvent& event );
+ void OnPopupMenu( wxCommandEvent& event );
+
void OnIdle( wxIdleEvent& event );
DECLARE_EVENT_TABLE();