private void CreateFieldPanel() { _FieldPanel = new Grid() { Row = 0, Padding = new Thickness(2) }; _FieldPanel.ColumnDefinitions.Add(1, GridUnitType.Star); // object field _FieldPanel.ColumnDefinitions.Add(220, GridUnitType.Pixel); // filter textfiald _FieldPanel.ColumnDefinitions.Add(180, GridUnitType.Pixel); // tabs Box box = new Box() { Row = 0, Column = 0, RowSpan = 10, ColumnSpan = 3 }; _FieldPanel.Controls.Add(box); _ObjectField = new Skill.Editor.UI.ObjectField <Dictionary>() { Column = 0, Margin = new Thickness(2, 2, 30, 2), VerticalAlignment = VerticalAlignment.Top }; _ObjectField.Label.text = "Dictionary"; _FieldPanel.Controls.Add(_ObjectField); _ObjectField.ObjectChanged += _ObjectField_ObjectChanged; _TxtFilter = new UI.TextField() { Column = 1 }; _FieldPanel.Controls.Add(_TxtFilter); _TxtFilter.TextChanged += _TxtFilter_TextChanged; _LblFilter = new Label() { Column = 1, Text = "filter", HorizontalAlignment = HorizontalAlignment.Center, Width = 40 }; _FieldPanel.Controls.Add(_LblFilter); _LayoutButtonsPanel = new Toolbar() { Column = 3 }; _TBtnAudioPanel = new ToolbarButton(); _TBtnTextPanel = new ToolbarButton(); _TBtnAudioPanel.Content.text = "Audio"; _TBtnAudioPanel.Content.tooltip = "set subtitles for audio files"; _TBtnTextPanel.Content.text = "Text"; _TBtnTextPanel.Content.tooltip = "add text"; _LayoutButtonsPanel.Items.Add(_TBtnTextPanel); _LayoutButtonsPanel.Items.Add(_TBtnAudioPanel); _LayoutButtonsPanel.SelectedIndex = 0; _FieldPanel.Controls.Add(_LayoutButtonsPanel); _TBtnAudioPanel.Selected += LayoutButtons_Selected; _TBtnTextPanel.Selected += LayoutButtons_Selected; }
/// <summary> /// Create a PropertyGrid /// </summary> public PropertyGrid(bool autoScroll) { RowDefinitions.Add(20, Skill.Framework.UI.GridUnitType.Pixel); if (autoScroll) { RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); } else { RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Auto); } _Title = new Skill.Framework.UI.Label() { Row = 0 }; _Title.Content.text = "Properties"; Controls.Add(_Title); if (autoScroll) { _ScrollView = new Skill.Framework.UI.ScrollView() { Row = 1, HandleScrollWheel = true }; Controls.Add(_ScrollView); } }
public CurveTrackTreeViewItem(CurveTrack track, CurveEditor.EditCurveInfo info) { this.Track = track; this.Info = info; this.ColumnDefinitions.Add(20, GridUnitType.Pixel); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(36, GridUnitType.Pixel); _TbVisible = new Skill.Editor.UI.ToggleButton() { Column = 0, IsChecked = track.Visibility == Skill.Framework.UI.Visibility.Visible }; _LblName = new Label() { Column = 1, Text = info.Attribute.Name }; _CFColor = new Skill.Editor.UI.ColorField() { Column = 2, Color = track.Color }; this.Controls.Add(_TbVisible); this.Controls.Add(_LblName); this.Controls.Add(_CFColor); _TbVisible.Changed += _TbVisible_Changed; _CFColor.ColorChanged += _CFColor_ColorChanged; }
public CurveTrackTreeViewItem(string name, CurveTrack curveTrack, BaseTrackBar trackBar, KeyType keyType) { this.CurveTrack = curveTrack; this.TrackBar = trackBar; this.KeyType = keyType; this.ColumnDefinitions.Add(22, GridUnitType.Pixel); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(20, GridUnitType.Pixel); _TbVisible = new Skill.Editor.UI.ToggleButton() { Column = 0, IsChecked = TrackBar.Visibility == Skill.Framework.UI.Visibility.Visible, Margin = new Thickness(2, 0, 0, 0) }; _LblName = new Label() { Column = 1, Text = name }; this.Controls.Add(_TbVisible); this.Controls.Add(_LblName); _TbVisible.Changed += _TbVisible_Changed; }
internal CurveTrackTreeView(CurveEditor curveEditor) { this._CurveEditor = curveEditor; RowDefinitions.Add(25, Skill.Framework.UI.GridUnitType.Pixel); RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); _Toolbar = new Grid(); _Toolbar.ColumnDefinitions.Add(30, GridUnitType.Pixel); _Toolbar.ColumnDefinitions.Add(1, GridUnitType.Star); _Toolbar.ColumnDefinitions.Add(30, GridUnitType.Pixel); // create header _Title = new Skill.Framework.UI.Label() { Row = 0, Column = 1 }; _Title.Text = "Curves"; _Toolbar.Controls.Add(_Title); _BtnClear = new Button() { Row = 0, Column = 0 }; _BtnClear.Content.tooltip = "Remove all curves"; _Toolbar.Controls.Add(_BtnClear); _BtnAddKey = new Button() { Row = 0, Column = 2, IsEnabled = false }; _BtnAddKey.Content.tooltip = "Add key to Selected"; _Toolbar.Controls.Add(_BtnAddKey); Controls.Add(_Toolbar); _TreeView = new TreeView() { Row = 1, UserData = this, HandleScrollWheel = true }; _TreeView.DisableFocusable(); Controls.Add(_TreeView); _BtnClear.Click += _BtnClear_Click; _BtnAddKey.Click += _BtnAddKey_Click; _CurveEditor.Changed += _CurveEditor_Changed; _TreeView.SelectedItemChanged += _TreeView_SelectedItemChanged; }
public TabHeader(int tabCount = 2, bool multiSelect = false) { this.MultiSelect = multiSelect; this.Height = 16; this.TabCount = Math.Max(2, tabCount); for (int i = 0; i < this.TabCount; i++) { this.ColumnDefinitions.Add(1, GridUnitType.Star); } this.LabelStyle = new GUIStyle() { alignment = TextAnchor.MiddleCenter }; this.LabelStyle.normal.textColor = new Color(0.7f, 0.7f, 0.7f, 1); if (!multiSelect) { _Group = new ToggleButtonGroup(); } this._Toggles = new Skill.Editor.UI.ToggleButton[this.TabCount]; this._Labels = new Label[this.TabCount]; for (int i = 0; i < this.TabCount; i++) { _Toggles[i] = new Skill.Editor.UI.ToggleButton() { Row = 0, Column = i, Group = _Group }; _Labels[i] = new Skill.Framework.UI.Label() { Row = 0, Column = i, Style = LabelStyle }; this.Controls.Add(_Toggles[i]); this.Controls.Add(_Labels[i]); if (multiSelect) { _Toggles[i].Changed += TabHeader_Changed; } else { _Toggles[i].Checked += TabHeader_Checked; } } this._SelectedTab = -1; this.SelectedTab = 0; this._FirstTryLoadEditorStyle = false; }
public FieldComponent() { this.ColumnDefinitions.Add(16, GridUnitType.Pixel); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.RowDefinitions.Add(20, GridUnitType.Pixel); this.RowDefinitions.Add(1, GridUnitType.Star); _ValueField = new UI.FloatField() { Row = 0, Column = 1, ColumnSpan = 3 }; this.Controls.Add(_ValueField); _Label = new Label() { Row = 0, Column = 0 }; this.Controls.Add(_Label); _BtnSign = new Button() { Row = 1, Column = 1 }; this.Controls.Add(_BtnSign); _BtnIncrease = new Button() { Row = 1, Column = 2 }; this.Controls.Add(_BtnIncrease); _BtnDecrease = new Button() { Row = 1, Column = 3 }; this.Controls.Add(_BtnDecrease); _BtnSign.Click += _BtnSign_Click; _BtnIncrease.Click += _BtnIncrease_Click; _BtnDecrease.Click += _BtnDecrease_Click; _ValueField.ValueChanged += _ValueField_ValueChanged; _RefreshStyles = true; }
public AudioField(DictionaryEditorWindow editor, AudioClipSubtitle subtitle) { this.Height = 18; this.Margin = new Skill.Framework.UI.Thickness(1); this._RefreshStyles = true; this.Subtitle = subtitle; this._Editor = editor; this.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); this.ColumnDefinitions.Add(18, Skill.Framework.UI.GridUnitType.Pixel); this.ColumnDefinitions.Add(18, Skill.Framework.UI.GridUnitType.Pixel); this.ColumnDefinitions.Add(16, Skill.Framework.UI.GridUnitType.Pixel); //this._Bg = new Skill.Framework.UI.Box() { Column = 0, ColumnSpan = 3 }; //this.Controls.Add(_Bg); this._LblClipName = new Skill.Framework.UI.Label() { Column = 0 }; UpdateTitle(); this.Controls.Add(_LblClipName); if (_ButtonStyle == null) { _ButtonStyle = new GUIStyle(); } this._BtnAddNext = new Skill.Framework.UI.Button() { Column = 1, Margin = new Skill.Framework.UI.Thickness(1), Style = _ButtonStyle }; this._BtnAddNext.Content.tooltip = "Add next"; this.Controls.Add(_BtnAddNext); this._BtnRemove = new Skill.Framework.UI.Button() { Column = 2, Margin = new Skill.Framework.UI.Thickness(1), Style = _ButtonStyle }; this._BtnRemove.Content.tooltip = "Remove"; this.Controls.Add(_BtnRemove); this._BtnAddNext.Click += _BtnAddNext_Click; this._BtnRemove.Click += _BtnRemove_Click; }
private void CreateUI() { _Frame = new Skill.Editor.UI.EditorFrame("Frame", this); _Frame.Grid.RowDefinitions.Add(140, Skill.Framework.UI.GridUnitType.Pixel); // Panel _Frame.Grid.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // Empty _Frame.Grid.Padding = new Skill.Framework.UI.Thickness(2, 4); _Panel = new Skill.Framework.UI.Grid(); _Panel.RowDefinitions.Add(24, Skill.Framework.UI.GridUnitType.Pixel); // _UnitsField _Panel.RowDefinitions.Add(36, Skill.Framework.UI.GridUnitType.Pixel); // _BtnOrganizeByPrefab _Panel.RowDefinitions.Add(36, Skill.Framework.UI.GridUnitType.Pixel); // _BtnOrganizeByUnits _Panel.RowDefinitions.Add(36, Skill.Framework.UI.GridUnitType.Pixel); // _BtnRemoveEmptyObjects _Panel.RowDefinitions.Add(4, Skill.Framework.UI.GridUnitType.Pixel); // empty _Frame.Controls.Add(_Panel); var margin = new Skill.Framework.UI.Thickness(0, 4, 0, 0); Grid g = new Grid() { Row = 0, Column = 0, Margin = margin }; g.ColumnDefinitions.Add(40, GridUnitType.Pixel); g.ColumnDefinitions.Add(1, GridUnitType.Star); _UnitsLabel = new Label() { Column = 0, Text = "Units" }; g.Controls.Add(_UnitsLabel); _BtnOrganizeByPrefab = new Button() { Row = 1, Column = 0, Margin = margin }; _BtnOrganizeByPrefab.Content.text = "Organize by prefab"; _Panel.Controls.Add(_BtnOrganizeByPrefab); _UnitsField = new Skill.Editor.UI.Vector3Field() { Column = 1, Value = _UnitLength }; g.Controls.Add(_UnitsField); _Panel.Controls.Add(g); _BtnOrganizeByUnits = new Button() { Row = 2, Column = 0, Margin = margin }; _BtnOrganizeByUnits.Content.text = "Organize by units"; _Panel.Controls.Add(_BtnOrganizeByUnits); _BtnRemoveEmptyObjects = new Button() { Row = 3, Column = 0, Margin = margin }; _BtnRemoveEmptyObjects.Content.text = "Delete empty objects"; _Panel.Controls.Add(_BtnRemoveEmptyObjects); _BtnOrganizeByPrefab.Click += _BtnOrganizeByPrefab_Click; _BtnOrganizeByUnits.Click += _BtnOrganizeByUnits_Click; _BtnRemoveEmptyObjects.Click += _BtnRemoveEmptyObjects_Click; _UnitsField.ValueChanged += _UnitsField_ValueChanged; }
public BreakPointsEditor(ItemProperties owner, AudioState state) { _OwnerProperties = owner; this.State = state; this._RefreshStyle = true; this.RowDefinitions.Add(16, GridUnitType.Pixel); // title this.RowDefinitions.Add(1, GridUnitType.Star); // list this.RowDefinitions.Add(16, GridUnitType.Pixel); // buttons this.RowDefinitions.Add(60, GridUnitType.Pixel); // Audio Preview this.RowDefinitions.Add(24, GridUnitType.Pixel); // _BtnUpdatePreview _Title = new Label { Row = 0, Text = "Break Points" }; this.Controls.Add(_Title); _BreakPointsList = new Skill.Framework.UI.ListBox() { Row = 1 }; _BreakPointsList.DisableFocusable(); _BreakPointsList.BackgroundVisible = true; this.Controls.Add(_BreakPointsList); _ButtonsPanel = new Grid() { Row = 2 }; _ButtonsPanel.ColumnDefinitions.Add(1, GridUnitType.Star); _ButtonsPanel.ColumnDefinitions.Add(20, GridUnitType.Pixel); _ButtonsPanel.ColumnDefinitions.Add(20, GridUnitType.Pixel); this.Controls.Add(_ButtonsPanel); _BtnAdd = new Button() { Column = 1 }; _ButtonsPanel.Controls.Add(_BtnAdd); _BtnRemove = new Button() { Column = 2, IsEnabled = false }; _ButtonsPanel.Controls.Add(_BtnRemove); _AudioPreview = new Skill.Editor.UI.AudioPreviewCurve() { Row = 3 }; this.Controls.Add(_AudioPreview); _BtnUpdatePreview = new Button() { Row = 4, Margin = new Thickness(0, 2) }; _BtnUpdatePreview.Content.text = "Update Preview Image"; this.Controls.Add(_BtnUpdatePreview); _BreakPointsList.SelectionChanged += _BreakPointsList_SelectionChanged; _BtnAdd.Click += _BtnAdd_Click; _BtnRemove.Click += _BtnRemove_Click; _BtnUpdatePreview.Click += _BtnUpdatePreview_Click; }