コード例 #1
0
ファイル: TrackTreeView.cs プロジェクト: TagsRocks/skill
        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;
        }
コード例 #2
0
        public ParameterEditor(IBehaviorItem item, ParameterDataCollection dataDifinition, ParameterDataCollection data)
        {
            _Item           = item;
            _DataDifinition = dataDifinition;
            _Data           = data;

            this._RefreshStyle = true;

            this.RowDefinitions.Add(16, Skill.Framework.UI.GridUnitType.Pixel); // title
            this.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);   // list
            this.RowDefinitions.Add(16, Skill.Framework.UI.GridUnitType.Pixel); // buttons

            _Title = new Framework.UI.Label {
                Row = 0, Text = "Parameters"
            };
            this.Controls.Add(_Title);

            _FieldsList = new Skill.Framework.UI.ListBox()
            {
                Row = 1
            };
            _FieldsList.DisableFocusable();
            _FieldsList.BackgroundVisible = true;
            this.Controls.Add(_FieldsList);

            _ButtonsPanel = new Framework.UI.Grid()
            {
                Row = 2
            };
            _ButtonsPanel.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _ButtonsPanel.ColumnDefinitions.Add(20, Skill.Framework.UI.GridUnitType.Pixel);
            _ButtonsPanel.ColumnDefinitions.Add(20, Skill.Framework.UI.GridUnitType.Pixel);
            this.Controls.Add(_ButtonsPanel);

            _BtnAddImage = new Framework.UI.Image()
            {
                Column = 1
            };
            _ButtonsPanel.Controls.Add(_BtnAddImage);


            _BtnAdd = new UI.IntPopup()
            {
                Column = 1
            };
            _BtnAdd.Options.Add(new UI.PopupOption(1, "float"));
            _BtnAdd.Options.Add(new UI.PopupOption(2, "int"));
            _BtnAdd.Options.Add(new UI.PopupOption(3, "bool"));
            _BtnAdd.Options.Add(new UI.PopupOption(4, "string"));
            _ButtonsPanel.Controls.Add(_BtnAdd);

            _BtnRemove = new Framework.UI.Button()
            {
                Column = 2, IsEnabled = false
            };
            _ButtonsPanel.Controls.Add(_BtnRemove);


            _BtnAdd.OptionChanged        += _BtnAdd_OptionChanged;
            _BtnRemove.Click             += _BtnRemove_Click;
            _FieldsList.SelectionChanged += _FieldsList_SelectionChanged;

            Rebuild();
        }