Esempio n. 1
0
 public static void SetSchema(DockPanel dockPanel, Extender.Schema schema)
 {
     if (schema == Extender.Schema.Default)
     {
         dockPanel.Extender.AutoHideTabFactory = null;
         dockPanel.Extender.DockPaneTabFactory = null;
         dockPanel.Extender.AutoHideStripFactory = null;
         dockPanel.Extender.DockPaneCaptionFactory = null;
         dockPanel.Extender.DockPaneStripFactory = null;
     }
     else if (schema == Extender.Schema.Override)
     {
         dockPanel.Extender.AutoHideTabFactory = null;
         dockPanel.Extender.DockPaneTabFactory = null;
         dockPanel.Extender.DockPaneCaptionFactory = null;
         dockPanel.Extender.AutoHideStripFactory = new AutoHideStripOverrideFactory();
         dockPanel.Extender.DockPaneStripFactory = new DockPaneStripOverrideFactory();
     }
     else if (schema == Extender.Schema.FromBase)
     {
         dockPanel.Extender.AutoHideTabFactory = new AutoHideTabFromBaseFactory();
         dockPanel.Extender.DockPaneTabFactory = new DockPaneTabFromBaseFactory();
         dockPanel.Extender.AutoHideStripFactory = new AutoHideStripFromBaseFactory();
         dockPanel.Extender.DockPaneCaptionFactory = new DockPaneCaptionFromBaseFactory();
         dockPanel.Extender.DockPaneStripFactory = new DockPaneStripFromBaseFactory();
     }
 }
Esempio n. 2
0
		private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(ResourceHelper.GetString("FloatWindow.Constructor.NullDockPanel")));

			m_dockList = new DockList(this);

			FormBorderStyle = FormBorderStyle.SizableToolWindow;
			ShowInTaskbar = false;
			
			SuspendLayout();
			if (boundsSpecified)
			{
				Bounds = bounds;
				StartPosition = FormStartPosition.Manual;
			}
			else
				StartPosition = FormStartPosition.WindowsDefaultLocation;

			m_dummyControl = new DummyControl();
			m_dummyControl.Bounds = Rectangle.Empty;
			Controls.Add(m_dummyControl);

			m_dockPanel = dockPanel;
			Owner = DockPanel.FindForm();
			DockPanel.AddFloatWindow(this);
			if (pane != null)
				pane.FloatWindow = this;

			ResumeLayout();
		}
Esempio n. 3
0
		private void SetOutline(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
		{
			Rectangle rect = fullPanelEdge ? dockPanel.DockArea : dockPanel.DocumentWindowBounds;
			rect.Location = dockPanel.PointToScreen(rect.Location);
			if (dock == DockStyle.Top)
			{
				int height = (int)(rect.Height * dockPanel.DockBottomPortion);
				rect = new Rectangle(rect.X, rect.Y, rect.Width, height);
			}
			else if (dock == DockStyle.Bottom)
			{
				int height = (int)(rect.Height * dockPanel.DockBottomPortion);
				rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height);
			}
			else if (dock == DockStyle.Left)
			{
				int width = (int)(rect.Width * dockPanel.DockLeftPortion);
				rect = new Rectangle(rect.X, rect.Y, width, rect.Height);
			}
			else if (dock == DockStyle.Right)
			{
				int width = (int)(rect.Width * dockPanel.DockRightPortion);
				rect = new Rectangle(rect.Right - width, rect.Y, width, rect.Height);
			}
			else if (dock == DockStyle.Fill)
			{
				rect = dockPanel.DocumentWindowBounds;
				rect.Location = dockPanel.PointToScreen(rect.Location);
			}

			SetDragForm(rect);
		}
		internal DockWindowCollection(DockPanel dockPanel)
		{
			InnerList.Add(new DockWindow(dockPanel, DockState.Document));
			InnerList.Add(new DockWindow(dockPanel, DockState.DockLeft));
			InnerList.Add(new DockWindow(dockPanel, DockState.DockRight));
			InnerList.Add(new DockWindow(dockPanel, DockState.DockTop));
			InnerList.Add(new DockWindow(dockPanel, DockState.DockBottom));
		}
Esempio n. 5
0
 public static void SetExtender(DockPanel dockPanel)
 {
      dockPanel.Extender.AutoHideTabFactory = new Extender.AutoHideTabFromBaseFactory();
     dockPanel.Extender.DockPaneTabFactory = new Extender.DockPaneTabFromBaseFactory();
     dockPanel.Extender.AutoHideStripFactory = new Extender.AutoHideStripFromBaseFactory();
     dockPanel.Extender.DockPaneCaptionFactory = new Extender.DockPaneCaptionFromBaseFactory();
     dockPanel.Extender.DockPaneStripFactory = new Extender.DockPaneStripFromBaseFactory();
 }
Esempio n. 6
0
		internal AutoHidePaneCollection(DockPanel panel, DockState dockState)
		{
			m_dockPanel = panel;
			m_states = new AutoHideStateCollection();
			States[DockState.DockTopAutoHide].Selected = (dockState==DockState.DockTopAutoHide);
			States[DockState.DockBottomAutoHide].Selected = (dockState==DockState.DockBottomAutoHide);
			States[DockState.DockLeftAutoHide].Selected = (dockState==DockState.DockLeftAutoHide);
			States[DockState.DockRightAutoHide].Selected = (dockState==DockState.DockRightAutoHide);
		}
 protected internal AutoHideStripFromBase(DockPanel panel)
     : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     BackColor = Color.WhiteSmoke;
 }
Esempio n. 8
0
		/// <include file='CodeDoc/AutoHideStripBase.xml' path='//CodeDoc/Class[@name="AutoHideStripBase"]/Construct[@name="(DockPanel)"]/*'/>
		protected internal AutoHideStripBase(DockPanel panel)
		{
			m_dockPanel = panel;
			m_panesTop = new AutoHidePaneCollection(panel, DockState.DockTopAutoHide);
			m_panesBottom = new AutoHidePaneCollection(panel, DockState.DockBottomAutoHide);
			m_panesLeft = new AutoHidePaneCollection(panel, DockState.DockLeftAutoHide);
			m_panesRight = new AutoHidePaneCollection(panel, DockState.DockRightAutoHide);

			SetStyle(ControlStyles.Selectable, false);
		}
