Example #1
0
        /// <summary>
        /// Constructor that instantiates and sets up ProfessionalColorTable object</summary>
        public CustomColorTable()
        {
            var allPropInfos = GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
            var properyMap = new Dictionary<string, PropertyInfo>();
            int count = "Settable".Length;
            foreach (var propInfo in allPropInfos)
            {
                if (propInfo.PropertyType != typeof(Color)) continue;
                if (propInfo.Name.StartsWith("Settable"))
                {
                    string name = propInfo.Name.Remove(0, count);
                    properyMap.Add(name, propInfo);

                }
            }

            ProfessionalColorTable colorTable = new ProfessionalColorTable();
            PropertyInfo[] originals = colorTable.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
            foreach (var propInfo in originals)
            {
                PropertyInfo settable;
                if (properyMap.TryGetValue(propInfo.Name, out settable))
                {
                    settable.SetValue(this, propInfo.GetValue(colorTable, null), null);
                }
            }

            SettableToolStripBorder = Color.Transparent;
           
            SettableImageMarginGradientBegin = Color.Transparent;
            SettableImageMarginGradientMiddle = Color.Transparent;
            SettableImageMarginGradientEnd = Color.Transparent;                                           
        }
        public DockPanelStripRenderer(Boolean drawBottomBorder)
        {
            this.drawBottomBorder = drawBottomBorder;
            this.colorTable       = new ProfessionalColorTable();

            renderer = new ToolStripProfessionalRenderer();
        }
        public FolderViewModeWindow(string[] resLabels) {
            ProfessionalColorTable pct = new ProfessionalColorTable();
            clrBG = pct.ToolStripDropDownBackground;
            clrBorder = pct.MenuBorder;

            BackColor = clrBG;

            InitializeComponent();

            labelTHUMBSTRIP.Text = resLabels[0];
            labelTHUMBNAIL.Text = resLabels[1];
            labelTILE.Text = resLabels[2];
            labelICON.Text = resLabels[3];
            labelLIST.Text = resLabels[4];
            labelDETAIL.Text = resLabels[5];

            Rectangle rct = new Rectangle(4, 4, 16, 16);
            PixelFormat pf = PixelFormat.Format32bppArgb;
            labelTHUMBSTRIP.Image2 = Resource.imgFilm.Clone(rct, pf);
            labelTHUMBNAIL.Image2 = Resource.imgThumb.Clone(rct, pf);
            labelTILE.Image2 = Resource.imgTiles.Clone(rct, pf);
            labelICON.Image2 = Resource.imgIcon.Clone(rct, pf);
            labelLIST.Image2 = Resource.imgList.Clone(rct, pf);
            labelDETAIL.Image2 = Resource.imgDetails.Clone(rct, pf);

            labelTHUMBSTRIP.Tag = FOLDERVIEWMODE.FVM_THUMBSTRIP;
            labelTHUMBNAIL.Tag = FOLDERVIEWMODE.FVM_THUMBNAIL;
            labelTILE.Tag = FOLDERVIEWMODE.FVM_TILE;
            labelICON.Tag = FOLDERVIEWMODE.FVM_ICON;
            labelLIST.Tag = FOLDERVIEWMODE.FVM_LIST;
            labelDETAIL.Tag = FOLDERVIEWMODE.FVM_DETAILS;

            trackBar1.LostFocus += trackBar1_LostFocus;
            trackBar1.KeyDown += trackBar1_KeyDown;
        }
Example #4
0
 private void InitColors()
 {
     try
     //myCustom Renderer
     {
         Office2007Renderer     renderer   = (Office2007Renderer)ToolStripManager.Renderer;
         ProfessionalColorTable colorTable = (ProfessionalColorTable)renderer.ColorTable;
         //Set Colors
         base.ForeColor = colorTable.MenuItemText;
         base.BackColor = colorTable.ToolStripContentPanelGradientBegin;
     }
     catch (Exception ex)
     {
         //Standard Renderer
         try
         {
             System.Windows.Forms.ToolStripProfessionalRenderer renderer   = (System.Windows.Forms.ToolStripProfessionalRenderer)ToolStripManager.Renderer;
             System.Windows.Forms.ProfessionalColorTable        colorTable = (System.Windows.Forms.ProfessionalColorTable)renderer.ColorTable;
             //Set Colors
             base.ForeColor = colorTable.GripDark;
             base.BackColor = colorTable.ToolStripContentPanelGradientBegin;
         }
         catch (Exception ex3)
         {
             Console.WriteLine(ex3.Message);
         }
         Console.WriteLine(ex.Message);
     }
 }
