private void ViewLog_Click(object sender, System.EventArgs e) { // Log Content logWindow = DockingManager.Contents.Add(new ChildWindows.Log(), "Log", new ImageList(), -1); DockingManager.AddContentWithState(logWindow, State.DockBottom); }
public GameClientForm( ) { InitializeComponent( ); // Write greeting AppLog.Info( "Beginning {0} at {1}", Assembly.GetCallingAssembly( ), DateTime.Now ); AppLog.GetSource( Severity.Info ).WriteEnvironment( ); // Create the docking manager m_DockingManager = new DockingManager( this, VisualStyle.IDE ); m_DockingManager.InnerControl = gameDisplay; m_DockingManager.OuterControl = this; ProfileViewer profileViewer1 = new ProfileViewer( ); profileViewer1.RootSection = GameProfiles.Game; m_ProfileViewer1Content = m_DockingManager.Contents.Add( profileViewer1, "Profile Viewer 1" ); m_DockingManager.AddContentWithState( m_ProfileViewer1Content, State.Floating ); m_DockingManager.HideContent( m_ProfileViewer1Content ); ProfileViewer profileViewer2 = new ProfileViewer( ); profileViewer2.RootSection = GameProfiles.Game; m_ProfileViewer2Content = m_DockingManager.Contents.Add( profileViewer2, "Profile Viewer 2" ); m_DockingManager.AddContentWithState( m_ProfileViewer2Content, State.Floating ); m_DockingManager.HideContent( m_ProfileViewer2Content ); PropertyGrid debugInfoProperties = CreateDebugInfoPropertyGrid( ); m_DebugInfoContent = m_DockingManager.Contents.Add(debugInfoProperties, "Debug Info"); m_DockingManager.AddContentWithState( m_DebugInfoContent, State.Floating ); m_DockingManager.HideContent( m_DebugInfoContent ); m_LogDisplayContent = m_DockingManager.Contents.Add( m_LogDisplay, "Log" ); m_DockingManager.AddContentWithState( m_LogDisplayContent, State.DockBottom ); if ( File.Exists( m_ClientSetupFile ) ) { m_DockingManager.LoadConfigFromFile( m_ClientSetupFile ); } }
public MainForm( ) { InitializeComponent( ); psDisplay.OnBeginRender += psDisplay_OnBeginPaint; // Create the docking manager m_DockingManager = new DockingManager( this, VisualStyle.IDE ); m_DockingManager.InnerControl = psDisplay; m_DockingManager.OuterControl = this; IParticleSystem ps = new ParticleSystem( ); m_ParticleSystems.Add( new ParticleSystemEmitter( ps ) ); // BuilderControl psBuilder = new BuilderControl( ); ParticleSystemEditor psBuilder = new ParticleSystemEditor( ); psBuilder.ParticleSystem = ps; Content psBuilderContent = m_DockingManager.Contents.Add( psBuilder, "Particle System Builder" ); m_DockingManager.AddContentWithState( psBuilderContent, State.DockLeft ); RenderControl renderControl = new RenderControl( m_Method ); Content renderControlContent = m_DockingManager.Contents.Add( renderControl, "Rendering" ); m_DockingManager.AddContentWithState( renderControlContent, State.Floating ); }
public MainForm() { InitializeComponent(); //////////////////////////////////////////////////////////////////////////////////////////// // Open File Data and Program Database //////////////////////////////////////////////////////////////////////////////////////////// dat_conn = DatabaseConnection.getInstance(); ///////////////////////////////////////////////////////////////////////////////////////////// // MainTree and Table Tabpage ///////////////////////////////////////////////////////////////////////////////////////////// //docking _manager = new DockingManager(this, VisualStyle.IDE); // Create Content which contains a RichTextBox c = _manager.Contents.Add(new TreeForm(), "tree menu"); _manager.AddContentWithState(c, State.DockLeft); //////////////////////////////////////////////////////////////////////////////////////////// // Main WorkSpace - Show main working window - display model graphics //////////////////////////////////////////////////////////////////////////////////////////// // ShowModelGraphicWindow(); }
private void AddDocking() { _dockingManager = new DockingManager(this, VisualStyle.IDE); _dockingManager.InnerControl = pnlBody; _dockingManager.OuterControl = tBarMain; Content ouBar = new Content(_dockingManager); _dockingManager.Contents.Add(ouBar); ouBar.Title = "Navigation"; ouBar.FullTitle = "Navigation"; ouBar.CaptionBar = true; ouBar.CloseButton = false; ouBar.DisplaySize = new Size(100, 410); ouBar.Control = pnlNavBar; ouBar.ImageList = imlMain; ouBar.ImageIndex = 3; _dockingManager.ShowContent(_dockingManager.Contents["Navigation"]); _dockingManager.AddContentWithState(ouBar, State.DockLeft); }
protected virtual void InitializeDockingControls( ) { // Create the docking manager m_DockingManager = new DockingManager( this, VisualStyle.IDE ); m_DockingManager.InnerControl = display; m_DockingManager.OuterControl = statusStrip; // Add log, property editor, and edit mode controls to the docking manager m_LogDisplayContent = m_DockingManager.Contents.Add( m_LogDisplay, "Log" ); m_PropertyEditorContent = m_DockingManager.Contents.Add( new ObjectPropertyEditor( ), "Property Editor" ); m_SelectionContent = m_DockingManager.Contents.Add( new SelectionControl( ), "Selection" ); m_DockingManager.AddContentWithState( m_LogDisplayContent, State.DockBottom ); m_DockingManager.AddContentWithState( m_SelectionContent, State.DockRight ); m_DockingManager.AddContentWithState( m_PropertyEditorContent, State.DockLeft ); m_EditModesContent = m_DockingManager.Contents.Add( new EditModesControl( ), Resources.EditModes ); m_DockingManager.AddContentToZone( m_EditModesContent, m_SelectionContent.ParentWindowContent.ParentZone, 0 ); }
private void Load_Form(object sender, System.EventArgs e) { #region Magic Controls workarounds // Setting this using designer causes a Code Generation Error MainTabs.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument; // Setting this using designer appears to have no affect MainTabs.IDEPixelBorder = true; // Order is important for docking to work. This isn't really a Magic Controls // issue, but related to how Winforms processes docking events. // Since InitializeComponent is GENERATED code, the form control collection gets cleared // and then the controls are added in the correct order; this.Controls.Clear(); this.Controls.Add(MainTabs); this.Controls.Add(MainStatus); this.Controls.Add(MainMenu); #endregion #region Magic Controls Initialisation DockingManager = new DockingManager(this, VisualStyle.IDE); DockingManager.InnerControl = MainTabs; DockingManager.OuterControl = MainStatus; #endregion #region Our Initialisation CurrentChannelManager = new Channels.ChannelManager(DockingManager); #region RenderContainer RenderTarget.Left = GameTab.Left; RenderTarget.Top = GameTab.Top; RenderTarget.Height = GameTab.Height; RenderTarget.Width = GameTab.Width; #endregion #region Add our windows // Connection // Content connectionWindow = DockingManager.Contents.Add(new ChildWindows.Connection(), "Connection", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Connection); // connectionWindow.DisplaySize = new Size(200, GameTab.Height); // connectionWindow.CaptionBar = true; // connectionWindow.CloseButton = false; // DockingManager.AddContentWithState(connectionWindow, State.DockLeft); // Log Content logWindow = DockingManager.Contents.Add(new ChildWindows.Log(), "Log", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Log); DockingManager.AddContentWithState(logWindow, State.DockBottom); // Who Content whoWindow = DockingManager.Contents.Add(new ChildWindows.WhoList(), "Who's online", Icons.IconManager.GlobalImageList,-1); DockingManager.AddContentWithState(whoWindow, State.DockRight); // Command Content commandWindow = DockingManager.Contents.Add(new ChildWindows.Command(), "Command", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Command); DockingManager.AddContentWithState(commandWindow, State.DockBottom); // Chat Content chatWindow = DockingManager.Contents.Add(new ChildWindows.Chat(), "Chat", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Chat); DockingManager.AddContentWithState(chatWindow, State.DockBottom); // MiniMap miniMap = new ChildWindows.MiniMap(); Content mapWindow = DockingManager.Contents.Add(miniMap, "Mini Map", Icons.IconManager.GlobalImageList,-1); DockingManager.AddContentWithState(mapWindow, State.DockBottom); this.Navigate("http://www.strive3d.net"); #endregion loadSettings(); #region Events RenderTarget.LostFocus += new EventHandler( RenderTarget_LostFocus ); RenderTarget.Click += new EventHandler( RenderTarget_Click ); #endregion #endregion }
public override void PerformRestore(DockingManager dm) { // Use the existing DockingManager method that will create a Window appropriate for // this Content and then add a new Zone for hosting the Window. It will always place // the Zone at the inner most level dm.AddContentWithState(_content, _state); }
public override void PerformRestore(DockingManager dm) { // Grab a list of all floating forms Form[] owned = dm.Container.FindForm().OwnedForms; FloatingForm target = null; // Find the match to one of our best friends foreach(Form f in owned) { FloatingForm ff = f as FloatingForm; if (ff != null) { if (ZoneHelper.ContentNames(ff.Zone).Contains(_best)) { target = ff; break; } } } // If no friends then try associates as second best option if (target == null) { // Find the match to one of our best friends foreach(Form f in owned) { FloatingForm ff = f as FloatingForm; if (ff != null) { if (ZoneHelper.ContentNames(ff.Zone).Contains(_associates)) { target = ff; break; } } } } // If we found a friend/associate, then restore to it if (target != null) { // We should have a child and be able to restore to its Zone _child.PerformRestore(target.Zone); } else { // Restore its location/size _content.DisplayLocation = _location; _content.DisplaySize = _size; // Use the docking manage method to create us a new Floating Window at correct size/location dm.AddContentWithState(_content, State.Floating); } }
public MediaPortalEditor() { InitializeComponent(); Text = "MediaPortalEditor"; // Initialize style options style = VisualStyle.IDE; SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); // Create the docking and tab manager tabManager = new TabControl(); tabManager.Appearance = TabControl.VisualAppearance.MultiDocument; tabManager.ClosePressed += new EventHandler(OnDesignerClosed); tabManager.SelectionChanged += new EventHandler(OnDesignerIndexChanged); tabManager.Dock = DockStyle.Fill; tabManager.Style = style; tabManager.IDEPixelBorder = true; tabManager.ShowClose = false; tabManager.ImageList = tabImageList; Controls.Add(tabManager); dockManager = new DockingManager(this, style); dockManager.InnerControl = tabManager; dockManager.TabControlCreated += new DockingManager.TabControlCreatedHandler(OnTabControlCreated); dockManager.ContentHidden += new DockingManager.ContentHandler(OnContentHidden); dockManager.ContentShown += new DockingManager.ContentHandler(OnContentShown); // Create Status Bar statusBar = CreateStatusBar(); dockManager.OuterControl = statusBar; // Create Menu and Toolbar topMenu = CreateTopMenu(); // Create Skin Tree skinExplorer = new MpeExplorer(this); Content c = dockManager.Contents.Add(skinExplorer, "Explorer", serviceImageList, 0); dockManager.AddContentWithState(c, State.DockLeft); // Create Properties propertyManager = new MpePropertyManager(this); c = dockManager.Contents.Add(propertyManager, "Properties", serviceImageList, 1); dockManager.AddContentWithState(c, State.DockRight); // Create Help Manager and Browser helpManager = new MpeHelpManager(this); c = dockManager.Contents.Add(helpManager, "Help", serviceImageList, 2); dockManager.AddContentWithState(c, State.DockBottom); helpBrowser = new MpeHelpBrowser(this); // Setup Tab Designers selectedDesignerIndex = -1; // Static Self Reference self = this; }
private void Load_Form(object sender, System.EventArgs e) { #region Magic Controls workarounds // Setting this using designer causes a Code Generation Error MainTabs.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument; // Setting this using designer appears to have no affect MainTabs.IDEPixelBorder = true; // Order is important for docking to work. This isn't really a Magic Controls // issue, but related to how Winforms processes docking events. // Since InitializeComponent is GENERATED code, the form control collection gets cleared // and then the controls are added in the correct order; this.Controls.Clear(); this.Controls.Add(MainTabs); this.Controls.Add(MainStatus); this.Controls.Add(MainMenu); #endregion #region Magic Controls Initialisation DockingManager = new DockingManager(this, VisualStyle.IDE); DockingManager.InnerControl = MainTabs; DockingManager.OuterControl = MainStatus; #endregion #region Our Initialisation CurrentChannelManager = new Channels.ChannelManager(DockingManager); #region RenderContainer RenderTarget.Left = GameTab.Left; RenderTarget.Top = GameTab.Top; RenderTarget.Height = GameTab.Height; RenderTarget.Width = GameTab.Width; #endregion #region Add our windows // Connection // Content connectionWindow = DockingManager.Contents.Add(new ChildWindows.Connection(), "Connection", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Connection); // connectionWindow.DisplaySize = new Size(200, GameTab.Height); // connectionWindow.CaptionBar = true; // connectionWindow.CloseButton = false; // DockingManager.AddContentWithState(connectionWindow, State.DockLeft); // Log Content logWindow = DockingManager.Contents.Add(new ChildWindows.Log(), "Log", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Log); DockingManager.AddContentWithState(logWindow, State.DockBottom); // Who Content whoWindow = DockingManager.Contents.Add(new ChildWindows.WhoList(), "Who's online", Icons.IconManager.GlobalImageList, -1); DockingManager.AddContentWithState(whoWindow, State.DockRight); // Command Content commandWindow = DockingManager.Contents.Add(new ChildWindows.Command(), "Command", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Command); DockingManager.AddContentWithState(commandWindow, State.DockBottom); // Chat Content chatWindow = DockingManager.Contents.Add(new ChildWindows.Chat(), "Chat", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Chat); DockingManager.AddContentWithState(chatWindow, State.DockBottom); // MiniMap miniMap = new ChildWindows.MiniMap(); Content mapWindow = DockingManager.Contents.Add(miniMap, "Mini Map", Icons.IconManager.GlobalImageList, -1); DockingManager.AddContentWithState(mapWindow, State.DockBottom); this.Navigate("http://www.strive3d.net"); #endregion loadSettings(); #region Events RenderTarget.LostFocus += new EventHandler(RenderTarget_LostFocus); RenderTarget.Click += new EventHandler(RenderTarget_Click); #endregion #endregion }
public MainForm(string strOpenFileName) { // // Required for Windows Form Designer support // InitializeComponent(); m_dkm = new DockingManager(this, VisualStyle.IDE); Globals.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged); m_doc = Globals.ActiveDocument; Globals.MainForm = this; // Create all the "Contents" used to display the various animation components m_ctlPreviewPanel = new PreviewPanel(m_doc); Globals.PreviewControl = m_ctlPreviewPanel.PreviewControl; m_ctlPreviewPanel.Dock = DockStyle.Fill; Controls.Add(m_ctlPreviewPanel); m_dkm.InnerControl = m_ctlPreviewPanel; m_frmStrips = new StripsForm(m_doc); Globals.StripsForm = m_frmStrips; m_tntStrips = m_dkm.Contents.Add(m_frmStrips, m_frmStrips.Text); m_tntStrips.DisplaySize = new Size(ClientSize.Width / 4, ClientSize.Height / 2); m_wcStrips = m_dkm.AddContentWithState(m_tntStrips, State.DockLeft); m_frmBitmaps = new BitmapsForm(m_doc); m_tntBitmaps = m_dkm.Contents.Add(m_frmBitmaps, m_frmBitmaps.Text); m_tntBitmaps.DisplaySize = new Size(ClientSize.Width / 4, ClientSize.Height / 2); m_dkm.AddContentWithState(m_tntBitmaps, State.DockTop); // Add the Bitmaps form to the StripForm's Zone m_dkm.AddContentToZone(m_tntBitmaps, m_wcStrips.ParentZone, 1); m_frmFrames = new StripForm(m_doc); Globals.StripForm = m_frmFrames; m_tntFrames = m_dkm.Contents.Add(m_frmFrames, m_frmFrames.Text); m_frmFrames.Content = m_tntFrames; int cx = ClientSize.Width - (ClientSize.Width / 4); int cy = ClientSize.Height / 3; m_tntFrames.DisplaySize = new Size(cx, cy); m_dkm.AddContentWithState(m_tntFrames, State.DockBottom); m_frmCombiner = new CombinerForm(); m_tntCombiner = m_dkm.Contents.Add(m_frmCombiner, m_frmCombiner.Text); m_tntCombiner.DisplaySize = new Size(ClientSize.Width / 2, ClientSize.Height / 2); // m_dkm.AddContentWithState(m_tntCombiner, State.Floating); // m_dkm.HideContent(m_tntCombiner); // Do a little wiring ((StripControl)Globals.StripControl).FrameOffsetChanged += new FrameOffsetEventHandler(((PreviewControl)Globals.PreviewControl).OnFrameOffsetChanged); ((PreviewControl)Globals.PreviewControl).FrameOffsetChanged += new FrameOffsetEventHandler(((StripControl)Globals.StripControl).OnFrameOffsetChanged); // We always have a document around if (strOpenFileName == null) NewDocument(); else OpenDocument(strOpenFileName); }
/// <summary> /// Initialises this form /// </summary> public GameViewForm( GameSetup setup ) { InitializeComponent( ); m_Setup = setup; // Create a property editor for the DebugInfo class // Can't just bung the a DebugInfo object into a property grid - it's all static properties // Create a property bag containing those properties instead PropertyBag debugInfo = new PropertyBag( ); foreach ( PropertyInfo property in typeof( DebugInfo ).GetProperties( BindingFlags.Static | BindingFlags.Public ) ) { debugInfo.Properties.Add( new ExPropertySpec( property ) ); } debugInfo.SetValue += ExPropertySpec.SetValue; debugInfo.GetValue += ExPropertySpec.GetValue; PropertyGrid debugInfoProperties = new PropertyGrid( ); debugInfoProperties.SelectedObject = debugInfo; // Set up a docking manager m_DockingManager = new DockingManager( this, VisualStyle.IDE ); m_DockingManager.InnerControl = gameDisplay; // Add the property grid to the docking manager m_DebugInfoContent = m_DockingManager.Contents.Add( debugInfoProperties, "Debug Info" ); m_DockingManager.AddContentWithState( m_DebugInfoContent, State.DockLeft ); }
/// <summary> /// 为设计器添加可停靠窗口 /// </summary> private void AddDockingManagers() { dockManager = new DockingManager(this, VisualStyle.IDE); //定义对象OuterControl,Docking Manager不会关注该对象以后生成的对象的窗口区域 //对象InnerControl,Docking Manager不会关注在该对象生成以前的对象的窗口区域 dockManager.OuterControl = this.toolStripOperation; dockManager.InnerControl = this.ViewDesign; //添加可隐藏的控件模块库窗口 this.tabSolution_Controls = new Content(this.dockManager); this.tabSolution_Controls.Control = this.toolboxServiceImpl; this.tabSolution_Controls.FullTitle = "控制模块库"; this.tabSolution_Controls.Title = "控制模块库"; this.tabSolution_Controls.AutoHideSize = this.toolboxServiceImpl.Size; this.tabSolution_Controls.DisplaySize = this.toolboxServiceImpl.Size; dockManager.Contents.Add(this.tabSolution_Controls); dockManager.AddContentWithState(this.tabSolution_Controls, State.DockLeft); //添加可隐藏的属性设计窗口 this.tabSolution_Property = new Content(this.dockManager); this.tabSolution_Property.Control = this.controlfilteredPropertyGrid; this.tabSolution_Property.FullTitle = "模块属性"; this.tabSolution_Property.Title = "模块属性"; this.tabSolution_Property.AutoHideSize = this.controlfilteredPropertyGrid.Size; this.tabSolution_Property.DisplaySize = this.controlfilteredPropertyGrid.Size; this.tabSolution_Property.DisplayLocation = new Point(this.Location.X + this.Width - 200, this.Location.Y + 100); this.tabSolution_Property.FloatingSize = this.controlfilteredPropertyGrid.Size; dockManager.Contents.Add(this.tabSolution_Property); dockManager.AddContentWithState(this.tabSolution_Property, State.Floating); //添加可隐藏的资源管理器窗口 this.tabSolution_TreeView = new Content(this.dockManager); this.tabSolution_TreeView.Control = this.solutionTreeView; this.tabSolution_TreeView.FullTitle = "资源管理器"; this.tabSolution_TreeView.Title = "资源管理器"; this.tabSolution_TreeView.AutoHideSize = this.solutionTreeView.Size; this.tabSolution_TreeView.DisplaySize = this.solutionTreeView.Size; //添加可隐藏的工程管理器窗口 this.tabSolution_ListBox = new Content(dockManager); this.tabSolution_ListBox.Control = this.ProListBox; this.tabSolution_ListBox.FullTitle = "工程管理器"; this.tabSolution_ListBox.Title = "工程管理器"; this.tabSolution_ListBox.AutoHideSize = this.ProListBox.Size; this.tabSolution_ListBox.DisplaySize = this.ProListBox.Size; Zone zone = dockManager.CreateZoneForContent(State.DockRight); dockManager.ReorderZoneToInnerMost(zone); dockManager.Contents.Add(this.tabSolution_ListBox); dockManager.AddContentToZone(this.tabSolution_ListBox, zone, 0); dockManager.Contents.Add(this.tabSolution_TreeView); dockManager.AddContentToZone(this.tabSolution_TreeView, zone, 1); //添加可隐藏的错误列表窗口 this.tabSolution_ErrorBox = new Content(this.dockManager); this.tabSolution_ErrorBox.Control = this.errorForm; this.tabSolution_ErrorBox.FullTitle = "错误列表"; this.tabSolution_ErrorBox.Title = "错误列表"; this.tabSolution_ErrorBox.AutoHideSize = this.errorForm.Size; this.tabSolution_ErrorBox.DisplaySize = this.errorForm.Size; this.dockManager.Contents.Add(this.tabSolution_ErrorBox); this.dockManager.AddContentWithState(this.tabSolution_ErrorBox, State.DockBottom); //为隐藏窗口添加关闭事件处理函数,当隐藏窗口关闭时设置响应窗口状态栏的状态 this.dockManager.ContentHidden += new DockingManager.ContentHandler(dockingManager_Controls_ContentHidden); }