Esempio n. 9
0
		public AutoHideWindow(DockPanel dockPanel)
		{
			m_dockPanel = dockPanel;

			m_timerMouseTrack = new Timer();
			m_timerMouseTrack.Tick += new EventHandler(TimerMouseTrack_Tick);

			Visible = false;
			m_splitter = new AutoHideWindowSplitter();
			Controls.Add(m_splitter);
		}
Esempio n. 10
0
		/// <summary>
		/// This method is required for Windows Forms designer support.
		/// Do not change the method contents inside the source code editor. The Forms designer might
		/// not be able to load this method if it was changed manually.
		/// </summary>
		private void InitializeComponent() {
			ResourceManager resources = new ResourceManager(typeof (MainForm));
			statusBar = new StatusBar();
			splitter3 = new Splitter();
			dockPanel1 = new DockPanel();
			SuspendLayout();
			// 
			// statusBar
			// 
			statusBar.Location = new Point(0, 459);
			statusBar.Name = "statusBar";
			statusBar.Size = new Size(758, 21);
			statusBar.TabIndex = 6;
			// 
			// splitter3
			// 
			splitter3.Dock = DockStyle.Bottom;
			splitter3.Location = new Point(0, 456);
			splitter3.Name = "splitter3";
			splitter3.Size = new Size(758, 3);
			splitter3.TabIndex = 21;
			splitter3.TabStop = false;
			// 
			// dockPanel1
			// 
			dockPanel1.ActiveAutoHideContent = null;
			dockPanel1.Dock = DockStyle.Fill;
			dockPanel1.Font = new Font("Tahoma", 11F, FontStyle.Regular, GraphicsUnit.World);
			dockPanel1.Location = new Point(0, 0);
			dockPanel1.Name = "dockPanel1";
			dockPanel1.Size = new Size(758, 456);
			dockPanel1.TabIndex = 23;
			// 
			// MainForm
			// 
			AutoScaleBaseSize = new Size(5, 13);
			ClientSize = new Size(758, 480);
			Controls.Add(dockPanel1);
			Controls.Add(splitter3);
			Controls.Add(statusBar);
			Icon = ((Icon) (resources.GetObject("$this.Icon")));
			IsMdiContainer = true;
			Name = "MainForm";
			Text = "CH3ETAH";
			WindowState = FormWindowState.Maximized;
			Closing += new CancelEventHandler(Form_Closing);
			Load += new EventHandler(MainForm_Load);
			ResumeLayout(false);

		}
Esempio n. 11
0
		/// <include file='CodeDoc/AutoHideStripBase.xml' path='//CodeDoc/Class[@name="AutoHideStripBase"]/Construct[@name="(DockPanel)"]/*'/>
		protected internal AutoHideStripBase(DockPanel panel)
		{
			m_dockPanel = panel;
			m_panesTop = new AutoHidePaneCollection(panel, DockState.DockTopAutoHide);
			m_panesBottom = new AutoHidePaneCollection(panel, DockState.DockBottomAutoHide);
			m_panesLeft = new AutoHidePaneCollection(panel, DockState.DockLeftAutoHide);
			m_panesRight = new AutoHidePaneCollection(panel, DockState.DockRightAutoHide);

			#if FRAMEWORK_VER_2x
			SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			#else
			SetStyle(ControlStyles.DoubleBuffer, true);
			#endif
			SetStyle(ControlStyles.Selectable, false);
		}
Esempio n. 12
0
        public void Initialize(Dp.DockPanel _dockPanel)
        {
            dockPanel = _dockPanel;

            // Register default windows.
            this.Register <ActorBrowserForm>("Actor browser");
            this.Register <ActorTypeBrowserForm>("Actor type browser");
            this.Register <WebBrowserForm>("Web browser");
            this.Register <LogForm>("Log");
            this.Register <PropertyBrowserForm>("Property browser");
            this.Register <TextEditorForm>("Text editor");

            // Create default windows.
            Add("Actor browser");
            Add("Actor type browser");
            Add("Web browser");
            Add("Property browser");
            Add("Log");
        }
Esempio n. 13
0
		internal DockWindow(DockPanel dockPanel, DockState dockState)
		{
			m_dockList = new DockList(this);
			m_dockPanel = dockPanel;
			m_dockState = dockState;
			Visible = false;

			SuspendLayout();

			if (DockState == DockState.DockLeft || DockState == DockState.DockRight ||
				DockState == DockState.DockTop || DockState == DockState.DockBottom)
			{
				m_splitter = new DockWindowSplitter();
				Controls.Add(m_splitter);
			}

			if (DockState == DockState.DockLeft)
			{
				Dock = DockStyle.Left;
				m_splitter.Dock = DockStyle.Right;
			}
			else if (DockState == DockState.DockRight)
			{
				Dock = DockStyle.Right;
				m_splitter.Dock = DockStyle.Left;
			}
			else if (DockState == DockState.DockTop)
			{
				Dock = DockStyle.Top;
				m_splitter.Dock = DockStyle.Bottom;
			}
			else if (DockState == DockState.DockBottom)
			{
				Dock = DockStyle.Bottom;
				m_splitter.Dock = DockStyle.Top;
			}
			else if (DockState == DockState.Document)
			{
				Dock = DockStyle.Fill;
			}

			ResumeLayout();
		}
Esempio n. 14
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
			this.dockManager = new WeifenLuo.WinFormsUI.DockPanel();
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.statusBar1 = new System.Windows.Forms.StatusBar();
			this.toolBar1 = new System.Windows.Forms.ToolBar();
			this.imageList2 = new System.Windows.Forms.ImageList(this.components);
			this.SuspendLayout();
			// 
			// dockManager
			// 
			this.dockManager.ActiveAutoHideContent = null;
			this.dockManager.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.dockManager.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dockManager.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
			this.dockManager.Location = new System.Drawing.Point(0, 42);
			this.dockManager.MdiIntegration = false;
			this.dockManager.Name = "dockManager";
			this.dockManager.Size = new System.Drawing.Size(855, 609);
			this.dockManager.TabIndex = 0;
			// 
			// statusBar1
			// 
			this.statusBar1.Location = new System.Drawing.Point(0, 651);
			this.statusBar1.Name = "statusBar1";
			this.statusBar1.Size = new System.Drawing.Size(855, 21);
			this.statusBar1.TabIndex = 0;
			this.statusBar1.Text = "Ready.";
			// 
			// toolBar1
			// 
			this.toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.toolBar1.BackColor = System.Drawing.SystemColors.Control;
			this.toolBar1.DropDownArrows = true;
			this.toolBar1.ImageList = this.imageList2;
			this.toolBar1.Location = new System.Drawing.Point(0, 0);
			this.toolBar1.Name = "toolBar1";
			this.toolBar1.ShowToolTips = true;
			this.toolBar1.Size = new System.Drawing.Size(855, 42);
			this.toolBar1.TabIndex = 1;
			// 
			// imageList2
			// 
			this.imageList2.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
			this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// MainForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(855, 672);
			this.Controls.Add(this.dockManager);
			this.Controls.Add(this.toolBar1);
			this.Controls.Add(this.statusBar1);
			this.IsMdiContainer = true;
			this.Menu = this.mainMenu1;
			this.Name = "MainForm";
			this.Text = "MainForm";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.ResumeLayout(false);

		}
