示例#1
0
        public SuperTabControlPanel()
        {
            _PanelStyle = new ElementStyle();
            _PanelColor = new SuperTabPanelColorTable();

            _PanelColor.ColorTableChanged += PanelColor_ColorTableChanged;
        }
示例#2
0
        private void InitChannelList()
        {
            ElementStyle elementStyle = new ElementStyle();
            elementStyle.TextColor = Color.SlateGray;
            elementStyle.Font = new Font(this.channel_list.Font.FontFamily, 9f, FontStyle.Bold);
            elementStyle.Name = "groupstyle";
            this.favorite_list.Styles.Add(elementStyle);
            this.channel_list.Styles.Add(elementStyle);
            ElementStyle gray = new ElementStyle();
            gray.TextColor = Color.SlateGray;
            gray.Name = "subitemstyle";
            this.favorite_list.Styles.Add(gray);
            this.channel_list.Styles.Add(gray);
            gray = new ElementStyle();
            gray.TextColor = Color.Maroon;
            gray.Name = "subitemphone";
            this.channel_list.Styles.Add(gray);
            this.favorite_list.Styles.Add(gray);

            this.channel_list.GroupNodeCreated += AdvTree7GroupNodeCreated;
            this.channel_list.DataNodeCreated += AdvTree7DataNodeCreated;
            //this.channel_list.TileSize = new Size(250, 60);
            this.channel_list.TileSize = new Size(250, 40);
            this.channel_list.GroupingMembers = "Group";
            this.channel_list.DisplayMembers = "Name,EPGnow,EPGnext,Url";

            this.favorite_list.GroupNodeCreated += AdvTreeGroupNodeCreated;
            this.favorite_list.DataNodeCreated += AdvTreeDataNodeCreated;
            //this.favorite_list.TileSize = new Size(250, 60);
            this.favorite_list.TileSize = new Size(250, 40);
            this.favorite_list.GroupingMembers = "Group";
            this.favorite_list.DisplayMembers = "Name,EPGnow,EPGnext,Url";
        }
 public NodeRendererEventArgs(Graphics g, Node node, Rectangle bounds, ElementStyle style, Color color)
 {
     this.Graphics = g;
     this.Node = node;
     this.NodeBounds = bounds;
     this.Style = style;
     this.Color = color;
 }
示例#4
0
 public ItemStyleMapper(ElementStyle style)
 {
     m_ElementStyle=style;
     m_BackColor1=new ColorExMapper("BackColor",style);
     m_BackColor2=new ColorExMapper("BackColor2",style);
     m_ForeColor=new ColorExMapper("TextColor",style);
     m_BorderColor=new ColorExMapper("BorderColor",style);
 }
 /// <summary>
 /// Initializes a new instance of the ColumnHeaderRendererEventArgs class.
 /// </summary>
 /// <param name="columnHeader"></param>
 /// <param name="graphics"></param>
 /// <param name="bounds"></param>
 /// <param name="style"></param>
 public ColumnHeaderRendererEventArgs(AdvTree tree, ColumnHeader columnHeader, Graphics graphics, Rectangle bounds, ElementStyle style)
 {
     Tree = tree;
     ColumnHeader = columnHeader;
     Graphics = graphics;
     Bounds = bounds;
     Style = style;
 }
示例#6
0
        /// <summary>
        /// Creates new instance of the ItemContainer object.
        /// </summary>
        public ItemContainer()
        {
            m_IsContainer = true;
            this.AutoCollapseOnClick = true;
            this.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;

            //m_Padding.SpacingChanged += new EventHandler(PaddingChanged);
            //m_Margin.SpacingChanged += new EventHandler(MarginChanged);

            m_BackgroundStyle.StyleChanged += BackgroundStyleChanged;

            _TitleStyle = new ElementStyle();
            _TitleStyle.StyleChanged += TitleStyleChanged;
        }
示例#7
0
        /// <summary>
        /// Creates new instance of the object.
        /// </summary>
        public BaseItemControl()
        {
            if (!ColorFunctions.ColorsLoaded)
            {
                NativeFunctions.RefreshSettings();
                NativeFunctions.OnDisplayChange();
                ColorFunctions.LoadColors();
            }

            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.StandardDoubleClick, true);
            this.SetStyle(DisplayHelp.DoubleBufferFlag, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            m_ColorScheme = new ColorScheme(eDotNetBarStyle.Office2007);
            m_BackgroundStyle = new ElementStyle();
            m_BackgroundStyle.SetColorScheme(m_ColorScheme);
            m_BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);
        }
