/// <summary>
        /// Creates a new FocusManager
        /// </summary>
        /// <param name="rootControl">The control which represents</param>
        /// <param name="startControl"></param>
        /// <exception cref="ArgumentNullException">Is thrown if <paramref name="startControl"/> or <paramref name="rootControl"/> is null</exception>
        /// <exception cref="ArgumentException">Is thrown if <paramref name="startControl"/> has no container</exception>
        /// <exception cref="ArgumentException">Is thrown if <paramref name="startControl"/> is no IInputHandler</exception>
        /// <exception cref="ArgumentException">Is thrown if <paramref name="rootControl"/> has an container</exception>
        /// <exception cref="ArgumentException">Is thrown if <paramref name="startControl"/> is not within <paramref name="rootControl"/></exception>
        public FocusManager(ContainerControl rootControl, Control startControl)
        {
            if (rootControl == null)
                throw new ArgumentNullException("rootControl");
            if (rootControl.Container != null)
                throw new ArgumentException("rootControl has an container!", "rootControl");

            if (startControl == null)
                throw new ArgumentNullException("startControl");
            if (startControl.Container == null)
                throw new ArgumentException("startControl doesn't have an container!", "startControl");
            if (!(startControl is IInputHandler))
                throw new ArgumentException("startControl isn't an IInputHandler!", "startControl");

            _rootControl = rootControl;

            CalculateList();
            _focusedIndex = -1;
            for (int i = 0; i < _controls.Length; i++)
            {
                if (_controls[i] == startControl)
                {
                    _focusedIndex = i;
                    _controls[i].IsFocused = true;
                }
                else
                {
                    _controls[i].IsFocused = false;
                }
            }

            if(_focusedIndex == -1)
                throw new ArgumentException("startControl is not within rootControl", "startControl");
        }
        /// <summary>
        /// Creates a new Application
        /// </summary>
        /// <param name="rootContainer">A <code>ContainerControl</code> which is at the root of the </param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="rootContainer"/> is null.</exception>
        /// <exception cref="ArgumentException">Thrown when the Container-Property of <paramref name="rootContainer"/> is set.</exception>
        public Application(ContainerControl rootContainer)
        {
            if (rootContainer == null)
                throw new ArgumentNullException("rootContainer");
            if (rootContainer.Container != null)
                throw new ArgumentException("The root-container can't have the Container-Property set.", "rootContainer");

            RootContainer = rootContainer;
        }
Exemple #3
0
        public override void InitializeControl(Form parentForm, ContainerControl parent)
        {
            if (parent is ToolContainerControl)
            {
                base.InitializeControl(parentForm, parent);
            }

            throw new ArgumentException("El contenedor solo puede ser un ToolContainerControl", "parent");
        }
Exemple #4
0
        public void AutoScaleDimensions_SetInvalid_ThrowsArgumentOutOfRangeException(Size value)
        {
            var control = new ContainerControl();

            Assert.Throws <ArgumentOutOfRangeException>("value", () => control.AutoScaleDimensions = value);
        }