Example #5
0
                protected override void DrawFlatComboDropDown(ComboBox comboBox, Graphics g, Rectangle dropDownRect)
                {
                    if (UseBaseAdapter(comboBox))
                    {
                        base.DrawFlatComboDropDown(comboBox, g, dropDownRect);
                        return;
                    }


                    if (!comboBox.Enabled || !ToolStripManager.VisualStylesEnabled)
                    {
                        g.FillRectangle(SystemBrushes.Control, dropDownRect);
                    }
                    else
                    {
                        ToolStripComboBoxControl toolStripComboBox = comboBox as ToolStripComboBoxControl;
                        ProfessionalColorTable   colorTable        = GetColorTable(toolStripComboBox);

                        if (!comboBox.DroppedDown)
                        {
                            bool focused = comboBox.ContainsFocus || comboBox.MouseIsOver;
                            if (focused)
                            {
                                using (Brush b = new LinearGradientBrush(dropDownRect, colorTable.ComboBoxButtonSelectedGradientBegin, colorTable.ComboBoxButtonSelectedGradientEnd, LinearGradientMode.Vertical)) {
                                    g.FillRectangle(b, dropDownRect);
                                }
                            }
                            else if (toolStripComboBox.Owner.IsOnOverflow)
                            {
                                using (Brush b = new SolidBrush(colorTable.ComboBoxButtonOnOverflow)) {
                                    g.FillRectangle(b, dropDownRect);
                                }
                            }
                            else
                            {
                                using (Brush b = new LinearGradientBrush(dropDownRect, colorTable.ComboBoxButtonGradientBegin, colorTable.ComboBoxButtonGradientEnd, LinearGradientMode.Vertical)) {
                                    g.FillRectangle(b, dropDownRect);
                                }
                            }
                        }
                        else
                        {
                            using (Brush b = new LinearGradientBrush(dropDownRect, colorTable.ComboBoxButtonPressedGradientBegin, colorTable.ComboBoxButtonPressedGradientEnd, LinearGradientMode.Vertical)) {
                                g.FillRectangle(b, dropDownRect);
                            }
                        }
                    }

                    Brush brush  = (comboBox.Enabled) ? SystemBrushes.ControlText : SystemBrushes.GrayText;
                    Point middle = new Point(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2);

                    // if the width is odd - favor pushing it over one pixel right.
                    middle.X += (dropDownRect.Width % 2);
                    g.FillPolygon(brush, new Point[] {
                        new Point(middle.X - FlatComboAdapter.Offset2X, middle.Y - 1),
                        new Point(middle.X + FlatComboAdapter.Offset2X + 1, middle.Y - 1),
                        new Point(middle.X, middle.Y + FlatComboAdapter.Offset2Y)
                    });
                }
 public DockPanelStripRenderer(Boolean drawBottomBorder)
 {
     this.drawBottomBorder = drawBottomBorder;
     this.colorTable = new ProfessionalColorTable();
     UiRenderMode renderMode = PluginBase.MainForm.Settings.RenderMode;
     if (renderMode == UiRenderMode.System) renderer = new ToolStripSystemRenderer();
     else renderer = new ToolStripProfessionalRenderer();
 }
 public TabStripMapColorTable(ProfessionalColorTable table, IDictionary<KnownTabColor, Color> colorMap) : base(table)
 {
     if (colorMap == null)
     {
         throw new ArgumentNullException();
     }
     this.InitializeColorMap(colorMap);
 }