Esempio n. 15
0
		public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent)
		{

			if (dockPanel.Contents.Count != 0)
				throw new InvalidOperationException(ResourceHelper.GetString("DockPanel.LoadFromXml.AlreadyInitialized"));

			EnumConverter dockStateConverter = new EnumConverter(typeof(DockState));
			EnumConverter dockAlignmentConverter = new EnumConverter(typeof(DockAlignment));
			RectangleConverter rectConverter = new RectangleConverter();

			XmlTextReader xmlIn = new XmlTextReader(stream);
			xmlIn.WhitespaceHandling = WhitespaceHandling.None;
			xmlIn.MoveToContent();

			if (xmlIn.Name != "DockPanel")
				throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));

			string formatVersion = xmlIn.GetAttribute("FormatVersion");
			if (formatVersion != ConfigFileVersion)
				throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidFormatVersion"));
			DockPanelStruct dockPanelStruct = new DockPanelStruct();
			dockPanelStruct.DockLeftPortion = Convert.ToDouble(xmlIn.GetAttribute("DockLeftPortion"), CultureInfo.InvariantCulture);
			dockPanelStruct.DockRightPortion = Convert.ToDouble(xmlIn.GetAttribute("DockRightPortion"), CultureInfo.InvariantCulture);
			dockPanelStruct.DockTopPortion = Convert.ToDouble(xmlIn.GetAttribute("DockTopPortion"), CultureInfo.InvariantCulture);
			dockPanelStruct.DockBottomPortion = Convert.ToDouble(xmlIn.GetAttribute("DockBottomPortion"), CultureInfo.InvariantCulture);
			dockPanelStruct.IndexActiveDocumentPane = Convert.ToInt32(xmlIn.GetAttribute("ActiveDocumentPane"));
			dockPanelStruct.IndexActivePane = Convert.ToInt32(xmlIn.GetAttribute("ActivePane"));

			// Load Contents
			MoveToNextElement(xmlIn);
			if (xmlIn.Name != "Contents")
				throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
			int countOfContents = Convert.ToInt32(xmlIn.GetAttribute("Count"));
			ContentStruct[] contents = new ContentStruct[countOfContents];
			MoveToNextElement(xmlIn);
			for (int i=0; i<countOfContents; i++)
			{
				int id = Convert.ToInt32(xmlIn.GetAttribute("ID"));
				if (xmlIn.Name != "Content" || id != i)
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));

				contents[i].PersistString = xmlIn.GetAttribute("PersistString");
				contents[i].AutoHidePortion = Convert.ToDouble(xmlIn.GetAttribute("AutoHidePortion"), CultureInfo.InvariantCulture);
				contents[i].IsHidden = Convert.ToBoolean(xmlIn.GetAttribute("IsHidden"));
				contents[i].IsFloat = Convert.ToBoolean(xmlIn.GetAttribute("IsFloat"));
				MoveToNextElement(xmlIn);
			}

			// Load Panes
			if (xmlIn.Name != "Panes")
				throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
			int countOfPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"));
			PaneStruct[] panes = new PaneStruct[countOfPanes];
			MoveToNextElement(xmlIn);
			for (int i=0; i<countOfPanes; i++)
			{
				int id = Convert.ToInt32(xmlIn.GetAttribute("ID"));
				if (xmlIn.Name != "Pane" || id != i)
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));

				panes[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState"));
				panes[i].IndexActiveContent = Convert.ToInt32(xmlIn.GetAttribute("ActiveContent"));
				panes[i].ZOrderIndex = -1;

				MoveToNextElement(xmlIn);
				if (xmlIn.Name != "Contents")
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
				int countOfPaneContents = Convert.ToInt32(xmlIn.GetAttribute("Count"));
				panes[i].IndexContents = new int[countOfPaneContents];
				MoveToNextElement(xmlIn);
				for (int j=0; j<countOfPaneContents; j++)
				{
					int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"));
					if (xmlIn.Name != "Content" || id2 != j)
						throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));

					panes[i].IndexContents[j] = Convert.ToInt32(xmlIn.GetAttribute("RefID"));
					MoveToNextElement(xmlIn);
				}
			}

			// Load DockWindows
			if (xmlIn.Name != "DockWindows")
				throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
			int countOfDockWindows = Convert.ToInt32(xmlIn.GetAttribute("Count"));
			DockWindowStruct[] dockWindows = new DockWindowStruct[countOfDockWindows];
			MoveToNextElement(xmlIn);
			for (int i=0; i<countOfDockWindows; i++)
			{
				int id = Convert.ToInt32(xmlIn.GetAttribute("ID"));
				if (xmlIn.Name != "DockWindow" || id != i)
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));

				dockWindows[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState"));
				dockWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex"));
				MoveToNextElement(xmlIn);
				if (xmlIn.Name != "DockList")
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
				int countOfDockList = Convert.ToInt32(xmlIn.GetAttribute("Count"));
				dockWindows[i].DockList = new DockListItem[countOfDockList];
				MoveToNextElement(xmlIn);
				for (int j=0; j<countOfDockList; j++)
				{
					int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"));
					if (xmlIn.Name != "Pane" || id2 != j)
						throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
					dockWindows[i].DockList[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID"));
					dockWindows[i].DockList[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane"));
					dockWindows[i].DockList[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment"));
					dockWindows[i].DockList[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture);
					MoveToNextElement(xmlIn);
				}
			}

			// Load FloatWindows
			if (xmlIn.Name != "FloatWindows")
				throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
			int countOfFloatWindows = Convert.ToInt32(xmlIn.GetAttribute("Count"));
			FloatWindowStruct[] floatWindows = new FloatWindowStruct[countOfFloatWindows];
			MoveToNextElement(xmlIn);
			for (int i=0; i<countOfFloatWindows; i++)
			{
				int id = Convert.ToInt32(xmlIn.GetAttribute("ID"));
				if (xmlIn.Name != "FloatWindow" || id != i)
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));

				floatWindows[i].Bounds = (Rectangle)rectConverter.ConvertFromInvariantString(xmlIn.GetAttribute("Bounds"));
				floatWindows[i].AllowRedocking = Convert.ToBoolean(xmlIn.GetAttribute("AllowRedocking"));
				floatWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex"));
				MoveToNextElement(xmlIn);
				if (xmlIn.Name != "DockList")
					throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
				int countOfDockList = Convert.ToInt32(xmlIn.GetAttribute("Count"));
				floatWindows[i].DockList = new DockListItem[countOfDockList];
				MoveToNextElement(xmlIn);
				for (int j=0; j<countOfDockList; j++)
				{
					int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"));
					if (xmlIn.Name != "Pane" || id2 != j)
						throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat"));
					floatWindows[i].DockList[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID"));
					floatWindows[i].DockList[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane"));
					floatWindows[i].DockList[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment"));
					floatWindows[i].DockList[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture);
					MoveToNextElement(xmlIn);
				}
			}
			xmlIn.Close();
					
			dockPanel.DockLeftPortion = dockPanelStruct.DockLeftPortion;
			dockPanel.DockRightPortion = dockPanelStruct.DockRightPortion;
			dockPanel.DockTopPortion = dockPanelStruct.DockTopPortion;
			dockPanel.DockBottomPortion = dockPanelStruct.DockBottomPortion;

			// Create Contents
			for (int i=0; i<contents.Length; i++)
			{
				DockContent content = deserializeContent(contents[i].PersistString);
				if (content == null)
					content = new DummyContent();
				content.DockPanel = dockPanel;
				content.AutoHidePortion = contents[i].AutoHidePortion;
				content.IsHidden = true;
				content.IsFloat = contents[i].IsFloat;
			}

			// Create panes
			for (int i=0; i<panes.Length; i++)
			{
				DockPane pane = null;
				for (int j=0; j<panes[i].IndexContents.Length; j++)
				{
					DockContent content = dockPanel.Contents[panes[i].IndexContents[j]];
					if (j==0)
						pane = dockPanel.DockPaneFactory.CreateDockPane(content, panes[i].DockState, false);
					else if (panes[i].DockState == DockState.Float)
						content.FloatPane = pane;
					else
						content.PanelPane = pane;
				}
			}

			// Assign Panes to DockWindows
			for (int i=0; i<dockWindows.Length; i++)
			{
				for (int j=0; j<dockWindows[i].DockList.Length; j++)
				{
					DockWindow dw = dockPanel.DockWindows[dockWindows[i].DockState];
					int indexPane = dockWindows[i].DockList[j].IndexPane;
					DockPane pane = dockPanel.Panes[indexPane];
					int indexPrevPane = dockWindows[i].DockList[j].IndexPrevPane;
					DockPane prevPane = (indexPrevPane == -1) ? dw.DockList.GetDefaultPrevPane(pane) : dockPanel.Panes[indexPrevPane];
					DockAlignment alignment = dockWindows[i].DockList[j].Alignment;
					double proportion = dockWindows[i].DockList[j].Proportion;
					pane.AddToDockList(dw, prevPane, alignment, proportion);
					if (panes[indexPane].DockState == dw.DockState)
						panes[indexPane].ZOrderIndex = dockWindows[i].ZOrderIndex;
				}
			}

			// Create float windows
			for (int i=0; i<floatWindows.Length; i++)
			{
				FloatWindow fw = null;
				for (int j=0; j<floatWindows[i].DockList.Length; j++)
				{
					int indexPane = floatWindows[i].DockList[j].IndexPane;
					DockPane pane = dockPanel.Panes[indexPane];
					if (j == 0)
						fw = dockPanel.FloatWindowFactory.CreateFloatWindow(dockPanel, pane, floatWindows[i].Bounds);
					else
					{
						int indexPrevPane = floatWindows[i].DockList[j].IndexPrevPane;
						DockPane prevPane = indexPrevPane == -1 ? null : dockPanel.Panes[indexPrevPane];
						DockAlignment alignment = floatWindows[i].DockList[j].Alignment;
						double proportion = floatWindows[i].DockList[j].Proportion;
						pane.AddToDockList(fw, prevPane, alignment, proportion);
						if (panes[indexPane].DockState == fw.DockState)
							panes[indexPane].ZOrderIndex = floatWindows[i].ZOrderIndex;
					}
				}
			}

			// sort DockContent by its Pane's ZOrder
			int[] sortedContents = null;
			if (contents.Length > 0)
			{
				sortedContents = new int[contents.Length];
				for (int i=0; i<contents.Length; i++)
					sortedContents[i] = i;

				int lastDocument = contents.Length;
				for (int i=0; i<contents.Length - 1; i++)
				{
					for (int j=i+1; j<contents.Length; j++)
					{
						DockPane pane1 = dockPanel.Contents[sortedContents[i]].Pane;
						int ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
						DockPane pane2 = dockPanel.Contents[sortedContents[j]].Pane;
						int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
						if (ZOrderIndex1 > ZOrderIndex2)
						{
							int temp = sortedContents[i];
							sortedContents[i] = sortedContents[j];
							sortedContents[j] = temp;
						}
					}
				}
			}

			// show non-document DockContent first to avoid screen flickers
			for (int i=0; i<contents.Length; i++)
			{
				DockContent content = dockPanel.Contents[sortedContents[i]];
				if (content.Pane != null && content.Pane.DockState != DockState.Document)
					content.IsHidden = contents[sortedContents[i]].IsHidden;
			}

			// after all non-document DockContent, show document DockContent
			for (int i=0; i<contents.Length; i++)
			{
				DockContent content = dockPanel.Contents[sortedContents[i]];
				if (content.Pane != null && content.Pane.DockState == DockState.Document)
					content.IsHidden = contents[sortedContents[i]].IsHidden;
			}

			for (int i=0; i<panes.Length; i++)
				dockPanel.Panes[i].ActiveContent = panes[i].IndexActiveContent == -1 ? null : dockPanel.Contents[panes[i].IndexActiveContent];

			if (dockPanelStruct.IndexActiveDocumentPane != -1)
				dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate();

			if (dockPanelStruct.IndexActivePane != -1)
				dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate();

			for (int i=dockPanel.Contents.Count-1; i>=0; i--)
				if (dockPanel.Contents[i] is DummyContent)
					dockPanel.Contents[i].Close();
		}
Esempio n. 16
0
		public static void LoadFromXml(DockPanel dockPanel, string filename, DeserializeDockContent deserializeContent)
		{
			FileStream fs = new FileStream(filename, FileMode.Open);
			try
			{
				LoadFromXml(dockPanel, fs, deserializeContent);
			}
			finally
			{
				fs.Close();
			}
		}
Esempio n. 17
0
		public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding)
		{
			XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding); 

			// Use indenting for readability
			xmlOut.Formatting = Formatting.Indented;
			
			// Always begin file with identification and warning
			xmlOut.WriteStartDocument();
			xmlOut.WriteComment(" DockPanel configuration file. Author: Weifen Luo, all rights reserved. ");
			xmlOut.WriteComment(" !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! ");

			// Associate a version number with the root element so that future version of the code
			// will be able to be backwards compatible or at least recognise out of date versions
			xmlOut.WriteStartElement("DockPanel");
			xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion);
			xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture));
			xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture));
			xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture));
			xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture));
			xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString());
			xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString());

			// Contents
			xmlOut.WriteStartElement("Contents");
			xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString());
			foreach (DockContent content in dockPanel.Contents)
			{
				xmlOut.WriteStartElement("Content");
				xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString());
				xmlOut.WriteAttributeString("PersistString", content.PersistString);
				xmlOut.WriteAttributeString("AutoHidePortion", content.AutoHidePortion.ToString(CultureInfo.InvariantCulture));
				xmlOut.WriteAttributeString("IsHidden", content.IsHidden.ToString());
				xmlOut.WriteAttributeString("IsFloat", content.IsFloat.ToString());
				xmlOut.WriteEndElement();
			}
			xmlOut.WriteEndElement();

			// Panes
			xmlOut.WriteStartElement("Panes");
			xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString());
			foreach (DockPane pane in dockPanel.Panes)
			{
				xmlOut.WriteStartElement("Pane");
				xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString());
				xmlOut.WriteAttributeString("DockState", pane.DockState.ToString());
				xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString());
				xmlOut.WriteStartElement("Contents");
				xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString());
				foreach (DockContent content in pane.Contents)
				{
					xmlOut.WriteStartElement("Content");
					xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString());
					xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString());
					xmlOut.WriteEndElement();
				}
				xmlOut.WriteEndElement();
				xmlOut.WriteEndElement();
			}
			xmlOut.WriteEndElement();

			// DockWindows
			xmlOut.WriteStartElement("DockWindows");
			int count = 0;
			foreach (DockWindow dw in dockPanel.DockWindows)
				if (dw.DockList.Count > 0)
					count++;
			xmlOut.WriteAttributeString("Count", count.ToString());
			int i = 0;
			foreach (DockWindow dw in dockPanel.DockWindows)
			{
				if (dw.DockList.Count == 0)
					continue;
				xmlOut.WriteStartElement("DockWindow");
				xmlOut.WriteAttributeString("ID", i.ToString());
				xmlOut.WriteAttributeString("DockState", dw.DockState.ToString());
				xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString());
				xmlOut.WriteStartElement("DockList");
				xmlOut.WriteAttributeString("Count", dw.DockList.Count.ToString());
				foreach (DockPane pane in dw.DockList)
				{
					xmlOut.WriteStartElement("Pane");
					xmlOut.WriteAttributeString("ID", dw.DockList.IndexOf(pane).ToString());
					xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString());
					NestedDockingStatus status = pane.NestedDockingStatus;
					xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PrevPane).ToString());
					xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString());
					xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture));
					xmlOut.WriteEndElement();
				}
				xmlOut.WriteEndElement();
				xmlOut.WriteEndElement();
				i++;
			}
			xmlOut.WriteEndElement();

			// FloatWindows
			RectangleConverter rectConverter = new RectangleConverter();
			xmlOut.WriteStartElement("FloatWindows");
			xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString());
			foreach (FloatWindow fw in dockPanel.FloatWindows)
			{
				xmlOut.WriteStartElement("FloatWindow");
				xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString());
				xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds));
				xmlOut.WriteAttributeString("AllowRedocking", fw.AllowRedocking.ToString());
				xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString());
				xmlOut.WriteStartElement("DockList");
				xmlOut.WriteAttributeString("Count", fw.DockList.Count.ToString());
				foreach (DockPane pane in fw.DockList)
				{
					xmlOut.WriteStartElement("Pane");
					xmlOut.WriteAttributeString("ID", fw.DockList.IndexOf(pane).ToString());
					xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString());
					NestedDockingStatus status = pane.NestedDockingStatus;
					xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PrevPane).ToString());
					xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString());
					xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture));
					xmlOut.WriteEndElement();
				}
				xmlOut.WriteEndElement();
				xmlOut.WriteEndElement();
			}
			xmlOut.WriteEndElement();	//	</FloatWindows>
			
			xmlOut.WriteEndElement();
			xmlOut.WriteEndDocument();

			// This should flush all actions and close the file
			xmlOut.Close();
		}