Exemple #5
0
 public DelegateCall(ContainerControl f, Delegate d, params Object[] p)
 {
     _form     = f;
     _delegate = d;
     _objects  = p;
 }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ContentWindow"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        public ContentWindow(Editor editor)
            : base(editor, true, ScrollBars.None)
        {
            Title = "Content";
            Icon  = editor.Icons.Folder32;

            // Content database events
            editor.ContentDatabase.WorkspaceModified += () => _isWorkspaceDirty = true;
            editor.ContentDatabase.ItemRemoved       += ContentDatabaseOnItemRemoved;

            // Toolstrip
            _toolStrip = new ToolStrip(34.0f)
            {
                Parent = this,
            };
            _importButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Import64, () => Editor.ContentImporting.ShowImportFileDialog(CurrentViewFolder)).LinkTooltip("Import content");
            _toolStrip.AddSeparator();
            _navigateBackwardButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Left64, NavigateBackward).LinkTooltip("Navigate backward");
            _navigateForwardButton  = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Right64, NavigateForward).LinkTooltip("Navigate forward");
            _navigateUpButton       = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Up64, NavigateUp).LinkTooltip("Navigate up");

            // Navigation bar
            _navigationBar = new NavigationBar
            {
                Parent = this,
            };

            // Split panel
            _split = new SplitPanel(Orientation.Horizontal, ScrollBars.Both, ScrollBars.Vertical)
            {
                AnchorPreset  = AnchorPresets.StretchAll,
                Offsets       = new Margin(0, 0, _toolStrip.Bottom, 0),
                SplitterValue = 0.2f,
                Parent        = this,
            };

            // Content structure tree searching query input box
            var headerPanel = new ContainerControl
            {
                AnchorPreset = AnchorPresets.HorizontalStretchTop,
                IsScrollable = true,
                Offsets      = new Margin(0, 0, 0, 18 + 6),
                Parent       = _split.Panel1,
            };

            _foldersSearchBox = new TextBox
            {
                AnchorPreset  = AnchorPresets.HorizontalStretchMiddle,
                WatermarkText = "Search...",
                Parent        = headerPanel,
                Bounds        = new Rectangle(4, 4, headerPanel.Width - 8, 18),
            };
            _foldersSearchBox.TextChanged += OnFoldersSearchBoxTextChanged;

            // Content structure tree
            _tree = new Tree(false)
            {
                Y      = headerPanel.Bottom,
                Parent = _split.Panel1,
            };
            _tree.SelectedChanged += OnTreeSelectionChanged;

            // Content items searching query input box and filters selector
            var contentItemsSearchPanel = new ContainerControl
            {
                AnchorPreset = AnchorPresets.HorizontalStretchTop,
                IsScrollable = true,
                Offsets      = new Margin(0, 0, 0, 18 + 8),
                Parent       = _split.Panel2,
            };
            const float viewDropdownWidth = 50.0f;

            _itemsSearchBox = new TextBox
            {
                AnchorPreset  = AnchorPresets.HorizontalStretchMiddle,
                WatermarkText = "Search...",
                Parent        = contentItemsSearchPanel,
                Bounds        = new Rectangle(viewDropdownWidth + 8, 4, contentItemsSearchPanel.Width - 12 - viewDropdownWidth, 18),
            };
            _itemsSearchBox.TextChanged += UpdateItemsSearch;
            _viewDropdown = new ViewDropdown
            {
                AnchorPreset       = AnchorPresets.MiddleLeft,
                SupportMultiSelect = true,
                TooltipText        = "Change content view and filter options",
                Parent             = contentItemsSearchPanel,
                Offsets            = new Margin(4, viewDropdownWidth, -9, 18),
            };
            _viewDropdown.SelectedIndexChanged += e => UpdateItemsSearch();
            for (int i = 0; i <= (int)ContentItemSearchFilter.Other; i++)
            {
                _viewDropdown.Items.Add(((ContentItemSearchFilter)i).ToString());
            }
            _viewDropdown.PopupCreate += OnViewDropdownPopupCreate;

            // Content View
            _view = new ContentView
            {
                AnchorPreset = AnchorPresets.HorizontalStretchTop,
                Offsets      = new Margin(0, 0, contentItemsSearchPanel.Bottom + 4, 0),
                IsScrollable = true,
                Parent       = _split.Panel2,
            };
            _view.OnOpen         += Open;
            _view.OnNavigateBack += NavigateBackward;
            _view.OnRename       += Rename;
            _view.OnDelete       += Delete;
            _view.OnDuplicate    += Duplicate;
            _view.OnPaste        += Paste;
        }
Exemple #7
0
 public TrackedErrorProvider(ContainerControl parentControl) : base(parentControl)
 {
 }
