Commit 9ad37e4e authored by gbazin's avatar gbazin

* modules/gui/wxwindows/*: got rid of the Misc menu and moved everything in the Settings one.
parent bf61fa48
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc * interface.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.71 2003/11/21 18:55:40 gbazin Exp $ * $Id: interface.cpp,v 1.72 2003/11/29 13:39:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -345,11 +345,8 @@ void Interface::CreateOurMenuBar() ...@@ -345,11 +345,8 @@ void Interface::CreateOurMenuBar()
wxU(_(HELP_FILEINFO)) ); wxU(_(HELP_FILEINFO)) );
/* Create the "Settings" menu */ /* Create the "Settings" menu */
wxMenu *settings_menu = new wxMenu; p_settings_menu = new wxMenu;
settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")), b_settings_menu = 1;
wxU(_(HELP_PREFS)) );
settings_menu->AppendCheckItem( Extra_Event, wxU(_("&Extended GUI") ),
wxU(_(EXTRA_PREFS)) );
/* Create the "Audio" menu */ /* Create the "Audio" menu */
p_audio_menu = new wxMenu; p_audio_menu = new wxMenu;
...@@ -363,10 +360,6 @@ void Interface::CreateOurMenuBar() ...@@ -363,10 +360,6 @@ void Interface::CreateOurMenuBar()
p_navig_menu = new wxMenu; p_navig_menu = new wxMenu;
b_navig_menu = 1; b_navig_menu = 1;
/* Create the "Miscellaneous" menu */
p_misc_menu = new wxMenu;
b_misc_menu = 1;
/* Create the "Help" menu */ /* Create the "Help" menu */
wxMenu *help_menu = new wxMenu; wxMenu *help_menu = new wxMenu;
help_menu->Append( About_Event, wxU(_("&About...")), wxU(_(HELP_ABOUT)) ); help_menu->Append( About_Event, wxU(_("&About...")), wxU(_(HELP_ABOUT)) );
...@@ -375,11 +368,10 @@ void Interface::CreateOurMenuBar() ...@@ -375,11 +368,10 @@ void Interface::CreateOurMenuBar()
wxMenuBar *menubar = new wxMenuBar( wxMB_DOCKABLE ); wxMenuBar *menubar = new wxMenuBar( wxMB_DOCKABLE );
menubar->Append( file_menu, wxU(_("&File")) ); menubar->Append( file_menu, wxU(_("&File")) );
menubar->Append( view_menu, wxU(_("&View")) ); menubar->Append( view_menu, wxU(_("&View")) );
menubar->Append( settings_menu, wxU(_("&Settings")) ); menubar->Append( p_settings_menu, wxU(_("&Settings")) );
menubar->Append( p_audio_menu, wxU(_("&Audio")) ); menubar->Append( p_audio_menu, wxU(_("&Audio")) );
menubar->Append( p_video_menu, wxU(_("&Video")) ); menubar->Append( p_video_menu, wxU(_("&Video")) );
menubar->Append( p_navig_menu, wxU(_("&Navigation")) ); menubar->Append( p_navig_menu, wxU(_("&Navigation")) );
menubar->Append( p_misc_menu, wxU(_("&Miscellaneous")) );
menubar->Append( help_menu, wxU(_("&Help")) ); menubar->Append( help_menu, wxU(_("&Help")) );
/* Attach the menu bar to the frame */ /* Attach the menu bar to the frame */
...@@ -748,7 +740,32 @@ void RecursiveDestroy( wxMenu *menu ) ...@@ -748,7 +740,32 @@ void RecursiveDestroy( wxMenu *menu )
void Interface::OnMenuOpen(wxMenuEvent& event) void Interface::OnMenuOpen(wxMenuEvent& event)
{ {
#if !defined( __WXMSW__ ) #if !defined( __WXMSW__ )
if( event.GetEventObject() == p_audio_menu ) if( event.GetEventObject() == p_settings_menu )
{
if( b_settings_menu )
{
p_settings_menu = SettingsMenu( p_intf, this );
/* Add static items */
p_settings_menu->AppendCheckItem( Extra_Event,
wxU(_("&Extended GUI") ), wxU(_(EXTRA_PREFS)) );
p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")),
wxU(_(HELP_PREFS)) );
/* Work-around for buggy wxGTK */
wxMenu *menu = GetMenuBar()->GetMenu( 2 );
RecursiveDestroy( menu );
/* End work-around */
menu = GetMenuBar()->Replace( 2, p_settings_menu,
wxU(_("&Settings")));
if( menu ) delete menu;
b_settings_menu = 0;
}
else b_settings_menu = 1;
}
else if( event.GetEventObject() == p_audio_menu )
{ {
if( b_audio_menu ) if( b_audio_menu )
{ {
...@@ -805,29 +822,20 @@ void Interface::OnMenuOpen(wxMenuEvent& event) ...@@ -805,29 +822,20 @@ void Interface::OnMenuOpen(wxMenuEvent& event)
} }
else b_navig_menu = 1; else b_navig_menu = 1;
} }
else if( event.GetEventObject() == p_misc_menu )
{
if( b_misc_menu )
{
p_misc_menu = MiscMenu( p_intf, this );
/* Work-around for buggy wxGTK */
wxMenu *menu = GetMenuBar()->GetMenu( 6 );
RecursiveDestroy( menu );
/* End work-around */
menu = GetMenuBar()->Replace( 6, p_misc_menu,
wxU(_("&Miscellaneous")));
if( menu ) delete menu;
b_misc_menu = 0;
}
else b_misc_menu = 1;
}
#else #else
p_settings_menu = SettingsMenu( p_intf, this );
/* Add static items */
p_settings_menu->AppendCheckItem( Extra_Event, wxU(_("&Extended GUI") ),
wxU(_(EXTRA_PREFS)) );
p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")),
wxU(_(HELP_PREFS)) );
wxMenu *menu =
GetMenuBar()->Replace( 2, p_settings_menu, wxU(_("&Settings")) );
if( menu ) delete menu;
p_audio_menu = AudioMenu( p_intf, this ); p_audio_menu = AudioMenu( p_intf, this );
wxMenu *menu = GetMenuBar()->Replace( 3, p_audio_menu, wxU(_("&Audio")) ); menu = GetMenuBar()->Replace( 3, p_audio_menu, wxU(_("&Audio")) );
if( menu ) delete menu; if( menu ) delete menu;
p_video_menu = VideoMenu( p_intf, this ); p_video_menu = VideoMenu( p_intf, this );
...@@ -837,11 +845,8 @@ void Interface::OnMenuOpen(wxMenuEvent& event) ...@@ -837,11 +845,8 @@ void Interface::OnMenuOpen(wxMenuEvent& event)
p_navig_menu = NavigMenu( p_intf, this ); p_navig_menu = NavigMenu( p_intf, this );
menu = GetMenuBar()->Replace( 5, p_navig_menu, wxU(_("&Navigation")) ); menu = GetMenuBar()->Replace( 5, p_navig_menu, wxU(_("&Navigation")) );
if( menu ) delete menu; if( menu ) delete menu;
p_misc_menu = MiscMenu( p_intf, this );
menu = GetMenuBar()->Replace( 6, p_misc_menu, wxU(_("&Miscellaneous")) );
if( menu ) delete menu;
#endif #endif
} }
#if defined( __WXMSW__ ) || defined( __WXMAC__ ) #if defined( __WXMSW__ ) || defined( __WXMAC__ )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc * menus.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: menus.cpp,v 1.26 2003/11/24 13:40:03 gbazin Exp $ * $Id: menus.cpp,v 1.27 2003/11/29 13:39:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -69,10 +69,10 @@ enum ...@@ -69,10 +69,10 @@ enum
OpenDisc_Event, OpenDisc_Event,
OpenNet_Event, OpenNet_Event,
FirstAutoGenerated_Event = wxID_HIGHEST + 1999, FirstAutoGenerated_Event = wxID_HIGHEST + 1999,
SettingsMenu_Events = wxID_HIGHEST + 5000,
AudioMenu_Events = wxID_HIGHEST + 2000, AudioMenu_Events = wxID_HIGHEST + 2000,
VideoMenu_Events = wxID_HIGHEST + 3000, VideoMenu_Events = wxID_HIGHEST + 3000,
NavigMenu_Events = wxID_HIGHEST + 4000, NavigMenu_Events = wxID_HIGHEST + 4000,
MiscMenu_Events = wxID_HIGHEST + 5000,
PopupMenu_Events = wxID_HIGHEST + 6000 PopupMenu_Events = wxID_HIGHEST + 6000
}; };
...@@ -379,17 +379,17 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent ) ...@@ -379,17 +379,17 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
ppsz_varnames, pi_objects, NavigMenu_Events ); ppsz_varnames, pi_objects, NavigMenu_Events );
} }
wxMenu *MiscMenu( intf_thread_t *_p_intf, wxWindow *p_parent ) wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
{ {
#define MAX_MISC_ITEMS 10 #define MAX_SETTINGS_ITEMS 10
vlc_object_t *p_object; vlc_object_t *p_object;
char *ppsz_varnames[MAX_MISC_ITEMS]; char *ppsz_varnames[MAX_SETTINGS_ITEMS];
int pi_objects[MAX_MISC_ITEMS]; int pi_objects[MAX_SETTINGS_ITEMS];
int i = 0; int i = 0;
/* Initializations */ /* Initializations */
memset( pi_objects, 0, MAX_MISC_ITEMS * sizeof(int) ); memset( pi_objects, 0, MAX_SETTINGS_ITEMS * sizeof(int) );
p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INTF, p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INTF,
FIND_PARENT ); FIND_PARENT );
...@@ -404,7 +404,7 @@ wxMenu *MiscMenu( intf_thread_t *_p_intf, wxWindow *p_parent ) ...@@ -404,7 +404,7 @@ wxMenu *MiscMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
/* Build menu */ /* Build menu */
return new Menu( _p_intf, p_parent, i, return new Menu( _p_intf, p_parent, i,
ppsz_varnames, pi_objects, MiscMenu_Events ); ppsz_varnames, pi_objects, SettingsMenu_Events );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.74 2003/11/27 06:37:11 adn Exp $ * $Id: wxwindows.h,v 1.75 2003/11/29 13:39:43 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -229,14 +229,14 @@ private: ...@@ -229,14 +229,14 @@ private:
int i_old_playing_status; int i_old_playing_status;
/* For auto-generated menus */ /* For auto-generated menus */
wxMenu *p_settings_menu;
vlc_bool_t b_settings_menu;
wxMenu *p_audio_menu; wxMenu *p_audio_menu;
vlc_bool_t b_audio_menu; vlc_bool_t b_audio_menu;
wxMenu *p_video_menu; wxMenu *p_video_menu;
vlc_bool_t b_video_menu; vlc_bool_t b_video_menu;
wxMenu *p_navig_menu; wxMenu *p_navig_menu;
vlc_bool_t b_navig_menu; vlc_bool_t b_navig_menu;
wxMenu *p_misc_menu;
vlc_bool_t b_misc_menu;
}; };
class StreamDialog; class StreamDialog;
...@@ -893,10 +893,10 @@ private: ...@@ -893,10 +893,10 @@ private:
/* Menus */ /* Menus */
void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent, void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
const wxPoint& pos ); const wxPoint& pos );
wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent ); wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent ); wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent ); wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
wxMenu *MiscMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
class MenuEvtHandler : public wxEvtHandler class MenuEvtHandler : public wxEvtHandler
{ {
......
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