示例#8
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);
		}
示例#9
0
		private NodeCellRendererEventArgs GetCellDisplayInfo(ElementStyle style, Graphics g, Cell cell, Point cellOffset, ColorScheme cs)
		{
			m_CellDisplayInfo.Cell=cell;
			m_CellDisplayInfo.Graphics=g;
			m_CellDisplayInfo.Style=style;
			m_CellDisplayInfo.CellOffset=cellOffset;
            m_CellDisplayInfo.ColorScheme = cs;
			return m_CellDisplayInfo;
		}
示例#10
0
		private void PaintSingleNode(Node node, NodeDisplayContext context)
		{
            _PaintedNodes.Add(node);
			Rectangle r=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.NodeContentBounds,node,context.Offset);
			TreeRenderer renderer=context.NodeRenderer;
			if(node.NodeRenderer!=null && node.RenderMode==eNodeRenderMode.Custom)
				renderer = node.NodeRenderer;
            bool isSelected = node.IsSelectionVisible && node.IsSelected;

			// Paint node background
            ElementStyle style = GetEffectiveNodeBackgroundStyle(node, context);

			Region backRegion=null;
			if(style!=null)
			{
				context.NodeRendererEventArgs.Graphics=context.Graphics;
				context.NodeRendererEventArgs.Node = node;
				context.NodeRendererEventArgs.NodeBounds = r;
				context.NodeRendererEventArgs.Style = style;
                if (!node.FullRowBackground) // Node full row backgrounds are drawn first...
                    renderer.DrawNodeBackground(context.NodeRendererEventArgs);
                ElementStyleDisplayInfo di = new ElementStyleDisplayInfo(style, context.Graphics, context.NodeRendererEventArgs.NodeBounds);
                di.Bounds.Inflate(1, 1);
				backRegion=ElementStyleDisplay.GetStyleRegion(di);
                di.Bounds = r;
			}

            if (NodeDisplay.DrawExpandPart(node) && context.ExpandDisplayInfo != null)
            {
                r = NodeDisplay.GetNodeRectangle(eNodeRectanglePart.ExpandBounds, node, context.Offset);
                context.ExpandDisplayInfo.Node = node;
                context.ExpandDisplayInfo.ExpandPartBounds = r;
                context.ExpandDisplayInfo.IsMouseOver = node.MouseOverNodePart == eMouseOverNodePart.Expand;
                renderer.DrawNodeExpandPart(context.ExpandDisplayInfo);
            }

            if (NodeDisplay.HasColumnsVisible(node))
            {
                PaintColumnHeaders(node.NodesColumns, context.Graphics, false);
            }

			Region oldRegion=null;
			if(backRegion!=null)
			{
				oldRegion=context.Graphics.Clip;
				context.Graphics.SetClip(backRegion,CombineMode.Intersect);
			}
			
			ElementStyle cellStyle = null;
            if (context.CellStyleDefault == null)
            {
                cellStyle = new ElementStyle();
                cellStyle.TextColor = style.TextColor;
                cellStyle.TextShadowColor = style.TextShadowColor;
                cellStyle.TextShadowOffset = style.TextShadowOffset;
                cellStyle.TextAlignment = style.TextAlignment;
                cellStyle.TextLineAlignment = style.TextLineAlignment;
                cellStyle.TextTrimming = style.TextTrimming;
                cellStyle.WordWrap = style.WordWrap;
                cellStyle.Font = style.Font;
                cellStyle.UseMnemonic = style.UseMnemonic;
            }
            
			foreach(Cell cell in node.Cells)
			{
                if (!cell.IsVisible) continue;
                if (cell.StyleNormal != null)
                {
                    if (context.CellStyleDefault != null)
                        style = context.CellStyleDefault.Copy();
                    else
                        style = cellStyle.Copy();
                    style.ApplyStyle(cell.StyleNormal);
                }
                else if (context.CellStyleDefault != null)
                    style = context.CellStyleDefault.Copy();
                else
                {
                    if (!cell.Enabled || cell.IsMouseDown && (cell.StyleMouseDown != null || context.CellStyleMouseDown != null) ||
                        cell.IsSelected && (cell.StyleSelected != null || context.CellStyleSelected != null) ||
                        cell.IsMouseOver && (cell.StyleMouseOver != null || context.CellStyleMouseOver != null))
                        style = cellStyle.Copy();
                    else
                        style = cellStyle;
                }

				if(!cell.Enabled && cell.StyleDisabled!=null)
					style.ApplyStyle(cell.StyleDisabled);
				else if(!cell.Enabled && context.CellStyleDisabled!=null)
					style.ApplyStyle(context.CellStyleDisabled);
				else if(cell.IsMouseDown && cell.StyleMouseDown!=null)
					style.ApplyStyle(cell.StyleMouseDown);
				else if(cell.IsMouseDown && context.CellStyleMouseDown!=null)
					style.ApplyStyle(context.CellStyleMouseDown);
				else 
				{
					if(cell.IsSelected && cell.StyleSelected!=null)
						style.ApplyStyle(cell.StyleSelected);
                    else if (cell.IsSelected && context.CellStyleSelected != null && context.CellStyleSelected.Custom)
						style.ApplyStyle(context.CellStyleSelected);

					if(cell.IsMouseOver && cell.StyleMouseOver!=null)
						style.ApplyStyle(cell.StyleMouseOver);
					else if(cell.IsMouseOver && context.CellStyleMouseOver!=null)
						style.ApplyStyle(context.CellStyleMouseOver);
				}

				r=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.NodeBounds,node,context.Offset);
				
				if(style!=null)
				{
					if(style.Font==null)
						style.Font=context.DefaultFont;
                    if (isSelected)
                    {
                        style.BackColor = Color.Empty;
                        style.BackColorSchemePart = eColorSchemePart.None;
                        style.BackColor2 = Color.Empty;
                        style.BackColor2SchemePart = eColorSchemePart.None;
                    }

					Rectangle rCell=cell.BoundsRelative;
					Rectangle rText=cell.TextContentBounds;
					rCell.Offset(r.Location);
					rText.Offset(r.Location);
					ElementStyleDisplayInfo di=GetElementStyleDisplayInfo(style,context.Graphics,rCell);
					ElementStyleDisplay.Paint(di);
					NodeCellRendererEventArgs ci=GetCellDisplayInfo(style,context.Graphics,cell,r.Location, context.ColorScheme);
					
					if(ci.Cell.CheckBoxVisible)
						renderer.DrawCellCheckBox(ci);
					if(!ci.Cell.Images.LargestImageSize.IsEmpty)
						renderer.DrawCellImage(ci);
					renderer.DrawCellText(ci);
                    if (context.View == eView.Tile && node.HasChildNodes && !context.TileGroupLineColor.IsEmpty)
                        renderer.DrawTileGroupLine(new NodeRendererEventArgs(context.Graphics, node, r, style, context.TileGroupLineColor));                        
				}
			}

            if (backRegion != null)
            {
                context.Graphics.SetClip(oldRegion, CombineMode.Replace);
                backRegion.Dispose();
            }
            if(oldRegion!=null) oldRegion.Dispose();
		}
