+
+
+void
+VideoPanel::scale_fit_clicked ()
+{
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
+ i->video->set_custom_ratio (optional<float>());
+ }
+}
+
+
+void
+VideoPanel::scale_custom_clicked ()
+{
+ if (!scale_custom_edit_clicked()) {
+ _scale_fit->SetValue (true);
+ }
+}
+
+
+bool
+VideoPanel::scale_custom_edit_clicked ()
+{
+ shared_ptr<const VideoContent> vc = _parent->selected_video().front()->video;
+ CustomScaleDialog* d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
+ int const r = d->ShowModal ();
+ if (r == wxID_OK) {
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
+ i->video->set_custom_ratio (d->custom_ratio());
+ i->video->set_custom_size (d->custom_size());
+ }
+ }
+ d->Destroy ();
+ return r == wxID_OK;
+}
+
+
+void
+VideoPanel::left_right_link_clicked ()
+{
+ right_crop_changed ();
+}
+
+
+void
+VideoPanel::top_bottom_link_clicked ()
+{
+ bottom_crop_changed ();
+}
+
+
+void
+VideoPanel::left_crop_changed ()
+{
+ if (_left_right_link->GetValue()) {
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
+ i->video->set_right_crop (i->video->left_crop());
+ }
+ }
+}
+
+
+void
+VideoPanel::right_crop_changed ()
+{
+ if (_left_right_link->GetValue()) {
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
+ i->video->set_left_crop (i->video->right_crop());
+ }
+ }
+}
+
+
+void
+VideoPanel::top_crop_changed ()
+{
+ if (_top_bottom_link->GetValue()) {
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
+ i->video->set_bottom_crop (i->video->top_crop());
+ }
+ }
+}
+
+
+void
+VideoPanel::bottom_crop_changed ()
+{
+ if (_top_bottom_link->GetValue()) {
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
+ i->video->set_top_crop (i->video->bottom_crop());
+ }
+ }
+}
+
+
+