示例#1
0
        private void RemoveBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == Movie.CurrentBranch)
                {
                    Movie.CurrentBranch = -1;
                }
                else if (index < Movie.CurrentBranch)
                {
                    Movie.CurrentBranch--;
                }

                _backupBranch = SelectedBranch.Clone();
                UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
                UndoBranchToolStripMenuItem.Text    = "Undo Branch Removal";
                toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Removal");
                _branchUndo = BranchUndo.Remove;

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == Movie.BranchCount)
                {
                    BranchView.ClearSelectedRows();
                    BranchView.SelectRow(Movie.BranchCount - 1, true);
                }

                CallRemovedCallback(index);
                Tastudio.RefreshDialog();
                GlobalWin.OSD.AddMessage("Removed branch " + index.ToString());
            }
        }
示例#2
0
        public void SelectBranchExternal(bool next)
        {
            if (SelectedBranch == null)
            {
                BranchView.SelectRow(Movie.CurrentBranch, true);
                BranchView.Refresh();
                return;
            }
            int sel = BranchView.SelectedRows.First();

            if (next)
            {
                if (GetBranch(sel + 1) != null)
                {
                    BranchView.SelectRow(sel, false);
                    BranchView.SelectRow(sel + 1, true);
                }
            }
            else             // previous
            {
                if (GetBranch(sel - 1) != null)
                {
                    BranchView.SelectRow(sel, false);
                    BranchView.SelectRow(sel - 1, true);
                }
            }
            BranchView.Refresh();
        }
示例#3
0
        private void RemoveBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == Movie.CurrentBranch)
                {
                    Movie.CurrentBranch = -1;
                }
                else if (index < Movie.CurrentBranch)
                {
                    Movie.CurrentBranch--;
                }

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == Movie.BranchCount)
                {
                    BranchView.ClearSelectedRows();
                    BranchView.SelectRow(Movie.BranchCount - 1, true);
                }

                //BranchView.Refresh();
                Tastudio.RefreshDialog();
                GlobalWin.OSD.AddMessage("Removed branch " + index.ToString());
            }
        }
示例#4
0
 private void BranchView_CellDropped(object sender, InputRoll.CellEventArgs e)
 {
     if (e.NewCell != null && e.NewCell.IsDataCell && e.OldCell.RowIndex.Value < Movie.BranchCount)
     {
         int currenthash = Movie.BranchHashByIndex(Movie.CurrentBranch);
         Movie.SwapBranches(e.OldCell.RowIndex.Value, e.NewCell.RowIndex.Value);
         int newindex = Movie.BranchIndexByHash(currenthash);
         Movie.CurrentBranch = newindex;
         BranchView.SelectRow(newindex, true);
     }
 }
 public void SelectBranchExternal(int slot)
 {
     if (GetBranch(slot) != null)
     {
         BranchView.SelectRow(slot, true);
         BranchView.Refresh();
     }
     else
     {
         NonExistentBranchMessage(slot);
     }
 }
示例#6
0
        public void Branch()
        {
            TasBranch branch = CreateBranch();

            Movie.NewBranchText = "";             // reset every time it's used
            Movie.AddBranch(branch);
            BranchView.RowCount = Movie.BranchCount;
            Movie.CurrentBranch = Movie.BranchCount - 1;
            BranchView.ScrollToIndex(Movie.CurrentBranch);
            BranchView.SelectRow(Movie.CurrentBranch, true);
            BranchView.Refresh();
            Tastudio.RefreshDialog();
        }
 public void UpdateBranchExternal(int slot = -1)
 {
     if (slot != -1)
     {
         if (GetBranch(slot) != null)
         {
             BranchView.SelectRow(slot, true);
         }
         else
         {
             NonExistentBranchMessage(slot);
             return;
         }
     }
     UpdateBranchToolStripMenuItem_Click(null, null);
 }
示例#8
0
        public void SelectBranchExternal(int slot)
        {
            if (Tastudio.FloatEditingMode)
            {
                return;
            }

            if (GetBranch(slot) != null)
            {
                BranchView.SelectRow(slot, true);
                BranchView.Refresh();
            }
            else
            {
                NonExistentBranchMessage(slot);
            }
        }
示例#9
0
        public void LoadBranchExternal(int slot = -1)
        {
            if (Tastudio.FloatEditingMode)
            {
                return;
            }

            if (slot != -1)
            {
                if (GetBranch(slot) != null)
                {
                    BranchView.SelectRow(slot, true);
                }
                else
                {
                    NonExistentBranchMessage(slot);
                    return;
                }
            }
            LoadBranchToolStripMenuItem_Click(null, null);
        }
示例#10
0
 public void AddBranchExternal()
 {
     AddBranchToolStripMenuItem_Click(null, null);
     BranchView.SelectRow(Movie.CurrentBranch, true);
     BranchView.Refresh();
 }
示例#11
0
 private void Select(int index, bool value)
 {
     BranchView.SelectRow(index, value);
     UpdateButtons();
 }