public ParameterEditor(AnimationTreeEditorWindow editor) { this._Editor = editor; this.RowDefinitions.Add(20, GridUnitType.Pixel); this.RowDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(60, GridUnitType.Pixel); _ParameterLabel = new Label() { Row = 0, Column = 0, Text = "Parameters" }; this.Controls.Add(_ParameterLabel); _ParameterList = new ListBox() { Row = 1, Column = 0, ColumnSpan = 2 }; _ParameterList.DisableFocusable(); this.Controls.Add(_ParameterList); _ParameterToolbar = new UniformGrid() { Row = 0, Column = 1, Rows = 1, Columns = 2 }; this.Controls.Add(_ParameterToolbar); _MnuParameter = new UI.MenuBar() { Column = 0 }; _ParameterToolbar.Controls.Add(_MnuParameter); _MnuAddParameter = new UI.MenuBarItem(); _MnuParameter.Controls.Add(_MnuAddParameter); _MnuAddFloatParameter = new UI.MenuItem("Float") { UserData = AnimationTreeParameterType.Float }; _MnuAddParameter.Add(_MnuAddFloatParameter); _MnuAddIntegerParameter = new UI.MenuItem("Integer") { UserData = AnimationTreeParameterType.Integer }; _MnuAddParameter.Add(_MnuAddIntegerParameter); _BtnRemoveParameter = new Button() { Column = 1 }; _BtnRemoveParameter.Content.tooltip = "remove selected parameter"; _ParameterToolbar.Controls.Add(_BtnRemoveParameter); SetButtonsEnable(); _ParameterList.SelectionChanged += _ParameterList_SelectionChanged; _MnuAddFloatParameter.Click += _MnuAddParameter_Click; _MnuAddIntegerParameter.Click += _MnuAddParameter_Click; _BtnRemoveParameter.Click += _BtnRemoveParameter_Click; }
public ProfileEditor(AnimationTreeEditorWindow editor) { this._Editor = editor; this.RowDefinitions.Add(20, GridUnitType.Pixel); this.RowDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(1, GridUnitType.Star); this.ColumnDefinitions.Add(60, GridUnitType.Pixel); _ProfileLabel = new Label() { Row = 0, Column = 0, Text = "Profiles" }; this.Controls.Add(_ProfileLabel); _ProfileList = new ListBox() { Row = 1, Column = 0, ColumnSpan = 2 }; _ProfileList.DisableFocusable(); this.Controls.Add(_ProfileList); _ProfileToolbar = new UniformGrid() { Row = 0, Column = 1, Rows = 1, Columns = 2 }; this.Controls.Add(_ProfileToolbar); _BtnAddProfile = new Button() { Column = 0 }; _BtnAddProfile.Content.tooltip = "add new profile"; _ProfileToolbar.Controls.Add(_BtnAddProfile); _BtnRemoveProfile = new Button() { Column = 1 }; _BtnRemoveProfile.Content.tooltip = "remove selected profile"; _ProfileToolbar.Controls.Add(_BtnRemoveProfile); SetButtonsEnable(); _ProfileList.SelectionChanged += _ProfileList_SelectionChanged; _BtnAddProfile.Click += _BtnAddProfile_Click; _BtnRemoveProfile.Click += _BtnRemoveProfile_Click; }
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(); }