/// <summary>
        /// Constructor
        /// </summary>
        public PropertyPanel(DockingContainer container) : base(container)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call

            // configure the propertygrid refresh timer
            _refreshTimer.AutoReset = false;
            _refreshTimer.Elapsed  += new ElapsedEventHandler(OnRefresh);
            _refreshTimer.Interval  = 200;
            _refreshTimer.Enabled   = false;

            // Note that this is a global setter (it should be called once) that will work for all property grids.
            // It is set here as we only have one property grid in the code but it could be considered to move the call to a global settings location.
            SingleTypeDescriptionProvider propertyGridSingleProvider = new SingleTypeDescriptionProvider(TypeDescriptor.GetProvider(typeof(Single)));

            TypeDescriptor.AddProvider(propertyGridSingleProvider, typeof(Single));

            // listen to the changes
            EditorScene.PropertyChanged       += new CSharpFramework.PropertyChangedEventHandler(this.OnPropertyChanged);
            EditorManager.SceneChanged        += new SceneChangedEventHandler(this.OnSceneChanged);
            EditorScene.ShapeChanged          += new ShapeChangedEventHandler(this.OnShapeChanged);
            EditorScene.LayerChanged          += new LayerChangedEventHandler(this.OnLayerChanged);
            EditorScene.ZoneChanged           += new ZoneChangedEventHandler(EditorScene_ZoneChanged);
            propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyGrid_PropertyValueChanged);

            EditorManager.ShapeSelectionChanged += new ShapeSelectionChangedEventHandler(OnSelectionChanged);

            UpdateHelpPanel();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ShapeCreatorPanel(DockingContainer container)
            : base(container)
        {
            //
              // Required for Windows Form Designer support
              //
              InitializeComponent();

              // Add help button
              _helpbutton = new ToolStripHelpButton(Text);
              _helpbutton.Alignment = ToolStripItemAlignment.Right;
              toolStrip.Items.Insert(0, _helpbutton);

              label_Description.Text = null;

              IProject.NewProjectLoaded += new EventHandler(IProject_NewProjectLoaded);
              IProject.ProjectUnloaded += new EventHandler(IProject_ProjectUnloaded);
              PrefabDesc.OnPrefabSaved += new EventHandler(PrefabDesc_OnPrefabSaved);
              PrefabDesc.OnPrefabPropertiesChanged += new EventHandler(PrefabDesc_OnPrefabPropertiesChanged);
              treeView_Creators.ImageList = TreeViewImages.ImageList;

              // Incremental search
              searchPanel.FilterChanged += new EventHandler(searchPanel_FilterChanged);

              // Used for UI updates in case the prefab directory changes (to update view of available prefabs)
              EditorManager.EditorSettingsChanged += new EditorSettingsChangedEventHandler(EditorManager_EditorSettingsChanged);

              // UI updates of ShapeCreatorPanel can be triggered from the EditorManager.GUI as desired (e.g. when ShapeCreators
              // have been added in custom plugins from e.g. some scene callback and they should be available in the list)
              EditorManager.GUI.ShapeCreatorUpdateRequest += new EventHandler(EditorManager_GUI_ShapeCreatorUpdateRequest);
        }