Example #8
0
 public DockPanelStripRenderer(Boolean drawBottomBorder, Boolean useTheme)
 {
     this.useTheme         = useTheme;
     this.drawBottomBorder = drawBottomBorder;
     this.colorTable       = new ProfessionalColorTable();
     //UiRenderMode renderMode = PluginBase.MainForm.Settings.RenderMode;
     //if (renderMode == UiRenderMode.System) renderer = new ToolStripSystemRenderer();
     //else renderer = new ToolStripProfessionalRenderer(this.colorTable);
 }
        internal Color FromKnownColor(ProfessionalColorTable.KnownColors color) {
            if (ProfessionalColors.ColorFreshnessKey != colorFreshnessKey  || ProfessionalColors.ColorScheme  != lastKnownColorScheme) {
                ResetRGBTable();               
            }
            colorFreshnessKey = ProfessionalColors.ColorFreshnessKey;
            lastKnownColorScheme = ProfessionalColors.ColorScheme;

            return (Color)ColorTable[color];
        }
                protected override void DrawFlatComboDropDown(ComboBox comboBox, Graphics g, Rectangle dropDownRect)
                {
                    Brush brush5;
                    Point point;

                    if (UseBaseAdapter(comboBox))
                    {
                        base.DrawFlatComboDropDown(comboBox, g, dropDownRect);
                        return;
                    }
                    if (!comboBox.Enabled || !ToolStripManager.VisualStylesEnabled)
                    {
                        g.FillRectangle(SystemBrushes.Control, dropDownRect);
                    }
                    else
                    {
                        ToolStripComboBox.ToolStripComboBoxControl toolStripComboBoxControl = comboBox as ToolStripComboBox.ToolStripComboBoxControl;
                        ProfessionalColorTable colorTable = GetColorTable(toolStripComboBoxControl);
                        if (!comboBox.DroppedDown)
                        {
                            if (comboBox.ContainsFocus || comboBox.MouseIsOver)
                            {
                                using (Brush brush = new LinearGradientBrush(dropDownRect, colorTable.ComboBoxButtonSelectedGradientBegin, colorTable.ComboBoxButtonSelectedGradientEnd, LinearGradientMode.Vertical))
                                {
                                    g.FillRectangle(brush, dropDownRect);
                                    goto Label_0114;
                                }
                            }
                            if (toolStripComboBoxControl.Owner.IsOnOverflow)
                            {
                                using (Brush brush2 = new SolidBrush(colorTable.ComboBoxButtonOnOverflow))
                                {
                                    g.FillRectangle(brush2, dropDownRect);
                                    goto Label_0114;
                                }
                            }
                            using (Brush brush3 = new LinearGradientBrush(dropDownRect, colorTable.ComboBoxButtonGradientBegin, colorTable.ComboBoxButtonGradientEnd, LinearGradientMode.Vertical))
                            {
                                g.FillRectangle(brush3, dropDownRect);
                                goto Label_0114;
                            }
                        }
                        using (Brush brush4 = new LinearGradientBrush(dropDownRect, colorTable.ComboBoxButtonPressedGradientBegin, colorTable.ComboBoxButtonPressedGradientEnd, LinearGradientMode.Vertical))
                        {
                            g.FillRectangle(brush4, dropDownRect);
                        }
                    }
Label_0114:
                    brush5 = comboBox.Enabled ? SystemBrushes.ControlText : SystemBrushes.GrayText;
                    point  = new Point(dropDownRect.Left + (dropDownRect.Width / 2), dropDownRect.Top + (dropDownRect.Height / 2))
                    {
                        X = point.X + (dropDownRect.Width % 2)
                    };
                    Point[] points = new Point[] { new Point(point.X - 2, point.Y - 1), new Point(point.X + 3, point.Y - 1), new Point(point.X, point.Y + 2) };
                    g.FillPolygon(brush5, points);
                }
Example #11
0
 public DockPanelStripRenderer(Boolean drawBottomBorder)
 {
     this.drawBottomBorder = drawBottomBorder;
     this.colorTable       = new ProfessionalColorTable();
     // DTODO: Calculate the correct setting here.
     //UiRenderMode renderMode = PluginBase.MainForm.Settings.RenderMode;
     //if (renderMode == UiRenderMode.System) renderer = new ToolStripSystemRenderer();
     //else renderer = new ToolStripProfessionalRenderer();
     renderer = new ToolStripProfessionalRenderer();
 }
Example #12
0
 public BreadCrumbControl()
 {
     InitializeComponent();
     
     //remove unnecessary colors
     var professionalColorTable = new ProfessionalColorTable {UseSystemColors = true};
     BreadCrumbTrail.Renderer = new ToolStripProfessionalRenderer(professionalColorTable);
     RightToolStrip.Renderer = new ToolStripProfessionalRenderer(professionalColorTable);
     _overflowStack = new Stack<ToolStripMenuItem>();
 }
Example #13
0
		private void splitContainer1_Paint(object sender, PaintEventArgs e)
		{
			ProfessionalColorTable	pct = new ProfessionalColorTable();
			Rectangle				bounds = (sender as SplitContainer).SplitterRectangle;

			int			squares;
			int			maxSquares = 9;
			int			squareSize = 4;
			int			boxSize = 2;

			// Make sure we need to do work
			if ((bounds.Width > 0) && (bounds.Height > 0))
			{
				Graphics	g = e.Graphics;

				// Setup colors from the provided renderer
				Color		begin = pct.OverflowButtonGradientMiddle;
				Color		end = pct.OverflowButtonGradientEnd;

				// Make sure we need to do work
				using (Brush b = new LinearGradientBrush(bounds, begin, end, LinearGradientMode.Vertical))
				{
					g.FillRectangle(b, bounds);
				}

				// Calculate squares
				if ((bounds.Width > squareSize) && (bounds.Height > squareSize))
				{
					squares = Math.Min((bounds.Width / squareSize), maxSquares);

					// Calculate start
					int		start = (bounds.Width - (squares * squareSize)) / 2;
					int		Y = bounds.Y  + 1;

					// Get brushes
					Brush dark = new SolidBrush(pct.GripDark);
					Brush middle = new SolidBrush(pct.ToolStripBorder);
					Brush light = new SolidBrush(pct.ToolStripDropDownBackground);

					// Draw
					for (int idx = 0; idx < squares; idx++)
					{
						// Draw grips
						g.FillRectangle(dark, start, Y, boxSize, boxSize);
						g.FillRectangle(light, start + 1, Y+1, boxSize, boxSize);
						g.FillRectangle(middle, start + 1, Y+1, 1, 1);
						start += squareSize;
					}

					dark.Dispose();
					middle.Dispose();
					light.Dispose();
				}
			}
		}