Esempio n. 18
0
		public static void SaveAsXml(DockPanel dockPanel, string filename, Encoding encoding)
		{
			FileStream fs = new FileStream(filename, FileMode.Create);
			try
			{
				SaveAsXml(dockPanel, fs, encoding);
			}
			finally
			{
				fs.Close();
			}
		}
Esempio n. 19
0
		public static void SaveAsXml(DockPanel dockPanel, string filename)
		{
			SaveAsXml(dockPanel, filename, Encoding.Unicode);
		}
Esempio n. 20
0
		/**
		* This method is required for Windows Forms designer support.
		* Do not change the method contents inside the source code editor. The Forms designer might
		* not be able to load this method if it was changed manually.
		*/
		public void InitializeComponent() 
		{
			this.dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
			this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
			this.colorDialog = new System.Windows.Forms.ColorDialog();
			this.printDialog = new System.Windows.Forms.PrintDialog();
			this.statusBarPanel = new System.Windows.Forms.StatusBarPanel();
			this.printPreviewDialog = new System.Windows.Forms.PrintPreviewDialog();
			this.statusBar = new System.Windows.Forms.StatusBar();
			this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel)).BeginInit();
			this.SuspendLayout();
			// 
			// dockPanel
			// 
			this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
			this.dockPanel.Location = new System.Drawing.Point(0, 0);
			this.dockPanel.Name = "dockPanel";
			this.dockPanel.Size = new System.Drawing.Size(552, 367);
			this.dockPanel.TabIndex = 6;
			// 
			// openFileDialog
			//
			this.openFileDialog.Filter = "All Files|*.*";
			this.openFileDialog.RestoreDirectory = true;
			//
			// colorDialog
			//
			this.colorDialog.FullOpen = true;
			this.colorDialog.ShowHelp = false;
			// 
			// statusBarPanel
			// 
			this.statusBarPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
			this.statusBarPanel.Width = 536;
			// 
			// printPreviewDialog
			// 
			this.printPreviewDialog.AutoScrollMargin = new System.Drawing.Size(0, 0);
			this.printPreviewDialog.AutoScrollMinSize = new System.Drawing.Size(0, 0);
			this.printPreviewDialog.ClientSize = new System.Drawing.Size(400, 300);
			this.printPreviewDialog.Enabled = true;
			this.printPreviewDialog.Location = new System.Drawing.Point(21, 213);
			this.printPreviewDialog.MinimumSize = new System.Drawing.Size(375, 250);
			this.printPreviewDialog.Name = "printPreviewDialog";
			this.printPreviewDialog.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.printPreviewDialog.TransparencyKey = System.Drawing.Color.Empty;
			this.printPreviewDialog.Visible = false;
			// 
			// statusBar
			// 
			this.statusBar.Location = new System.Drawing.Point(0, 367);
			this.statusBar.Name = "statusBar";
			this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {this.statusBarPanel});
			this.statusBar.ShowPanels = true;
			this.statusBar.Size = new System.Drawing.Size(552, 22);
			this.statusBar.TabIndex = 5;
			// 
			// saveFileDialog
			//
			this.saveFileDialog.Filter = "All Files|*.*";
			this.saveFileDialog.RestoreDirectory = true;
			// 
			// MainForm
			// 
			this.AllowDrop = true;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
			this.ClientSize = new System.Drawing.Size(552, 389);
			this.Controls.Add(this.dockPanel);
			this.Controls.Add(this.statusBar);
			this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Name = "MainForm";
			this.Text = " FlashDevelop";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.OnMainFormClosing);
			this.Activated += new System.EventHandler(this.OnMainFormActivate);
			this.Load += new System.EventHandler(this.OnMainFormLoad);
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanel)).EndInit();
			this.ResumeLayout(false);
		}
		protected internal AutoHideStripOverride(DockPanel dockPanel) : base(dockPanel)
		{
			BackColor = Color.Yellow;//SystemColors.ControlLight;
		}
