Example #1
0
		private void Initialize()
		{
			InitializeComponent();
			if(m_Bar!=null)
				propertyGrid1.BrowsableAttributes=new AttributeCollection(new Attribute[] {BrowsableAttribute.Yes});
			else
				propertyGrid1.BrowsableAttributes=new AttributeCollection(new Attribute[] {DevCoBrowsable.Yes});
			propertyGrid1.CommandsVisibleIfAvailable=false;
			LoadResourceImages();
			m_catTable=new Hashtable(20);
			
			m_GridViewSubclass=new GridViewSubclass();
			m_GridViewSubclass.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown);

			foreach(Control ctrl in propertyGrid1.Controls)
			{
				if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0)
				{
					m_GridViewSubclass.AssignHandle(ctrl.Handle);
					break;
				}
			}

			if(m_DotNetBar!=null && !m_DotNetBar.IsDesignTime() || m_Bar!=null)
			{
				btnCancel.Visible=false;
				btnClose.Location=btnCancel.Location;
			}

			CreateToolbar();
			RefreshView();
		}
Example #2
0
		private void FormClosing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			m_GridViewSubclass.ReleaseHandle();
			m_GridViewSubclass=null;

			if(m_HtmlHelp!=null)
				m_HtmlHelp.CloseHelpWindow();

			// ColorScheme property when changed is not detected, so try to fix it here...
			if(m_DotNetBar!=null)
			{
				foreach(Bar bar in m_DotNetBar.Bars)
				{
					if(bar.ColorScheme._DesignTimeSchemeChanged)
					{
						m_DataChanged=true;
						bar.ColorScheme._DesignTimeSchemeChanged=false;
					}
				}
			}
			else if(m_Bar!=null)
			{
				if(m_Bar.ColorScheme._DesignTimeSchemeChanged)
				{
					m_DataChanged=true;
					m_Bar.ColorScheme._DesignTimeSchemeChanged=false;
				}
			}


			// Save form position
			if(this.WindowState!=FormWindowState.Minimized)
			{
				string s="";
				if(this.WindowState==FormWindowState.Maximized)
				{
					s="1";
				}
				else
				{
					s=this.DesktopLocation.X+","+this.DesktopLocation.Y+","+this.Width+","+this.Height;
				}
				try
				{
					Microsoft.Win32.RegistryKey key=Microsoft.Win32.Registry.CurrentUser;
					key=key.CreateSubKey("Software\\DevComponents\\DotNetBar");
					key.SetValue("DesignerPosition",s);
					// Save Panel size
					key.SetValue("DesignerPanelSize",barTree.Width);
					key.Close();
				}
				catch(Exception)
				{
				}
			}
		}
Example #3
0
		private void InitializeInternal()
		{
			propertyBars.CommandsVisibleIfAvailable=false;
			propertyMenus.CommandsVisibleIfAvailable=false;
			propertyCategories.CommandsVisibleIfAvailable=false;

			m_catTable=new Hashtable(20);
			
			m_GridSubclassBars=new GridViewSubclass();
			m_GridSubclassBars.ParentGrid=propertyBars;
			m_GridSubclassBars.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown);
			m_GridSubclassMenus=new GridViewSubclass();
			m_GridSubclassMenus.ParentGrid=propertyMenus;
			m_GridSubclassMenus.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown);
			m_GridSubclassCategories=new GridViewSubclass();
			m_GridSubclassCategories.ParentGrid=propertyCategories;
			m_GridSubclassCategories.OnRightMouseDown+=new EventHandler(this.GridViewMouseDown);
			
			foreach(Control ctrl in propertyBars.Controls)
			{
				if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0)
				{
					m_GridSubclassBars.AssignHandle(ctrl.Handle);
					break;
				}
			}
			foreach(Control ctrl in propertyMenus.Controls)
			{
				if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0)
				{
					m_GridSubclassMenus.AssignHandle(ctrl.Handle);
					break;
				}
			}
			foreach(Control ctrl in propertyCategories.Controls)
			{
				if(ctrl.GetType().ToString().IndexOf("PropertyGridView")>=0)
				{
					m_GridSubclassCategories.AssignHandle(ctrl.Handle);
					break;
				}
			}
		}