]> git.sesse.net Git - vlc/commitdiff
Misc WX improvements - patches by zcot
authorClément Stenac <zorglub@videolan.org>
Thu, 6 Oct 2005 17:45:57 +0000 (17:45 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 6 Oct 2005 17:45:57 +0000 (17:45 +0000)
* Option to have extended interface by default (Closes: #232)
* Fix "floating" volume bar with wxMSW 2.6.X (Closes:#289)
* Enforce minimum vertical size (Closes:#360)
* Fix a font size problem on WX

* Add him to THANKS, obviously :)

THANKS
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/wxwidgets.cpp

diff --git a/THANKS b/THANKS
index ec77aecab07274ebe117d17f50adfac23cedea79..1510e088b7cfc43586d1048c8f0522f258d24c42 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -95,6 +95,7 @@ Remco Poortinga <poortinga at telin.nl> - IPv6 multicast patch
 Rene Gollent <rgollent at u.arizona.edu> - BeOS interface fix
 Roine Gustafsson <roine at popstar.com> - spudec bug fixes
 Rudolf Cornelissen <rag.cornelissen at inter.nl.net> - BeOS fixes
+Scott Claude <cutmancw at hotmail dot com> - Visualisation, WX improvements
 Sebastien Chaumat <Sebastien.Chaumat at ens-lyon.fr> - YOPY port tests
 Steve Lhomme <steve dot lhomme at free dot fr> - MSVC fixes and Matroska enhancements
 Steve Brown <sbrown at cortland.com> - fix for optional PES size bug
index c75b1587296d3aa519e9e77319cfaad8c2e7b821..ce4f6ee9942c43e90cb1edcf1c250b61cf161aed 100644 (file)
@@ -330,6 +330,20 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
 
     if( ws->GetSettings( WindowSettings::ID_MAIN, b_shown, p, s ) )
         Move( p );
+
+    /* Set minimum window size to prevent user from glitching it */
+    s = GetSize();
+    if( config_GetInt( p_intf, "wx-embed" ) )
+    {
+        wxSize  s2;
+        s2 = video_window->GetSize();
+        s.SetHeight( s.GetHeight() - s2.GetHeight() );
+    }
+    SetMinSize( s );
+
+    /* Show extended GUI if requested */
+    if( ( b_extra = config_GetInt( p_intf, "wx-extended" ) ) )
+        frame_sizer->Show( extra_frame );
 }
 
 Interface::~Interface()
@@ -359,7 +373,7 @@ Interface::~Interface()
 void Interface::Init()
 {
     /* Misc init */
-    SetupHotkeys();
+    //SetupHotkeys();
 }
 
 void Interface::Update()
@@ -473,6 +487,34 @@ void Interface::CreateOurMenuBar()
 #endif
 #endif
     }
+
+/* Patch by zcot for menu wrapping */
+#if defined(WIN32)
+    /* Find out size of msw menu bar */
+    i_size = 0;
+    SIZE sizing;
+    HDC hdc = GetDC( NULL );
+    for( unsigned int i = 0; i < menubar->GetMenuCount(); i++ )
+    {
+        //                [ MENU BUTTON WIDTH CALCULATION ]
+        // [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
+        GetTextExtentPoint32( hdc, menubar->GetLabelTop(i),
+                                        strlen( menubar->GetLabelTop(i) ),
+                                        &sizing );
+        i_size += sizing.cx;                             // + text size..
+        // +1 more pixel on each size
+        i_size += 2;
+        // width of 2 DLGFRAME
+        i_size += GetSystemMetrics( SM_CXDLGFRAME ) * 2;
+    }
+    ReleaseDC( NULL, hdc );
+    // Width of 2 edges of app window
+    i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
+    // + 2 more pixels on each side..
+    i_size += 4;
+#endif
+/* End patch by zcot */
+
     frame_sizer->SetMinSize( i_size, -1 );
 
     /* Intercept all menu events in our custom event handler */
@@ -536,11 +578,13 @@ void Interface::CreateOurToolBar()
                       wxU(_(HELP_PLO)) );
     }
 
+#if !( (wxMAJOR_VERSION <= 2) && (wxMINOR_VERSION <= 6) && (wxRELEASE_NUMBER < 2) )
     wxControl *p_dummy_ctrl =
         new wxControl( toolbar, -1, wxDefaultPosition,
                        wxSize(35, 16 ), wxBORDER_NONE );
 
     toolbar->AddControl( p_dummy_ctrl );
+#endif
 
     volctrl = new VLCVolCtrl( p_intf, toolbar );
     toolbar->AddControl( volctrl );
index a5450b568f6dafd7170d6d658eecfe473185c926..4a629f93b6578947fb3a92e38126a8995c2a37b0 100644 (file)
@@ -89,6 +89,8 @@ private:
 #define BOOKMARKS_TEXT N_("Show bookmarks dialog")
 #define BOOKMARKS_LONGTEXT N_("Show bookmarks dialog when the interface " \
     "starts.")
+#define EXTENDED_TEXT N_("Show extended GUI")
+#define EXTENDED_LONGTEXT N_("Show extended GUI")
 #define TASKBAR_TEXT N_("Show taskbar entry")
 #define TASKBAR_LONGTEXT N_("Show taskbar entry")
 #define MINIMAL_TEXT N_("Minimal interface")
@@ -125,6 +127,8 @@ vlc_module_begin();
     add_bool( "wx-taskbar", 1, NULL,
               TASKBAR_TEXT, TASKBAR_LONGTEXT, VLC_FALSE );
     add_deprecated( "wxwin-taskbar", VLC_FALSE); /*Deprecated since 0.8.4*/
+    add_bool( "wx-extended", 0, NULL,
+              EXTENDED_TEXT, EXTENDED_LONGTEXT, VLC_FALSE );
     add_bool( "wx-minimal", 0, NULL,
               MINIMAL_TEXT, MINIMAL_LONGTEXT, VLC_TRUE );
     add_deprecated( "wxwin-minimal", VLC_FALSE); /*Deprecated since 0.8.4*/