Esempio n. 22
0
		public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent)
		{
			LoadFromXml(dockPanel, stream, deserializeContent, true);
		}
Esempio n. 23
0
		public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding)
		{
			SaveAsXml(dockPanel, stream, encoding, false);
		}
Esempio n. 24
0
        public void Detach()
        {
            StoreConfiguration();

            DetachPadContents(true);
            DetachViewContents(true);

            try
            {
                if (dockPanel != null)
                {
                    dockPanel.Dispose();
                    dockPanel = null;
                }
            }
            catch (Exception e)
            {
                MessageService.ShowError(e);
            }
            if (contentHash != null)
            {
                contentHash.Clear();
            }

            wbForm.Controls.Clear();
        }
		/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPanel, Rectangle)"]/*'/>
		public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullDockPanel")));

			DockPanel = dockPanel;
			if (FloatPane == null)
			{
				IsHidden = true;	// to reduce the screen flicker
				FloatPane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, false);
				FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
			}

			FloatPane.FloatWindow.Bounds = floatWindowBounds;
			
			Show(dockPanel, DockState.Float);
			Activate();
		}
		/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPanel)"]/*'/>
		public void Show(DockPanel dockPanel)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullDockPanel")));

			if (DockState == DockState.Unknown)
				Show(dockPanel, DefaultShowState);
			else			
				Activate();
		}
