예제 #1
0
        public void SelectDown(SequencePanel panel, Cell cell)
        {
            int index = _rowsList.IndexOf(cell.Row) + 1;

            while (index < _rowsList.Count && !_rowsList[index].IsVisible)
            {
                index++;
            }
            if (index >= _rowsList.Count)
            {
                return;
            }
            int indexShow = -1;

            for (int i = 0; i <= index; i++)
            {
                if (_rowsList[i].IsVisible)
                {
                    indexShow++;
                }
            }
            if (panel.IndexRow + panel.ShowRow <= indexShow)
            {
                panel.IndexRow = indexShow - panel.ShowRow + 1;
            }
            Select(panel, _rowsList[index][cell.IndexColumn + 1]);
        }
예제 #2
0
        public void SelectUp(SequencePanel panel, Cell cell)
        {
            int index = _rowsList.IndexOf(cell.Row) - 1;

            while (index >= 0 && !_rowsList[index].IsVisible)
            {
                index--;
            }
            if (index < 0)
            {
                return;
            }
            int indexShow = -1;

            for (int i = 0; i <= index; i++)
            {
                if (_rowsList[i].IsVisible)
                {
                    indexShow++;
                }
            }
            if (panel.IndexRow > 0 && panel.IndexRow >= index)
            {
                panel.IndexRow = index - 1;
            }
            Select(panel, _rowsList[index][cell.IndexColumn + 1]);
        }
예제 #3
0
        public void SelectRight(SequencePanel panel, Cell cell)
        {
            int index = cell.IndexColumn + 1;

            if (index >= hScrollBar.Maximum)
            {
                return;
            }
            if (hScrollBar.Value + hScrollBar.LargeChange <= index + 1)
            {
                hScrollBar.Value = index - hScrollBar.LargeChange + 2;
            }
            Select(panel, cell.Row[index + 1]);
        }
예제 #4
0
        public void SelectLeft(SequencePanel panel, Cell cell)
        {
            int index = cell.IndexColumn - 1;

            if (index < 0)
            {
                return;
            }
            if (hScrollBar.Value > index)
            {
                hScrollBar.Value = index;
            }
            Select(panel, cell.Row[index + 1]);
        }
예제 #5
0
 public void Select(SequencePanel panel, Glyph glyph)
 {
     SequencePanel.isSelected = true;
     if (SequencePanel.glyphSelect != null)
     {
         SequencePanel.glyphSelect.StateGlyph = eStateGlyph.Normal;
     }
     SequencePanel.glyphSelect            = glyph;
     SequencePanel.glyphSelect.StateGlyph = eStateGlyph.Select;
     panel.ContextMenuStrip = glyph.GetContextMenu(panel);
     if (glyph is Cell)
     {
         ChangeSelect((glyph as Cell).Object);
     }
     else
     {
         ChangeSelect(null);
     }
     Refresh( );
 }
예제 #6
0
        public override ContextMenuStrip GetContextMenu(SequencePanel panel)
        {
            ContextMenuStrip  contextMenu = new ContextMenuStrip( );
            ToolStripMenuItem item;

            contextMenu.ImageScalingSize = new Size(22, 22);

            item = (ToolStripMenuItem)contextMenu.Items.Add("Clear events", null, OnClearColumn);
            item.ShortcutKeys = Keys.Control | Keys.Delete;

            contextMenu.Items.Add("-");

            item = (ToolStripMenuItem)contextMenu.Items.Add("Insert events", null, OnInsertColumn);
            item.ShortcutKeys = Keys.Insert;

            item = (ToolStripMenuItem)contextMenu.Items.Add("Remove events", null, OnRemoveColumn);
            item.ShortcutKeys = Keys.Delete;
            item.Enabled      = Parent.IsRemoveColumn(Index - 1);

            contextMenu.Items.Add("-");

            item = (ToolStripMenuItem)contextMenu.Items.Add("Cut", null, OnCutColumn);
            item.ShortcutKeys = Keys.Control | Keys.X;
            item.Enabled      = Parent.IsCutColumn(Index - 1);

            item = (ToolStripMenuItem)contextMenu.Items.Add("Copy", null, OnCopyColumn);
            item.ShortcutKeys = Keys.Control | Keys.C;
            item.Enabled      = Parent.IsCopyColumn(Index - 1);

            item = (ToolStripMenuItem)contextMenu.Items.Add("Paste", null, OnPasteColumn);
            item.ShortcutKeys = Keys.Control | Keys.V;
            item.Enabled      = Parent.IsPasteColumn(Index - 1);

            //Clipboard.
            return(contextMenu);
        }
예제 #7
0
 /// <summary>
 /// Возвращает контекстное меню для элемента последовательности
 /// </summary>
 /// <param name="panel">Панель для отображения меню</param>
 /// <returns>Объект контекстного меню</returns>
 public virtual ContextMenuStrip GetContextMenu(SequencePanel panel)
 {
     return(null);
 }
예제 #8
0
 public override ContextMenuStrip GetContextMenu(SequencePanel panel)
 {
     return(Row.Stream.GetContextMenu(panel, Row.ObjectCollection.TypeCollection, Column.Index - 1));
 }