예제 #1
0
 void OnEnable()
 {
     _Instance      = this;
     _RefreshStyles = true;
     if (_Frame == null)
     {
         this.CreateUI();
     }
 }
예제 #2
0
        void OnDestroy()
        {
            if (_IsPlaying)
            {
                Stop();
            }
            Rollback();
            Clear();

            _Frame = null;
            if (_Instance == this)
            {
                _Instance = null;
            }
            else if (!this.Equals(_Instance))
            {
                throw new System.ApplicationException("_Instance does not equal this");
            }
        }
예제 #3
0
        internal TrackTreeView(MatineeEditorWindow editor)
        {
            this._Editor = editor;
            RowDefinitions.Add(25, Skill.Framework.UI.GridUnitType.Pixel);
            RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);

            _Toolbar = new Framework.UI.Grid();
            _Toolbar.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _Toolbar.ColumnDefinitions.Add(30, Skill.Framework.UI.GridUnitType.Pixel);

            // create header
            _Title = new Skill.Framework.UI.Label()
            {
                Row = 0, Column = 0
            };
            _Title.Text = "Tracks";
            _Toolbar.Controls.Add(_Title);

            Controls.Add(_Toolbar);

            _BtnAddKey = new Framework.UI.Button()
            {
                Row = 0, Column = 1, IsEnabled = false
            };
            _BtnAddKey.Content.tooltip = "Add key to Selected";
            _Toolbar.Controls.Add(_BtnAddKey);

            _TreeView = new TreeView()
            {
                Row = 1, UserData = this, HandleScrollWheel = true, AlwayShowVertical = true, Padding = new Framework.UI.Thickness(0, 0, 0, 16), AutoHeight = true
            };
            _TreeView.DisableFocusable();
            Controls.Add(_TreeView);

            // create context menu
            this._TreeView.ContextMenu  = new TrackTreeViewContextMenu(this);
            this._TrackGroupContextMenu = new TrackGroupContextMenu(this);
            this._TrackItemContextMenu  = new TrackItemContextMenu(this);

            _TreeView.SelectedItemChanged += _TreeView_SelectedItemChanged;
            _BtnAddKey.Click += _BtnAddKey_Click;
        }