示例#11
0
文件: FormMain.cs 项目: marlonnn/VPI
 private void SetAdvTreeNodeColor(Color color, Node node)
 {
     ElementStyle style = new ElementStyle();
     style.BackColor = color;
     node.Style = style;
 }
示例#12
0
        private ElementStyle GetBackgroundStyle()
        {
            if (m_CachedStyle != null)
                return m_CachedStyle;

            ElementStyle style = new ElementStyle();

            if (this.EffectiveStyle == eDotNetBarStyle.Office2000 || this.EffectiveStyle == eDotNetBarStyle.OfficeXP)
            {
                style.Border = eStyleBorderType.Solid;
                style.BorderWidth = 1;
                style.BorderColor = SystemColors.ControlDark;
                style.BackColor = SystemColors.Control;
                style.TextColor = SystemColors.ControlText;
            }
            else if (this.EffectiveStyle == eDotNetBarStyle.Office2003 || this.EffectiveStyle == eDotNetBarStyle.VS2005 || BarFunctions.IsOffice2007Style(this.EffectiveStyle))
            {
                ColorScheme scheme = null;
                if (this.ContainerControl is Bar)
                    scheme = ((Bar)this.ContainerControl).ColorScheme;
                else if (this.ContainerControl is MenuPanel)
                    scheme = ((MenuPanel)this.ContainerControl).ColorScheme;
                if (scheme == null)
                    scheme = new ColorScheme(this.EffectiveStyle);

                style.Border = eStyleBorderType.Solid;
                style.BorderWidth = 1;
                style.BorderColorSchemePart = eColorSchemePart.BarDockedBorder;
                style.BackColorSchemePart = eColorSchemePart.BarBackground;
                style.BackColor2SchemePart = eColorSchemePart.BarBackground2;
                style.BackColorGradientAngle = 90;
                style.TextColorSchemePart = eColorSchemePart.ItemPressedText;
            }
            style.TextLineAlignment = eStyleTextAlignment.Center;
            style.TextAlignment = eStyleTextAlignment.Center;
            m_CachedStyle = style;

            return m_CachedStyle;
        }