Exemple #3
0
        /// <summary>
        /// Hide restore containers
        /// </summary>
        /// <param name="panel">panel</param>
        public static void HideRestoreContainers(AutoHidePanel panel)
        {
            DockingContainer        parentContainer  = panel.RestoreParent;
            List <DockingContainer> containersToHide = new List <DockingContainer>();

            while (parentContainer != null)
            {
                int visibleChildrenCount = GetVisibleChildrenCount(parentContainer);
                if (visibleChildrenCount > 1)
                {
                    break;
                }

                containersToHide.Add(parentContainer);
                parentContainer = parentContainer.Parent as DockingContainer;
            }

            for (int index = containersToHide.Count - 1; index >= 0; index--)
            {
                parentContainer = containersToHide[index];
                int splitterIndex  = parentContainer.Parent.Controls.IndexOf(parentContainer.Splitter);
                int containerIndex = parentContainer.Parent.Controls.IndexOf(parentContainer);
                parentContainer.Splitter.Visible = false;
                parentContainer.Visible          = false;
                parentContainer.SplitterBefore   = splitterIndex < containerIndex;
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public PropertyPanel(DockingContainer container)
            : base(container)
        {
            // This call is required by the Windows.Forms Form Designer.
              InitializeComponent();

              // TODO: Add any initialization after the InitializeComponent call
              propertyGrid.AddHelpButton("Property Panel", "shapes");

              // configure the propertygrid refresh timer
              _refreshTimer.AutoReset = false;
              _refreshTimer.Elapsed += new ElapsedEventHandler(OnRefresh);
              _refreshTimer.Interval = 200;
              _refreshTimer.Enabled=false;

              // Note that this is a global setter (it should be called once) that will work for all property grids.
              // It is set here as we only have one property grid in the code but it could be considered to move the call to a global settings location.
              SingleTypeDescriptionProvider propertyGridSingleProvider = new SingleTypeDescriptionProvider(TypeDescriptor.GetProvider(typeof(Single)));
              TypeDescriptor.AddProvider(propertyGridSingleProvider, typeof(Single));

              // listen to the changes
              EditorScene.PropertyChanged += new CSharpFramework.PropertyChangedEventHandler(this.OnPropertyChanged);
              EditorManager.SceneChanged += new SceneChangedEventHandler(this.OnSceneChanged);
              EditorScene.ShapeChanged += new ShapeChangedEventHandler(this.OnShapeChanged);
              EditorScene.LayerChanged += new LayerChangedEventHandler(this.OnLayerChanged);
              EditorScene.ZoneChanged += new ZoneChangedEventHandler(EditorScene_ZoneChanged);
              propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyGrid_PropertyValueChanged);

              EditorManager.ShapeSelectionChanged += new ShapeSelectionChangedEventHandler(OnSelectionChanged);

              UpdateHelpPanel();
        }
Exemple #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ShapeCreatorPanel(DockingContainer container)
            : base(container)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Add help button
            _helpbutton           = new ToolStripHelpButton(Text);
            _helpbutton.Alignment = ToolStripItemAlignment.Right;
            toolStrip.Items.Insert(0, _helpbutton);


            label_Description.Text = null;

            IProject.NewProjectLoaded            += new EventHandler(IProject_NewProjectLoaded);
            IProject.ProjectUnloaded             += new EventHandler(IProject_ProjectUnloaded);
            PrefabDesc.OnPrefabSaved             += new EventHandler(PrefabDesc_OnPrefabSaved);
            PrefabDesc.OnPrefabPropertiesChanged += new EventHandler(PrefabDesc_OnPrefabPropertiesChanged);
            treeView_Creators.ImageList           = TreeViewImages.ImageList;

            // Incremental search
            searchPanel.FilterChanged += new EventHandler(searchPanel_FilterChanged);

            // Used for UI updates in case the prefab directory changes (to update view of available prefabs)
            EditorManager.EditorSettingsChanged += new EditorSettingsChangedEventHandler(EditorManager_EditorSettingsChanged);

            // UI updates of ShapeCreatorPanel can be triggered from the EditorManager.GUI as desired (e.g. when ShapeCreators
            // have been added in custom plugins from e.g. some scene callback and they should be available in the list)
            EditorManager.GUI.ShapeCreatorUpdateRequest += new EventHandler(EditorManager_GUI_ShapeCreatorUpdateRequest);
        }
Exemple #6
0
        /// <summary>
        /// Set the height of a form docked: top or bottom or fill
        /// </summary>
        /// <param name="info">info identifing the form</param>
        /// <param name="newHeight">new height value</param>
        public void SetHeight(DockableFormInfo info, int newHeight)
        {
            int delta = newHeight - info.DockableForm.Height;

            if (delta == 0)
            {
                return;
            }

            DockingContainer container = HierarchyUtility.GetClosestDockableContainer(info.DockableForm);

            List <DockingContainer> hierarchy = new List <DockingContainer>();
            List <int> modifiers = new List <int>();

            hierarchy.Add(container);
            modifiers.Add(delta);

            DockingContainer containerParent = container.Parent as DockingContainer;

            while (containerParent != null)
            {
                hierarchy.Add(containerParent);
                modifiers.Add(containerParent.Height - container.Height + delta);

                container       = containerParent;
                containerParent = containerParent.Parent as DockingContainer;
            }

            for (int index = hierarchy.Count - 1; index >= 0; index--)
            {
                hierarchy[index].Height += modifiers[index];
            }
        }
Exemple #7
0
        /// <summary>
        /// Add sorted floating containers to the list
        /// </summary>
        /// <param name="containers">containers</param>
        private void AddSortedFloatingContainers(List <DockingContainer> containers)
        {
            List <DockingContainer> containersToBringInFront = new List <DockingContainer>();

            foreach (DockableFormInfo info in _dockableForms)
            {
                FormsTabbedView view = HierarchyUtility.GetTabbedView(info.DockableForm);
                if (view.IsDocked)
                {
                    continue;
                }

                DockingContainer container = HierarchyUtility.GetClosestDockableContainer(info.DockableForm);
                if (_host.Contains(container) == false)
                {
                    continue;
                }

                if (containersToBringInFront.Contains(container) == false)
                {
                    containersToBringInFront.Add(container);
                }
            }

            SortContainersBasedOnTheirZOrder(containersToBringInFront);

            containers.AddRange(containersToBringInFront);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ScriptListPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

              EditorScene.LayerChanged += new LayerChangedEventHandler(EditorScene_LayerChanged);
              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);
              listView1.MouseDoubleClick += new MouseEventHandler(_listBox_MouseDoubleClick);
        }
