Exemplo n.º 1
0
        private void CreateUI()
        {
            _Frame = new Skill.Editor.UI.EditorFrame("Frame", this);

            _Frame.Grid.RowDefinitions.Add(20, GridUnitType.Pixel);
            _Frame.Grid.RowDefinitions.Add(1, GridUnitType.Star);

            _Frame.Grid.ColumnDefinitions.Add(1, GridUnitType.Star);
            _Frame.Grid.ColumnDefinitions.Add(2, GridUnitType.Pixel);
            _Frame.Grid.ColumnDefinitions.Add(2, GridUnitType.Star);

            _LblAnimations = new Skill.Editor.UI.DropShadowLabel()
            {
                Row = 0, Column = 0, Text = "Animations"
            };
            _Frame.Controls.Add(_LblAnimations);

            _LblHierarchy = new Skill.Editor.UI.DropShadowLabel()
            {
                Row = 0, Column = 2, Text = "Hierarchy"
            };
            _Frame.Controls.Add(_LblHierarchy);

            _AnimationList = new ListBox()
            {
                Row = 1, Column = 0, Margin = new Thickness(2)
            };
            _AnimationList.DisableFocusable();
            _AnimationList.BackgroundVisible = true;
            _Frame.Controls.Add(_AnimationList);

            _VSplitter = new Skill.Editor.UI.GridSplitter()
            {
                Row = 0, RowSpan = 2, Column = 1, Orientation = Orientation.Vertical
            };
            _Frame.Controls.Add(_VSplitter);

            _TransformTree = new UI.TreeView()
            {
                Row = 1, Column = 2, Margin = new Thickness(2), IsEnabled = false
            };
            _TransformTree.DisableFocusable();
            _TransformTree.Background.Visibility = Visibility.Visible;
            _TransformTree.SelectedStyle         = new GUIStyle();
            _Frame.Controls.Add(_TransformTree);

            _AnimationList.SelectionChanged += _AnimationList_SelectionChanged;
        }
Exemplo n.º 2
0
        private void CreateUI()
        {
            _Frame = new Skill.Editor.UI.EditorFrame("Frame", this);

            _Frame.Grid.RowDefinitions.Add(20, GridUnitType.Pixel);  // Label
            _Frame.Grid.RowDefinitions.Add(1, GridUnitType.Star);    // Panels

            _Frame.Grid.ColumnDefinitions.Add(1, GridUnitType.Star); // class Panel
            _Frame.Grid.ColumnDefinitions.Add(1, GridUnitType.Star); // Properties Panel
            _Frame.Grid.Padding = new Thickness(2, 4);

            _LblClasses = new Skill.Editor.UI.DropShadowLabel()
            {
                Row = 0, Column = 0, Text = "Class", Margin = new Thickness(0, 0, 20, 2)
            };
            _Frame.Controls.Add(_LblClasses);

            _LblProperties = new Skill.Editor.UI.DropShadowLabel()
            {
                Row = 0, Column = 1, Text = "Properties", Margin = new Thickness(0, 0, 20, 2)
            };
            _Frame.Controls.Add(_LblProperties);

            _ClassPanel = new Grid()
            {
                Row = 1, Column = 0
            };
            _ClassPanel.ColumnDefinitions.Add(1, GridUnitType.Star);   // listbox
            _ClassPanel.ColumnDefinitions.Add(36, GridUnitType.Pixel); // buttons
            _Frame.Controls.Add(_ClassPanel);

            _ClassList = new ListBox()
            {
                Row = 0, Column = 0, Margin = new Thickness(2), Padding = new Thickness(0, 2)
            };
            _ClassList.BackgroundVisible = true;
            _ClassList.DisableFocusable();
            _ClassPanel.Controls.Add(_ClassList);

            _ClassButtonsPanel = new StackPanel()
            {
                Row = 0, Column = 1, Orientation = Orientation.Vertical
            };
            _ClassPanel.Controls.Add(_ClassButtonsPanel);

            Thickness buttonMargin = new Thickness(3, 4, 5, 0);
            float     buttonHeight = 26;

            _BtnAddClass = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnAddClass.Content.tooltip = "add new class";
            _ClassButtonsPanel.Controls.Add(_BtnAddClass);

            _BtnRemoveClass = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnRemoveClass.Content.tooltip = "remove selected class";
            _ClassButtonsPanel.Controls.Add(_BtnRemoveClass);


            _PropertiesPanel = new Grid()
            {
                Row = 1, Column = 1
            };
            _PropertiesPanel.ColumnDefinitions.Add(1, GridUnitType.Star);   // listbox
            _PropertiesPanel.ColumnDefinitions.Add(36, GridUnitType.Pixel); // buttons
            _Frame.Controls.Add(_PropertiesPanel);


            _PropertyButtonsPanel = new StackPanel()
            {
                Row = 0, Column = 1, Orientation = Orientation.Vertical
            };
            _PropertiesPanel.Controls.Add(_PropertyButtonsPanel);

            _PropertyList = new ListBox()
            {
                Row = 0, Column = 0, RowSpan = 4, Margin = new Thickness(2), Padding = new Thickness(0, 2)
            };
            _PropertyList.BackgroundVisible = true;
            _PropertyList.DisableFocusable();
            _PropertiesPanel.Controls.Add(_PropertyList);

            _BtnAddPrimitiveProperty = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnAddPrimitiveProperty.Content.tooltip = "add primitive property";
            _PropertyButtonsPanel.Controls.Add(_BtnAddPrimitiveProperty);

            _BtnAddClassProperty = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnAddClassProperty.Content.tooltip = "add class property";
            _PropertyButtonsPanel.Controls.Add(_BtnAddClassProperty);

            _BtnPropertyUp = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnPropertyUp.Content.tooltip = "move selected property up";
            _PropertyButtonsPanel.Controls.Add(_BtnPropertyUp);

            _BtnPropertyDown = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnPropertyDown.Content.tooltip = "move selected property down";
            _PropertyButtonsPanel.Controls.Add(_BtnPropertyDown);

            _BtnRemoveProperty = new Button()
            {
                Height = buttonHeight, Margin = buttonMargin
            };
            _BtnRemoveProperty.Content.tooltip = "remove selected property";
            _PropertyButtonsPanel.Controls.Add(_BtnRemoveProperty);

            CheckControlsEnable();


            _ClassList.SelectionChanged += _ClassList_SelectionChanged;
            _BtnAddClass.Click          += _BtnAddClass_Click;
            _BtnRemoveClass.Click       += _BtnRemoveClass_Click;

            _PropertyList.SelectionChanged += _PropertyList_SelectionChanged;
            _BtnAddPrimitiveProperty.Click += _BtnAddValueProperty_Click;
            _BtnAddClassProperty.Click     += _BtnAddClassProperty_Click;
            _BtnRemoveProperty.Click       += _BtnRemoveProperty_Click;
            _BtnPropertyUp.Click           += _BtnPropertyUp_Click;
            _BtnPropertyDown.Click         += _BtnPropertyDown_Click;
        }