示例#13
0
 public void ResetBackgroundStyle()
 {
     if(m_BackgroundStyle!=null)
         m_BackgroundStyle.StyleChanged -= new EventHandler(this.VisualPropertyChanged);
     m_BackgroundStyle = new ElementStyle();
     m_BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);
     this.Refresh();
 }
示例#14
0
        private AdvTree.AdvTree CreatePropertyTree()
        {

            AdvTree.AdvTree tree = new DevComponents.AdvTree.AdvTree();
#if (!TRIAL)
            tree.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
#endif
            // Default node style
            ElementStyle elementStyle1 = new ElementStyle();
            elementStyle1.Name = STR_DefaultNodeStyle;
            elementStyle1.TextColor = System.Drawing.SystemColors.ControlText;
            elementStyle1.TextTrimming = eStyleTextTrimming.None;
            elementStyle1.TextLineAlignment = eStyleTextAlignment.Center;
            tree.Styles.Add(elementStyle1);
            tree.NodeStyle = elementStyle1;

            _ReadOnlyStyle = new ElementStyle();
            _ReadOnlyStyle.Name = "ReadOnlyStyle";
            _ReadOnlyStyle.TextColor = SystemColors.ControlDark;
            _ReadOnlyStyle.TextTrimming = eStyleTextTrimming.None;
            tree.Styles.Add(_ReadOnlyStyle);

            // Category style
            _CategoryStyle = new ElementStyle();
            _CategoryStyle.Name = "CategoryStyle";
            _CategoryStyle.TextColor = System.Drawing.SystemColors.ControlText;
            _CategoryStyle.BackColorSchemePart = eColorSchemePart.PanelBackground;
            _CategoryStyle.Font = new Font(this.Font, FontStyle.Bold);
            tree.Styles.Add(_CategoryStyle);

            // Value Changed Style
            _ValueChangedStyle = new ElementStyle();
            _ValueChangedStyle.Name = "ValueChangedStyle";
            _ValueChangedStyle.Font = new Font(this.Font, FontStyle.Bold);
            tree.Styles.Add(_ValueChangedStyle);

            tree.AccessibleRole = System.Windows.Forms.AccessibleRole.Outline;
            tree.AllowDrop = false;
            tree.DragDropEnabled = false;
            tree.BackColor = System.Drawing.SystemColors.Window;
            tree.BackgroundStyle.Class = "TreeBorderKey";
            tree.Name = "propertyTree";
            tree.PathSeparator = ";";
            tree.Size = new System.Drawing.Size(150, 100);
            tree.TabIndex = 0;
            tree.ExpandWidth = 12;
            tree.ExpandButtonType = eExpandButtonType.Triangle;
            tree.Indent = 0;
            tree.GridRowLines = true;
            tree.GridColumnLines = true;
            tree.GridColumnLineResizeEnabled = true;
            tree.GridLinesColor = Color.WhiteSmoke;
            tree.HScrollBarVisible = false;
            tree.SelectionPerCell = true;
            tree.SelectionBoxStyle = eSelectionStyle.FullRowSelect;
            tree.SelectionFocusAware = false;
            tree.CellHorizontalSpacing = 2;
            tree.BeforeNodeSelect += new AdvTreeNodeCancelEventHandler(PropertyTreeBeforeNodeSelect);
            tree.KeyboardSearchEnabled = false;
            tree.KeyPress += new KeyPressEventHandler(PropertyTreeKeyPress);
            tree.ColumnResizing += new EventHandler(PropertyTreeColumnResized);
            tree.DoubleClick += new EventHandler(PropertyTreeDoubleClick);
            tree.Leave += new EventHandler(PropertyTreeLeave);

            AdvTree.ColumnHeader header = new DevComponents.AdvTree.ColumnHeader();
            header.Name = "propertyName";
            header.Width.Relative = 50;
            tree.Columns.Add(header);

            header = new DevComponents.AdvTree.ColumnHeader();
            header.Name = "propertyValue";
            header.Width.Relative = 50;
            tree.Columns.Add(header);

            tree.ColumnsVisible = false;

            tree.Dock = DockStyle.Fill;
            return tree;
        }
