Commit afb1dbb6 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: misc fixes.

parent b5a213db
......@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.22 2003/05/04 22:42:16 gbazin Exp $
* $Id: interface.cpp,v 1.23 2003/05/07 12:23:06 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -134,8 +134,12 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
EVT_MENU(Prefs_Event, Interface::OnPreferences)
EVT_MENU_OPEN(Interface::OnMenuOpen)
EVT_MENU_CLOSE(Interface::OnMenuClose)
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
EVT_CONTEXT_MENU(Interface::OnContextMenu)
#else
EVT_RIGHT_UP(Interface::OnContextMenu)
#endif
/* Toolbar events */
EVT_MENU(OpenFile_Event, Interface::OnOpenFile)
......@@ -408,6 +412,7 @@ void Interface::Open( int i_access_method )
*****************************************************************************/
void Interface::OnMenuOpen(wxMenuEvent& event)
{
#if !defined( __WXMSW__ )
if( event.GetEventObject() == p_audio_menu )
{
if( b_audio_menu )
......@@ -434,11 +439,30 @@ void Interface::OnMenuOpen(wxMenuEvent& event)
}
else b_video_menu = 1;
}
#else
p_audio_menu = AudioMenu( p_intf, this );
wxMenu *menu = GetMenuBar()->Replace( 3, p_audio_menu, _("&Audio") );
if( menu ) delete menu;
p_video_menu = VideoMenu( p_intf, this );
menu = GetMenuBar()->Replace( 4, p_video_menu, _("&Video") );
if( menu ) delete menu;
#endif
}
void Interface::OnMenuClose(wxMenuEvent& event)
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
void Interface::OnContextMenu(wxContextMenuEvent& event)
{
::PopupMenu( p_intf, this, ScreenToClient(event.GetPosition()) );
}
#else
void Interface::OnContextMenu(wxMouseEvent& event)
{
::PopupMenu( p_intf, this, event.GetPosition() );
}
#endif
void Interface::OnExit( wxCommandEvent& WXUNUSED(event) )
{
......
......@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: menus.cpp,v 1.2 2003/05/05 22:23:40 gbazin Exp $
* $Id: menus.cpp,v 1.3 2003/05/07 12:23:06 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -89,7 +89,8 @@ BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler)
EVT_MENU(-1, MenuEvtHandler::OnMenuEvent)
END_EVENT_TABLE()
void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
const wxPoint& pos )
{
vlc_object_t *p_object;
char *ppsz_varnames[19];
......@@ -163,11 +164,7 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
ppsz_varnames, pi_objects );
_p_main_interface->p_popup_menu = popupmenu;
wxPoint mousepos = wxGetMousePosition();
_p_main_interface->PopupMenu( popupmenu,
_p_main_interface->ScreenToClient(mousepos).x,
_p_main_interface->ScreenToClient(mousepos).y
);
_p_main_interface->PopupMenu( popupmenu, pos.x, pos.y );
}
wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
......
......@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.16 2003/05/07 00:18:39 gbazin Exp $
* $Id: open.cpp,v 1.17 2003/05/07 12:23:06 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -165,11 +165,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface,
wxPoint(20,25), wxSize(120, -1),
0, NULL );
mrl_combo->SetToolTip( _("You can use this field directly by typing the "
"full MRL you want to open.\n""Alternatively, the field will be filled"
"automatically when you use the following controls.") );
"full MRL you want to open.\n""Alternatively, the field will be "
"filled automatically when you use the controls below") );
mrl_sizer->Add( mrl_label, 0, wxEXPAND | wxALL, 5 );
mrl_sizer->Add( mrl_combo, 1, wxEXPAND | wxALL, 5 );
mrl_sizer->Add( mrl_label, 0, wxALL | wxALIGN_CENTER, 5 );
mrl_sizer->Add( mrl_combo, 1, wxALL | wxALIGN_CENTER, 5 );
mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 );
......@@ -503,12 +503,8 @@ void OpenDialog::UpdateMRL( int i_access_method )
break;
case 2:
mrl = "udp" + demux + "://";
break;
case 3:
/* http access */
mrl = "http" + demux + "://" + net_addrs[3]->GetLineText(0);
mrl = "http" + demux + "://" + net_addrs[2]->GetLineText(0);
break;
}
break;
......
......@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.6 2003/04/21 00:54:26 ipkiss Exp $
* $Id: streamout.cpp,v 1.7 2003/05/07 12:23:06 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -155,8 +155,12 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ):
mrl_combo = new wxComboBox( panel, MRL_Event, mrl,
wxPoint(20,25), wxSize(120, -1),
0, NULL );
mrl_sizer->Add( mrl_label, 0, wxEXPAND | wxALL, 5 );
mrl_sizer->Add( mrl_combo, 1, wxEXPAND | wxALL, 5 );
mrl_combo->SetToolTip( _("You can use this field directly by typing the "
"full MRL you want to open.\n""Alternatively, the field will be "
"filled automatically when you use the controls below") );
mrl_sizer->Add( mrl_label, 0, wxALL | wxALIGN_CENTER, 5 );
mrl_sizer->Add( mrl_combo, 1, wxALL | wxALIGN_CENTER, 5 );
mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 );
/* Create the output encapsulation panel */
......
......@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.14 2003/05/04 22:42:16 gbazin Exp $
* $Id: timer.cpp,v 1.15 2003/05/07 12:23:06 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -105,7 +105,9 @@ void Timer::Notify()
/* If the "display popup" flag has changed */
if( p_intf->b_menu_change )
{
PopupMenu( p_intf, p_main_interface );
wxPoint mousepos = wxGetMousePosition();
PopupMenu( p_intf, p_main_interface,
p_main_interface->ScreenToClient(mousepos) );
p_intf->b_menu_change = 0;
}
......
......@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.19 2003/05/04 22:42:16 gbazin Exp $
* $Id: wxwindows.h,v 1.20 2003/05/07 12:23:06 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -155,7 +155,12 @@ private:
void OnNextStream( wxCommandEvent& event );
void OnMenuOpen( wxMenuEvent& event );
void OnMenuClose( wxMenuEvent& event );
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
void OnContextMenu(wxContextMenuEvent& event);
#else
void OnContextMenu(wxMouseEvent& event);
#endif
DECLARE_EVENT_TABLE();
......@@ -442,7 +447,8 @@ private:
#endif
/* Menus */
void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface );
void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
const wxPoint& pos );
wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface );
wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface );
......
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