]> git.sesse.net Git - vlc/commitdiff
wx/dilaogs/ : Fix button alignment in dialogs (refs #470)
authorChristophe Mutricy <xtophe@videolan.org>
Sun, 7 May 2006 15:41:37 +0000 (15:41 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Sun, 7 May 2006 15:41:37 +0000 (15:41 +0000)
modules/gui/wxwidgets/dialogs/iteminfo.cpp
modules/gui/wxwidgets/dialogs/open.cpp
modules/gui/wxwidgets/dialogs/streamout.cpp
modules/gui/wxwidgets/dialogs/subtitles.cpp
modules/gui/wxwidgets/dialogs/vlm/vlm_panel.cpp

index 116c0faec79e2c6735f574378d4023aeff62a031..bb8784294602d9053e0743cc396d88485e59f473 100644 (file)
@@ -80,16 +80,15 @@ ItemInfoDialog::ItemInfoDialog( intf_thread_t *_p_intf,
     wxButton *cancel_button = new wxButton( panel, wxID_CANCEL );
 
     /* Place everything in sizers */
-    wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-    button_sizer->Add( ok_button, 0, wxALL, 5 );
-    button_sizer->Add( cancel_button, 0, wxALL, 5 );
-    button_sizer->Layout();
+    wxStdDialogButtonSizer *button_sizer = new wxStdDialogButtonSizer;
+    button_sizer->AddButton( ok_button );
+    button_sizer->AddButton( cancel_button );
+    button_sizer->Realize();
     wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
     wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
     panel_sizer->Add( info_panel, 1, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
-    panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
-                      wxALL, 5 );
+    panel_sizer->Add( button_sizer, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Layout();
     panel->SetSizerAndFit( panel_sizer );
     main_sizer->Add( panel, 1, wxGROW, 0 );
index e0b3575d9876e894847a81fa05b62f79b81e8513..92d7c06b8cb8baa2406821064c67c96941bc3921 100644 (file)
@@ -321,11 +321,11 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
         ok_button->SetDefault();
         wxButton *cancel_button =
             new wxButton( p_advanced_dialog, wxID_CANCEL );
-        wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-        button_sizer->Add( ok_button, 0, wxALL, 5 );
-        button_sizer->Add( cancel_button, 0, wxALL, 5 );
-        button_sizer->Layout();
-        sizer->Add( button_sizer, 0, wxALL, 0 );
+        wxStdDialogButtonSizer *button_sizer = new wxStdDialogButtonSizer;
+        button_sizer->AddButton( ok_button );
+        button_sizer->AddButton( cancel_button );
+        button_sizer->Realize();
+        sizer->Add( button_sizer, 0, wxEXPAND|wxALL, 5 );
 
         sizer->SetMinSize( 400, -1 );
         p_advanced_dialog->SetSizerAndFit( sizer );
@@ -562,10 +562,10 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     OnPageChange( event );
 
     /* Place everything in sizers */
-    wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-    button_sizer->Add( cancel_button, 0, wxALL, 5 );
-    button_sizer->Add( ok_button, 0, wxALL, 5 );
-    button_sizer->Layout();
+    wxStdDialogButtonSizer *button_sizer = new wxStdDialogButtonSizer;
+    button_sizer->AddButton( cancel_button );
+    button_sizer->AddButton( ok_button );
+    button_sizer->Realize();
     wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
     wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
 #if (!wxCHECK_VERSION(2,5,2))
@@ -575,7 +575,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
 #endif
     panel_sizer->Add( adv_sizer, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
-    panel_sizer->Add( button_sizer, 0, wxALIGN_RIGHT | wxALL, 5 );
+    panel_sizer->Add( button_sizer, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Layout();
     panel->SetSizerAndFit( panel_sizer );
     main_sizer->Add( panel, 1, wxGROW, 0 );
index f98845cc9dc183442a0e6b1c5748ac551abce42d..89823c947406177f2e430b989865506816104e24 100644 (file)
@@ -197,10 +197,10 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     wxButton *cancel_button = new wxButton( panel, wxID_CANCEL );
 
     /* Place everything in sizers */
-    wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-    button_sizer->Add( ok_button, 0, wxALL, 5 );
-    button_sizer->Add( cancel_button, 0, wxALL, 5 );
-    button_sizer->Layout();
+    wxStdDialogButtonSizer *button_sizer = new wxStdDialogButtonSizer;
+    button_sizer->AddButton( ok_button );
+    button_sizer->AddButton( cancel_button );
+    button_sizer->Realize();
     wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
     wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
     panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
@@ -208,8 +208,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     panel_sizer->Add( encapsulation_panel, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( transcoding_panel, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( misc_panel, 0, wxEXPAND | wxALL, 5 );
-    panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
-                      wxALL, 5 );
+    panel_sizer->Add( button_sizer, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Layout();
     panel->SetSizerAndFit( panel_sizer );
     main_sizer->Add( panel, 1, wxGROW, 0 );
index db02fc10c993b2b830debc223cb5abfdb4a9db6d..c3494724202a813785092a74716c0b93382f1187 100644 (file)
@@ -244,14 +244,13 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     wxButton *cancel_button = new wxButton( panel, wxID_CANCEL );
 
     /* Place everything in sizers */
-    wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-    button_sizer->Add( ok_button, 0, wxALL, 5 );
-    button_sizer->Add( cancel_button, 0, wxALL, 5 );
-    button_sizer->Layout();
+    wxStdDialogButtonSizer *button_sizer = new wxStdDialogButtonSizer;
+    button_sizer->AddButton( ok_button );
+    button_sizer->AddButton( cancel_button );
+    button_sizer->Realize();
 
     panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
-    panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
-                      wxALL, 5 );
+    panel_sizer->Add( button_sizer, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Layout();
     panel->SetSizerAndFit( panel_sizer );
     main_sizer->Add( panel, 1, wxGROW, 0 );
index 226b828d3a8a4d1675d576f87f836c28a8bae229..a87ded731d13896316e554bbc6c21489052143f4 100644 (file)
@@ -40,9 +40,9 @@ enum
 
 BEGIN_EVENT_TABLE( VLMPanel, wxPanel)
    EVT_TIMER( Timer_Event, VLMPanel::OnTimer )
-   EVT_BUTTON( wxID_CLOSE, VLMPanel::OnClose )
+   EVT_BUTTON( Close_Event, VLMPanel::OnClose )
    EVT_BUTTON( Load_Event, VLMPanel::OnLoad )
-   EVT_BUTTON( wxID_SAVE, VLMPanel::OnSave )
+   EVT_BUTTON( Save_Event, VLMPanel::OnSave )
 END_EVENT_TABLE()
 
 
@@ -75,10 +75,10 @@ VLMPanel::VLMPanel( intf_thread_t *_p_intf, wxWindow *_p_parent ) :
 #endif
 
     wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-    button_sizer->Add( new wxButton( this, wxID_CLOSE ));
+    button_sizer->Add( new wxButton( this, Close_Event, wxU(_("Close") ) ) );
     button_sizer->Add( 0, 0, 1 );
     button_sizer->Add( new wxButton( this, Load_Event, wxU(_("Load") ) ), 0, wxRIGHT, 10 );
-    button_sizer->Add( new wxButton( this, wxID_SAVE ));
+    button_sizer->Add( new wxButton( this, Save_Event, wxU(_("Save") ) ) );
     panel_sizer->Add( button_sizer, 0 , wxEXPAND | wxALL, 5 );
 
     panel_sizer->Layout();
@@ -409,7 +409,8 @@ VLMAddStreamPanel::VLMAddStreamPanel( intf_thread_t *_p_intf,
 
     if( !b_edit )
     {
-        lower_sizer->Add( new wxButton( this, wxID_CLEAR ),
+        lower_sizer->Add( new wxButton( this, Clear_Event,
+                          wxU( _( "Clear" )  ) ),
                          0 , wxEXPAND | wxALL , 5 );
     }
     lower_sizer->Add( new wxButton( this, Create_Event,