Example #14
0
        /// <summary>
        /// Initializes a new instance of the SourceOutlinerControl class.
        /// </summary>
        public SourceOutlinerControl()
        {
            InitializeComponent();

            // Create the image list for the icons and load it up
            // with the icon strip in the resources.
            treeViewImages.ImageSize = new Size(16, 16);
            Image img = Resources.TreeViewIcons;
            treeViewImages.Images.AddStrip(img);
            treeViewImages.TransparentColor = Color.Magenta;

            var colorTable = new ProfessionalColorTable {UseSystemColors = true};
            filterToolStrip.Renderer = new ToolStripProfessionalRenderer(colorTable);
        }
Example #15
0
        public DockPanelStripRenderer(Boolean drawBottomBorder)
        {
            this.drawBottomBorder = drawBottomBorder;
            this.colorTable       = new ProfessionalColorTable();
            UiRenderMode renderMode = PluginBase.MainForm.Settings.RenderMode;

            if (renderMode == UiRenderMode.System)
            {
                renderer = new ToolStripSystemRenderer();
            }
            else
            {
                renderer = new ToolStripProfessionalRenderer();
            }
        }
        public void InitFrom(ProfessionalColorTable colorTable, bool makeColorsDefault)
        {
            // Instead of "colors[ColorTableGroup.ButtonSelectedBorder] = colorTable.ButtonSelectedBorder"...
            // use reflection.
            Type colorTableType = colorTable.GetType();
            Type colorTableGroupType = typeof(ColorTableGroup);
            foreach (ColorTableGroup colorTableGroup in Enum.GetValues(colorTableGroupType))
            {
                var prop = colorTableType.GetProperty(Enum.GetName(colorTableGroupType, colorTableGroup));
                if (prop != null)
                    colors[colorTableGroup] = (Color)prop.GetValue(colorTable, null);
            }

            if (makeColorsDefault)
                MakeColorsDefault();
        }
                protected override void DrawFlatComboDropDown(ComboBox comboBox, Graphics g, Rectangle dropDownRect)
                {
                    if (UseBaseAdapter(comboBox))
                    {
                        base.DrawFlatComboDropDown(comboBox, g, dropDownRect);
                        return;
                    }

                    if (!comboBox.Enabled || !ToolStripManager.VisualStylesEnabled)
                    {
                        g.FillRectangle(SystemBrushes.Control, dropDownRect);
                    }
                    else
                    {
                        ToolStripComboBoxControl?toolStripComboBox = comboBox as ToolStripComboBoxControl;
                        ProfessionalColorTable   colorTable        = GetColorTable(toolStripComboBox);

                        if (!comboBox.DroppedDown)
                        {
                            bool focused = comboBox.ContainsFocus || comboBox.MouseIsOver;
                            if (focused)
                            {
                                using Brush b = new LinearGradientBrush(
                                          dropDownRect,
                                          colorTable.ComboBoxButtonSelectedGradientBegin,
                                          colorTable.ComboBoxButtonSelectedGradientEnd,
                                          LinearGradientMode.Vertical);

                                g.FillRectangle(b, dropDownRect);
                            }
                            else if (toolStripComboBox is not null && toolStripComboBox.Owner.IsOnOverflow)
                            {
                                using var b = colorTable.ComboBoxButtonOnOverflow.GetCachedSolidBrushScope();
                                g.FillRectangle(b, dropDownRect);
                            }
                            else
                            {
                                using Brush b = new LinearGradientBrush(
                                          dropDownRect,
                                          colorTable.ComboBoxButtonGradientBegin,
                                          colorTable.ComboBoxButtonGradientEnd,
                                          LinearGradientMode.Vertical);

                                g.FillRectangle(b, dropDownRect);
                            }
                        }
Example #18
0
 private void InitColors()
 {
     try
     //myCustom Renderer
     {
         Office2007Renderer     renderer    = (Office2007Renderer)ToolStripManager.Renderer;
         ProfessionalColorTable _colorTable = (ProfessionalColorTable)renderer.ColorTable;
         //Set Colors
         GradientTop         = _colorTable.ToolStripGradientBegin;
         GradientBottom      = _colorTable.ToolStripGradientMiddle;
         GradientBorderColor = _colorTable.ToolStripBorder;
         if (GradientBorderColor == Color.White)
         {
             GradientBorderColor = Color.LightGray;
         }
         this.ForeColor   = _colorTable.MenuItemText;
         HotForeColor     = _colorTable.MenuItemText;
         PressedForeColor = _colorTable.MenuItemText;
     }
     catch (Exception ex)
     {
         try
         {
             System.Windows.Forms.ToolStripProfessionalRenderer renderer    = (System.Windows.Forms.ToolStripProfessionalRenderer)ToolStripManager.Renderer;
             System.Windows.Forms.ProfessionalColorTable        _colorTable = (System.Windows.Forms.ProfessionalColorTable)renderer.ColorTable;
             //Set Colors
             GradientTop         = _colorTable.ToolStripGradientBegin;
             GradientBottom      = _colorTable.ToolStripGradientMiddle;
             GradientBorderColor = _colorTable.ToolStripBorder;
             if (GradientBorderColor == Color.White)
             {
                 GradientBorderColor = Color.LightGray;
             }
             this.ForeColor   = _colorTable.SeparatorDark;
             HotForeColor     = _colorTable.SeparatorDark;
             PressedForeColor = _colorTable.SeparatorDark;
         }
         catch (Exception ex3)
         {
             Console.WriteLine(ex3.Message);
         }
         Console.WriteLine(ex.Message);
     }
 }
Example #19
0
        /// <summary>
        /// Initializes a new instance of the SourceOutlinerControl class.
        /// </summary>
        public SourceOutlinerControl()
        {
            InitializeComponent();

            // Create the image list for the icons and load it up
            // with the icon strip in the resources.
            _treeViewImages.ImageSize = new Size(16, 16);
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SourceOutlinerControl));
            System.Drawing.Image img = ((System.Drawing.Image)(resources.GetObject("TreeViewIcons")));
            if (img != null)
            {
                _treeViewImages.Images.AddStrip(img);
            }
            _treeViewImages.TransparentColor = Color.Magenta;

            System.Windows.Forms.ProfessionalColorTable colorTable = new System.Windows.Forms.ProfessionalColorTable();
            colorTable.UseSystemColors = true;
            this.filterToolStrip.Renderer = new System.Windows.Forms.ToolStripProfessionalRenderer(colorTable);
        }
