]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*: misc fixes.
authorGildas Bazin <gbazin@videolan.org>
Wed, 7 May 2003 12:23:06 +0000 (12:23 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 7 May 2003 12:23:06 +0000 (12:23 +0000)
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/menus.cpp
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/streamout.cpp
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/wxwindows.h

index 79aeac93155ed87387b8657c5b9fee74775236db..e3db228699cbefedbe83b1cad691a3762e1386c1 100644 (file)
@@ -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) )
 {
index de16235200171e6840a8778ff4916fc1757cbc53..ee3ccedb19c2bb8e064759a0fe7a56724f2d558d 100644 (file)
@@ -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 )
index 15838bc70c5c38da00485d804bee32ac6188628a..10619a335bc1d40db3bbd805619495437c405dc1 100644 (file)
@@ -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;
index f05e62fe62cd75d24500dbc24cd76ce6e306afbf..ac930499a0884ebbf45480181183d0e9ffea4fd7 100644 (file)
@@ -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 */
index 7321913abcedbcd72545c77be4ae1eb1335e251b..00122d81ccf708dd0a652a1e3912c514f24b2e35 100644 (file)
@@ -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;
     }
 
index 46637316a751e251a225e2adb89f19fdad05c828..2b0cb09793016a77b5c89f479d857b5b45c226fc 100644 (file)
@@ -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 );