Commit 5a90c358 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: enable popup menu support in the "dialogs provider".
parent 035792d5
......@@ -4,7 +4,7 @@
* 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>
*
......@@ -91,3 +91,5 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
#define INTF_DIALOG_MESSAGES 11
#define INTF_DIALOG_FILEINFO 12
#define INTF_DIALOG_PREFS 13
#define INTF_DIALOG_POPUPMENU 20
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -74,6 +74,17 @@ Dialogs::Dialogs( intf_thread_t *_p_intf )
/* 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()
......@@ -122,6 +133,8 @@ void Dialogs::ShowFileInfo()
void Dialogs::ShowPopup()
{
if( p_provider && p_provider->pf_show_dialog )
p_provider->pf_show_dialog( p_provider, INTF_DIALOG_POPUPMENU, 0 );
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -72,7 +72,8 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
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()
/*****************************************************************************
......@@ -95,6 +96,9 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent )
/* 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()
......@@ -237,3 +241,17 @@ void DialogsProvider::Open( int i_access_method, int i_arg )
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 );
}
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -539,12 +539,16 @@ void Interface::OnMenuOpen(wxMenuEvent& event)
#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) )
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -100,6 +100,7 @@ void Timer::Notify()
/* 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 );
......@@ -107,6 +108,9 @@ void Timer::Notify()
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;
}
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -203,6 +203,8 @@ private:
void OnOpenNet( wxCommandEvent& event );
void OnOpenSat( wxCommandEvent& event );
void OnPopupMenu( wxCommandEvent& event );
void OnIdle( wxIdleEvent& event );
DECLARE_EVENT_TABLE();
......
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