private void AddSubtitleContextMenuItem_Click(object sender, EventArgs e)
        {
            //TODO: rethink this?
            var subForm = new SubtitleMaker();
            subForm.DisableFrame();

            int index = -1;
            var sub = new Subtitle();
            for (int x = 0; x < Global.MovieSession.Movie.Subtitles.Count; x++)
            {
                sub = Global.MovieSession.Movie.Subtitles[x];
                if (Global.Emulator.Frame == sub.Frame)
                {
                    index = x;
                    break;
                }
            }

            if (index < 0)
            {
                sub = new Subtitle { Frame = Global.Emulator.Frame };
            }

            subForm.Sub = sub;

            if (subForm.ShowDialog() == DialogResult.OK)
            {
                if (index >= 0)
                {
                    Global.MovieSession.Movie.Subtitles.RemoveAt(index);
                }

                Global.MovieSession.Movie.Subtitles.Add(subForm.Sub);
            }
        }
Exemple #2
0
        private void SubGrid_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (_readOnly)
            {
                return;
            }

            var c = SubGrid.SelectedRows;

            if (c.Count == 0)
            {
                return;
            }

            using var s = new SubtitleMaker { Sub = GetRow(c[0].Index) };
            if (s.ShowDialog() == DialogResult.OK)
            {
                ChangeRow(s.Sub, SubGrid.SelectedRows[0].Index);
            }
        }
Exemple #3
0
 private void SubGrid_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (ReadOnly) return;
     var c = SubGrid.SelectedRows;
     if (c.Count == 0) return;
     var s = new SubtitleMaker {Sub = GetRow(c[0].Index)};
     if (s.ShowDialog() == DialogResult.OK)
     {
         ChangeRow(s.Sub, SubGrid.SelectedRows[0].Index);
     }
 }