Exemple #9
0
        /// <summary>
        /// Remove the form
        /// </summary>
        /// <param name="info">info about form to remove</param>
        public void Remove(DockableFormInfo info)
        {
            if (info == null)
            {
                return;
            }

            FormsTabbedView view = HierarchyUtility.GetTabbedView(info.DockableForm);

            if (view != null)
            {
                if (view.Count == 1 && view.IsDocked)
                {
                    _layout.Undock(view);
                }

                if (view.Count == 1)
                {
                    _host.Remove(view.Parent);

                    DockingContainer container = HierarchyUtility.GetClosestDockableContainer(info.DockableForm);
                    container.SetModeEmpty();

                    view.Remove(info);
                }
                else
                {
                    if (view.Remove(info) == false)
                    {
                        if (SelectedFormInfo == info)
                        {
                            SelectedFormInfo = null;
                        }

                        return;
                    }
                }
            }

            if (SelectedFormInfo == info)
            {
                SelectedFormInfo = null;
            }

            _dockableForms.Remove(info);
            info.SelectedChanged   -= OnFormSelectedChanged;
            info.ShowAutoPanel     -= OnShowFormAutoPanel;
            info.ExplicitDisposing -= OnInfoDisposing;

            if (info.IsAutoHideMode)
            {
                _autohide.ArrangeAutoButtonsPanels();
            }

            info.Dispose();
        }
Exemple #10
0
        /// <summary>
        /// Move a window using mouse
        /// </summary>
        public void MoveWindowByMouse()
        {
            if (_movedWindow == null)
            {
                return;
            }

            DockAllowed      allowedDock         = _allowedDock;
            Point            screenLocation      = Control.MousePosition;
            DockingContainer containerUnderMouse = GetContainerUnderMouse(screenLocation);

            Rectangle fillRectangle = FormWrapper.GetFillRectangleFromPoint(screenLocation, containerUnderMouse, _host);

            if (fillRectangle.IsEmpty)
            {
                _guider.HideCenterGuider();
            }
            else
            {
                if (containerUnderMouse == null)
                {
                    _guider.ShowCenterGuider(allowedDock, fillRectangle);
                }
                else
                {
                    allowedDock = DockAllowed.All;
                    _guider.ShowCenterGuider(allowedDock, fillRectangle);
                }
            }


            GuidedDockResult result = _guider.GetDockResult(allowedDock, screenLocation);

            if (result.DockMode == DockableMode.Outer && result.Dock != DockStyle.None)
            {
                Rectangle bounds = OuterDockPreviewEngine.GetPreviewBounds(result.Dock, _host, _movedWindow);
                _guider.ShowPreviewPanel(bounds);
            }
            else if (result.DockMode == DockableMode.Inner && result.Dock != DockStyle.None)
            {
                Rectangle freeBounds = FormWrapper.GetFillScreenRectangle(_host);
                Rectangle bounds     = InnerDockPreviewEngine.GetPreviewBounds(result.Dock, _movedWindow, containerUnderMouse, freeBounds);
                if (bounds.IsEmpty)
                {
                    _guider.HidePreviewPanel();
                }
                else
                {
                    _guider.ShowPreviewPanel(bounds);
                }
            }
            else
            {
                _guider.HidePreviewPanel();
            }
        }
        public ResourceViewerPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

              // show auto thumbnail button to enable auto thumbnail feature
              resourceMasterPanel.ShowAutoThumbnailButton();

              EditorManager.SceneClosing += new CancelEventHandler(EditorManager_SceneClosing);
        }
Exemple #12
0
        /// <summary>
        /// On begin move a positioner using the mouse
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event arguments</param>
        private void OnPositionerBeginMoveByMouse(object sender, ControlEventArgs e)
        {
            DockingContainer container = (DockingContainer)e.Control;

            if (container.SingleChild == null)
            {
                return;
            }

            _guider.BeginWindowMovement(container, container.SingleChild.AllowedDock);
        }
