Exemple #1
0
        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);
        }