summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wx/about_dialog.cc2
-rw-r--r--src/wx/config_dialog.cc46
-rw-r--r--src/wx/dci_metadata_dialog.cc16
-rw-r--r--src/wx/film_editor.cc87
-rw-r--r--src/wx/gain_calculator_dialog.cc6
-rw-r--r--src/wx/new_film_dialog.cc8
-rw-r--r--src/wx/properties_dialog.cc8
-rw-r--r--src/wx/server_dialog.cc6
-rw-r--r--src/wx/wx_util.cc24
-rw-r--r--src/wx/wx_util.h7
10 files changed, 117 insertions, 93 deletions
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc
index 27644a00f..cbac3ed43 100644
--- a/src/wx/about_dialog.cc
+++ b/src/wx/about_dialog.cc
@@ -142,7 +142,7 @@ AboutDialog::add_section (wxString name, wxArrayString credits)
int c = 0;
for (size_t i = 0; i < credits.Count(); ++i) {
- add_label_to_sizer (sizers[c], panel, credits[i]);
+ add_label_to_sizer (sizers[c], panel, credits[i], false);
++c;
if (c == N) {
c = 0;
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index a737818ec..e622c331b 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -80,7 +80,7 @@ ConfigDialog::make_misc_panel ()
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_misc_panel->SetSizer (s);
- wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (3, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
s->Add (table, 1, wxALL | wxEXPAND, 8);
@@ -95,7 +95,7 @@ ConfigDialog::make_misc_panel ()
table->Add (_language, 1, wxEXPAND);
table->AddSpacer (0);
- wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DVD-o-matic to see language changes)"));
+ wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DVD-o-matic to see language changes)"), false);
wxFont font = restart->GetFont();
font.SetStyle (wxFONTSTYLE_ITALIC);
font.SetPointSize (font.GetPointSize() - 1);
@@ -103,12 +103,12 @@ ConfigDialog::make_misc_panel ()
table->AddSpacer (0);
table->AddSpacer (0);
- add_label_to_sizer (table, _misc_panel, _("Threads to use for encoding on this host"));
+ add_label_to_sizer (table, _misc_panel, _("Threads to use for encoding on this host"), true);
_num_local_encoding_threads = new wxSpinCtrl (_misc_panel);
- table->Add (_num_local_encoding_threads, 1, wxEXPAND);
+ table->Add (_num_local_encoding_threads, 1);
table->AddSpacer (0);
- add_label_to_sizer (table, _misc_panel, _("Default directory for new films"));
+ add_label_to_sizer (table, _misc_panel, _("Default directory for new films"), true);
#ifdef DVDOMATIC_USE_OWN_DIR_PICKER
_default_directory = new DirPickerCtrl (_misc_panel);
#else
@@ -117,17 +117,17 @@ ConfigDialog::make_misc_panel ()
table->Add (_default_directory, 1, wxEXPAND);
table->AddSpacer (0);
- add_label_to_sizer (table, _misc_panel, _("Default DCI name details"));
+ add_label_to_sizer (table, _misc_panel, _("Default DCI name details"), true);
_default_dci_metadata_button = new wxButton (_misc_panel, wxID_ANY, _("Edit..."));
table->Add (_default_dci_metadata_button);
table->AddSpacer (1);
- add_label_to_sizer (table, _misc_panel, _("Default format"));
+ add_label_to_sizer (table, _misc_panel, _("Default format"), true);
_default_format = new wxChoice (_misc_panel, wxID_ANY);
table->Add (_default_format);
table->AddSpacer (1);
- add_label_to_sizer (table, _misc_panel, _("Default content type"));
+ add_label_to_sizer (table, _misc_panel, _("Default content type"), true);
_default_dcp_content_type = new wxChoice (_misc_panel, wxID_ANY);
table->Add (_default_dcp_content_type);
table->AddSpacer (1);
@@ -194,23 +194,23 @@ ConfigDialog::make_tms_panel ()
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_tms_panel->SetSizer (s);
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
s->Add (table, 1, wxALL | wxEXPAND, 8);
- add_label_to_sizer (table, _tms_panel, _("IP address"));
+ add_label_to_sizer (table, _tms_panel, _("IP address"), true);
_tms_ip = new wxTextCtrl (_tms_panel, wxID_ANY);
table->Add (_tms_ip, 1, wxEXPAND);
- add_label_to_sizer (table, _tms_panel, _("Target path"));
+ add_label_to_sizer (table, _tms_panel, _("Target path"), true);
_tms_path = new wxTextCtrl (_tms_panel, wxID_ANY);
table->Add (_tms_path, 1, wxEXPAND);
- add_label_to_sizer (table, _tms_panel, _("User name"));
+ add_label_to_sizer (table, _tms_panel, _("User name"), true);
_tms_user = new wxTextCtrl (_tms_panel, wxID_ANY);
table->Add (_tms_user, 1, wxEXPAND);
- add_label_to_sizer (table, _tms_panel, _("Password"));
+ add_label_to_sizer (table, _tms_panel, _("Password"), true);
_tms_password = new wxTextCtrl (_tms_panel, wxID_ANY);
table->Add (_tms_password, 1, wxEXPAND);
@@ -233,15 +233,15 @@ ConfigDialog::make_metadata_panel ()
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_metadata_panel->SetSizer (s);
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
s->Add (table, 1, wxALL | wxEXPAND, 8);
- add_label_to_sizer (table, _metadata_panel, _("Issuer"));
+ add_label_to_sizer (table, _metadata_panel, _("Issuer"), true);
_issuer = new wxTextCtrl (_metadata_panel, wxID_ANY);
table->Add (_issuer, 1, wxEXPAND);
- add_label_to_sizer (table, _metadata_panel, _("Creator"));
+ add_label_to_sizer (table, _metadata_panel, _("Creator"), true);
_creator = new wxTextCtrl (_metadata_panel, wxID_ANY);
table->Add (_creator, 1, wxEXPAND);
@@ -260,11 +260,11 @@ ConfigDialog::make_ab_panel ()
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_ab_panel->SetSizer (s);
- wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (3, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
s->Add (table, 1, wxALL, 8);
- add_label_to_sizer (table, _ab_panel, _("Reference scaler"));
+ add_label_to_sizer (table, _ab_panel, _("Reference scaler"), true);
_reference_scaler = new wxChoice (_ab_panel, wxID_ANY);
vector<Scaler const *> const sc = Scaler::all ();
for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
@@ -275,7 +275,7 @@ ConfigDialog::make_ab_panel ()
table->AddSpacer (0);
{
- add_label_to_sizer (table, _ab_panel, _("Reference filters"));
+ add_label_to_sizer (table, _ab_panel, _("Reference filters"), true);
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_reference_filters = new wxStaticText (_ab_panel, wxID_ANY, wxT (""));
s->Add (_reference_filters, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 6);
@@ -302,7 +302,7 @@ ConfigDialog::make_servers_panel ()
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_servers_panel->SetSizer (s);
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (0, 1);
s->Add (table, 1, wxALL | wxEXPAND, 8);
@@ -323,11 +323,11 @@ ConfigDialog::make_servers_panel ()
{
wxSizer* s = new wxBoxSizer (wxVERTICAL);
_add_server = new wxButton (_servers_panel, wxID_ANY, _("Add"));
- s->Add (_add_server);
+ s->Add (_add_server, 0, wxTOP | wxBOTTOM, 2);
_edit_server = new wxButton (_servers_panel, wxID_ANY, _("Edit"));
- s->Add (_edit_server);
+ s->Add (_edit_server, 0, wxTOP | wxBOTTOM, 2);
_remove_server = new wxButton (_servers_panel, wxID_ANY, _("Remove"));
- s->Add (_remove_server);
+ s->Add (_remove_server, 0, wxTOP | wxBOTTOM, 2);
table->Add (s, 0);
}
diff --git a/src/wx/dci_metadata_dialog.cc b/src/wx/dci_metadata_dialog.cc
index c08c58ed4..9c124ed74 100644
--- a/src/wx/dci_metadata_dialog.cc
+++ b/src/wx/dci_metadata_dialog.cc
@@ -27,34 +27,34 @@ using boost::shared_ptr;
DCIMetadataDialog::DCIMetadataDialog (wxWindow* parent, DCIMetadata dm)
: wxDialog (parent, wxID_ANY, _("DCI name"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
- add_label_to_sizer (table, this, _("Audio Language (e.g. EN)"));
+ add_label_to_sizer (table, this, _("Audio Language (e.g. EN)"), true);
_audio_language = new wxTextCtrl (this, wxID_ANY);
table->Add (_audio_language, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Subtitle Language (e.g. FR)"));
+ add_label_to_sizer (table, this, _("Subtitle Language (e.g. FR)"), true);
_subtitle_language = new wxTextCtrl (this, wxID_ANY);
table->Add (_subtitle_language, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Territory (e.g. UK)"));
+ add_label_to_sizer (table, this, _("Territory (e.g. UK)"), true);
_territory = new wxTextCtrl (this, wxID_ANY);
table->Add (_territory, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Rating (e.g. 15)"));
+ add_label_to_sizer (table, this, _("Rating (e.g. 15)"), true);
_rating = new wxTextCtrl (this, wxID_ANY);
table->Add (_rating, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Studio (e.g. TCF)"));
+ add_label_to_sizer (table, this, _("Studio (e.g. TCF)"), true);
_studio = new wxTextCtrl (this, wxID_ANY);
table->Add (_studio, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Facility (e.g. DLA)"));
+ add_label_to_sizer (table, this, _("Facility (e.g. DLA)"), true);
_facility = new wxTextCtrl (this, wxID_ANY);
table->Add (_facility, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Package Type (e.g. OV)"));
+ add_label_to_sizer (table, this, _("Package Type (e.g. OV)"), true);
_package_type = new wxTextCtrl (this, wxID_ANY);
table->Add (_package_type, 1, wxEXPAND);
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index f6c1163eb..b9ad12d64 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -97,28 +97,33 @@ FilmEditor::make_film_panel ()
_film_sizer = new wxBoxSizer (wxVERTICAL);
_film_panel->SetSizer (_film_sizer);
- wxGridBagSizer* grid = new wxGridBagSizer (4, 4);
+ wxGridBagSizer* grid = new wxGridBagSizer (DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
_film_sizer->Add (grid, 0, wxALL, 8);
int r = 0;
- add_label_to_grid_bag_sizer (grid, _film_panel, _("Name"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _film_panel, _("Name"), true, wxGBPosition (r, 0));
_name = new wxTextCtrl (_film_panel, wxID_ANY);
- grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
+ grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND | wxLEFT | wxRIGHT);
++r;
- add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Name"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Name"), true, wxGBPosition (r, 0));
_dcp_name = new wxStaticText (_film_panel, wxID_ANY, wxT (""));
grid->Add (_dcp_name, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
++r;
+ int flags = wxALIGN_CENTER_VERTICAL;
+#ifdef __WXOSX__
+ flags |= wxALIGN_RIGHT;
+#endif
+
_use_dci_name = new wxCheckBox (_film_panel, wxID_ANY, _("Use DCI name"));
- grid->Add (_use_dci_name, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
+ grid->Add (_use_dci_name, wxGBPosition (r, 0), wxDefaultSpan, flags);
_edit_dci_button = new wxButton (_film_panel, wxID_ANY, _("Details..."));
grid->Add (_edit_dci_button, wxGBPosition (r, 1), wxDefaultSpan);
++r;
- add_label_to_grid_bag_sizer (grid, _film_panel, _("Content"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _film_panel, _("Content"), true, wxGBPosition (r, 0));
_content = new wxFilePickerCtrl (_film_panel, wxID_ANY, wxT (""), _("Select Content File"), wxT("*.*"));
grid->Add (_content, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND);
++r;
@@ -128,18 +133,18 @@ FilmEditor::make_film_panel ()
grid->Add (_trust_content_header, wxGBPosition (r, 0), wxGBSpan(1, 2));
++r;
- add_label_to_grid_bag_sizer (grid, _film_panel, _("Content Type"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _film_panel, _("Content Type"), true, wxGBPosition (r, 0));
_dcp_content_type = new wxChoice (_film_panel, wxID_ANY);
grid->Add (_dcp_content_type, wxGBPosition (r, 1));
++r;
- video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Original Frame Rate"), wxGBPosition (r, 0)));
+ video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Original Frame Rate"), true, wxGBPosition (r, 0)));
_source_frame_rate = new wxStaticText (_film_panel, wxID_ANY, wxT (""));
grid->Add (video_control (_source_frame_rate), wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
++r;
{
- add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Frame Rate"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Frame Rate"), true, wxGBPosition (r, 0));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_dcp_frame_rate = new wxChoice (_film_panel, wxID_ANY);
s->Add (_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
@@ -157,19 +162,19 @@ FilmEditor::make_film_panel ()
_frame_rate_description->SetFont(font);
++r;
- video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Length"), wxGBPosition (r, 0)));
+ video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Length"), true, wxGBPosition (r, 0)));
_length = new wxStaticText (_film_panel, wxID_ANY, wxT (""));
grid->Add (video_control (_length), wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
++r;
{
- video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim frames"), wxGBPosition (r, 0)));
+ video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim frames"), true, wxGBPosition (r, 0)));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- video_control (add_label_to_sizer (s, _film_panel, _("Start")));
+ video_control (add_label_to_sizer (s, _film_panel, _("Start"), true));
_trim_start = new wxSpinCtrl (_film_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
s->Add (video_control (_trim_start));
- video_control (add_label_to_sizer (s, _film_panel, _("End")));
+ video_control (add_label_to_sizer (s, _film_panel, _("End"), true));
_trim_end = new wxSpinCtrl (_film_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
s->Add (video_control (_trim_end));
@@ -177,7 +182,7 @@ FilmEditor::make_film_panel ()
}
++r;
- video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim method"), wxGBPosition (r, 0)));
+ video_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim method"), true, wxGBPosition (r, 0)));
_trim_type = new wxChoice (_film_panel, wxID_ANY);
grid->Add (video_control (_trim_type), wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
++r;
@@ -189,13 +194,13 @@ FilmEditor::make_film_panel ()
/* STILL-only stuff */
{
- still_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Duration"), wxGBPosition (r, 0)));
+ still_control (add_label_to_grid_bag_sizer (grid, _film_panel, _("Duration"), true, wxGBPosition (r, 0)));
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_still_duration = new wxSpinCtrl (_film_panel);
still_control (_still_duration);
s->Add (_still_duration, 1, wxEXPAND);
/// TRANSLATORS: `s' here is an abbreviation for seconds, the unit of time
- still_control (add_label_to_sizer (s, _film_panel, _("s")));
+ still_control (add_label_to_sizer (s, _film_panel, _("s"), false));
grid->Add (s, wxGBPosition (r, 1));
}
++r;
@@ -268,31 +273,31 @@ FilmEditor::make_video_panel ()
_video_sizer = new wxBoxSizer (wxVERTICAL);
_video_panel->SetSizer (_video_sizer);
- wxGridBagSizer* grid = new wxGridBagSizer (4, 4);
+ wxGridBagSizer* grid = new wxGridBagSizer (DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
_video_sizer->Add (grid, 0, wxALL, 8);
int r = 0;
- add_label_to_grid_bag_sizer (grid, _video_panel, _("Format"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("Format"), true, wxGBPosition (r, 0));
_format = new wxChoice (_video_panel, wxID_ANY);
grid->Add (_format, wxGBPosition (r, 1));
++r;
- add_label_to_grid_bag_sizer (grid, _video_panel, _("Left crop"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("Left crop"), true, wxGBPosition (r, 0));
_left_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
grid->Add (_left_crop, wxGBPosition (r, 1));
++r;
- add_label_to_grid_bag_sizer (grid, _video_panel, _("Right crop"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("Right crop"), true, wxGBPosition (r, 0));
_right_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
grid->Add (_right_crop, wxGBPosition (r, 1));
++r;
- add_label_to_grid_bag_sizer (grid, _video_panel, _("Top crop"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("Top crop"), true, wxGBPosition (r, 0));
_top_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
grid->Add (_top_crop, wxGBPosition (r, 1));
++r;
- add_label_to_grid_bag_sizer (grid, _video_panel, _("Bottom crop"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("Bottom crop"), true, wxGBPosition (r, 0));
_bottom_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
grid->Add (_bottom_crop, wxGBPosition (r, 1));
++r;
@@ -307,19 +312,19 @@ FilmEditor::make_video_panel ()
/* VIDEO-only stuff */
{
- video_control (add_label_to_grid_bag_sizer (grid, _video_panel, _("Filters"), wxGBPosition (r, 0)));
+ video_control (add_label_to_grid_bag_sizer (grid, _video_panel, _("Filters"), true, wxGBPosition (r, 0)));
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_filters = new wxStaticText (_video_panel, wxID_ANY, _("None"));
video_control (_filters);
s->Add (_filters, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
_filters_button = new wxButton (_video_panel, wxID_ANY, _("Edit..."));
video_control (_filters_button);
- s->Add (_filters_button, 0);
+ s->Add (_filters_button, 0, wxALIGN_CENTER_VERTICAL);
grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
}
++r;
- video_control (add_label_to_grid_bag_sizer (grid, _video_panel, _("Scaler"), wxGBPosition (r, 0)));
+ video_control (add_label_to_grid_bag_sizer (grid, _video_panel, _("Scaler"), true, wxGBPosition (r, 0)));
_scaler = new wxChoice (_video_panel, wxID_ANY);
grid->Add (video_control (_scaler), wxGBPosition (r, 1));
++r;
@@ -329,7 +334,7 @@ FilmEditor::make_video_panel ()
_scaler->Append (std_to_wx ((*i)->name()));
}
- add_label_to_grid_bag_sizer (grid, _video_panel, _("Colour look-up table"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("Colour look-up table"), true, wxGBPosition (r, 0));
_colour_lut = new wxChoice (_video_panel, wxID_ANY);
for (int i = 0; i < 2; ++i) {
_colour_lut->Append (std_to_wx (colour_lut_index_to_name (i)));
@@ -339,11 +344,11 @@ FilmEditor::make_video_panel ()
++r;
{
- add_label_to_grid_bag_sizer (grid, _video_panel, _("JPEG2000 bandwidth"), wxGBPosition (r, 0));
+ add_label_to_grid_bag_sizer (grid, _video_panel, _("JPEG2000 bandwidth"), true, wxGBPosition (r, 0));
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_j2k_bandwidth = new wxSpinCtrl (_video_panel, wxID_ANY);
s->Add (_j2k_bandwidth, 1);
- add_label_to_sizer (s, _video_panel, _("MBps"));
+ add_label_to_sizer (s, _video_panel, _("MBps"), false);
grid->Add (s, wxGBPosition (r, 1));
}
++r;
@@ -365,7 +370,7 @@ FilmEditor::make_audio_panel ()
_audio_sizer = new wxBoxSizer (wxVERTICAL);
_audio_panel->SetSizer (_audio_sizer);
- wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
+ wxFlexGridSizer* grid = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
_audio_sizer->Add (grid, 0, wxALL, 8);
_show_audio = new wxButton (_audio_panel, wxID_ANY, _("Show Audio..."));
@@ -373,11 +378,11 @@ FilmEditor::make_audio_panel ()
grid->AddSpacer (0);
{
- video_control (add_label_to_sizer (grid, _audio_panel, _("Audio Gain")));
+ video_control (add_label_to_sizer (grid, _audio_panel, _("Audio Gain"), true));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_audio_gain = new wxSpinCtrl (_audio_panel);
s->Add (video_control (_audio_gain), 1);
- video_control (add_label_to_sizer (s, _audio_panel, _("dB")));
+ video_control (add_label_to_sizer (s, _audio_panel, _("dB"), false));
_audio_gain_calculate_button = new wxButton (_audio_panel, wxID_ANY, _("Calculate..."));
video_control (_audio_gain_calculate_button);
s->Add (_audio_gain_calculate_button, 1, wxEXPAND);
@@ -385,12 +390,12 @@ FilmEditor::make_audio_panel ()
}
{
- video_control (add_label_to_sizer (grid, _audio_panel, _("Audio Delay")));
+ video_control (add_label_to_sizer (grid, _audio_panel, _("Audio Delay"), true));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_audio_delay = new wxSpinCtrl (_audio_panel);
s->Add (video_control (_audio_delay), 1);
/// TRANSLATORS: this is an abbreviation for milliseconds, the unit of time
- video_control (add_label_to_sizer (s, _audio_panel, _("ms")));
+ video_control (add_label_to_sizer (s, _audio_panel, _("ms"), false));
grid->Add (s);
}
@@ -412,7 +417,7 @@ FilmEditor::make_audio_panel ()
s->Add (video_control (_audio_stream), 1);
_audio = new wxStaticText (_audio_panel, wxID_ANY, wxT (""));
s->Add (video_control (_audio), 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8);
- grid->Add (s, 1, wxEXPAND);
+ grid->Add (s);
}
_use_external_audio = new wxRadioButton (_audio_panel, wxID_ANY, _("Use external audio"));
@@ -420,7 +425,7 @@ FilmEditor::make_audio_panel ()
grid->AddSpacer (0);
for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) {
- add_label_to_sizer (grid, _audio_panel, std_to_wx (audio_channel_name (i)));
+ add_label_to_sizer (grid, _audio_panel, std_to_wx (audio_channel_name (i)), true);
_external_audio[i] = new wxFilePickerCtrl (_audio_panel, wxID_ANY, wxT (""), _("Select Audio File"), wxT ("*.wav"));
grid->Add (_external_audio[i], 1, wxEXPAND);
}
@@ -436,7 +441,7 @@ FilmEditor::make_subtitle_panel ()
_subtitle_panel = new wxPanel (_notebook);
_subtitle_sizer = new wxBoxSizer (wxVERTICAL);
_subtitle_panel->SetSizer (_subtitle_sizer);
- wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
+ wxFlexGridSizer* grid = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
_subtitle_sizer->Add (grid, 0, wxALL, 8);
_with_subtitles = new wxCheckBox (_subtitle_panel, wxID_ANY, _("With Subtitles"));
@@ -447,20 +452,20 @@ FilmEditor::make_subtitle_panel ()
grid->Add (video_control (_subtitle_stream));
{
- video_control (add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset")));
+ video_control (add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset"), true));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_subtitle_offset = new wxSpinCtrl (_subtitle_panel);
s->Add (_subtitle_offset);
- video_control (add_label_to_sizer (s, _subtitle_panel, _("pixels")));
+ video_control (add_label_to_sizer (s, _subtitle_panel, _("pixels"), false));
grid->Add (s);
}
{
- video_control (add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Scale")));
+ video_control (add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Scale"), true));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
_subtitle_scale = new wxSpinCtrl (_subtitle_panel);
s->Add (video_control (_subtitle_scale));
- video_control (add_label_to_sizer (s, _subtitle_panel, _("%")));
+ video_control (add_label_to_sizer (s, _subtitle_panel, _("%"), false));
grid->Add (s);
}
@@ -1392,7 +1397,7 @@ FilmEditor::setup_scaling_description ()
}
Crop const crop = _film->crop ();
- if (crop.left || crop.right || crop.top || crop.bottom) {
+ if ((crop.left || crop.right || crop.top || crop.bottom) && _film->size() != libdcp::Size (0, 0)) {
libdcp::Size const cropped = _film->cropped_size (_film->size ());
d << wxString::Format (
_("Cropped to %dx%d (%.2f:1)\n"),
diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc
index 22e6b447a..7499cbf8b 100644
--- a/src/wx/gain_calculator_dialog.cc
+++ b/src/wx/gain_calculator_dialog.cc
@@ -26,14 +26,14 @@ using namespace boost;
GainCalculatorDialog::GainCalculatorDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("Gain Calculator"))
{
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
- add_label_to_sizer (table, this, _("I want to play this back at fader"));
+ add_label_to_sizer (table, this, _("I want to play this back at fader"), true);
_wanted = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC));
table->Add (_wanted, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("But I have to use fader"));
+ add_label_to_sizer (table, this, _("But I have to use fader"), true);
_actual = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC));
table->Add (_actual, 1, wxEXPAND);
diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc
index 8beb13004..289926b8e 100644
--- a/src/wx/new_film_dialog.cc
+++ b/src/wx/new_film_dialog.cc
@@ -37,15 +37,15 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent)
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (overall_sizer);
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 6, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6);
- add_label_to_sizer (table, this, _("Film name"));
+ add_label_to_sizer (table, this, _("Film name"), true);
_name = new wxTextCtrl (this, wxID_ANY);
- table->Add (_name, 1, wxEXPAND);
+ table->Add (_name, 0, wxEXPAND);
- add_label_to_sizer (table, this, _("Create in folder"));
+ add_label_to_sizer (table, this, _("Create in folder"), true);
#ifdef DVDOMATIC_USE_OWN_DIR_PICKER
_folder = new DirPickerCtrl (this);
diff --git a/src/wx/properties_dialog.cc b/src/wx/properties_dialog.cc
index 44a713dc3..aa97623cd 100644
--- a/src/wx/properties_dialog.cc
+++ b/src/wx/properties_dialog.cc
@@ -36,17 +36,17 @@ PropertiesDialog::PropertiesDialog (wxWindow* parent, shared_ptr<Film> film)
: wxDialog (parent, wxID_ANY, _("Film Properties"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
, _film (film)
{
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 3, 6);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
- add_label_to_sizer (table, this, _("Frames"));
+ add_label_to_sizer (table, this, _("Frames"), true);
_frames = new wxStaticText (this, wxID_ANY, wxT (""));
table->Add (_frames, 1, wxALIGN_CENTER_VERTICAL);
- add_label_to_sizer (table, this, _("Disk space required"));
+ add_label_to_sizer (table, this, _("Disk space required"), true);
_disk = new wxStaticText (this, wxID_ANY, wxT (""));
table->Add (_disk, 1, wxALIGN_CENTER_VERTICAL);
- add_label_to_sizer (table, this, _("Frames already encoded"));
+ add_label_to_sizer (table, this, _("Frames already encoded"), true);
_encoded = new ThreadedStaticText (this, _("counting..."), boost::bind (&PropertiesDialog::frames_already_encoded, this));
table->Add (_encoded, 1, wxALIGN_CENTER_VERTICAL);
diff --git a/src/wx/server_dialog.cc b/src/wx/server_dialog.cc
index 7a9cf95c7..30e3c0f83 100644
--- a/src/wx/server_dialog.cc
+++ b/src/wx/server_dialog.cc
@@ -30,14 +30,14 @@ ServerDialog::ServerDialog (wxWindow* parent, ServerDescription* server)
_server = new ServerDescription (wx_to_std (N_("localhost")), 1);
}
- wxFlexGridSizer* table = new wxFlexGridSizer (2, 4, 4);
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DVDOMATIC_SIZER_X_GAP, DVDOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
- add_label_to_sizer (table, this, _("Host name or IP address"));
+ add_label_to_sizer (table, this, _("Host name or IP address"), true);
_host = new wxTextCtrl (this, wxID_ANY);
table->Add (_host, 1, wxEXPAND);
- add_label_to_sizer (table, this, _("Threads to use"));
+ add_label_to_sizer (table, this, _("Threads to use"), true);
_threads = new wxSpinCtrl (this, wxID_ANY);
table->Add (_threads, 1, wxEXPAND);
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 1a7b73faf..b9e78932a 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -35,21 +35,37 @@ using namespace boost;
* @param s Sizer to add to.
* @param p Parent window for the wxStaticText.
* @param t Text for the wxStaticText.
+ * @param left true if this label is a `left label'; ie the sort
+ * of label which should be right-aligned on OS X.
* @param prop Proportion to pass when calling Add() on the wxSizer.
*/
wxStaticText *
-add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, int prop)
+add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, bool left, int prop)
{
+ int flags = wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT;
+#ifdef __WXOSX__
+ if (left) {
+ flags |= wxALIGN_RIGHT;
+ t += wxT (":");
+ }
+#endif
wxStaticText* m = new wxStaticText (p, wxID_ANY, t);
- s->Add (m, prop, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ s->Add (m, prop, flags, 6);
return m;
}
wxStaticText *
-add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, wxGBPosition pos, wxGBSpan span)
+add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool left, wxGBPosition pos, wxGBSpan span)
{
+ int flags = wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT;
+#ifdef __WXOSX__
+ if (left) {
+ flags |= wxALIGN_RIGHT;
+ t += wxT (":");
+ }
+#endif
wxStaticText* m = new wxStaticText (p, wxID_ANY, t);
- s->Add (m, pos, span, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ s->Add (m, pos, span, flags);
return m;
}
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index 464aa1752..18a9f251c 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -32,14 +32,17 @@ class wxFilePickerCtrl;
class wxSpinCtrl;
class wxGridBagSizer;
+#define DVDOMATIC_SIZER_X_GAP 8
+#define DVDOMATIC_SIZER_Y_GAP 8
+
/** @file src/wx/wx_util.h
* @brief Some utility functions and classes.
*/
extern void error_dialog (wxWindow *, wxString);
extern bool confirm_dialog (wxWindow *, wxString);
-extern wxStaticText* add_label_to_sizer (wxSizer *, wxWindow *, wxString, int prop = 0);
-extern wxStaticText* add_label_to_grid_bag_sizer (wxGridBagSizer *, wxWindow *, wxString, wxGBPosition, wxGBSpan span = wxDefaultSpan);
+extern wxStaticText* add_label_to_sizer (wxSizer *, wxWindow *, wxString, bool left, int prop = 0);
+extern wxStaticText* add_label_to_grid_bag_sizer (wxGridBagSizer *, wxWindow *, wxString, bool, wxGBPosition, wxGBSpan span = wxDefaultSpan);
extern std::string wx_to_std (wxString);
extern wxString std_to_wx (std::string);
extern void dvdomatic_setup_i18n ();