Exemple #13
0
        /// <summary>
        /// Dock a form previously added to guider over another form previously added to guider
        /// </summary>
        /// <param name="info">info about the form to dock</param>
        /// <param name="infoOver">info about form over which to dock</param>
        /// <param name="dock">how to dock</param>
        /// <param name="mode">were to dock</param>
        public void DockOver(DockableFormInfo info, DockableFormInfo infoOver, DockStyle dock, DockableMode mode)
        {
            DockingContainer containerToDock      = HierarchyUtility.GetClosestDockableContainer(info.DockableForm);
            DockingContainer containerWhereToDock = null;

            if (infoOver != null)
            {
                containerWhereToDock = HierarchyUtility.GetClosestDockableContainer(infoOver.DockableForm);
            }

            _layout.DockControl(containerToDock, containerWhereToDock, dock, mode);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ShapeTreePanel(DockingContainer container)
            : base(container)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

              // Add help buttons
              _helpbuttonShapes = new ToolStripHelpButton("Shapes Panel");
              toolStrip_Shapes.Items.Add(_helpbuttonShapes);
              _helpbuttonLayers = new ToolStripHelpButton("Layer Panel");
              toolStrip1.Items.Add(_helpbuttonLayers);

              //check if in design mode. visual studio 2010 can crash when you try to call any static functions or members from EditorManager when in design mode
              if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
              {
            // set specific image lists
            shapeTreeView.ImageList = EditorManager.GUI.ShapeTreeImages.ImageList;

            EditorManager.SceneChanged += new SceneChangedEventHandler(shapeTreeView.OnSceneChanged);
            EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);

            EditorScene.ShapeChanged += new ShapeChangedEventHandler(shapeTreeView.OnShapeChanged);
            EditorScene.LayerChanged += new LayerChangedEventHandler(shapeTreeView.OnLayerChanged);
            EditorScene.LayerChanged += new LayerChangedEventHandler(EditorScene_LayerChanged);

            EditorManager.SceneEvent += new SceneEventHandler(EditorManager_SceneEvent);

            //EditorScene.LayerChanged += new LayerChangedEventHandler(layerListView.OnLayerChanged);
            //EditorManager.SceneChanged += new SceneChangedEventHandler(layerListView.OnSceneChanged);

            CSharpFramework.Layer.ActiveShapeChanged += new CSharpFramework.Layer.ActiveShapeChangedEventHandler(Layer_ActiveShapeChanged);
            shapeTreeView.NodeStateChanged += new CSharpFramework.TreeViewMS.NodeStateChangedEventHandlers(shapeTreeView_NodeStateChanged);

            // make these two context menus available in the control
            treeView_Layers.ContextMenu_Layers = this.contextMenuStrip_Layer;
            treeView_Layers.ContextMenu_Zones = this.contextMenuStrip_Zones;
            treeView_Layers.OnSelectionChanged += new EventHandler(treeView_Layers_OnSelectionChanged);
            UpdateLayerToolbar();
            UpdatedLayerInfoPanelVisible = false;

            // associate drop-to-floor directions
            directionPosXToolStripMenuItem.Tag = Vector3F.XAxis;
            directionNegXToolStripMenuItem.Tag = -Vector3F.XAxis;
            directionPosYToolStripMenuItem.Tag = Vector3F.YAxis;
            directionNegYToolStripMenuItem.Tag = -Vector3F.YAxis;
            directionCeilingToolStripMenuItem.Tag = Vector3F.ZAxis;
            directionFloorToolStripMenuItem.Tag = -Vector3F.ZAxis;

            // Incremental search
            searchPanel.FilterChanged += new EventHandler(searchPanel_FilterChanged);
              }
        }
Exemple #15
0
        public ResourceViewerPanel(DockingContainer container) : base(container)
        {
            InitializeComponent();

            // Add help button
            _helpbutton = new ToolStripHelpButton(Text);
            resourceMasterPanel.ToolStrip.Items.Add(_helpbutton);

            // show auto thumbnail button to enable auto thumbnail feature
            resourceMasterPanel.ShowAutoThumbnailButton();

            EditorManager.SceneClosing += new CancelEventHandler(EditorManager_SceneClosing);
        }
        public ResourceViewerPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

              // show auto thumbnail button to enable auto thumbnail feature
              resourceMasterPanel.ShowAutoThumbnailButton();

              EditorManager.SceneClosing += new CancelEventHandler(EditorManager_SceneClosing);

            #if !HK_DEBUG
              this.TabText += " (More information available in Dev or Debug builds)";
            #endif
        }
        public HavokAiPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

            EditorManager.Actions.ActionEvent      += Actions_ActionEvent;
            EditorManager.SceneEvent               += EditorManager_SceneEvent;
            EditorManager.SceneChanged             += EditorManager_SceneChanged;
            EditorManager.CustomSceneSerialization += EditorManager_CustomSceneSerialization;

            m_imageList.ImageList.ImageSize = new System.Drawing.Size(16, 16);
            m_imageList.AddBitmap(Path.Combine(EditorManager.AppDataDir, @"bitmaps\Shapes\shapes_navmeshlocalsettings.png"), Color.Magenta); // use local settings icon for now.
            this.GlobalSettings_ListView.SmallImageList = m_imageList.ImageList;
        }
Exemple #18
0
        /// <summary>
        /// Constructor
        /// </summary>
        public UndoHistoryPanel(DockingContainer container) : base(container)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Check if in design mode. visual studio 2010 can crash when you try to
            // call any static functions or members from EditorManager when in design mode.
            if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
            {
                this.actionHistoryView.SetStack(EditorManager.Actions);
            }
        }
        public ResourceViewerPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

              // Add help button
              _helpbutton = new ToolStripHelpButton(Text);
              resourceMasterPanel.ToolStrip.Items.Add(_helpbutton);

              // show auto thumbnail button to enable auto thumbnail feature
              resourceMasterPanel.ShowAutoThumbnailButton();

              EditorManager.SceneClosing += new CancelEventHandler(EditorManager_SceneClosing);
        }
Exemple #20
0
        /// <summary>
        /// Get the count of visible children
        /// </summary>
        /// <param name="container">container</param>
        /// <returns>count of visible children</returns>
        private static int GetVisibleChildrenCount(DockingContainer container)
        {
            int count = 0;

            foreach (Control control in container.Controls)
            {
                if (control.Visible)
                {
                    count++;
                }
            }

            return(count);
        }