Exemple #8
0
 public void display(bool asPopup, ContainerControl parent, int x, int y)
 {
     this.dockableControl.display(asPopup, parent, x, y);
 }
            public void TestInitialize()
            {
                var i = 1;
                this.controlList = new ControlList();
                this.rootControl = new TextControl { Id = i++, Name = "RootControl" };
                this.rootCalc = new CalculationControl { Id = i++, Name = "RootCalc", CalculationExpression = "{%RootControl%}*3" };
                this.outerRepeat = new RepeaterControl { Id = i++, Name = "OuterRepeater" };
                this.outerChild = new TextControl { Id = i++, Name = "OuterChild", ParentId = this.outerRepeat.Id };
                this.outerCalc = new CalculationControl
                                 {
                                     Id = i++,
                                     Name = "OuterCalc",
                                     ParentId = this.outerRepeat.Id,
                                     CalculationExpression = "{%OuterChild%}*2"
                                 };
                this.innerRepeat = new RepeaterControl { Id = i++, Name = "InnerRepeater", ParentId = this.outerRepeat.Id };
                this.innerChild = new TextControl { Id = i++, Name = "InnerChild", ParentId = this.innerRepeat.Id };
                this.innerCalc = new CalculationControl
                                 {
                                     Id = i++,
                                     Name = "InnerCalc",
                                     ParentId = this.innerRepeat.Id,
                                     CalculationExpression = "{%InnerChild%}*5"
                                 };
                this.innerCalcWithDependency = new CalculationControl
                                               {
                                                   Id = i + 1,
                                                   Name = "InnerCalcWithDependency",
                                                   ParentId = this.innerRepeat.Id,
                                                   CalculationExpression = "{%InnerCalc%}+{%OuterCalc%}+{%RootCalc%}"
                                               };

                this.innerRepeat.AddChild(this.innerChild);
                this.innerRepeat.AddChild(this.innerCalc);
                this.innerRepeat.AddChild(this.innerCalcWithDependency);

                this.outerRepeat.AddChild(this.innerRepeat);
                this.outerRepeat.AddChild(this.outerChild);
                this.outerRepeat.AddChild(this.outerCalc);

                this.controlList.Add(this.rootControl);
                this.controlList.Add(this.rootCalc);
                this.controlList.Add(this.outerRepeat);
            }
 public void initProperties(bool dockable, string title, ContainerControl parent)
 {
     this.dockableControl.initProperties(dockable, title, parent, false, Color.FromArgb(0xe0, 0xea, 0xf5), Color.FromArgb(0xbf, 0xc9, 0xd3));
 }
Exemple #11
0
 /// <summary>
 /// Sets the Focus to a control within a given Form or a UserControl.
 ///
 /// </summary>
 /// <param name="AContainer">Either a Form or a UserControl.</param>
 /// <param name="AControlName">Name of the control to set the focus to</param>
 /// <returns>The name of the control if the control is found (used in
 /// SetFocusOnDataBoundControlInternal), otherwise ''.
 /// </returns>
 public static String SetFocusOnControlInFormOrUserControl(ContainerControl AContainer, String AControlName)
 {
     return(SetFocusOnControlInFormOrUserControl(AContainer, AControlName, null, ""));
 }
 public ContainerControlView(ContainerControl i_Control) : base(i_Control as ExControl)
 {
 }
