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; }
public void ShowPad(IPadContent content) { if (contentHash[content] == null) { IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties()); string type = content.GetType().ToString(); content.Control.Dock = DockStyle.None; Content c1; if (content.Icon != null) { ImageList imgList = new ImageList(); imgList.Images.Add(content.Icon); c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0); } else { c1 = dockManager.Contents.Add(content.Control, content.Title); } c1.DisplaySize = new Size(270, 200); contentHash[content] = c1; if (properties.GetProperty(type, "Left") == "Left") { if (leftContent == null) { leftContent = dockManager.AddContentWithState(c1, State.DockLeft); } else { dockManager.AddContentToWindowContent(c1, leftContent); } } else if (properties.GetProperty(type, "Left") == "Bottom") { if (bottomContent == null) { bottomContent = dockManager.AddContentWithState(c1, State.DockBottom); } else { dockManager.AddContentToWindowContent(c1, bottomContent); } } } else { Content c = (Content)contentHash[content]; if (c != null) { dockManager.ShowContent(c); } } }
public MainForm() { // // Required for Windows Form Designer support // InitializeComponent(); // Create the docking manager instance dockManager = new DockingManager(this, VisualStyle.IDE); // Define innner/outer controls for correct docking operation dockManager.InnerControl = tabControl; dockManager.OuterControl = toolBar; tree.ImageList = imageList16; // Create content instances Content c = dockManager.Contents.Add(Tree, "Connections", imageList16, 0); c.DisplaySize = new Size(230, c.DisplaySize.Height); c.AutoHideSize = new Size(230, c.DisplaySize.Height); c.FloatingSize = new Size(230, c.DisplaySize.Height); // Add to the display on the left hand side dockManager.AddContentWithState(c, State.DockLeft); }
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); }
protected void CreateDockingWindows() { // Create the docking manager instance _manager = new DockingManager(this, VisualStyle.IDE); // Define innner/outer controls for correct docking operation _manager.InnerControl = tabControl1; _manager.OuterControl = menuControl1; // Create the tree control TreeView tv = new DragTree(); tv.Nodes.Add(new TreeNode("First")); tv.Nodes.Add(new TreeNode("Second")); tv.Nodes.Add(new TreeNode("Third")); tv.Nodes.Add(new TreeNode("Fourth")); // Create a rich text box for the second content _global = new RichTextBox(); // Create content instances Content c1 = _manager.Contents.Add(tv, "TreeView"); Content c2 = _manager.Contents.Add(_global, "Another Window"); // Add to the display on the left hand side WindowContent wc = _manager.AddContentWithState(c1, State.DockLeft); // Add at the bottom of the same column _manager.AddContentToZone(c2, wc.ParentZone, 1); }
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); } }
/// <summary> /// 初始化程序界面 /// </summary> private void InitGui() { _dockmanager1 = new DockingManager(this.ChildrenPanel1, Crownwood.DotNetMagic.Common.VisualStyle.Office2007Silver); //this.tabControlCenter.Dock = DockStyle.Fill; _dockmanager1.InnerControl = this.axTOCControl1; _SlightWorkSpaceCtrl = new MapSlightSeeing(this); _SlightWorkSpaceCtrl.Dock = DockStyle.Fill; _workspaceContent = _dockmanager1.Contents.Add(this._SlightWorkSpaceCtrl); _dockmanager1.AddContentWithState(_workspaceContent, Crownwood.DotNetMagic.Docking.State.DockBottom); }
protected void OnCreateC1(object sender, EventArgs e) { // Create Content which contains a RichTextBox Content c = _manager.Contents.Add(new DummyForm(), "Form " + _count++, _internalImages, _count % 6); // Setup initial state to match menu selections DefineContentState(c); // Setup the correct starting colors to match the menu selections DefineControlColors(c); // Request a new Docking window be created for the above Content on the right edge _manager.AddContentWithState(c, State.DockRight); }
// 初始化程序界面 private void InitGui() { _dockmanager1 = new DockingManager(this.panelmain, Crownwood.DotNetMagic.Common.VisualStyle.Office2007Silver); _dockmanager1.InnerControl = this.axMapControl1; _WorkSpaceCtrl = new MyMapContext(this); _WorkSpaceCtrl.Dock = DockStyle.Fill; _workspaceContent = _dockmanager1.Contents.Add(this._WorkSpaceCtrl); _dockmanager1.AddContentWithState(_workspaceContent, Crownwood.DotNetMagic.Docking.State.DockLeft); _dockmanager2 = new DockingManager(this.panelmain, Crownwood.DotNetMagic.Common.VisualStyle.Office2007Silver); _dockmanager2.InnerControl = this.axMapControl1; _Management = new ResourceManagement(this); _Management.Dock = DockStyle.Fill; _workspaceContent2 = _dockmanager2.Contents.Add(this._Management); _dockmanager2.AddContentWithState(_workspaceContent2, Crownwood.DotNetMagic.Docking.State.DockRight); IfControlEnabled(); }
private void InitDockingWindows() { dockingManager = new DockingManager(this, VisualStyle.IDE); //Add the tab control first. tabControl = new Crownwood.Magic.Controls.TabControl(); Panel welcomePanel = new Panel(); Panel welcomePanel2 = new Panel(); welcomePanel.Dock = DockStyle.Fill; Crownwood.Magic.Controls.TabPage welcomePage = new Crownwood.Magic.Controls.TabPage("Welcome", welcomePanel); tabControl.TabPages.Add(welcomePage); tabControl.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument; tabControl.Dock = DockStyle.Fill; tabControl.ClosePressed += new EventHandler(DoTabControlClosePressed); Controls.Add(tabControl); //Add Message form messageForm = new MessagesForm(); Content messageContent = dockingManager.Contents.Add(messageForm, "System Messages"); WindowContent messageWindowContent = dockingManager.AddContentWithState(messageContent, State.DockBottom) as WindowContent; //Add Menus topMenu = CreateMenus(); Controls.Add(topMenu); //Add status bar statusBar = new StatusBar(); statusBar.Dock = DockStyle.Bottom; statusBar.ShowPanels = true; StatusBarPanel statusBarPanel = new StatusBarPanel(); statusBarPanel.AutoSize = StatusBarPanelAutoSize.Spring; statusBar.Panels.Add(statusBarPanel); Controls.Add(statusBar); dockingManager.InnerControl = tabControl; dockingManager.OuterControl = statusBar; }
private void DockingPanel() { DockingManager _dockingManager = new DockingManager(this, VisualStyle.IDE); _dockingManager.OuterControl = panel_right; _dockingManager.InnerControl = panel_all; //panel_tj.Dock = DockStyle.Fill; panel_tj.Visible = true; panel_br.Visible = true; Content content = _dockingManager.Contents.Add(this.panel_left, "条件选择"); content.CloseButton = false; content.HideButton = true; content.DisplaySize = panel_left.Size; content.AutoHideSize = panel_left.Size; WindowContent wc = _dockingManager.AddContentWithState(content, State.DockLeft) as WindowContent; }
public MainForm() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // _dockingManager = new DockingManager(this, VisualStyle.Plain); _dockingManager.OuterControl = statusBar1; listView1 = new ListView(); listView1.Columns.Add("代号", 100, HorizontalAlignment.Left); listView1.Columns.Add("原因", 300, HorizontalAlignment.Left); listView1.View = View.Details; Content infoCont = _dockingManager.Contents.Add(listView1, "信息", imageList1, 1); _dockingManager.AddContentWithState(infoCont, State.DockBottom); _dockingManager.HideAllContents(); }
private void InitDockingWindows() { dockingManager = new DockingManager(this, VisualStyle.IDE); dockingManager.InnerControl = firstControl; //Add message windows MessagesForm messageForm = new MessagesForm(); Content messageContent = dockingManager.Contents.Add(messageForm, "System Messages"); WindowContent messageWindowContent = dockingManager.AddContentWithState(messageContent, State.DockBottom) as WindowContent; //Set main windows Panel welcomePanel = new Panel(); tabControl = new Crownwood.Magic.Controls.TabControl(); tabControl.TabPages.Add(new Crownwood.Magic.Controls.TabPage("First", welcomePanel)); tabControl.TabPages.Add(new Crownwood.Magic.Controls.TabPage("Third", new MessagesForm())); tabControl.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument; tabControl.Dock = DockStyle.Fill; tabControl.IDEPixelBorder = true; //tabControl. SuspendLayout(); Controls.Add(tabControl); //Set the region for docking. //RichTextBox filler = new RichTextBox(); //filler. Dock = DockStyle. Fill; StatusBar status = new StatusBar(); status.Dock = DockStyle.Bottom; dockingManager.OuterControl = status; }
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); } }
public MainForm() { InitializeComponent(); mutex = new Mutex(false, "SINGLE_RDIFramework.CodeMaker"); if (!mutex.WaitOne(0, false)) { mutex.Close(); mutex = null; } Version ApplicationVersion = new Version(Application.ProductVersion); this.Text = "RDIFramework.NET 平台代码生成器 V" + string.Format("{0}.{1}", ApplicationVersion.Major.ToString(), ApplicationVersion.Minor.ToString()); #region 左侧视图 dockManager = new DockingManager(this, VisualStyle.IDE) { OuterControl = statusBar, InnerControl = tabControlMain }; //定义对象OuterControl,Docking Manager不会关注该对象以后生成的对象的窗口区域 //对象InnerControl,Docking Manager不会关注在该对象生成以前的对象的窗口区域 //数据库视图 DBViewContent = new Content(dockManager) { Control = new DbView(this), Title = "数据库视图", FullTitle = "数据库视图", ImageList = leftViewImgs, ImageIndex = 0 }; var DBViewSize = DBViewContent.Control.Size; DBViewContent.AutoHideSize = DBViewSize; DBViewContent.DisplaySize = DBViewSize; //设计文档对象视图 DesignObjectContent = new Content(dockManager) { Control = new PDObjectView(this), Title = "PD对象管理", FullTitle = "PowerDesigner Objects", ImageList = leftViewImgs, ImageIndex = 1 }; var DesignObjectSize = DesignObjectContent.Control.Size; //PowerDesigner对象管理 DesignObjectContent.AutoHideSize = DesignObjectSize; DesignObjectContent.DisplaySize = DesignObjectSize; //将浮动窗口和具体在浮动窗口中被包含的面板联系起来 dockManager.Contents.Add(DBViewContent); WindowContent wcdb = dockManager.AddContentWithState(DBViewContent, State.DockLeft); dockManager.Contents.Add(DesignObjectContent); dockManager.AddContentWithState(DesignObjectContent, State.DockRight); //dockManager.AddContentToWindowContent(DesignObjectContent, wcdb); #endregion LoadStartPage(); #region 起始页 /* * appsettings = LTP.CmConfig.AppConfig.GetSettings(); * switch (appsettings.AppStart) * { * case "startuppage"://显示起始页 * { #region //启动起始页 * try * { * LoadStartPage(); * } * catch (System.Exception ex) * { * LogHelper.WriteException(ex); * } #endregion * } * break; * case "blank"://显示空环境 * { * } * break; * case "homepage": //打开主页 * { #region * string selstr = "首页"; * string link = "http://www.cnblogs.com/huyong/"; * if (appsettings.HomePage != null && appsettings.HomePage != "") * { * link = appsettings.HomePage; * } * //起始页 * Crownwood.Magic.Controls.TabPage page = new Crownwood.Magic.Controls.TabPage(); * page.Title = selstr; * page.Control = new IEView(this, link); * tabControlMain.TabPages.Add(page); * tabControlMain.SelectedTab = page; * #endregion * } * break; * } * */ #endregion this.tabControlMain.MouseUp += new MouseEventHandler(OnMouseUpTabPage); }
public void CreateViews(IContent codeView, IContent outputView, IContent watchView, IContent registersView, IContent dataCacheView, IContent instructionCacheView, IContent unifiedCacheView, IContent stackView, IContent pluginsUIView) { /* BB - 08/10/2014 - * The original position of the codeView was as the 'background' which occupied * whatever space wasn't used by the docked windows. This approach broke somehow * during the interface change, so now the codeView is treated as another docking * window. It's not a high priority to fix the problem since this docking interface * is being deprecated. */ /* * codeView.Control.Dock = DockStyle.Fill; * mManager.InnerControl.Controls.Add(codeView.Control); */ //The codeView is added at the bottom of this method. Content c = mManager.Contents.Add(registersView.Control, registersView.Control.Text, mInternalImages, 0); mManager.AddContentWithState(c, State.DockLeft); registersView.Tag = c; Content c1 = mManager.Contents.Add(outputView.Control, outputView.Control.Text, mInternalImages, 0); outputView.Tag = c1; Content c2 = mManager.Contents.Add(watchView.Control, watchView.Control.Text, mInternalImages, 0); watchView.Tag = c2; mManager.Contents.Add(c2); WindowContent wc = mManager.AddContentWithState(c1, State.DockBottom) as WindowContent; mManager.AddContentToWindowContent(c2, wc); //mContents.Add(outputView.Text, new ContentControl(outputView, outputView.Text, c1, mManager)); //mContents.Add(watchView.Text, new ContentControl(watchView, watchView.Text, c2, mManager)); c = mManager.Contents.Add(dataCacheView.Control, dataCacheView.Control.Text, mInternalImages, 0); dataCacheView.Tag = c; mManager.AddContentWithState(c, State.DockTop); mManager.HideContent(c); //mContents.Add(dataCacheView.Text, new ContentControl(dataCacheView, dataCacheView.Text, c, mManager)); c = mManager.Contents.Add(instructionCacheView.Control, instructionCacheView.Control.Text, mInternalImages, 0); instructionCacheView.Tag = c; mManager.AddContentWithState(c, State.DockTop); mManager.HideContent(c); //mContents.Add(instructionCacheView.Text, new ContentControl(instructionCacheView, instructionCacheView.Text, c, mManager)); c = mManager.Contents.Add(unifiedCacheView.Control, unifiedCacheView.Control.Text, mInternalImages, 0); unifiedCacheView.Tag = c; mManager.AddContentWithState(c, State.DockTop); mManager.HideContent(c); //mContents.Add(unifiedCacheView.Text, new ContentControl(unifiedCacheView, unifiedCacheView.Text, c, mManager)); c = mManager.Contents.Add(stackView.Control, stackView.Control.Text, mInternalImages, 0); stackView.Tag = c; mManager.AddContentWithState(c, State.DockRight); mManager.ToggleContentAutoHide(c); //mContents.Add(stackView.Text, new ContentControl(stackView, stackView.Text, c, mManager)); //pluginsUIView.Visible = false; c = mManager.Contents.Add(pluginsUIView.Control, pluginsUIView.Control.Text, mInternalImages, 0); pluginsUIView.Tag = c; mManager.AddContentWithState(c, State.DockTop); mManager.HideContent(c); //mContents.Add(pluginsUIView.Text, new ContentControl(pluginsUIView, pluginsUIView.Text, c, mManager)); Content c0 = mManager.Contents.Add(codeView.Control, codeView.Control.Text, mInternalImages, 0); mManager.AddContentWithState(c0, State.Floating); codeView.Tag = c0; }//CreateViews