Exemple #21
0
        /// <summary>
        /// On apply dock
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event arguments</param>
        private void OnApplyDock(object sender, DockControlEventArgs e)
        {
            Point screenPoint = Control.MousePosition;

            DockingContainer containerToDock      = (DockingContainer)e.Control;
            DockingContainer containerWhereToDock = null;

            if (e.DockMode == DockableMode.Inner)
            {
                containerWhereToDock = _guider.GetLeafDockedContainerFromPoint(screenPoint, e.Control);
            }

            _layout.DockControl(containerToDock, containerWhereToDock, e.Dock, e.DockMode);
        }
        public HavokPhysicsPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();
              SetupCollisionDataGridView();

              GetHavokPhysicsParams();
              GetWorldRuntimeCollisionParams();
              UpdateStatus();

              EditorManager.EditorModeChanged += new EditorModeChangedEventHandler(EditorManager_EditorModeChanged);
              EditorManager.CustomSceneSerialization += new CustomSceneSerializationEventHandler(EditorManager_CustomSceneSerialization);
              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);
              IScene.LayerChanged += new LayerChangedEventHandler(IScene_LayerChanged);
        }
        public ScenePropertiesPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

              // Initialize the control fields
              InitRestrictions();
              UpdateControlFromData();

              // Listen to changes of the editing controls
              difficultyTrackbar.ValueChanged += new EventHandler(UpdateDataFromControl);
              respawnTimeUpDown.ValueChanged  += new EventHandler(UpdateDataFromControl);
              respawnRateUpDown.ValueChanged  += new EventHandler(UpdateDataFromControl);
              descriptionBox.TextChanged      += new EventHandler(UpdateDataFromControl);
        }
Exemple #24
0
        public HavokPhysicsPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();
            SetupCollisionDataGridView();

            GetHavokPhysicsParams();
            GetWorldRuntimeCollisionParams();
            UpdateStatus();

            EditorManager.EditorModeChanged        += new EditorModeChangedEventHandler(EditorManager_EditorModeChanged);
            EditorManager.CustomSceneSerialization += new CustomSceneSerializationEventHandler(EditorManager_CustomSceneSerialization);
            EditorManager.SceneChanged             += new SceneChangedEventHandler(EditorManager_SceneChanged);
            IScene.LayerChanged += new LayerChangedEventHandler(IScene_LayerChanged);
        }
Exemple #25
0
        public ScenePropertiesPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

            // Initialize the control fields
            InitRestrictions();
            UpdateControlFromData();

            // Listen to changes of the editing controls
            difficultyTrackbar.ValueChanged += new EventHandler(UpdateDataFromControl);
            respawnTimeUpDown.ValueChanged  += new EventHandler(UpdateDataFromControl);
            respawnRateUpDown.ValueChanged  += new EventHandler(UpdateDataFromControl);
            descriptionBox.TextChanged      += new EventHandler(UpdateDataFromControl);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public UndoHistoryPanel(DockingContainer container)
            : base(container)
        {
            //
            // Required for Windows Form Designer support
            //
              InitializeComponent();

              // Check if in design mode. visual studio 2010 can crash when you try to
              // call any static functions or members from EditorManager when in design mode.
              if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
              {
            this.actionHistoryView.SetStack(EditorManager.Actions);
              }
        }
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="container"></param>
        public DragAndDropPanel(DockingContainer container)
            : base(container)
        {
            Text = "Meshes And Models";
              TabText = "Meshes And Models";

              InitializeComponent();

              // register event handlers
              listViewEntities.ItemDrag += new ItemDragEventHandler(listViewEntities_ItemDrag);
              listViewEntities.ItemMouseHover += new ListViewItemMouseHoverEventHandler(listViewEntities_ItemMouseHover);

              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);

              toolStripButtonMeshes.Checked = true;
              toolStripButtonModels.Checked = true;

              UpdateStatus();
        }