Exemple #13
0
        private void InitializeComponent()
        {
            backgroundWorker1       = new BackgroundWorker();
            panelContainer          = new ContainerControl();
            textBoxSearchString     = new TextBox();
            buttonStartSearch       = new Button();
            buttonStopSearch        = new Button();
            tabControlOutput        = new TabControl();
            tabPageSearchResults    = new TabPage();
            tabPageSearchStatistics = new TabPage();
            tabPageSearchErrors     = new TabPage();
            treeViewResults         = new TreeView();

            tabPageSearchResults.Controls.Add(treeViewResults);
            tabControlOutput.TabPages.Add(tabPageSearchResults);
            tabControlOutput.TabPages.Add(tabPageSearchStatistics);
            tabControlOutput.TabPages.Add(tabPageSearchErrors);
            panelContainer.Controls.Add(textBoxSearchString);
            panelContainer.Controls.Add(buttonStartSearch);
            panelContainer.Controls.Add(buttonStopSearch);
            panelContainer.Controls.Add(tabControlOutput);
            this.Controls.Add(panelContainer);

            panelContainer.Dock          = DockStyle.Fill;
            panelContainer.ActiveControl = textBoxSearchString;

            buttonStopSearch.Text     = "Стоп";
            buttonStopSearch.AutoSize = true;
            buttonStopSearch.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            buttonStopSearch.Top      = 10;
            buttonStopSearch.Left     = buttonStopSearch.Parent.Right - buttonStopSearch.Width - 10;
            buttonStopSearch.TabIndex = 3;
            buttonStopSearch.Click   += buttonStopSearch_Click;

            buttonStartSearch.Text     = "Старт";
            buttonStartSearch.AutoSize = true;
            buttonStartSearch.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            buttonStartSearch.Top      = 10;
            buttonStartSearch.Left     = buttonStopSearch.Left - buttonStartSearch.Width - 10;
            buttonStartSearch.TabIndex = 2;
            buttonStartSearch.Click   += buttonStartSearch_Click;

            textBoxSearchString.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            textBoxSearchString.Top      = 10;
            textBoxSearchString.Left     = 10;
            textBoxSearchString.Width    = buttonStartSearch.Left - 10 * 2;
            textBoxSearchString.Enabled  = true;
            textBoxSearchString.ReadOnly = false;
            textBoxSearchString.TabIndex = 1;

            tabControlOutput.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
            tabControlOutput.Left     = 10;
            tabControlOutput.Width    = tabControlOutput.Parent.Width - 10 * 2;
            tabControlOutput.Top      = textBoxSearchString.Bottom + 10;
            tabControlOutput.Height   = tabControlOutput.Parent.Bottom - tabControlOutput.Top - 10;
            tabControlOutput.TabIndex = 3;

            tabPageSearchResults.Text    = "Результаты";
            tabPageSearchStatistics.Text = "Статистика";
            tabPageSearchErrors.Text     = "Ошибки";

            treeViewResults.Anchor                = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
            treeViewResults.Top                   = 10;
            treeViewResults.Left                  = 10;
            treeViewResults.Width                 = treeViewResults.Parent.Width - 10 * 2;
            treeViewResults.Height                = treeViewResults.Parent.Height - 10 * 2;
            treeViewResults.ShowRootLines         = false;
            treeViewResults.NodeMouseDoubleClick += treeViewResults_NodeMouseDoubleClick;

            backgroundWorker1.DoWork          += backgroundWorker1_DoWork;
            backgroundWorker1.ProgressChanged += backgroundWorker1_ProgressChanged;

            backgroundWorker1.RunWorkerCompleted        += backgroundWorker1_RunWorkerCompleted;
            backgroundWorker1.WorkerReportsProgress      = true;
            backgroundWorker1.WorkerSupportsCancellation = true;

            this.treeViewResults.KeyPress += treeViewResults_KeyPress;
        }
            public void TestInitialize()
            {
                int i = 1;

                this.pageList = new PageList();
                this.controlList = new ControlList();
                this.rootControl = new TextControl { Id = i++, Name = "RootControl" };
                this.outerRepeat = new RepeaterControl { Id = i++, Name = "OuterRepeater" };
                this.outerChild = new TextControl { Id = i++, Name = "OuterChild", ParentId = this.outerRepeat.Id };
                this.innerRepeat = new RepeaterControl { Id = i++, Name = "InnerRepeater", ParentId = this.outerRepeat.Id };
                this.innerChild = new TextControl { Id = i++, Name = "InnerChild", ParentId = this.innerRepeat.Id };

                this.onAnotherPage = new TextControl { Id = i + 1, Name = "OnAnotherPage" };

                this.innerRepeat.AddChild(this.innerChild);
                this.outerRepeat.AddChild(this.innerRepeat);
                this.outerRepeat.AddChild(this.outerChild);
                this.controlList.Add(this.rootControl);
                this.controlList.Add(this.outerRepeat);

                Page first = new UserPage
                        {
                            Controls = this.controlList
                        };

                Page second = new UserPage
                              {
                                  Controls = new ControlList
                                             {
                                                 this.onAnotherPage
                                             }
                              };

                this.pageList.Add(first);
                this.pageList.Add(second);
            }
Exemple #15
0
 protected GameBase(ContainerControl container)
 {
     this.container = container;
     this.Container = container;
 }
Exemple #16
0
 public void display(ContainerControl parent, int x, int y)
 {
     this.dockableControl.display(parent, x, y);
 }