示例#15
0
 /// <summary>
 /// Initializes new instance of Cell class.
 /// </summary>
 /// <param name="text">Cell text.</param>
 public Cell(string text, ElementStyle styleNormal)
     : this(text)
 {
     this.StyleNormal = styleNormal;
 }
示例#16
0
		public void ResetBackgroundMouseOverStyle()
		{
			m_BackgroundMouseOverStyle.StyleChanged-=new EventHandler(this.VisualPropertyChanged);
			m_BackgroundMouseOverStyle=new ElementStyle();
			m_BackgroundMouseOverStyle.StyleChanged+=new EventHandler(this.VisualPropertyChanged);
            this.Invalidate();
		}
示例#17
0
        /// <summary>
        /// Starts fade background color style highlight for the property node.
        /// </summary>
        /// <param name="color">Specifies the fade background color.</param>
        public void StartHighlight(Color color)
        {
            if (_HighlightWorker == null)
            {
                _HighlightWorker = new BackgroundWorker();
                _HighlightWorker.WorkerSupportsCancellation = true;
                _HighlightWorker.DoWork += new DoWorkEventHandler(HighlightWorkerDoWork);
                _HighlightWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(HighlightWorkerCompleted);
                if (this.Style != null)
                {
                    _HighlightStyle = this.Style.Copy();
                }
                else
                {
                    AdvTree.AdvTree tree = this.TreeControl;
                    if (tree != null && tree.NodeStyle != null)
                        _HighlightStyle = tree.NodeStyle.Copy();
                    else
                        _HighlightStyle = new ElementStyle();
                }
            }
            else if (_HighlightWorker.IsBusy)
            {
                _HighlightWorker.CancelAsync();
                return;
            }

            _HighlightStyle.BackColor = color;
            this.Style = _HighlightStyle;
            _HighlightWorker.RunWorkerAsync(this.TreeControl);
        }
示例#18
0
		protected ElementStyle GetDefaultNodeStyle()
		{
			ElementStyle style=new ElementStyle();
			style.TextColorSchemePart=eColorSchemePart.ItemText;

			return style;
		}
示例#19
0
 private void DisposeStyleFont(ElementStyle style)
 {
     if (style == null) return;
     if (style.Font != null)
     {
         style.Font.Dispose();
         style.Font = null;
     }
 }
示例#20
0
        //private int _ExpandAreaWidth = 24;
        ///// <summary>
        ///// Returns width of the expand button area. Default is 24 pixels.
        ///// </summary>
        //public virtual int ExpandAreaWidth
        //{
        //    get { return _ExpandAreaWidth; }
        //    set
        //    {
        //        _ExpandAreaWidth = value;
        //    }
        //}

        ///// <summary>
        ///// Gets or sets width of command button area. Default is 8 pixels.
        ///// </summary>
        //public virtual int CommandAreaWidth
        //{
        //    get {return m_CommandAreaWidth;}
        //    set {m_CommandAreaWidth=value;}
        //}

		/// <summary>
		/// Sets the position and size of the node command button.
		/// </summary>
		/// <param name="layoutInfo">Node layout context information</param>
		protected virtual void LayoutCommandPart(NodeLayoutContextInfo layoutInfo, ElementStyle nodeStyle)
		{
			// Command part is right-aligned just before the node border
            Rectangle bounds = new Rectangle(layoutInfo.ContextNode.ContentBounds.Right - this.LayoutSettings.CommandAreaWidth -
				ElementStyleLayout.StyleSpacing(nodeStyle,eSpacePart.Border,eStyleSide.Right),layoutInfo.ContextNode.ContentBounds.Y+
				ElementStyleLayout.StyleSpacing(nodeStyle,eSpacePart.Border,eStyleSide.Top),
                this.LayoutSettings.CommandAreaWidth, layoutInfo.ContextNode.ContentBounds.Height -
				ElementStyleLayout.StyleSpacing(nodeStyle,eSpacePart.Border,eStyleSide.Top)-
				ElementStyleLayout.StyleSpacing(nodeStyle,eSpacePart.Border,eStyleSide.Bottom));
//			Rectangle bounds=new Rectangle(layoutInfo.ContextNode.ContentBounds.Right-this.CommandAreaWidth-
//				ElementStyleLayout.StyleSpacing(nodeStyle,eSpacePart.Border,eStyleSide.Right),layoutInfo.ContextNode.ContentBounds.Y, 
//				this.CommandAreaWidth, layoutInfo.ContextNode.ContentBounds.Height);
			layoutInfo.ContextNode.CommandBoundsRelative=bounds;
		}