Exemple #28
0
        /// <summary>
        /// Gets the child leaf window found at given screen location
        /// </summary>
        /// <param name="screenPoint">point in screen coordinates</param>
        /// <param name="ignored">control to be ignored from search</param>
        /// <returns>found dockable container</returns>
        public DockingContainer GetLeafDockedContainerFromPoint(Point screenPoint, Control ignored)
        {
            for (int childIndex = 0; childIndex < ControlsCount; childIndex++)
            {
                Control child = GetControlAt(childIndex);

                if (child == ignored)
                {
                    continue;
                }

                if (child.Visible == false)
                {
                    continue;
                }

                DockingContainer container = child as DockingContainer;
                if (container == null)
                {
                    continue;
                }

                if (container.RectangleToScreen(container.ClientRectangle).Contains(screenPoint) == false)
                {
                    continue;
                }

                if (container.SingleChild != null)
                {
                    if (container.SingleChild.IsDocked == false)
                    {
                        continue;
                    }

                    return(container);
                }

                return(GetLeafDockedContainerFromPoint(container, screenPoint));
            }

            return(null);
        }
        public HavokPhysicsPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();
              SetupCollisionDataGridView();

              GetHavokPhysicsParams();
              GetWorldRuntimeCollisionParams();
              UpdateStatus();

              // Add help button
              _helpbutton = new ToolStripHelpButton(Text);
              ToolStrip.Items.Add(_helpbutton);

              EditorManager.EditorModeChanged += new EditorModeChangedEventHandler(EditorManager_EditorModeChanged);
              EditorManager.CustomSceneSerialization += new CustomSceneSerializationEventHandler(EditorManager_CustomSceneSerialization);
              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);
              IScene.LayerChanged += new LayerChangedEventHandler(IScene_LayerChanged);
              EditorManager.EditorSettingsChanged += EditorManager_EditorSettingsChanged;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public InteractiveHelpPanel(DockingContainer container)
            : base(container)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

              // initialize the iHelp System (but not in the design mode)
              if (!EditorManager.DesignMode)
              {
            interactiveHelpControl1.RootApplicationHelpPath = Path.Combine(EditorManager.AppDataDir, @"help\");
            interactiveHelpControl1.CurrentApplicationHelpPath = Path.Combine(EditorManager.AppDataDir, @"help\");
            interactiveHelpControl1.PageNotFoundUrl = Path.Combine(EditorManager.AppDataDir, @"help\PageNotFound.html");
            interactiveHelpControl1.DefaultErrorUrl = Path.Combine(EditorManager.AppDataDir, @"DefaultError.html");
            interactiveHelpControl1.OpenApplicationHelpPage("index");
            interactiveHelpControl1.ScriptObject = new VForgeScriptableObject();
            interactiveHelpControl1.Reload();
            EditorManager.IHelpSystem = interactiveHelpControl1;
              }
        }
        public HavokAiPanel(DockingContainer container)
            : base(container)
        {
            InitializeComponent();

              EditorManager.Actions.ActionEvent += Actions_ActionEvent;
              EditorManager.SceneEvent += EditorManager_SceneEvent;
              EditorManager.SceneChanged += EditorManager_SceneChanged;
              EditorManager.CustomSceneSerialization += EditorManager_CustomSceneSerialization;

              m_imageList.ImageList.ImageSize = new System.Drawing.Size(16, 16);
              m_imageList.AddBitmap(Path.Combine(EditorManager.AppDataDir, @"bitmaps\Shapes\shapes_navmeshlocalsettings.png"), Color.Magenta);  // use local settings icon for now.
              this.GlobalSettings_ListView.SmallImageList = m_imageList.ImageList;
        }
        public TerrainEditorPanel(DockingContainer container)
            : base(container)
        {
            // actually this has to be done here
              this.brushListCtrl1 = new TerrainEditorPlugin.Controls.BrushListCtrl();
              this.brushListCtrl1.Dock = System.Windows.Forms.DockStyle.Top;
              this.brushListCtrl1.Location = new System.Drawing.Point(0, 254);
              this.brushListCtrl1.Name = "brushListCtrl1";
              this.brushListCtrl1.Size = new System.Drawing.Size(444, 400);
              this.brushListCtrl1.TabIndex = 1;
              //this.Controls.Add(this.brushListCtrl1);

              InitializeComponent();

              UpdatePanelStatus();
              UpdateHeightmapPanel();

              this.listView_DetailTextures.SmallImageList = _detailTexturesImageList.ImageList;
              _heightmapCursor = _heightmapCursor_Elevate;

              // add listeners
              EditorManager.SceneEvent += new SceneEventHandler(EditorManager_SceneEvent);
              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);
              IScene.LayerChanged += new LayerChangedEventHandler(IScene_LayerChanged);
              TerrainEditor.OnTerrainChanged += new EventHandler(TerrainEditor_OnTerrainChanged);
              TerrainEditor.OnHeightmapEditModeChanged += new EventHandler(TerrainEditor_OnHeightmapEditModeChanged);
              TerrainEditor.OnCurrentDecorationModelChanged += new EventHandler(TerrainEditor_OnCurrentDecorationModelChanged);
              TerrainEditor.OnDecorationModelListChanged += new EventHandler(TerrainEditor_OnDecorationModelListChanged);
              TerrainEditor.OnDecorationDirtyRegionChanged += new EventHandler(TerrainEditor_OnDecorationDirtyRegionChanged);
              TerrainEditor.OnCurrentDetailTextureChanged += new EventHandler(TerrainEditor_OnCurrentDetailTextureChanged);
              TerrainEditor.OnDetailTextureListChanged += new DetailTextureListChangedEventHandler(TerrainEditor_OnDetailTextureListChanged);
              TerrainEditor.OnTextureBakedViewChanged += new EventHandler(TerrainEditor_OnTextureBakedViewChanged);
              TerrainEditor.OnDirectionalLightingChanged += new EventHandler(TerrainEditor_OnDirectionalLightingChanged);
              TerrainEditor.OnMiniMapStatusChanged += new EventHandler(TerrainEditor_OnMiniMapStatusChanged);
              TerrainEditor.OnPreviewFullResolutionStatusChanged += new EventHandler(TerrainEditor_OnPreviewFullResolutionStatusChanged);
              TerrainEditor.OnHeightmapExportFilenameChanged += new EventHandler(TerrainEditor_OnHeightmapExportFilenameChanged);
              DetailTextureResource.OnDetailTextureResourcePropertyChanged += new DetailTextureResourcePropertyChangedEventHandler(DetailTextureResource_OnDetailTextureResourcePropertyChanged);
              DecorationModelResource.OnDecorationModelResourcePropertyChanged += new EventHandler(DecorationModelResource_OnDecorationModelResourcePropertyChanged);
              VisionViewBase.MouseContextChanged += new CSharpFramework.Contexts.ContextChangedEventHandler(VisionViewBase_MouseContextChanged);
              TextureAtlas.OnAtlasFileSaved += new EventHandler(TextureAtlas_OnAtlasFileSaved);
              ShapeComponent.OnUIUpdateBegin += new EventHandler(ShapeComponent_OnUIUpdateBegin);
              ShapeComponent.OnUIUpdateFinished += new EventHandler(ShapeComponent_OnUIUpdateFinished);
              EditorManager.CustomSceneSerialization += new CustomSceneSerializationEventHandler(EditorManager_CustomSceneSerialization);
              brushListCtrl1.Dock = DockStyle.Fill;
              brushListCtrl1.AutoSize = true;

              EditorManager.GUI.RecordableControls.Add("Terrain Editor: Toggle baked mode", toolStripButton_TextureBaked);

              this.splitContainer1.Panel2.Controls.Add(brushListCtrl1);
        }