Exemple #17
0
 public MDockBarManager(ContainerControl form) : base(form)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CslaContrib.WebGUI.ErrorProvider"/> class attached to a container.
 /// </summary>
 /// <param name="parentControl">The container of the control to monitor for errors.</param>
 public ErrorProvider(ContainerControl parentControl)
   : base(parentControl)
 {
   parentControl.BindingContextChanged += ParentControlBindingContextChanged;
 }
Exemple #19
0
        /// <summary>
        /// Set the AutoScaleDimensions for the given control
        /// </summary>
        /// <param name="control">The control that the property is set for</param>
        /// <param name="size">The design time dimensions for the control</param>
        protected void SetAutoScaleDimensions(ContainerControl control, SizeF size)
        {
            SizeF cSize = control.CurrentAutoScaleDimensions;

            _autoScaleFactor = new SizeF(cSize.Width / size.Width, cSize.Height / size.Height);
        }
Exemple #20
0
        /// <summary>
        /// Mueve un control desde un contenedor a otro
        /// </summary>
        /// <param name="container">
        /// El nuevo contenedor
        /// </param>
        public void Move(ContainerControl container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            this.ParentForm = container.ParentForm;
            this.Parent = container;
        }
 public ContainerRuleSearchStateWin(ContainerControl sender)
 {
     _sender = sender;
 }
Exemple #22
0
 public void initProperties(bool dockable, string title, ContainerControl parent)
 {
     this.dockableControl.initProperties(dockable, title, parent);
 }
Exemple #23
0
 public override void SetContainerContent(sw.FrameworkElement content)
 {
     this.content = content;
     Control.Children.Add(content);
     ContainerControl.InvalidateMeasure();
 }
Exemple #24
0
 public Windows7ProgressBar(ContainerControl parentControl)
 {
     ContainerControl = parentControl;
 }
Exemple #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TemporaryTestControlCollection"/> class.
 /// </summary>
 /// <param name="owner">
 /// A <see cref="ContainerControl"/> to be associated with this <see cref="TemporaryTestControlCollection"/>.
 /// </param>
 public TemporaryTestControlCollection(ContainerControl owner)
 {
     this.owner    = owner;
     this.controls = new List <Control>();
 }
Exemple #26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditTab"/> class.
        /// </summary>
        /// <param name="tab">The parent tab.</param>
        /// <param name="gizmo">The related gizmo.</param>
        public EditTab(CarveTab tab, EditTerrainGizmoMode gizmo)
            : base("Edit")
        {
            CarveTab = tab;
            Gizmo    = gizmo;
            CarveTab.SelectedTerrainChanged += OnSelectionChanged;
            Gizmo.SelectedChunkCoordChanged += OnSelectionChanged;

            // Main panel
            var panel = new Panel(ScrollBars.Both)
            {
                DockStyle = DockStyle.Fill,
                Parent    = this
            };

            // Mode
            var modeLabel = new Label(4, 4, 40, 18)
            {
                HorizontalAlignment = TextAlignment.Near,
                Text   = "Mode:",
                Parent = panel,
            };

            _modeComboBox = new ComboBox(modeLabel.Right + 4, 4, 110)
            {
                Parent = panel,
            };
            _modeComboBox.AddItem("Edit Chunk");
            _modeComboBox.AddItem("Add Patch");
            _modeComboBox.AddItem("Remove Patch");
            _modeComboBox.AddItem("Export terrain");
            _modeComboBox.SelectedIndex         = 0;
            _modeComboBox.SelectedIndexChanged += (combobox) => Gizmo.EditMode = (EditTerrainGizmoMode.Modes)combobox.SelectedIndex;
            Gizmo.ModeChanged += OnGizmoModeChanged;

            // Info
            _selectionInfoLabel = new Label(modeLabel.X, modeLabel.Bottom + 4, 40, 18 * 3)
            {
                VerticalAlignment   = TextAlignment.Near,
                HorizontalAlignment = TextAlignment.Near,
                Parent = panel,
            };

            // Chunk Properties
            _chunkProperties = new Panel(ScrollBars.None)
            {
                Location = new Vector2(_selectionInfoLabel.X, _selectionInfoLabel.Bottom + 4),
                Parent   = panel,
            };
            var chunkOverrideMaterialLabel = new Label(0, 0, 90, 64)
            {
                HorizontalAlignment = TextAlignment.Near,
                Text   = "Override Material",
                Parent = _chunkProperties,
            };

            _chunkOverrideMaterial = new AssetPicker(typeof(MaterialBase), new Vector2(chunkOverrideMaterialLabel.Right + 4, 0))
            {
                Width  = 300.0f,
                Parent = _chunkProperties,
            };
            _chunkOverrideMaterial.SelectedItemChanged += OnSelectedChunkOverrideMaterialChanged;
            _chunkProperties.Size = new Vector2(_chunkOverrideMaterial.Right + 4, _chunkOverrideMaterial.Bottom + 4);

            // Delete patch
            _deletePatchButton = new Button(_selectionInfoLabel.X, _selectionInfoLabel.Bottom + 4)
            {
                Text   = "Delete Patch",
                Parent = panel,
            };
            _deletePatchButton.Clicked += OnDeletePatchButtonClicked;

            // Export terrain
            _exportTerrainButton = new Button(_selectionInfoLabel.X, _selectionInfoLabel.Bottom + 4)
            {
                Text   = "Export terrain",
                Parent = panel,
            };
            _exportTerrainButton.Clicked += OnExportTerrainButtonClicked;

            // Update UI to match the current state
            OnSelectionChanged();
            OnGizmoModeChanged();
        }
