From 3e8c0de97d5eb9a1520d5d8eb40cce91c65e6cef Mon Sep 17 00:00:00 2001 From: Christophe Mutricy Date: Sun, 7 May 2006 15:41:37 +0000 Subject: [PATCH] wx/dilaogs/ : Fix button alignment in dialogs (refs #470) --- modules/gui/wxwidgets/dialogs/iteminfo.cpp | 11 +++++----- modules/gui/wxwidgets/dialogs/open.cpp | 20 +++++++++---------- modules/gui/wxwidgets/dialogs/streamout.cpp | 11 +++++----- modules/gui/wxwidgets/dialogs/subtitles.cpp | 11 +++++----- .../gui/wxwidgets/dialogs/vlm/vlm_panel.cpp | 11 +++++----- 5 files changed, 31 insertions(+), 33 deletions(-) diff --git a/modules/gui/wxwidgets/dialogs/iteminfo.cpp b/modules/gui/wxwidgets/dialogs/iteminfo.cpp index 116c0faec7..bb87842946 100644 --- a/modules/gui/wxwidgets/dialogs/iteminfo.cpp +++ b/modules/gui/wxwidgets/dialogs/iteminfo.cpp @@ -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 ); diff --git a/modules/gui/wxwidgets/dialogs/open.cpp b/modules/gui/wxwidgets/dialogs/open.cpp index e0b3575d98..92d7c06b8c 100644 --- a/modules/gui/wxwidgets/dialogs/open.cpp +++ b/modules/gui/wxwidgets/dialogs/open.cpp @@ -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 ); diff --git a/modules/gui/wxwidgets/dialogs/streamout.cpp b/modules/gui/wxwidgets/dialogs/streamout.cpp index f98845cc9d..89823c9474 100644 --- a/modules/gui/wxwidgets/dialogs/streamout.cpp +++ b/modules/gui/wxwidgets/dialogs/streamout.cpp @@ -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 ); diff --git a/modules/gui/wxwidgets/dialogs/subtitles.cpp b/modules/gui/wxwidgets/dialogs/subtitles.cpp index db02fc10c9..c349472420 100644 --- a/modules/gui/wxwidgets/dialogs/subtitles.cpp +++ b/modules/gui/wxwidgets/dialogs/subtitles.cpp @@ -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 ); diff --git a/modules/gui/wxwidgets/dialogs/vlm/vlm_panel.cpp b/modules/gui/wxwidgets/dialogs/vlm/vlm_panel.cpp index 226b828d3a..a87ded731d 100644 --- a/modules/gui/wxwidgets/dialogs/vlm/vlm_panel.cpp +++ b/modules/gui/wxwidgets/dialogs/vlm/vlm_panel.cpp @@ -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, -- GitLab