示例#21
0
 public ColorDescription(ElementStyle style, Color chunkColor, Color chunkColor2, int chunkGradientAngle)
 {
     this.BackgroundStyle = style;
     this.ChunkColor = chunkColor;
     this.ChunkColor2 = chunkColor2;
     this.ChunkGradientAngle = chunkGradientAngle;
 }
		/// <summary>
		/// Creates new instance of the class and initializes it with default values.
		/// </summary>
		/// <param name="g">Reference to graphics object.</param>
		/// <param name="node">Reference to context node.</param>
		/// <param name="bounds">Reference to node bounds</param>
		/// <param name="style">Reference to cell style</param>
		/// <param name="cell">Reference to cell</param>
		/// <param name="cellBounds">Reference to cell bounds</param>
		public NodeCellRendererEventArgs(Graphics g, Node node, Rectangle bounds, ElementStyle style, Cell cell, Rectangle cellBounds):base(g,node,bounds,style)
		{
			this.Cell = cell;
			this.CellBounds = cellBounds;
		}
示例#23
0
 protected override void OnStyleChanged()
 {
     m_CachedStyle = null;
     base.OnStyleChanged();
 }
示例#24
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
            this.buttonX1 = new DevComponents.DotNetBar.ButtonX();
            this.buttonRemoveItem = new DevComponents.DotNetBar.ButtonX();
            this.buttonAddItem = new DevComponents.DotNetBar.ButtonX();
            this.advTree1 = new DevComponents.AdvTree.AdvTree();
            this.columnHeader1 = new DevComponents.AdvTree.ColumnHeader();
            this.columnHeader2 = new DevComponents.AdvTree.ColumnHeader();
            this.node1 = new DevComponents.AdvTree.Node();
            this.elementStyle1 = new DevComponents.DotNetBar.ElementStyle();
            this.label1 = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.advTree1)).BeginInit();
            this.SuspendLayout();
            // 
            // propertyGrid1
            // 
            this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.propertyGrid1.Location = new System.Drawing.Point(300, 3);
            this.propertyGrid1.Name = "propertyGrid1";
            this.propertyGrid1.Size = new System.Drawing.Size(284, 331);
            this.propertyGrid1.TabIndex = 4;
            this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
            // 
            // buttonX1
            // 
            this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.buttonX1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.buttonX1.Location = new System.Drawing.Point(515, 341);
            this.buttonX1.Name = "buttonX1";
            this.buttonX1.Shape = new DevComponents.DotNetBar.RoundRectangleShapeDescriptor();
            this.buttonX1.Size = new System.Drawing.Size(69, 24);
            this.buttonX1.TabIndex = 5;
            this.buttonX1.Text = "&Close";
            this.buttonX1.Click += new System.EventHandler(this.buttonX1_Click);
            // 
            // buttonRemoveItem
            // 
            this.buttonRemoveItem.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.buttonRemoveItem.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.buttonRemoveItem.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.buttonRemoveItem.Enabled = false;
            this.buttonRemoveItem.FocusCuesEnabled = false;
            this.buttonRemoveItem.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonRemoveItem.Location = new System.Drawing.Point(32, 341);
            this.buttonRemoveItem.Name = "buttonRemoveItem";
            this.buttonRemoveItem.Shape = new DevComponents.DotNetBar.RoundRectangleShapeDescriptor();
            this.buttonRemoveItem.Size = new System.Drawing.Size(24, 24);
            this.buttonRemoveItem.TabIndex = 3;
            this.buttonRemoveItem.Click += new System.EventHandler(this.buttonRemoveItem_Click);
            // 
            // buttonAddItem
            // 
            this.buttonAddItem.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.buttonAddItem.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.buttonAddItem.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.buttonAddItem.FocusCuesEnabled = false;
            this.buttonAddItem.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonAddItem.Location = new System.Drawing.Point(4, 341);
            this.buttonAddItem.Name = "buttonAddItem";
            this.buttonAddItem.Shape = new DevComponents.DotNetBar.RoundRectangleShapeDescriptor();
            this.buttonAddItem.Size = new System.Drawing.Size(24, 24);
            this.buttonAddItem.TabIndex = 1;
            this.buttonAddItem.Click += new System.EventHandler(this.buttonAddItem_Click);
            // 
            // advTree1
            // 
            this.advTree1.AccessibleRole = System.Windows.Forms.AccessibleRole.Outline;
            this.advTree1.AllowDrop = true;
            this.advTree1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)));
            this.advTree1.BackColor = System.Drawing.SystemColors.Window;
            // 
            // 
            // 
            this.advTree1.BackgroundStyle.Class = "TreeBorderKey";
            this.advTree1.Columns.Add(this.columnHeader1);
            this.advTree1.Columns.Add(this.columnHeader2);
            this.advTree1.ExpandButtonType = DevComponents.AdvTree.eExpandButtonType.Triangle;
            this.advTree1.ExpandWidth = 18;
            this.advTree1.Location = new System.Drawing.Point(3, 3);
            this.advTree1.Name = "advTree1";
            this.advTree1.Nodes.AddRange(new DevComponents.AdvTree.Node[] {
            this.node1});
            this.advTree1.NodeStyle = this.elementStyle1;
            this.advTree1.PathSeparator = ";";
            this.advTree1.SelectionBoxStyle = DevComponents.AdvTree.eSelectionStyle.FullRowSelect;
            this.advTree1.Size = new System.Drawing.Size(291, 332);
            this.advTree1.Styles.Add(this.elementStyle1);
            this.advTree1.SuspendPaint = false;
            this.advTree1.TabIndex = 0;
            this.advTree1.Text = "advTree1";
            this.advTree1.AfterNodeDrop += new DevComponents.AdvTree.TreeDragDropEventHandler(this.advTree1_AfterNodeDrop);
            this.advTree1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.advTree1_MouseUp);
            this.advTree1.AfterNodeSelect += new DevComponents.AdvTree.AdvTreeNodeEventHandler(this.advTree1_AfterNodeSelect);
            // 
            // columnHeader1
            // 
            this.columnHeader1.Name = "columnHeader1";
            this.columnHeader1.Text = "Text";
            this.columnHeader1.Width.Relative = 70;
            // 
            // columnHeader2
            // 
            this.columnHeader2.Name = "columnHeader2";
            this.columnHeader2.Text = "Name";
            this.columnHeader2.Width.Relative = 30;
            // 
            // node1
            // 
            this.node1.Expanded = true;
            this.node1.Name = "node1";
            this.node1.Text = "node1";
            // 
            // elementStyle1
            // 
            this.elementStyle1.Name = "elementStyle1";
            this.elementStyle1.TextColor = System.Drawing.SystemColors.ControlText;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(153, 352);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(141, 13);
            this.label1.TabIndex = 6;
            this.label1.Text = "Drag && drop items to re-order";
            this.label1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            // 
            // CrumbBarItemsEditor
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = Color.White;
            this.Controls.Add(this.label1);
            this.Controls.Add(this.buttonX1);
            this.Controls.Add(this.propertyGrid1);
            this.Controls.Add(this.buttonRemoveItem);
            this.Controls.Add(this.buttonAddItem);
            this.Controls.Add(this.advTree1);
            this.Name = "CrumbBarItemsEditor";
            this.Size = new System.Drawing.Size(587, 373);
            this.Load += new System.EventHandler(this.CrumbBarItemsEditor_Load);
            ((System.ComponentModel.ISupportInitialize)(this.advTree1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
示例#25
0
 private ElementStyle GetDefaultColumnStyleNormal(TreeRenderer renderer)
 {
     if (renderer != null && renderer.Office2007ColorTable != null)
     {
         return renderer.Office2007ColorTable.StyleClasses[ElementStyleClassKeys.TreeColumnKey] as ElementStyle;
     }
     else
     {
         ElementStyle style = new ElementStyle();
         style.TextColor = ColorScheme.GetColor(0x000000);
         return style;
     }
 }
示例#26
0
 /// <summary>
 /// Creates node and initializes its text and Style property.
 /// </summary>
 public Node(string text, ElementStyle nodeStyle)
     : this()
 {
     this.Text = text;
     this.Style = nodeStyle;
 }
示例#27
0
//		private void MoveHostedControls(Node node, NodeDisplayContext context)
//		{
//			foreach(Cell cell in node.Cells)
//			{
//				if(cell.HostedControl!=null && cell.HostedControl.Visible)
//				{
//					Rectangle bounds = NodeDisplay.GetCellRectangle(eCellRectanglePart.TextBounds, cell, context.Offset);
//					if(cell.HostedControl.Bounds!=bounds)
//						cell.HostedControl.Bounds=bounds;
//					return;
//				}
//			}
//		}

		private ElementStyleDisplayInfo GetElementStyleDisplayInfo(ElementStyle style, Graphics g, Rectangle bounds)
		{
			m_ElementStyleDisplayInfo.Style=style;
			m_ElementStyleDisplayInfo.Graphics=g;
			m_ElementStyleDisplayInfo.Bounds=bounds;
			return m_ElementStyleDisplayInfo;
		}
示例#28
0
		public RibbonBar()
		{
            //this.BackColor = Color.Transparent;
			m_ItemContainer=new ItemContainer();
			m_ItemContainer.GlobalItem=false;
			m_ItemContainer.ContainerControl=this;
			m_ItemContainer.Stretch=false;
			m_ItemContainer.Displayed=true;
			m_ItemContainer.Style=eDotNetBarStyle.StyleManagerControlled;
			this.ColorScheme.Style=eDotNetBarStyle.StyleManagerControlled;
			m_ItemContainer.SetOwner(this);
			m_ItemContainer.SetSystemContainer(true);
			this.SetBaseItemContainer(m_ItemContainer);
            this.DragDropSupport = true;
			m_TitleStyle=new ElementStyle();
			m_TitleStyle.SetColorScheme(this.GetColorScheme());
			m_TitleStyle.StyleChanged+=new EventHandler(ElementStyleChanged);

            m_TitleStyleMouseOver = new ElementStyle();
            m_TitleStyleMouseOver.SetColorScheme(this.GetColorScheme());
            m_TitleStyleMouseOver.StyleChanged += new EventHandler(ElementStyleChanged);

            m_BackgroundMouseOverStyle.SetColorScheme(this.GetColorScheme());
            m_BackgroundMouseOverStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);

            this.ItemAdded += new EventHandler(RibbonBar_ItemAdded);
            this.ItemRemoved += new ItemRemovedEventHandler(RibbonBar_ItemRemoved);
		}
示例#29
0
 private ElementStyle GetDefaultNodesHeaderStyle(TreeRenderer renderer)
 {
     if (renderer != null && renderer.Office2007ColorTable != null)
     {
         return renderer.Office2007ColorTable.StyleClasses[ElementStyleClassKeys.TreeNodesColumnsHeaderKey] as ElementStyle;
     }
     else
     {
         ElementStyle style = new ElementStyle();
         style.BackColor = ColorScheme.GetColor(0xF9FCFD);
         style.BackColor2 = ColorScheme.GetColor(0xD3DBE9);
         style.BackColorGradientAngle = 90;
         style.TextColor = ColorScheme.GetColor(0x000000);
         style.BorderColor = ColorScheme.GetColor(0x9EB6CE);
         style.BorderBottom = eStyleBorderType.Solid;
         style.BorderBottomWidth = 1;
         style.BorderLeft = eStyleBorderType.Solid;
         style.BorderLeftWidth = 1;
         style.BorderTop = eStyleBorderType.Solid;
         style.BorderTopWidth = 1;
         return style;
     }
 }
示例#30
0
 /// <summary>
 /// Resets TitleStyle property to its default value. Used by Windows Forms designer for design-time support.
 /// </summary>
 public void ResetTitleStyleMouseOver()
 {
     m_TitleStyleMouseOver.StyleChanged -= new EventHandler(this.ElementStyleChanged);
     m_TitleStyleMouseOver = new ElementStyle();
     m_TitleStyleMouseOver.StyleChanged += new EventHandler(this.ElementStyleChanged);
     this.Invalidate();
 }