Exemple #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SpawnTab"/> class.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <param name="editor">The editor instance.</param>
        public SpawnTab(SpriteHandle icon, Editor editor)
            : base(string.Empty, icon)
        {
            Editor    = editor;
            Selected += tab => Editor.Windows.EditWin.Viewport.SetActiveMode <TransformGizmoMode>();
            ScriptsBuilder.ScriptsReload += OnScriptsReload;

            var actorGroups = new Tabs
            {
                Orientation  = Orientation.Vertical,
                UseScroll    = true,
                AnchorPreset = AnchorPresets.StretchAll,
                Offsets      = Margin.Zero,
                TabsSize     = new Float2(120, 32),
                Parent       = this,
            };

            _groupSearch = CreateGroupWithList(actorGroups, "Search", 26);
            _searchBox   = new TextBox
            {
                AnchorPreset  = AnchorPresets.HorizontalStretchTop,
                WatermarkText = "Search...",
                Parent        = _groupSearch.Parent.Parent,
                Bounds        = new Rectangle(4, 4, actorGroups.Width - 8, 18),
            };
            _searchBox.TextChanged += OnSearchBoxTextChanged;

            var groupBasicModels = CreateGroupWithList(actorGroups, "Basic Models");

            groupBasicModels.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax"));
            groupBasicModels.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax"));
            groupBasicModels.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax"));
            groupBasicModels.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax"));
            groupBasicModels.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax"));
            groupBasicModels.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax"));

            var groupLights = CreateGroupWithList(actorGroups, "Lights");

            groupLights.AddChild(CreateActorItem("Directional Light", typeof(DirectionalLight)));
            groupLights.AddChild(CreateActorItem("Point Light", typeof(PointLight)));
            groupLights.AddChild(CreateActorItem("Spot Light", typeof(SpotLight)));
            groupLights.AddChild(CreateActorItem("Sky Light", typeof(SkyLight)));

            var groupVisuals = CreateGroupWithList(actorGroups, "Visuals");

            groupVisuals.AddChild(CreateActorItem("Camera", typeof(Camera)));
            groupVisuals.AddChild(CreateActorItem("Environment Probe", typeof(EnvironmentProbe)));
            groupVisuals.AddChild(CreateActorItem("Skybox", typeof(Skybox)));
            groupVisuals.AddChild(CreateActorItem("Sky", typeof(Sky)));
            groupVisuals.AddChild(CreateActorItem("Exponential Height Fog", typeof(ExponentialHeightFog)));
            groupVisuals.AddChild(CreateActorItem("PostFx Volume", typeof(PostFxVolume)));
            groupVisuals.AddChild(CreateActorItem("Decal", typeof(Decal)));
            groupVisuals.AddChild(CreateActorItem("Particle Effect", typeof(ParticleEffect)));

            var groupPhysics = CreateGroupWithList(actorGroups, "Physics");

            groupPhysics.AddChild(CreateActorItem("Rigid Body", typeof(RigidBody)));
            groupPhysics.AddChild(CreateActorItem("Character Controller", typeof(CharacterController)));
            groupPhysics.AddChild(CreateActorItem("Box Collider", typeof(BoxCollider)));
            groupPhysics.AddChild(CreateActorItem("Sphere Collider", typeof(SphereCollider)));
            groupPhysics.AddChild(CreateActorItem("Capsule Collider", typeof(CapsuleCollider)));
            groupPhysics.AddChild(CreateActorItem("Mesh Collider", typeof(MeshCollider)));
            groupPhysics.AddChild(CreateActorItem("Fixed Joint", typeof(FixedJoint)));
            groupPhysics.AddChild(CreateActorItem("Distance Joint", typeof(DistanceJoint)));
            groupPhysics.AddChild(CreateActorItem("Slider Joint", typeof(SliderJoint)));
            groupPhysics.AddChild(CreateActorItem("Spherical Joint", typeof(SphericalJoint)));
            groupPhysics.AddChild(CreateActorItem("Hinge Joint", typeof(HingeJoint)));
            groupPhysics.AddChild(CreateActorItem("D6 Joint", typeof(D6Joint)));

            var groupOther = CreateGroupWithList(actorGroups, "Other");

            groupOther.AddChild(CreateActorItem("Animated Model", typeof(AnimatedModel)));
            groupOther.AddChild(CreateActorItem("Bone Socket", typeof(BoneSocket)));
            groupOther.AddChild(CreateActorItem("CSG Box Brush", typeof(BoxBrush)));
            groupOther.AddChild(CreateActorItem("Audio Source", typeof(AudioSource)));
            groupOther.AddChild(CreateActorItem("Audio Listener", typeof(AudioListener)));
            groupOther.AddChild(CreateActorItem("Empty Actor", typeof(EmptyActor)));
            groupOther.AddChild(CreateActorItem("Scene Animation", typeof(SceneAnimationPlayer)));
            groupOther.AddChild(CreateActorItem("Nav Mesh Bounds Volume", typeof(NavMeshBoundsVolume)));
            groupOther.AddChild(CreateActorItem("Nav Link", typeof(NavLink)));
            groupOther.AddChild(CreateActorItem("Nav Modifier Volume", typeof(NavModifierVolume)));
            groupOther.AddChild(CreateActorItem("Spline", typeof(Spline)));

            var groupGui = CreateGroupWithList(actorGroups, "GUI");

            groupGui.AddChild(CreateActorItem("UI Control", typeof(UIControl)));
            groupGui.AddChild(CreateActorItem("UI Canvas", typeof(UICanvas)));
            groupGui.AddChild(CreateActorItem("Text Render", typeof(TextRender)));
            groupGui.AddChild(CreateActorItem("Sprite Render", typeof(SpriteRender)));

            actorGroups.SelectedTabIndex = 1;
        }