Exemple #33
0
        /// <summary>
        /// Constructor
        /// </summary>
        public EnginePanel(DockingContainer container)
            : base(container)
        {
            // This call is required by the Windows.Forms Form Designer.
              InitializeComponent();
              _helpbutton = new ToolStripHelpButton(Text);
              toolStrip_EnginePanel.Items.Add(_helpbutton);

              // I put this into a separate function because VS messed it up too often!
              this.visionView = new ManagedFramework.VisionView();
              GizmoBase.GizmoChanged += new ShapeDragModeEventHandler(View.OnGizmoChanged);

              this.visionView.BackColor = System.Drawing.Color.DarkGray;
              this.visionView.CurrentContext = null;
              this.visionView.Dirty = true;
              this.visionView.Location = new System.Drawing.Point(0, 0);
              this.visionView.Name = "visionView";
              this.visionView.Size = new System.Drawing.Size(640, 480);
              this.visionView.TabIndex = 9;
              this.visionView.Dock = DockStyle.Fill;
              this.visionView.AllowDrop = true; // shape creators

              DockHandler.AllowRedocking = true;

              this.panel_VisionView.Controls.Add(this.visionView);

              // register vision view listeners
              EditorManager.SceneChanged += new SceneChangedEventHandler(visionView.OnSceneChanged);
              EditorScene.ShapeChanged += new ShapeChangedEventHandler(visionView.OnShapeChanged);
              EditorScene.PropertyChanged += new CSharpFramework.PropertyChangedEventHandler(visionView.OnPropertyChanged);
              EditorScene.LayerChanged += new LayerChangedEventHandler(EditorScene_LayerChanged);
              EditorManager.EditorModeChanged += new EditorModeChangedEventHandler(EditorManager_EditorModeChanged);
              VisionViewBase.MouseContextChanged += new ContextChangedEventHandler(this.OnMouseContextChanged);
              GizmoBase.GizmoChanged += new ShapeDragModeEventHandler(this.OnGizmoChanged);
              EditorManager.SceneChanged += new SceneChangedEventHandler(EditorManager_SceneChanged);
              EditorManager.SceneEvent += new SceneEventHandler(enginePanel_SceneEvent);
              ViewIconSettings.OnViewIconSettingsChanged += new EventHandler(ViewIconSettings_OnViewIconSettingsChanged);
              EditorApp.ActiveView = visionView;

              // register gizmo listeners
              EditorScene.ShapeChanged += new ShapeChangedEventHandler(visionView.Gizmo.OnShapeChanged);
              EditorScene.PropertyChanged += new CSharpFramework.PropertyChangedEventHandler(visionView.Gizmo.OnPropertyChanged);
              EditorScene.PropertyChanged += new CSharpFramework.PropertyChangedEventHandler(this.OnPropertyChanged);
              EditorScene.LayerChanged += new CSharpFramework.LayerChangedEventHandler(visionView.Gizmo.OnLayerChanged);
              EditorManager.SceneChanged += new CSharpFramework.SceneChangedEventHandler(visionView.Gizmo.OnSceneChanged);
              EditorManager.ShapeSelectionChanged += new ShapeSelectionChangedEventHandler(visionView.Gizmo.OnSelectionChanged);
              EditorManager.ShapeSelectionChanged += new ShapeSelectionChangedEventHandler(EditorManager_ShapeSelectionChanged);
              //EditorScene.V3DChanged += new V3DChangedEventHandler(visionView.Gizmo.OnV3DChanged);
              VisionViewBase.ProjectionModeChanged += new EventHandler(VisionViewBase_ProjectionModeChanged);
              // set the default move context
              visionView.SetDefaultContext();
              visionView.Gizmo.DragMode = ShapeDragMode.MOVE;

              // setup the context menus
              // the item's implementation is in this class because the View doesn't know about actions
              visionView.ContextMenu_SelShapes = contextMenuStrip_SelShapes;
              visionView.ContextMenu_View = contextMenuStrip_View;

              // register some shortcuts
              ShortCutConfig shortcuts = EditorManager.ShortCuts;
              shortcuts.Add(new MenuItemShortCut(pasteAtCursorToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(showGridToolStripMenuItem, Keys.G));
              shortcuts.Add(new MenuItemShortCut(toolStripButton_EnableMoveSnap, Keys.None));
              shortcuts.Add(new MenuItemShortCut(toolStripButton_EnableAngleSnap, Keys.None));
              shortcuts.Add(new MenuItemShortCut(solidToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(wireframeToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(sceneOriginToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(cameraPositionToolStripMenuItem1, Keys.None));
              shortcuts.Add(new MenuItemShortCut(traceHitToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_View_Properties, Keys.None));
              shortcuts.Add(new MenuItemShortCut(cameraPositionToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(shapeOriginToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(pivotToolStripMenuItem, Keys.None)); // drop to floor
              shortcuts.Add(new MenuItemShortCut(boundingBoxToolStripMenuItem, Keys.None)); // drop to floor
              shortcuts.Add(new MenuItemShortCut(bottomCenterToolStripMenuItem, Keys.None)); // drop to floor
              shortcuts.Add(new MenuItemShortCut(selectInTreeViewToolStripMenuItem, Keys.Control | Keys.T));
              shortcuts.Add(new MenuItemShortCut(Profiling_Next, Keys.None));
              shortcuts.Add(new MenuItemShortCut(Profiling_Previous, Keys.None));

              shortcuts.Add(new MenuItemShortCut(directionPosXToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(directionNegXToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(directionPosYToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(directionNegYToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(directionCeilingToolStripMenuItem, Keys.None));
              shortcuts.Add(new MenuItemShortCut(directionFloorToolStripMenuItem, Keys.None));

              // Register some tool strip shortcuts
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_Perspective, Keys.Alt | Keys.Control | Keys.P));
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_PerspectiveTop, Keys.Control | Keys.Shift | Keys.T));
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_PerspectiveFront, Keys.Control | Keys.Shift | Keys.F));
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_PerspectiveRight, Keys.Control | Keys.Shift | Keys.R));

              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_Top, Keys.Alt | Keys.Control | Keys.T));
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_Front, Keys.Alt | Keys.Control | Keys.F));
              shortcuts.Add(new MenuItemShortCut(ToolStripMenuItem_Right, Keys.Alt | Keys.Control | Keys.R));
              shortcuts.Add(new ToolStripSplitButtonShortCut(ToolStripButton_ZoomFit, Keys.F));
              shortcuts.Add(new ToolStripItemShortCut(ToolStripButton_IsolateSelection, Keys.I));

              shortcuts.Add(new ToolStripSplitButtonShortCut(ToolStripSplitButton_MoveSensitivity, Keys.Alt | Keys.Control | Keys.U));

              // Alignment shortcuts
              shortcuts.Add(new MenuItemShortCut(AlignToGridToolStripMenuItem, Keys.Alt | Keys.Control | Keys.G));
              shortcuts.Add(new MenuItemShortCut(AlignToObjectToolStripMenuItem, Keys.Alt | Keys.Control | Keys.O));
              shortcuts.Add(new MenuItemShortCut(AlignToHitPointToolStripMenuItem, Keys.Alt | Keys.Control | Keys.H));
              shortcuts.Add(new MenuItemShortCut(AlignToHitPointNormalToolStripMenuItem, Keys.Alt | Keys.Control | Keys.N));

              // associate drop-to-floor directions
              directionPosXToolStripMenuItem.Tag = Vector3F.XAxis;
              directionNegXToolStripMenuItem.Tag = -Vector3F.XAxis;
              directionPosYToolStripMenuItem.Tag = Vector3F.YAxis;
              directionNegYToolStripMenuItem.Tag = -Vector3F.YAxis;
              directionCeilingToolStripMenuItem.Tag = Vector3F.ZAxis;
              directionFloorToolStripMenuItem.Tag = -Vector3F.ZAxis;

              // get the drop down and cache for changing playmode
              _play_Dropdown = toolStripDropDownButton_PlayMode.DropDown;

              this.toolStripButton_MoveCameraWithKeys.Checked = EditorManager.Settings.MoveCameraWithKeys; //use settings from EditorSettingsBase

              if (!DesignMode)
              {
            this.SetMoveSensitivity(EditorManager.Settings.MoveSensitivity);
              }
              UpdateToolbarStatus();
        }
Exemple #34
0
 public SimplePanel(DockingContainer container)
     : base(container)
 {
     InitializeComponent();
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="container"></param>
 public VisionScriptPanel(DockingContainer container)
     : base(container)
 {
     EditorManager.ShapeSelectionChanged += new ShapeSelectionChangedEventHandler(EditorManager_ShapeSelectionChanged);
 }