示例#1
0
		/// <summary>
		/// Creates new instance of ExplorerBarGroupItem and assigns the name and text to it.
		/// </summary>
		/// <param name="sItemName">Item name.</param>
		/// <param name="ItemText">item text.</param>
		public ExplorerBarGroupItem(string sItemName, string ItemText):base(sItemName,ItemText)
		{
			m_IsContainer=true;
			m_AllowOnlyOneSubItemExpanded=false;

            m_TitleStyle = new ElementStyle();
            m_TitleStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);
            m_TitleHotStyle = new ElementStyle();
            m_TitleHotStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);
            m_BackStyle = new ElementStyle();
            m_BackStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);

            m_HeaderStyle = new ItemStyleMapper(m_TitleStyle);
            m_HeaderHotStyle = new ItemStyleMapper(m_TitleHotStyle);
            m_BackgroundStyle = new ItemStyleMapper(m_BackStyle);

            SubItemsImageSize = new Size(12, 12);
            ImageSize = new Size(12, 12);

            //try
            //{
            //    m_HeaderStyle.Font=new Font(System.Windows.Forms.SystemInformation.MenuFont,FontStyle.Bold);
            //    m_HeaderHotStyle.Font=new Font(System.Windows.Forms.SystemInformation.MenuFont,FontStyle.Bold);
            //}
            //catch
            //{
            //    m_HeaderStyle.Font=System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font;
            //    m_HeaderHotStyle.Font=System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font;
            //}

			BarFunctions.SetExplorerBarStyle(this,m_StockStyle);

            //m_BackgroundStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged);
            //m_HeaderStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged);
            //m_HeaderHotStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged);
		}
示例#2
0
		/// <summary>
		/// Creates new instance of side bar control.
		/// </summary>
		public ExplorerBar()
		{
			if(!ColorFunctions.ColorsLoaded)
			{
				NativeFunctions.RefreshSettings();
				NativeFunctions.OnDisplayChange();
				ColorFunctions.LoadColors();
			}
			m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003);

			m_ItemContainer=new ExplorerBarContainerItem();
			m_ItemContainer.GlobalItem=false;
			m_ItemContainer.ContainerControl=this;
			m_ItemContainer.Stretch=false;
			m_ItemContainer.Displayed=true;
			m_ItemContainer.SetOwner(this);

			//this.SetStyle(ControlStyles.Selectable,false);
			this.SetStyle(ControlStyles.UserPaint,true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint,true);
			this.SetStyle(ControlStyles.Opaque,true);
			this.SetStyle(ControlStyles.ResizeRedraw,true);
			this.SetStyle(DisplayHelp.DoubleBufferFlag,true);
			this.SetStyle(ControlStyles.ContainerControl,true);
			this.SetStyle(ControlStyles.SupportsTransparentBackColor,true);

			this.TabStop=true;

			#if TRIAL
				RemindForm frm=new RemindForm();
				frm.ShowDialog();
			#endif

			try
			{
				m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR");
				m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR");
				m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR");
			}
			catch(Exception)
			{
				m_MoveCursor=null;
				m_CopyCursor=null;
				m_NACursor=null;
			}

			ApplyDefaultSettings();
			m_BackStyle.StyleChanged+=new EventHandler(this.VisualPropertyChanged);

			this.AccessibleRole=AccessibleRole.ToolBar;

            m_BackgroundStyle = new ItemStyleMapper(m_BackStyle);
		}