Example #20
0
        /// <summary>
        /// Initializes a new instance of the SourceOutlinerControl class.
        /// </summary>
        public SourceOutlinerControl()
        {
            InitializeComponent();

            // Create the image list for the icons and load it up
            // with the icon strip in the resources.
            _treeViewImages.ImageSize = new Size(16, 16);
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SourceOutlinerControl));
            System.Drawing.Image img = ((System.Drawing.Image)(resources.GetObject("TreeViewIcons")));
            if (img != null)
            {
                _treeViewImages.Images.AddStrip(img);
            }
            _treeViewImages.TransparentColor = Color.Magenta;

            System.Windows.Forms.ProfessionalColorTable colorTable = new System.Windows.Forms.ProfessionalColorTable();
            colorTable.UseSystemColors    = true;
            this.filterToolStrip.Renderer = new System.Windows.Forms.ToolStripProfessionalRenderer(colorTable);
        }
Example #21
0
        public ProjectSetup(ComparisonSet set)
            : this()
        {
            this.Icon = Resources.App;
            tsbFiles.Checked = true;
            _set = set;

            compareFiles.LoadSet(set);
            referencePaths.LoadOptions(set.Config);
            compareOptions.LoadOptions(set.Config);
            viewFilter.LoadFilter(set.Filter);

            ProfessionalColorTable colorTable = new ProfessionalColorTable();
            colorTable.UseSystemColors = true;
            toolStrip1.Renderer = new ToolStripProfessionalRenderer(colorTable);

            compareFiles.BackColor =
            compareOptions.BackColor =
            referencePaths.BackColor =
            viewFilter.BackColor = ((ToolStripProfessionalRenderer)toolStrip1.Renderer).ColorTable.ToolStripPanelGradientEnd;
        }
        public FolderViewModeWindow(string[] resLabels) {
            ProfessionalColorTable pct = new ProfessionalColorTable();
            this.clrBG = pct.ToolStripDropDownBackground;
            this.clrBorder = pct.MenuBorder;

            this.BackColor = this.clrBG;

            InitializeComponent();

            this.labelTHUMBSTRIP.Text = resLabels[0];
            this.labelTHUMBNAIL.Text = resLabels[1];
            this.labelTILE.Text = resLabels[2];
            this.labelICON.Text = resLabels[3];
            this.labelLIST.Text = resLabels[4];
            this.labelDETAIL.Text = resLabels[5];

            Rectangle rct = new Rectangle(4, 4, 16, 16);
            System.Drawing.Imaging.PixelFormat pf = System.Drawing.Imaging.PixelFormat.Format32bppArgb;
            this.labelTHUMBSTRIP.Image2 = Resource.imgFilm.Clone(rct, pf);
            this.labelTHUMBNAIL.Image2 = Resource.imgThumb.Clone(rct, pf);
            this.labelTILE.Image2 = Resource.imgTiles.Clone(rct, pf);
            this.labelICON.Image2 = Resource.imgIcon.Clone(rct, pf);
            this.labelLIST.Image2 = Resource.imgList.Clone(rct, pf);
            this.labelDETAIL.Image2 = Resource.imgDetails.Clone(rct, pf);

            this.labelTHUMBSTRIP.Tag = FOLDERVIEWMODE.FVM_THUMBSTRIP;
            this.labelTHUMBNAIL.Tag = FOLDERVIEWMODE.FVM_THUMBNAIL;
            this.labelTILE.Tag = FOLDERVIEWMODE.FVM_TILE;
            this.labelICON.Tag = FOLDERVIEWMODE.FVM_ICON;
            this.labelLIST.Tag = FOLDERVIEWMODE.FVM_LIST;
            this.labelDETAIL.Tag = FOLDERVIEWMODE.FVM_DETAILS;

            this.trackBar1.LostFocus += new EventHandler(trackBar1_LostFocus);
            this.trackBar1.KeyDown += new KeyEventHandler(trackBar1_KeyDown);

            IntPtr p = this.trackBar1.Handle;
        }
 internal Color ComboBoxButtonSelectedGradientEnd( ProfessionalColorTable table ) {
   return table.MenuItemSelectedGradientEnd;
 }
 internal Color ComboBoxBorder( ProfessionalColorTable table ) {
   return table.ButtonSelectedHighlightBorder;
 }
 internal Color ComboBoxButtonOnOverflow( ProfessionalColorTable table ) {
   return table.ToolStripDropDownBackground;
 }
 internal Color ComboBoxButtonPressedGradientEnd( ProfessionalColorTable table ) {
   return table.ButtonPressedGradientEnd;
 }
 public BlackCustomRenderer(ProfessionalColorTable colorTable):base(colorTable)
 {
 }
		public void UpdateRenderer()
		{
			bool pro = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.UseProfessionalRenderer", true);
			if (pro) {
				ToolStripManager.Renderer = new ToolStripProfessionalRenderer();
			} else {
				ProfessionalColorTable colorTable = new ProfessionalColorTable();
				colorTable.UseSystemColors        = true;
				ToolStripManager.Renderer         = new ToolStripProfessionalRenderer(colorTable);
			}
		}
        private void InitializeColors()
        {
            _ProfessionalColorTable = new ProfessionalColorTable();
            _DividerBackgroundColor1 = this._ProfessionalColorTable.ToolStripGradientBegin;
            _DividerBackgroundColor2 = this._ProfessionalColorTable.ToolStripGradientEnd;

            _DividerBorderColor = _ProfessionalColorTable.SeparatorDark;

            _GripperColor1 = _ProfessionalColorTable.SeparatorLight;
            _GripperColor2 = _ProfessionalColorTable.SeparatorDark;

            _HeaderBackgroundColor2 = SystemColors.ActiveCaption;
            _HeaderBackgroundColor1 = SystemColors.InactiveCaption;

            _HeaderTextColor = Color.White;


            _PaneBackgroundColor1 = this._ProfessionalColorTable.ToolStripGradientBegin;
            _PaneBackgroundColor2 = this._ProfessionalColorTable.ToolStripGradientEnd;

            _PaneSelectedBackgroundColor1 = this._ProfessionalColorTable.ButtonSelectedGradientBegin;
            _PaneSelectedBackgroundColor2 = this._ProfessionalColorTable.ButtonSelectedGradientEnd;

            //beginColor = this._ProfessionalColorTable.ButtonCheckedGradientBegin;
            //endColor = this._ProfessionalColorTable.ButtonCheckedGradientEnd;
        }