Exemple #28
0
 /// <summary>
 /// Called when thumbnail drawing ends. Proxy should clear custom GUI from guiRoot from that should be not destroyed.
 /// </summary>
 /// <param name="request">The request to render thumbnail.</param>
 /// <param name="guiRoot">The GUI root container control.</param>
 public virtual void OnThumbnailDrawEnd(ThumbnailRequest request, ContainerControl guiRoot)
 {
 }
Exemple #29
0
 public static Control GetFocusedControl(ContainerControl control) => (control.ActiveControl is ContainerControl ? GetFocusedControl((ContainerControl)control.ActiveControl) : control.ActiveControl);
Exemple #30
0
        public void AutoValidate_SetInvalid_ThrowsInvalidEnumArgumentException(AutoValidate value)
        {
            var control = new ContainerControl();

            Assert.Throws <InvalidEnumArgumentException>("value", () => control.AutoValidate = value);
        }
 /// <inheritdoc />
 public override void OnThumbnailDrawBegin(ThumbnailRequest request, ContainerControl guiRoot, GPUContext context)
 {
     _preview.Asset  = (SpriteAtlas)request.Asset;
     _preview.Parent = guiRoot;
 }
Exemple #32
0
 /// <inheritdoc />
 public override void OnThumbnailDrawEnd(ThumbnailRequest request, ContainerControl guiRoot)
 {
     _preview.Model  = null;
     _preview.Parent = null;
 }