Esempio n. 27
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
     this.mnuMain        = new System.Windows.Forms.MainMenu();
     this.mnuFile        = new System.Windows.Forms.MenuItem();
     this.mnuOpen        = new System.Windows.Forms.MenuItem();
     this.mnuSave        = new System.Windows.Forms.MenuItem();
     this.mnuSeparator0  = new System.Windows.Forms.MenuItem();
     this.mnuExit        = new System.Windows.Forms.MenuItem();
     this.mnuView        = new System.Windows.Forms.MenuItem();
     this.mnuLevelDesign = new System.Windows.Forms.MenuItem();
     this.mnuPalette     = new System.Windows.Forms.MenuItem();
     this.mnuProperties  = new System.Windows.Forms.MenuItem();
     this.sbStatus       = new System.Windows.Forms.StatusBar();
     this.sbpnlLocation  = new System.Windows.Forms.StatusBarPanel();
     this.dockMain       = new WeifenLuo.WinFormsUI.DockPanel();
     this.menuItem1      = new System.Windows.Forms.MenuItem();
     this.mnuAll         = new System.Windows.Forms.MenuItem();
     ((System.ComponentModel.ISupportInitialize)(this.sbpnlLocation)).BeginInit();
     this.SuspendLayout();
     //
     // mnuMain
     //
     this.mnuMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.mnuFile,
         this.mnuView
     });
     //
     // mnuFile
     //
     this.mnuFile.Index = 0;
     this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.mnuOpen,
         this.mnuSave,
         this.mnuSeparator0,
         this.mnuExit
     });
     this.mnuFile.Text = "&File";
     //
     // mnuOpen
     //
     this.mnuOpen.Index    = 0;
     this.mnuOpen.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
     this.mnuOpen.Text     = "&Open...";
     this.mnuOpen.Click   += new System.EventHandler(this.mnuOpen_Click);
     //
     // mnuSave
     //
     this.mnuSave.Index    = 1;
     this.mnuSave.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
     this.mnuSave.Text     = "&Save";
     //
     // mnuSeparator0
     //
     this.mnuSeparator0.Index = 2;
     this.mnuSeparator0.Text  = "-";
     //
     // mnuExit
     //
     this.mnuExit.Index    = 3;
     this.mnuExit.Shortcut = System.Windows.Forms.Shortcut.CtrlW;
     this.mnuExit.Text     = "E&xit";
     this.mnuExit.Click   += new System.EventHandler(this.mnuExit_Click);
     //
     // mnuView
     //
     this.mnuView.Index = 1;
     this.mnuView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.mnuLevelDesign,
         this.mnuPalette,
         this.mnuProperties,
         this.menuItem1,
         this.mnuAll
     });
     this.mnuView.Text = "&View";
     //
     // mnuLevelDesign
     //
     this.mnuLevelDesign.Index  = 0;
     this.mnuLevelDesign.Text   = "&Level Design";
     this.mnuLevelDesign.Click += new System.EventHandler(this.mnuLevelDesign_Click);
     //
     // mnuPalette
     //
     this.mnuPalette.Index  = 1;
     this.mnuPalette.Text   = "&Palette";
     this.mnuPalette.Click += new System.EventHandler(this.mnuPalette_Click);
     //
     // mnuProperties
     //
     this.mnuProperties.Index  = 2;
     this.mnuProperties.Text   = "P&roperties";
     this.mnuProperties.Click += new System.EventHandler(this.mnuProperties_Click);
     //
     // sbStatus
     //
     this.sbStatus.Location = new System.Drawing.Point(0, 435);
     this.sbStatus.Name     = "sbStatus";
     this.sbStatus.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
         this.sbpnlLocation
     });
     this.sbStatus.ShowPanels = true;
     this.sbStatus.Size       = new System.Drawing.Size(600, 22);
     this.sbStatus.TabIndex   = 3;
     //
     // dockMain
     //
     this.dockMain.ActiveAutoHideContent = null;
     this.dockMain.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.dockMain.Font     = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
     this.dockMain.Location = new System.Drawing.Point(0, 0);
     this.dockMain.Name     = "dockMain";
     this.dockMain.Size     = new System.Drawing.Size(600, 435);
     this.dockMain.TabIndex = 4;
     //
     // menuItem1
     //
     this.menuItem1.Index = 3;
     this.menuItem1.Text  = "-";
     //
     // mnuAll
     //
     this.mnuAll.Index  = 4;
     this.mnuAll.Text   = "&All";
     this.mnuAll.Click += new System.EventHandler(this.mnuAll_Click);
     //
     // MainForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(600, 457);
     this.Controls.Add(this.dockMain);
     this.Controls.Add(this.sbStatus);
     this.Icon           = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.IsMdiContainer = true;
     this.Menu           = this.mnuMain;
     this.Name           = "MainForm";
     this.Text           = "GLEU - Graphical Level Editing Utility";
     this.KeyDown       += new System.Windows.Forms.KeyEventHandler(this.onKeyDown);
     ((System.ComponentModel.ISupportInitialize)(this.sbpnlLocation)).EndInit();
     this.ResumeLayout(false);
 }
		/// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Method[@name="Show(DockPanel, DockState)"]/*'/>
		public void Show(DockPanel dockPanel, DockState dockState)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(ResourceHelper.GetString("IDockContent.Show.NullDockPanel")));

			if (dockState == DockState.Unknown || dockState == DockState.Hidden)
				throw(new ArgumentException(ResourceHelper.GetString("IDockContent.Show.InvalidDockState")));

			DockPanel = dockPanel;

			if (dockState == DockState.Float && FloatPane == null)
				Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, true);
			else if (PanelPane == null)
			{
				DockPane paneExisting = null;
				foreach (DockPane pane in DockPanel.Panes)
					if (pane.DockState == dockState)
					{
						paneExisting = pane;
						break;
					}

				if (paneExisting == null)
					Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
				else
					Pane = paneExisting;
			}

			DockState = dockState;
			Activate();
		}
		/// <include file='CodeDoc/AutoHideStripVS2003.xml' path='//CodeDoc/Class[@name="AutoHideStripVS2003"]/Construct[@name="(DockPanel)"]/*'/>
		protected internal AutoHideStripVS2003(DockPanel panel) : base(panel)
		{
			SetStyle(ControlStyles.ResizeRedraw, true);
			SetStyle(ControlStyles.UserPaint, true);
			SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			BackColor = Color.WhiteSmoke;
		}
