public AudioStateGraphEditor(AudioControllerEditorWindow editor) { this._Editor = editor; this.Selection = new Skill.Editor.UI.SelectableCollection <Skill.Editor.UI.ISelectable>(); this.Selection.SelectionChanged += Selection_SelectionChanged; _Background = new Box() { Row = 0 }; this.Controls.Add(_Background); _ConnectionHost = new AudioConnectionHost(this) { Row = 0 }; this.Controls.Add(_ConnectionHost); _Panel = new Skill.Editor.UI.ZoomPanel() { Row = 0, MinZoomFactor = 0.6f, MaxZoomFactor = 1.0f }; this.Controls.Add(_Panel); this._MultiSelector = new Skill.Editor.UI.MultiSelector <Skill.Editor.UI.ISelectable>(this, Selection) { Row = 1 }; this.Controls.Add(_MultiSelector); this.WantsMouseEvents = true; this.ContextMenu = new GraphContextMenu(this); }
private void CreateBox2() { Grid grid = new Grid() { Row = 1, Column = 0, Padding = new Thickness(2) }; _PnlItems = grid; grid.ColumnDefinitions.Add(1, GridUnitType.Star); grid.ColumnDefinitions.Add(1, GridUnitType.Star); grid.RowDefinitions.Add(32, GridUnitType.Pixel); grid.RowDefinitions.Add(24, GridUnitType.Pixel); grid.RowDefinitions.Add(1, GridUnitType.Star); Box box = new Box() { Row = 0, Column = 0, RowSpan = 10, ColumnSpan = 10 }; grid.Controls.Add(box); _BtnCopyKeys = new Skill.Framework.UI.Button() { Row = 0, Column = 0, ColumnSpan = 2, Width = 46, HorizontalAlignment = HorizontalAlignment.Center, Margin = new Thickness(2) }; _BtnCopyKeys.Content.tooltip = "Copy keys to translate dictionary"; _SourceCaption = new Box() { Row = 1, Column = 0 }; _SourceCaption.Content.text = "Source"; _TranslateCaption = new Box() { Row = 1, Column = 1 }; _TranslateCaption.Content.text = "Translate"; _ListBox = new Skill.Framework.UI.ListBox() { Row = 2, Column = 0, ColumnSpan = 2, Margin = new Thickness(2) }; _ListBox.BackgroundVisible = true; _ListBox.DisableFocusable(); _ListBox.AlwayShowVertical = true; _ListBox.AutoScroll = true; grid.Controls.Add(_BtnCopyKeys); grid.Controls.Add(_SourceCaption); grid.Controls.Add(_TranslateCaption); grid.Controls.Add(_ListBox); _Frame.Controls.Add(grid); }
public TextureBrushGrid(int brushSize = 64) { LoadBrushes(brushSize); _BrushBg = new Skill.Framework.UI.Box() { Row = 0, Column = 0 }; _BrushSelectionGrid = new Skill.Framework.UI.SelectionGrid() { Row = 0, Column = 0, XCount = 10 }; for (int i = 0; i < _Brushes.Length; i++) { Skill.Framework.UI.SelectionGridItem item = new Skill.Framework.UI.SelectionGridItem(); item.Name = _Brushes[i].Brush.name; item.Content.image = _Brushes[i].Brush; _BrushSelectionGrid.Items.Add(item); } this.Controls.Add(_BrushBg); this.Controls.Add(_BrushSelectionGrid); _TryToLoadStyle = false; }
private void CreateUI() { _ChangeCheck = new ChangeCheck(); _ChangeCheck.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _ChangeCheck.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _ChangeCheck.RowDefinitions.Add(24, Skill.Framework.UI.GridUnitType.Pixel); // _BtnAdd , _BtnRemove _ChangeCheck.RowDefinitions.Add(164, Skill.Framework.UI.GridUnitType.Pixel); // _PointsScrollView _ChangeCheck.RowDefinitions.Add(86, Skill.Framework.UI.GridUnitType.Pixel); // _PnlPoperties _ChangeCheck.RowDefinitions.Add(130, Skill.Framework.UI.GridUnitType.Pixel); //_PnlTools _BtnAdd = new Button() { Row = 0, Column = 0 }; _BtnAdd.Content.text = "Add"; _BtnAdd.Content.tooltip = "Add new point the end of the path."; _BtnAdd.Content.image = Resources.UITextures.Plus; _BtnRemove = new Button() { Row = 0, Column = 1 }; _BtnRemove.Content.text = "Remove"; _BtnRemove.Content.tooltip = "Remove selected point."; _BtnRemove.Content.image = Resources.UITextures.Minus; _PointsScrollView = new Skill.Framework.UI.ScrollView() { Row = 1, Column = 0, ColumnSpan = 2, AlwayShowVertical = true, Padding = new Skill.Framework.UI.Thickness(0, 2) }; _GridPoints = new Skill.Framework.UI.SelectionGrid() { XCount = 5 }; _PointsScrollView.Controls.Add(_GridPoints); _PointsScrollView.RenderAreaChanged += _PointsScrollView_RenderAreaChanged; _SelectedPointPropertiesBackground = new Skill.Framework.UI.Box() { Row = 2, Column = 0, ColumnSpan = 2 }; _PnlPoperties = new Skill.Framework.UI.StackPanel() { Row = 2, Column = 0, ColumnSpan = 2, Orientation = Skill.Framework.UI.Orientation.Vertical, Padding = new Skill.Framework.UI.Thickness(2) }; _FFTime = new FloatField() { Height = 16, Margin = new Skill.Framework.UI.Thickness(0, 2, 0, 4) }; _FFTime.Label.text = "Time"; _VFValue = new Vector3Field() { Height = 20 }; _VFValue.Label.text = "Position"; _VFInTangent = new Vector3Field() { Height = 20 }; _VFInTangent.Label.text = "InTangent"; _VFOutTangent = new Vector3Field() { Height = 20 }; _VFOutTangent.Label.text = "OutTangent"; _PnlPoperties.Controls.Add(_FFTime); _PnlPoperties.Controls.Add(_VFValue); _PnlPoperties.Controls.Add(_VFInTangent); _PnlPoperties.Controls.Add(_VFOutTangent); _PnlTools = new Skill.Framework.UI.Grid() { Row = 5, Column = 0, ColumnSpan = 2, Padding = new Skill.Framework.UI.Thickness(2) }; _PnlTools.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _PnlTools.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _PnlTools.ColumnDefinitions.Add(2, Skill.Framework.UI.GridUnitType.Star); _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // _LmGroundLayer _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // _BtnGroundAll , _BtnGroundSelected _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // _LblFLinearTime _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _LmGroundLayer = new LayerMaskField() { Row = 0, Column = 0, ColumnSpan = 3, Layers = _Path.GroundLayer, Margin = new Framework.UI.Thickness(2) }; _LmGroundLayer.Label.text = "Ground Layer"; _BtnGroundSelected = new Button() { Row = 1, Column = 0, ColumnSpan = 2, Margin = new Skill.Framework.UI.Thickness(2, 2) }; _BtnGroundSelected.Content.text = "Ground Selected"; _BtnGroundSelected.Content.tooltip = "put selected on ground"; _BtnGroundAll = new Button() { Row = 1, Column = 2, Margin = new Skill.Framework.UI.Thickness(2, 2) }; _BtnGroundAll.Content.text = "Ground All"; _BtnGroundAll.Content.tooltip = "put all points on ground"; _LblFLinearTime = new LabelField() { Row = 2, Column = 0, Margin = new Skill.Framework.UI.Thickness(0, 2) }; _LblFLinearTime.Label.text = "Time"; _FFLinearTime = new FloatField() { Row = 2, Column = 1, Margin = new Skill.Framework.UI.Thickness(0, 2), Value = _Path.PathTime }; _BtnSetLinearTime = new Button() { Row = 2, Column = 2, Margin = new Skill.Framework.UI.Thickness(2, 2) }; _BtnSetLinearTime.Content.text = "Set Time by Distance"; _BtnSetLinearTime.Content.tooltip = "Set time of nodes by relative distance"; _SliSmoothValue = new Skill.Editor.UI.Slider() { Row = 3, Column = 0, ColumnSpan = 3, MinValue = 0.0f, MaxValue = 1.0f, Value = _Path.SmoothValue }; _SliSmoothValue.Label.text = "Smooth Value"; _BtnSmoothCurve = new Button() { Row = 4, Column = 0, ColumnSpan = 2, Margin = new Skill.Framework.UI.Thickness(2, 2) }; _BtnSmoothCurve.Content.text = "Smooth Curve"; _BtnSmoothCurve.Content.tooltip = "Smooth the in and out tangents of the keys."; _BtnSmoothPoint = new Button() { Row = 4, Column = 2, Margin = new Skill.Framework.UI.Thickness(2, 2) }; _BtnSmoothPoint.Content.text = "Smooth Point"; _BtnSmoothPoint.Content.tooltip = "Smooth the in and out tangents of the selected key."; _PnlTools.Controls.Add(_LmGroundLayer); _PnlTools.Controls.Add(_BtnGroundSelected); _PnlTools.Controls.Add(_BtnGroundAll); _PnlTools.Controls.Add(_LblFLinearTime); _PnlTools.Controls.Add(_FFLinearTime); _PnlTools.Controls.Add(_BtnSetLinearTime); _PnlTools.Controls.Add(_SliSmoothValue); _PnlTools.Controls.Add(_BtnSmoothPoint); _PnlTools.Controls.Add(_BtnSmoothCurve); _ChangeCheck.Controls.Add(_BtnAdd); _ChangeCheck.Controls.Add(_BtnRemove); _ChangeCheck.Controls.Add(_PointsScrollView); _ChangeCheck.Controls.Add(_SelectedPointPropertiesBackground); _ChangeCheck.Controls.Add(_PnlPoperties); _ChangeCheck.Controls.Add(_PnlTools); _Frame = new Skill.Framework.UI.Frame("EditorFrame"); _Frame.Grid.Controls.Add(_ChangeCheck); _BtnAdd.Click += _BtnAdd_Click; _BtnRemove.Click += _BtnRemove_Click; _ChangeCheck.Changed += _ChangeCheck_Changed; _GridPoints.SelectedChanged += _GridPoints_SelectedChanged; _FFTime.ValueChanged += SelectedPoint_ValueChanged; _VFValue.ValueChanged += SelectedPoint_ValueChanged; _VFInTangent.ValueChanged += SelectedPoint_ValueChanged; _VFOutTangent.ValueChanged += SelectedPoint_ValueChanged; _FFLinearTime.ValueChanged += _FFLinearTime_ValueChanged; _BtnSmoothPoint.Click += _BtnSmoothPoint_Click; _BtnSmoothCurve.Click += _BtnSmoothCurve_Click; _BtnSetLinearTime.Click += _BtnSetLinearTime_Click; _SliSmoothValue.ValueChanged += _SliSmoothValue_ValueChanged; _LmGroundLayer.LayersChanged += _LmGroundLayer_LayersChanged; _BtnGroundSelected.Click += _BtnGroundSelected_Click; _BtnGroundAll.Click += _BtnGroundAll_Click; }
public ParameterDifinitionEditor(ListItem owner, ParameterDataCollection data) { this._OwnerListItem = owner; this._Data = data; this.RowDefinitions.Add(24, GridUnitType.Pixel); // title this.RowDefinitions.Add(18, GridUnitType.Pixel); // header this.RowDefinitions.Add(1, GridUnitType.Star); // items this.RowDefinitions.Add(20, GridUnitType.Pixel); // buttons Skill.Editor.UI.DropShadowLabel title = new UI.DropShadowLabel() { Text = "Parameter Difinition", Height = 20, Margin = new Thickness(0, 0, 0, 4) }; this.Controls.Add(title); _HeaderBg = new Box() { Row = 1, Style = (GUIStyle)"RL Header" }; this.Controls.Add(_HeaderBg); _Header = new Grid() { Row = 1 }; _Header.ColumnDefinitions.Add(1, GridUnitType.Star); _Header.ColumnDefinitions.Add(2, GridUnitType.Star); _Header.ColumnDefinitions.Add(2, GridUnitType.Star); _Header.Controls.Add(new Label() { Column = 0, Text = "Type" }); _Header.Controls.Add(new Label() { Column = 1, Text = "Name" }); _Header.Controls.Add(new Label() { Column = 2, Text = "Default Value" }); this.Controls.Add(_Header); _LbItems = new Framework.UI.ListBox() { Row = 2 }; _LbItems.DisableFocusable(); _LbItems.BackgroundVisible = true; _LbItems.Background.Style = (GUIStyle)"RL Background"; this.Controls.Add(_LbItems); _PnlButtons = new Grid() { Row = 3 }; _PnlButtons.ColumnDefinitions.Add(1, GridUnitType.Star); _PnlButtons.ColumnDefinitions.Add(20, GridUnitType.Pixel); // btn add _PnlButtons.ColumnDefinitions.Add(20, GridUnitType.Pixel); // btn remove this.Controls.Add(_PnlButtons); _BtnAdd = new Button { Column = 1 }; _PnlButtons.Controls.Add(_BtnAdd); _BtnRemove = new Button() { Column = 2, IsEnabled = false }; _PnlButtons.Controls.Add(_BtnRemove); _LbItems.SelectionChanged += _LbItems_SelectionChanged; _BtnAdd.Click += _BtnAdd_Click; _BtnRemove.Click += _BtnRemove_Click; for (int i = 0; i < _Data.Count; i++) { ParameterItem item = new ParameterItem(_OwnerListItem, _Data[i]); _LbItems.Items.Add(item); } }
public GraphEditor(AnimationTreeEditorWindow editor) { this._Editor = editor; this.Selection = new UI.SelectableCollection <AnimNodeItem>(); this.Selection.SelectionChanged += Selection_SelectionChanged; this._MainPanel = new Grid(); this._MainPanel.RowDefinitions.Add(20, GridUnitType.Pixel); this._MainPanel.RowDefinitions.Add(1, GridUnitType.Star); this.Controls.Add(_MainPanel); _Background = new Box() { Row = 1 }; this._MainPanel.Controls.Add(_Background); _Panel = new UI.ZoomPanel() { Row = 1 }; this._MainPanel.Controls.Add(_Panel); this._MultiSelector = new UI.MultiSelector <AnimNodeItem>(this, Selection) { Row = 1 }; this._MainPanel.Controls.Add(_MultiSelector); this.WantsMouseEvents = true; this._MainPanel.ContextMenu = new GraphContextMenu(this); _ToolbarPanel = new Grid() { Row = 0 }; _ToolbarPanel.ColumnDefinitions.Add(180, GridUnitType.Pixel); _ToolbarPanel.ColumnDefinitions.Add(1, GridUnitType.Star); this._MainPanel.Controls.Add(_ToolbarPanel); _ToolbarBg = new Box() { Column = 1 }; this._ToolbarPanel.Controls.Add(_ToolbarBg); _ToolbarAlignButtons = new UniformGrid() { Rows = 1, Columns = 6 }; this._ToolbarPanel.Controls.Add(_ToolbarAlignButtons); _BtnAlignLeft = new Button() { Column = 0 }; _BtnAlignRight = new Button() { Column = 1 }; _BtnAlignTop = new Button() { Column = 2 }; _BtnAlignBottom = new Button() { Column = 3 }; _BtnAlignCenteredHorizontal = new Button() { Column = 4 }; _BtnAlignCenteredVertical = new Button() { Column = 5 }; _BtnAlignLeft.Content.tooltip = "align nodes top"; _BtnAlignRight.Content.tooltip = "align nodes bottom"; _BtnAlignTop.Content.tooltip = "align nodes left"; _BtnAlignBottom.Content.tooltip = "align nodes right"; _BtnAlignCenteredHorizontal.Content.tooltip = "align nodes centered horizontal"; _BtnAlignCenteredVertical.Content.tooltip = "align nodes centered vertical"; _ToolbarAlignButtons.Controls.Add(_BtnAlignLeft); _ToolbarAlignButtons.Controls.Add(_BtnAlignRight); _ToolbarAlignButtons.Controls.Add(_BtnAlignTop); _ToolbarAlignButtons.Controls.Add(_BtnAlignBottom); _ToolbarAlignButtons.Controls.Add(_BtnAlignCenteredHorizontal); _ToolbarAlignButtons.Controls.Add(_BtnAlignCenteredVertical); _BtnAlignLeft.Click += _BtnAlignLeft_Click; _BtnAlignRight.Click += _BtnAlignRight_Click; _BtnAlignTop.Click += _BtnAlignTop_Click; _BtnAlignBottom.Click += _BtnAlignBottom_Click; _BtnAlignCenteredHorizontal.Click += _BtnAlignCenteredHorizontal_Click; _BtnAlignCenteredVertical.Click += _BtnAlignCenteredVertical_Click; EnableToolbar(); }
private void CreateTextPanel() { _TextPanel = new Grid() { Row = 1, Padding = new Thickness(2) }; _TextPanel.ColumnDefinitions.Add(1, GridUnitType.Star); _TextPanel.ColumnDefinitions.Add(2, GridUnitType.Star); _TextPanel.ColumnDefinitions.Add(17, GridUnitType.Pixel); _TextPanel.ColumnDefinitions.Add(30, GridUnitType.Pixel); _TextPanel.RowDefinitions.Add(24, GridUnitType.Pixel); _TextPanel.RowDefinitions.Add(30, GridUnitType.Pixel); _TextPanel.RowDefinitions.Add(30, GridUnitType.Pixel); _TextPanel.RowDefinitions.Add(1, GridUnitType.Star); Box box = new Box() { Row = 0, Column = 0, RowSpan = 10, ColumnSpan = 10 }; _TextPanel.Controls.Add(box); _NameCaption = new Box() { Row = 0, Column = 0 }; _NameCaption.Content.text = "Key"; _ValueCaption = new Box() { Row = 0, Column = 1 }; _ValueCaption.Content.text = "Value"; _ListBox = new Skill.Framework.UI.ListBox() { Row = 1, RowSpan = 3, Column = 0, ColumnSpan = 3, Margin = new Thickness(2) }; _ListBox.BackgroundVisible = true; _ListBox.DisableFocusable(); _ListBox.AlwayShowVertical = true; _ListBox.AutoScroll = true; _BtnAdd = new Skill.Framework.UI.Button() { Row = 1, Column = 3, Margin = new Thickness(2) }; _BtnAdd.Content.tooltip = "Add"; _BtnRemove = new Skill.Framework.UI.Button() { Row = 2, Column = 3, Margin = new Thickness(2) }; _BtnAdd.Content.tooltip = "remove selected"; _BtnSave = new Skill.Framework.UI.Button() { Row = 3, Column = 3, Margin = new Thickness(2, 2, 2, 4), VerticalAlignment = VerticalAlignment.Bottom, Height = 28 }; _BtnSave.Content.tooltip = "Save Changes"; _TextPanel.Controls.Add(_NameCaption); _TextPanel.Controls.Add(_ValueCaption); _TextPanel.Controls.Add(_BtnAdd); _TextPanel.Controls.Add(_BtnRemove); _TextPanel.Controls.Add(_BtnSave); _TextPanel.Controls.Add(_ListBox); _BtnSave.Click += _BtnSave_Click; _BtnAdd.Click += _BtnAdd_Click; _BtnRemove.Click += _BtnRemove_Click; _ListBox.SelectionChanged += _ListBox_SelectionChanged; }