コード例 #1
0
            public CurveGroupContextMenu(CurveTrackTreeView treeView)
            {
                _TreeView = treeView;

                Skill.Editor.UI.MenuItem removeItem = new Skill.Editor.UI.MenuItem("Remove");
                removeItem.Click += CurveGroupRemove_Click;
                Add(removeItem);
            }
コード例 #2
0
ファイル: MatineeEditor.cs プロジェクト: TagsRocks/skill
        private void CreateUI()
        {
            _RefreshStyles = true;
            _Frame         = new EditorFrame("Frame", this)
            {
                Location = Skill.Framework.UI.FrameLocation.Fill
            };

            Skill.Framework.UI.DockPanel dockPanel = new Skill.Framework.UI.DockPanel()
            {
                LastChildFill = true
            };
            _Frame.Controls.Add(dockPanel);

            CreateMenuBar();
            CreateToolbar();

            dockPanel.Controls.Add(_MenuBar);      // add menu at top of window
            dockPanel.Controls.Add(_ToolbarPanel); // add toolbar at top of window under menu

            // grid for CurveEditor and Timeline
            _MainGrid = new Skill.Framework.UI.Grid();
            _MainGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(1, GridUnitType.Star), MinHeight = 30
            });                                                     // _TimeLine

            _MainGrid.ColumnDefinitions.Add(1, GridUnitType.Star);  // _CurveTreeView, _TracksGrid
            _MainGrid.ColumnDefinitions.Add(4, GridUnitType.Pixel); // splitter
            _MainGrid.ColumnDefinitions.Add(2, GridUnitType.Star);  // _TimeLine  and _CurveEditor

            _CurveEditor = new Curve.CurveEditor()
            {
                Row = 0, Column = 2
            };
            _CurveEditor.TimeLine.TimeBar.ShowTimePosition = true;
            _CurveEditor.TimeLine.View.ShowTimePosition    = true;
            //_CurveEditor.TimeLine.MinTime = -0.1f;
            _MainGrid.Controls.Add(_CurveEditor);


            _CurveTrackTreeView = new CurveTrackTreeView(_CurveEditor)
            {
                Row = 0, Column = 0, Margin = new Thickness(0, 0, 0, 0)
            };
            _MainGrid.Controls.Add(_CurveTrackTreeView);

            _TimeLine = new TimeLine(new TrackBarView()
            {
                SideView = true
            })
            {
                Row = 0, Column = 2
            };
            _TimeLine.TimePositionChanged += _TimeLine_TimePositionChanged;

            _TracksTreeView = new TrackTreeView(this)
            {
                Row = 0, Column = 0, Margin = new Thickness(0, 0, 0, 0)
            };
            _MainGrid.Controls.Add(_TracksTreeView);

            // add splitter between (_TimeLine and _CurveEditor) and (_CurveTreeView, _TracksTreeView and _PropertyGrid)
            _VSplitter = new Skill.Editor.UI.GridSplitter()
            {
                Orientation = Orientation.Vertical, Row = 0, Column = 1, RowSpan = 3
            };
            _MainGrid.Controls.Add(_VSplitter);

            _MainGrid.Controls.Add(_TimeLine);

            // fill remaining area with mainGrid
            dockPanel.Controls.Add(_MainGrid);

            _CurveEditor.TimeLine.TimePositionChanged += CurveEditorTimeLine_PositionChanged;

            _CurveEditor.TimeLine.TimeBar.SnapTime = 0.001;
            _TimeLine.TimeBar.SnapTime             = 0.001;

            _TimeLine.View.VerticalScrollChanged           += View_VerticalScrollChanged;
            _TracksTreeView.TreeView.ScrollPositionChanged += TreeView_ScrollPositionChanged;

            SetLayout(0);
        }