Esempio n. 30
0
        public void Attach(IWorkbench workbench)
        {
            wbForm = (DefaultWorkbench)workbench;
            wbForm.SuspendLayout();
            wbForm.IsMdiContainer = true;

            dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
            dockPanel.ActiveAutoHideContent = null;
            dockPanel.Dock = DockStyle.Fill;
            wbForm.Controls.Add(dockPanel);

            wbForm.Controls.Add(wbForm.TopToolStrip);
            wbForm.Controls.Add(wbForm.TopMenu);

            LoadConfiguration();

            ShowPads();
            //ShowViewContents();
            RedrawAllComponents();

            wbForm.ResumeLayout(false);
        }
Esempio n. 31
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DataCreator));
			this.statBar = new System.Windows.Forms.StatusBar();
			this.dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
			this.toolBar = new System.Windows.Forms.ToolBar();
			this.toolBarButtonTables = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonConnection = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonDocForm = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonCompare = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonOption = new System.Windows.Forms.ToolBarButton();
			this.imageList = new System.Windows.Forms.ImageList(this.components);
			this.msgPanel = new System.Windows.Forms.StatusBarPanel();
			this.statDatabase = new System.Windows.Forms.StatusBarPanel();
			this.statServer = new System.Windows.Forms.StatusBarPanel();
			((System.ComponentModel.ISupportInitialize)(this.msgPanel)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statDatabase)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statServer)).BeginInit();
			this.SuspendLayout();
			// 
			// statBar
			// 
			this.statBar.Location = new System.Drawing.Point(0, 400);
			this.statBar.Name = "statBar";
			this.statBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
																					   this.msgPanel,
																					   this.statDatabase,
																					   this.statServer});
			this.statBar.ShowPanels = true;
			this.statBar.Size = new System.Drawing.Size(536, 22);
			this.statBar.TabIndex = 0;
			this.statBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statBar_DrawItem);
			// 
			// dockPanel
			// 
			this.dockPanel.ActiveAutoHideContent = null;
			this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
			this.dockPanel.Location = new System.Drawing.Point(0, 0);
			this.dockPanel.Name = "dockPanel";
			this.dockPanel.Size = new System.Drawing.Size(536, 400);
			this.dockPanel.TabIndex = 0;
			// 
			// toolBar
			// 
			this.toolBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																					   this.toolBarButtonTables,
																					   this.toolBarButtonConnection,
																					   this.toolBarButtonDocForm,
																					   this.toolBarButtonCompare,
																					   this.toolBarButtonOption});
			this.toolBar.DropDownArrows = true;
			this.toolBar.ImageList = this.imageList;
			this.toolBar.Location = new System.Drawing.Point(0, 0);
			this.toolBar.Name = "toolBar";
			this.toolBar.ShowToolTips = true;
			this.toolBar.Size = new System.Drawing.Size(536, 42);
			this.toolBar.TabIndex = 7;
			this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
			// 
			// toolBarButtonTables
			// 
			this.toolBarButtonTables.ImageIndex = 2;
			this.toolBarButtonTables.Text = "Tables";
			this.toolBarButtonTables.ToolTipText = "Choose Tables";
			// 
			// toolBarButtonConnection
			// 
			this.toolBarButtonConnection.ImageIndex = 4;
			this.toolBarButtonConnection.Text = "Connect";
			this.toolBarButtonConnection.ToolTipText = "Connect to Database";
			// 
			// toolBarButtonDocForm
			// 
			this.toolBarButtonDocForm.ImageIndex = 0;
			this.toolBarButtonDocForm.Text = "SQL";
			this.toolBarButtonDocForm.ToolTipText = "SQL Script";
			// 
			// toolBarButtonCompare
			// 
			this.toolBarButtonCompare.ImageIndex = 9;
			this.toolBarButtonCompare.Text = "Compare";
			this.toolBarButtonCompare.ToolTipText = "Compare with second Database";
			// 
			// toolBarButtonOption
			// 
			this.toolBarButtonOption.ImageIndex = 5;
			this.toolBarButtonOption.Text = "Options";
			// 
			// imageList
			// 
			this.imageList.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// msgPanel
			// 
			this.msgPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
			this.msgPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
			this.msgPanel.Width = 341;
			// 
			// statDatabase
			// 
			this.statDatabase.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Contents;
			this.statDatabase.Text = "Select Database";
			this.statDatabase.Width = 97;
			// 
			// statServer
			// 
			this.statServer.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Contents;
			this.statServer.Text = "Select Server";
			this.statServer.Width = 82;
			// 
			// DataCreator
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(536, 422);
			this.Controls.Add(this.toolBar);
			this.Controls.Add(this.dockPanel);
			this.Controls.Add(this.statBar);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "DataCreator";
			this.Text = "SQL Insert Scripter";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.DataCreator_Load);
			this.Closed += new System.EventHandler(this.DataCreator_Closed);
			((System.ComponentModel.ISupportInitialize)(this.msgPanel)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.statDatabase)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.statServer)).EndInit();
			this.ResumeLayout(false);

		}
 protected internal AutoHideStripOverride(DockPanel dockPanel)
     : base(dockPanel)
 {
     BackColor = Color.Yellow;
 }
