/// <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); }
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(); // 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); #if !HK_DEBUG this.TabText += " (More information available in Dev or Debug builds)"; #endif }
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; }
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; IScene.PropertyChanged += IScene_PropertyChanged; }
/// <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(); }
/// <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); //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; } }
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(); // Add help buttons _helpbuttonShapes = new ToolStripHelpButton(Text); toolStrip_Main.Items.Add(_helpbuttonShapes); 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); }