public EditorDesktop() { _project = Plugins.Container.ResolveNamed<GameObject>("Project"); _project.Expanded = true; GuiHost.SetSkin(EditorSkin.CreateSkin()); //Setup Tooltip var tt = new SimpleTooltip(); tt.Delay = 2000; this.TooltipControl = tt; //Left Frame _frameLeft = this.AddFrame("frame", Width, 600, DockStyle.Left); _frameLeft.Opacity = 0.8f; var _toolbarFrame = _frameLeft.AddFrame(Width, 24, DockStyle.Top); _saveButton = _toolbarFrame.AddButton("save", 2, 2, 20, 20); _saveButton.Tooltip = Properties.Resources.SaveButtonToolTip; _saveButton.MouseClick += SaveButton_MouseClick; _loadButton = _toolbarFrame.AddButton("load", 24, 2, 20, 20); _loadButton.Tooltip = Properties.Resources.LoadButtonToolTip; _loadButton.MouseClick += LoadButton_MouseClick; _gameObjectDropDown = _toolbarFrame.AddDropDownList(46, 2, Width - 88); _gameObjectDropDown.SelectedItemChanged += GameObjectDropDown_SelectedItemChanged; _addGameObject = _toolbarFrame.AddDropDownButton(Width - 42, 2, DropDownButtonType.Plus); _addGameObject.Tooltip = Resources.AddGameObject; _addGameObject.MouseClick += AddGameObject_MouseClick; _removeGameObject = _toolbarFrame.AddDropDownButton(Width - 22, 2, DropDownButtonType.Minus); _removeGameObject.Tooltip = Resources.RemoveGameObject; _removeGameObject.MouseClick += RemoveGameObject_MouseClick; _splitContainer = _frameLeft.AddSplitContainer(Orientation.Vertical); _gameObjectTree = _splitContainer.SplitFrame1.AddTreeView(2, 42, 246, 330); _gameObjectTree.Dock = DockStyle.Fill; _gameObjectTree.SelectedNodeChanged += GameObjectTree_SelectedNodeChanged; var componentFrame = _splitContainer.SplitFrame2.AddFrame(0, 20, DockStyle.Top); _componentsDropDown = componentFrame.AddDropDownList(2, 2, Width - 44); _componentsDropDown.SelectedItemChanged += ComponentsDropDown_SelectedItemChanged; _addComponent = componentFrame.AddDropDownButton(Width - 42, 2, DropDownButtonType.Plus); _addComponent.Enabled = false; _addComponent.MouseClick += AddComponent_MouseClick; _removeComponent = componentFrame.AddDropDownButton(Width - 22, 2, DropDownButtonType.Minus); _removeComponent.Enabled = false; _removeComponent.MouseClick += RemoveComponent_MouseClick; _inspectorPanel = _splitContainer.SplitFrame2.AddStackPanel(); RefreshGameObjectTree(); RefreshGameObjectList(); GameObjectTree_SelectedNodeChanged(this, null); }
//public static TreeView AddTreeView(this Control parent, int x, int y, int width, int height) //{ // var treeView = new TreeView(); // treeView.Parent = parent; // treeView.Size = new Point(width, height); // treeView.Position = new Point(x, y); // treeView.Style = "listboxFrame"; // treeView.ClipFrame.Margin = new Margin(4); // treeView.Scrollbar.Margin = new Margin(1, 1, 1, 1); // treeView.Scrollbar.Size = new Squid.Point(13, 13); // treeView.Scrollbar.Slider.Style = "vscrollTrack"; // treeView.Scrollbar.Slider.Button.Style = "vscrollButton"; // treeView.Scrollbar.ButtonUp.Visible = false; // treeView.Scrollbar.ButtonDown.Visible = false; // treeView.Scrollbar.Slider.Margin = new Margin(0, 2, 0, 2); // treeView.Indent = 15; // return treeView; //} public static TestSplitContainer AddSplitContainer(this Control parent, Orientation orientation) { var splitter = new TestSplitContainer(); splitter.Parent = parent; if (orientation == Orientation.Horizontal) splitter.SplitButton.Style = "hsplitter"; else splitter.SplitButton.Style = "vsplitter"; splitter.Orientation = orientation; splitter.SplitButton.Size = new Point(4, 4); splitter.Dock = DockStyle.Fill; splitter.SplitFrame1.Size = new Point(250, 100); splitter.SplitFrame2.Size = new Point(250, 200); return splitter; }