Esempio n. 33
0
        private void RefreshChanges()
        {
            Region    region       = new Region(Rectangle.Empty);
            Rectangle rectDockArea = FullPanelEdge ? DockPanel.DockArea : DockPanel.DocumentWindowBounds;

            rectDockArea.Location = DockPanel.PointToScreen(rectDockArea.Location);
            if (ShouldPanelIndicatorVisible(DockState.DockLeft))
            {
                PanelLeft.Location = new Point(rectDockArea.X + _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
                PanelLeft.Visible  = true;
                region.Union(PanelLeft.Bounds);
            }
            else
            {
                PanelLeft.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.DockRight))
            {
                PanelRight.Location = new Point(rectDockArea.X + rectDockArea.Width - PanelRight.Width - _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
                PanelRight.Visible  = true;
                region.Union(PanelRight.Bounds);
            }
            else
            {
                PanelRight.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.DockTop))
            {
                PanelTop.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelTop.Width) / 2, rectDockArea.Y + _PanelIndicatorMargin);
                PanelTop.Visible  = true;
                region.Union(PanelTop.Bounds);
            }
            else
            {
                PanelTop.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.DockBottom))
            {
                PanelBottom.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelBottom.Width) / 2, rectDockArea.Y + rectDockArea.Height - PanelBottom.Height - _PanelIndicatorMargin);
                PanelBottom.Visible  = true;
                region.Union(PanelBottom.Bounds);
            }
            else
            {
                PanelBottom.Visible = false;
            }

            if (ShouldPanelIndicatorVisible(DockState.Document))
            {
                Rectangle rectDocumentWindow = DockPanel.DocumentWindowBounds;
                rectDocumentWindow.Location = DockPanel.PointToScreen(rectDocumentWindow.Location);
                PanelFill.Location          = new Point(rectDocumentWindow.X + (rectDocumentWindow.Width - PanelFill.Width) / 2, rectDocumentWindow.Y + (rectDocumentWindow.Height - PanelFill.Height) / 2);
                PanelFill.Visible           = true;
                region.Union(PanelFill.Bounds);
            }
            else
            {
                PanelFill.Visible = false;
            }

            if (ShouldPaneDiamondVisible())
            {
                Rectangle rect = DockPane.ClientRectangle;
                rect.Location        = DockPane.PointToScreen(rect.Location);
                PaneDiamond.Location = new Point(rect.Left + (rect.Width - PaneDiamond.Width) / 2, rect.Top + (rect.Height - PaneDiamond.Height) / 2);
                PaneDiamond.Visible  = true;
                using (GraphicsPath graphicsPath = PaneDiamond.DisplayingGraphicsPath.Clone() as GraphicsPath)
                {
                    Point[] pts = new Point[]
                    {
                        new Point(PaneDiamond.Left, PaneDiamond.Top),
                        new Point(PaneDiamond.Right, PaneDiamond.Top),
                        new Point(PaneDiamond.Left, PaneDiamond.Bottom)
                    };
                    using (Matrix matrix = new Matrix(PaneDiamond.ClientRectangle, pts))
                    {
                        graphicsPath.Transform(matrix);
                    }
                    region.Union(graphicsPath);
                }
            }
            else
            {
                PaneDiamond.Visible = false;
            }

            Region = region;
        }