Exemple #33
0
        public WinformsEventSink(ContainerControl controlToHook, SystemWindow systemWindow)
        {
            this.controlToHook  = controlToHook;
            this.widgetToSendTo = systemWindow;

            if (AllowInspector)
            {
                this.controlToHook.KeyDown += (s, e) =>
                {
                    switch (e.KeyCode)
                    {
                    case System.Windows.Forms.Keys.F12:
                        if (inspectForm != null)
                        {
                            // Toggle mode if window is open
                            inspectForm.Inspecting = !inspectForm.Inspecting;
                        }
                        else
                        {
                            try
                            {
                                // Otherwise open
                                inspectForm = WinformsSystemWindow.InspectorCreator.Invoke(widgetToSendTo);
                                inspectForm.StartPosition = FormStartPosition.Manual;
                                inspectForm.Location      = new System.Drawing.Point(0, 0);
                                inspectForm.FormClosed   += (s2, e2) =>
                                {
                                    inspectForm = null;
                                };
                                inspectForm.Show();

                                // Restore focus to ensure keyboard hooks in main SystemWindow work as expected
                                controlToHook.Focus();
                            }
                            catch { }
                        }
                        return;
                    }
                };
            }

            controlToHook.GotFocus  += controlToHook_GotFocus;
            controlToHook.LostFocus += controlToHook_LostFocus;

            controlToHook.KeyDown  += controlToHook_KeyDown;
            controlToHook.KeyUp    += controlToHook_KeyUp;
            controlToHook.KeyPress += controlToHook_KeyPress;

            controlToHook.MouseDown  += controlToHook_MouseDown;
            controlToHook.MouseMove  += formToHook_MouseMove;
            controlToHook.MouseUp    += controlToHook_MouseUp;
            controlToHook.MouseWheel += controlToHook_MouseWheel;

            controlToHook.AllowDrop = true;

            controlToHook.DragDrop  += ControlToHook_DragDrop;
            controlToHook.DragEnter += ControlToHook_DragEnter;
            controlToHook.DragLeave += ControlToHook_DragLeave;
            controlToHook.DragOver  += ControlToHook_DragOver;

            controlToHook.MouseCaptureChanged += controlToHook_MouseCaptureChanged;

            controlToHook.MouseLeave += controlToHook_MouseLeave;
        }
 public void TestInitialize()
 {
     this.containerControl = new RepeaterControl();
 }
Exemple #35
0
 public JcwDockManager(ContainerControl form)
     : this(form, 21, JcwStyle.JcwStyleFont)
 {
 }
Exemple #36
0
 public JcwDockManager(ContainerControl form, int autoHideContainerWidth)
     : this(form, autoHideContainerWidth, JcwStyle.JcwStyleFont)
 {
 }
Exemple #37
0
 public PresetsColumn(ContainerControl parent, GameCookerWindow cooker)
     : base(parent, cooker, true, cooker.AddPreset)
 {
     _cooker = cooker;
 }
 /// <summary>
 /// Gets all <code>IInputHandler</code> controls within <paramref name="control"/> ordered by thier TabIndex
 /// </summary>
 /// <param name="control">The control to search in</param>
 /// <returns>A list of controls</returns>
 private IEnumerable<Control> CalculateList(ContainerControl control)
 {
     foreach (var c in control.OrderBy(c => c.TabIndex))
     {
         if (c is IInputHandler)
             yield return c;
         if (c is ContainerControl)
             foreach (var cc in CalculateList(c as ContainerControl).Where(cc => cc is IInputHandler))
                 yield return cc;
     }
 }
 public VistaMenu(ContainerControl parentControl)
     : this()
 {
     ownerForm = parentControl;
 }
	public ErrorProvider(ContainerControl parentControl) {}
Exemple #41
0
        public virtual void InitializeControl(Form parentForm, ContainerControl parent)
        {
            this.Parent = parent;
            this.ParentForm = parentForm;

            this.Initialize();
        }