Example #30
0
 /// <summary>
 /// Initializes a new instance of the PanelColors class.
 /// </summary>
 public PanelColors()
 {
     this.m_professionalColorTable = new System.Windows.Forms.ProfessionalColorTable();
 }
Example #31
0
 public CustomMenuStripRenderer(ProfessionalColorTable table) : base(table) { }
 public TabStripMapColorTable(ProfessionalColorTable table) : base(table)
 {
     this.InitializeColorMap(null);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="Office2007Renderer"/> class.
        /// </summary>
        /// <param name="textColorIsRed">if set to <c>true</c> [text color is red].</param>
        /// <param name="colors">The colors.</param>
        private Office2007Renderer(bool textColorIsRed, ProfessionalColorTable colors) : base(colors) 
        {
            if (textColorIsRed) _textColor = Color.FromArgb(137, 22, 22);
            else _textColor = Color.FromArgb(21, 66, 139); // blue

            // Palette Initialization
            _textDisabled = _disabledTextColor;
            _textMenuStripItem = _textColor;
            _textStatusStripItem = _textColor;
            _textContextMenuItem = _textColor;
            _arrowDisabled = _disabledTextColor;
            _arrowLight = Color.FromArgb(106, 126, 197);
            _arrowDark = Color.FromArgb(64, 70, 90);
            _separatorMenuLight = Color.FromArgb(245, 245, 245);
            _separatorMenuDark = Color.FromArgb(197, 197, 197);
            _contextMenuBack = _c4;
            _contextCheckBorder = Color.FromArgb(242, 149, 54);
            _contextCheckTick = Color.FromArgb(66, 75, 138);
            _statusStripBorderDark = Color.FromArgb(86, 125, 176);
            _statusStripBorderLight = Color.White;
            _gripDark = Color.FromArgb(114, 152, 204);
            _gripLight = _c5;
            _itemContextItemEnabledColors = new GradientItemColors(
                _r1, _r2, _r3, _r4, _r5, _r6, _r7, _r8, Color.FromArgb(217, 203, 150), Color.FromArgb(192, 167, 118));
            _itemDisabledColors = new GradientItemColors(
                _c4, _c6, Color.FromArgb(236, 236, 236), 
                Color.FromArgb(230, 230, 230), _c6, Color.FromArgb(224, 224, 224),
                Color.FromArgb(200, 200, 200), Color.FromArgb(210, 210, 210), Color.FromArgb(212, 212, 212), 
                Color.FromArgb(195, 195, 195));
            _itemToolItemSelectedColors = new GradientItemColors(_r1, _r2, _r3, _r4, _r5, _r6, _r7, _r8, _r9, _rA);
            _itemToolItemPressedColors = new GradientItemColors(_rD, _rE, _rF, _rG, _rH, _rI, _rJ, _rK, _r9, _rA);
            _itemToolItemCheckedColors = new GradientItemColors(_rL, _rM, _rN, _rO, _rP, _rQ, _rR, _rS, _r9, _rA);
            _itemToolItemCheckPressColors = new GradientItemColors(_rT, _rU, _rV, _rW, _rX, _rI, _rY, _rZ, _r9, _rA);            
        }
Example #34
0
        public WhiteboardDialog(Form mainForm, GUIController controller, WhiteboardRoom wbRoom)
        {
            InitializeComponent();
            if (controller == null)
            {
                throw new ArgumentNullException("Cannot pass a null GUIController");
            }
            _MainForm = mainForm;
            _Controller = controller;
            WBRoom = wbRoom;
            this.Dock = DockStyle.Fill;

            if (WBRoom != null)
            {
                wbColorB.BackColor = Color.FromArgb(WBRoom.DrawColor);
                wbRoom.DrawPointSize = wbPointSize.Value;
            }

            // Turn off the gradient in toolstrip
            ProfessionalColorTable professionalColorTable = new ProfessionalColorTable();
            professionalColorTable.UseSystemColors = true;
            toolStrip1.Renderer = new ToolStripProfessionalRenderer(professionalColorTable);

            // Set the default image for tool button drop down
            if (WBRoom != null)
            {
                SetWhiteboardToolImage(WBRoom.DrawMode);
            }

            // Setup tooltips
            wbTooltip.SetToolTip (textDD, "Enter text for use in text or line drawing control");
            wbTooltip.SetToolTip(wbColorB, "Click to choose drawing color");
            wbTooltip.SetToolTip(wbPointSize, "Use to set size for drawing objects or text");
            wbTooltip.SetToolTip(undoB, "Click to undo your last drawing operation");
            wbTooltip.SetToolTip(clearB, "Click to clear all of your drawing in this Whiteboard room");
            wbTooltip.SetToolTip(clearAllB, "Click to clear entire Whiteboard room");
            wbTooltip.SetToolTip(playerListDD, "Select a player to synchronize your map view with");
            wbTooltip.SetToolTip(viewUndoB, "Revert to your previous view");
            wbTooltip.SetToolTip(otherWBRoomsLB, "Select additional Whiteboard rooms to overlay with this room");

        }
Example #35
0
		public ProExtTsr(ProfessionalColorTable ct) : base(ct)
		{
			m_bCustomColorTable = true;
		}
 internal Color ComboBoxButtonGradientBegin( ProfessionalColorTable table ) {
   return table.MenuItemPressedGradientBegin;
 }
		public ToolStripProfessionalRenderer (ProfessionalColorTable professionalColorTable) : base ()
		{
			color_table = professionalColorTable;
			rounded_edges = true;
		}
Example #38
0
 /// <summary>
 /// Initializes a new instance of the Office2007Renderer class.
 /// </summary>
 /// <param name="professionalColorTable">A <see cref="ProfessionalColorTable"/> to be used for painting.</param>
 public Office2007Renderer(System.Windows.Forms.ProfessionalColorTable professionalColorTable)
     : base(professionalColorTable)
 {
 }
Example #39
0
 public ToolStripProfessionalRenderer(ProfessionalColorTable professionalColorTable) : base()
 {
     color_table   = professionalColorTable;
     rounded_edges = true;
 }
 /// <summary>
 /// Initializes the control for the first time
 /// </summary>
 private void Initialize()
 {
    colorTable = new NaviToolstripColorTable();
    renderer = new NaviToolstripRenderer(colorTable);
    base.Renderer = renderer;
 }
        public static NavigateBarColorTable ImportColorsFromProfColorTable(ProfessionalColorTable tColorTable)
        {
            NavigateBarColorTable nvColorTable = new NavigateBarColorTable();

            // Custom
            nvColorTable.TextColor = SystemColors.ControlText;
            nvColorTable.SelectedTextColor = SystemColors.ControlText;
            nvColorTable.BorderColor = tColorTable.ButtonSelectedHighlightBorder;

            // Caption
            nvColorTable.CaptionTextColor = SystemColors.MenuText;
            nvColorTable.CaptionBegin = tColorTable.ToolStripGradientBegin;
            nvColorTable.CaptionEnd = tColorTable.ToolStripGradientEnd;
            nvColorTable.CaptionDescBegin = tColorTable.ToolStripGradientBegin;
            nvColorTable.CaptionDescEnd = tColorTable.ToolStripGradientEnd;

            // Separator
            nvColorTable.SeparatorDark = tColorTable.SeparatorDark;
            nvColorTable.SeparatorLight = tColorTable.SeparatorLight;

            // Button Normal
            nvColorTable.ButtonNormalBegin = tColorTable.ToolStripGradientBegin;
            nvColorTable.ButtonNormalMiddleBegin = tColorTable.ToolStripGradientMiddle;
            nvColorTable.ButtonNormalMiddleEnd = tColorTable.ToolStripGradientMiddle;
            nvColorTable.ButtonNormalEnd = tColorTable.ToolStripGradientEnd;

            // Button Selected
            nvColorTable.ButtonSelectedBegin = tColorTable.ButtonPressedGradientBegin;
            nvColorTable.ButtonSelectedMiddleBegin = tColorTable.ButtonPressedGradientMiddle;
            nvColorTable.ButtonSelectedMiddleEnd = tColorTable.ButtonPressedGradientMiddle;
            nvColorTable.ButtonSelectedEnd = tColorTable.ButtonPressedGradientEnd;

            // Button Mouse Over
            nvColorTable.ButtonMouseOverBegin = tColorTable.ButtonSelectedGradientBegin;
            nvColorTable.ButtonMouseOverMiddleBegin = tColorTable.ButtonSelectedGradientMiddle;
            nvColorTable.ButtonMouseOverMiddleEnd = tColorTable.ButtonSelectedGradientMiddle;
            nvColorTable.ButtonMouseOverEnd = tColorTable.ButtonSelectedGradientEnd;

            // Menu
            nvColorTable.MenuBackColor = tColorTable.ToolStripDropDownBackground;

            return nvColorTable;
        }
Example #42
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="AColorTable">The <see cref="System.Windows.Forms.ProfessionalColorTable" /> to initialise the Renderer with.</param>
 public TOpenPetraToolStripRenderer(ProfessionalColorTable AColorTable) : base(AColorTable)
 {
 }
 private void SetToolStripRenderer() {
     if (DrawFlatToolbar) {
         // use an office look and feel with system colors 
         ProfessionalColorTable colorTable = new ProfessionalColorTable();
         colorTable.UseSystemColors = true;
         ToolStripRenderer = new ToolStripProfessionalRenderer(colorTable);
     }
     else {
         ToolStripRenderer = new ToolStripSystemRenderer();
     }
 }