public void ProfessionalColorTable_Properties_Get_ReturnsExpected(Func <ProfessionalColorTable, Color> factory)
        {
            var   table  = new ProfessionalColorTable();
            Color result = factory(table);

            Assert.Equal(result, factory(table));
        }
Exemple #2
0
        //private void DetailsContainer_Panel1_Paint(object sender, PaintEventArgs e)
        //{

        //    ProfessionalColorTable t = new ProfessionalColorTable();
        //    t.UseSystemColors = guiProps.Get<bool>("useSystemColors").Value;

        //    ToolStripManager.Renderer = new ToolStripProfessionalRenderer(t);

        //    Graphics g = e.Graphics;

        //    if (e.ClipRectangle.Height > 0 && e.ClipRectangle.Width > 0)
        //    {
        //        LinearGradientBrush b = new LinearGradientBrush(e.ClipRectangle, t.MenuStripGradientEnd, t.MenuStripGradientBegin, LinearGradientMode.Vertical);
        //        LinearGradientBrush b = new LinearGradientBrush(Point.Empty, new Point(e.ClipRectangle.Width, 1), t.MenuStripGradientEnd, t.MenuStripGradientBegin);

        //        g.FillRectangle(b, e.ClipRectangle);
        //    }
        //}



        private void panel2_Paint(object sender, PaintEventArgs e)
        {
            Panel p = sender as Panel;

            if (p != null)
            {
                ProfessionalColorTable t = new ProfessionalColorTable();

                t.UseSystemColors = guiProps.Get <bool>("useSystemColors").Value;

                ToolStripManager.Renderer = new ToolStripProfessionalRenderer(t);

                Rectangle rect = new Rectangle(Point.Empty, new Size(p.Width, p.Height));

                Graphics g = e.Graphics;

                //if (e.ClipRectangle.Height > 0 && e.ClipRectangle.Width > 0)
                //{
                LinearGradientBrush b = new LinearGradientBrush(rect, t.MenuStripGradientEnd, t.MenuStripGradientBegin, LinearGradientMode.Vertical);
                // LinearGradientBrush b = new LinearGradientBrush(rect, t.MenuStripGradientEnd, t.MenuStripGradientBegin, LinearGradientMode.Vertical);

                //   LinearGradientBrush b = new LinearGradientBrush(Point.Empty, new Point(e.ClipRectangle.Width, 1), t.MenuStripGradientEnd, t.MenuStripGradientBegin,);

                g.FillRectangle(b, e.ClipRectangle);
                //}
            }
        }
 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);
     }
 }
        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;
        }
Exemple #5
0
        private void LogViewContainer_Panel2_Paint(object sender, PaintEventArgs e)
        {
            Panel p = sender as Panel;

            if (p != null)
            {
                ProfessionalColorTable t = new ProfessionalColorTable();

                t.UseSystemColors = guiProps.Get <bool>("useSystemColors").Value;
                Rectangle r = new Rectangle(e.ClipRectangle.Location, e.ClipRectangle.Size);



                if (p.Width > 0 && p.Height > 0)
                {
                    LinearGradientBrush b = new LinearGradientBrush(new Rectangle(Point.Empty,
                                                                                  new Size(p.Width, p.Height)),
                                                                    t.MenuStripGradientEnd,
                                                                    t.MenuStripGradientBegin, LinearGradientMode.Vertical);


                    // LinearGradientBrush b = new LinearGradientBrush(rect, t.MenuStripGradientEnd, t.MenuStripGradientBegin, LinearGradientMode.Vertical);

                    //   LinearGradientBrush b = new LinearGradientBrush(Point.Empty, new Point(e.ClipRectangle.Width, 1), t.MenuStripGradientEnd, t.MenuStripGradientBegin,);

                    e.Graphics.FillRectangle(b, r);
                }
                //}
            }
        }
Exemple #6
0
        private void Init()
        {
            ProfessionalColorTable vs2005ColorTable = new ProfessionalColorTable();

            vs2005ColorTable.UseSystemColors = true;
            ts1.Renderer = new ToolStripProfessionalRenderer(vs2005ColorTable);

            tbFileName.Image = Res.GetImage(1);
            btnLoad.Image    = Res.GetImage(1);
            btnPaste.Image   = Res.GetImage(7);
            btnClear.Image   = Res.GetImage(82);

            SetImage(null);
            if (FPicture.IsDataColumn)
            {
                pcPages.ActivePageIndex = 1;
            }
            else if (FPicture.IsFileLocation)
            {
                pcPages.ActivePageIndex = 2;
                tbFileName.Text         = FPicture.ImageLocation;
            }
            else if (FPicture.IsWebLocation)
            {
                pcPages.ActivePageIndex = 3;
                tbUrl.Text = FPicture.ImageLocation;
            }
            else
            {
                pcPages.ActivePageIndex = 0;
                SetImage(FPicture.Image);
            }
            tvData.CreateNodes(FPicture.Report.Dictionary);
            tvData.SelectedItem = FPicture.DataColumn;
        }
        private void cbbColorTable_SelectedIndexChanged(object sender, EventArgs e)
        {
            var type = cbbRenderer.SelectedItem as Type;

            if (type != null)
            {
                var colorTable = Activator.CreateInstance(type) as ProfessionalColorTable;
                if (colorTable != null)
                {
                    if (colorTable.Equals(currentColorTable) == false)
                    {
                        var panelColorTable = colorTable.PanelColorTable;
                        if (panelColorTable != null)
                        {
                            PanelSettingsManager.SetPanelProperties(
                                Controls,
                                panelColorTable);
                        }

                        currentColorTable         = colorTable;
                        currentRenderer           = Activator.CreateInstance(currentRenderer.GetType(), new object[] { colorTable }) as ToolStripProfessionalRenderer;
                        ToolStripManager.Renderer = currentRenderer;
                    }
                }
            }
        }
Exemple #8
0
        public SkorkToolStripRender(ref ToolStrip ts, int theme)
        {
            this.colorTable = new ProfessionalColorTable();
            this.renderer   = new ToolStripProfessionalRenderer(colorTable);

            SetColorPalette(ref ts, ref theme);
            SetRenderer(ref ts, ref theme);
        }
Exemple #9
0
        public override void Init(ExportBase export)
        {
            base.Init(export);
            TextExport textExport = Export as TextExport;

            report = textExport.Report;

            ProfessionalColorTable vs2005ColorTable = new ProfessionalColorTable();

            vs2005ColorTable.UseSystemColors = true;
            toolStrip.Renderer = new ToolStripProfessionalRenderer(vs2005ColorTable);

            cbPageBreaks.Checked = textExport.PageBreaks;
            cbEmptyLines.Checked = textExport.EmptyLines;
            if (textExport.Frames && textExport.TextFrames)
            {
                cbbFrames.SelectedIndex = 1;
            }
            else if (textExport.Frames && !textExport.TextFrames)
            {
                cbbFrames.SelectedIndex = 2;
            }
            else
            {
                cbbFrames.SelectedIndex = 0;
            }
            cbDataOnly.Checked = textExport.DataOnly;
            if (textExport.Encoding == Encoding.Default)
            {
                cbbCodepage.SelectedIndex = 0;
            }
            else if (textExport.Encoding == Encoding.UTF8)
            {
                cbbCodepage.SelectedIndex = 1;
            }
            else if (textExport.Encoding == Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage))
            {
                cbbCodepage.SelectedIndex = 2;
            }
            udX.Value = (decimal)textExport.ScaleX;
            udY.Value = (decimal)textExport.ScaleY;

            udX.ValueChanged += new EventHandler(udX_ValueChanged);
            udY.ValueChanged += new EventHandler(udX_ValueChanged);
            cbbFrames.SelectedIndexChanged += new EventHandler(cbbFrames_SelectedIndexChanged);

            MyRes res = new MyRes("Preview");

            tbPage.Text        = "1";
            prevPage           = 1;
            lblTotalPages.Text = String.Format(Res.Get("Misc,ofM"), report.PreparedPages.Count);

            cbFontSize.SelectedIndex = 4;

            previewExport             = new TextExport();
            previewExport.PreviewMode = true;
            CalcScale();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PageViewerWindow"/> class.
        /// </summary>
        public PageViewerWindow()
        {
            InitializeComponent();

            colourTable = new ProfessionalColorTable();
            colourTable.UseSystemColors = true;

            pfsRenderer = new PfsRenderer(new Rectangle(1, 1, 34, 34), Color.White, SystemColors.ControlDark);
        }
        public void ProfessionalColorTable_ImageMarginGradientEnd_Get_ReturnsExpected(bool useSystemColors)
        {
            var table = new ProfessionalColorTable
            {
                UseSystemColors = useSystemColors
            };

            Assert.NotEqual(table.ImageMarginGradientEnd, table.ImageMarginGradientEnd);
        }
Exemple #12
0
            protected override void OnHandleCreated(EventArgs e)
            {
                ProfessionalColorTable colorTable = (ParentForm != null && ParentForm.Site != null) ? ParentForm.Site.GetService(typeof(ProfessionalColorTable)) as ProfessionalColorTable : null;

                if (colorTable != null)
                {
                    this.ToolStripRenderer = new ToolStripProfessionalRenderer(colorTable);
                }
                base.OnHandleCreated(e);
            }
        private void CreateVS2005Renderer()
        {
            ProfessionalColorTable vs2005ColorTable = new ProfessionalColorTable();

            vs2005ColorTable.UseSystemColors = true;
            ToolStripRenderer renderer = new ToolStripProfessionalRenderer(vs2005ColorTable);

            toolStrip1.Renderer = renderer;
            toolStrip2.Renderer = renderer;
        }
Exemple #14
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();
                }
            }
        }
Exemple #15
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>();
        }
        public void ProfessionalColorTable_ChangeUserPreferences_GetColor_ReturnsExpected(UserPreferenceCategory category)
        {
            using RemoteInvokeHandle invokerHandle = RemoteExecutor.Invoke(() =>
            {
                // Simulate a SystemEvents.UserPreferenceChanged event.
                var table   = new ProfessionalColorTable();
                Color color = table.ButtonSelectedHighlight;
                SystemEventsHelper.SendMessageOnUserPreferenceChanged(category);
                Assert.Equal(color, table.ButtonSelectedHighlight);
            });

            // verify the remote process succeeded
            Assert.Equal(0, invokerHandle.ExitCode);
        }
Exemple #17
0
 private void SetToolStripRenderer()
 {
     if (DrawFlatToolbar)
     {
         // use an office look and feel with system colors
         var colorTable = new ProfessionalColorTable();
         colorTable.UseSystemColors = true;
         ToolStripRenderer          = new ToolStripProfessionalRenderer(colorTable);
     }
     else
     {
         ToolStripRenderer = new ToolStripSystemRenderer();
     }
 }
            public static void Start()
            {
#if DEBUG
                Stopwatch st = new Stopwatch();
                st.Start();
#endif
                //load settings
                Settings.Load();

                //install downloaded update if it exists
                if (Settings.Data.Data.General.AutoUpdate.Update.Downloaded)
                {
                    if (AutoUpdate.AutoUpdate.InstallUpdate())
                    {
                        return;
                    }
                }

                Template.Load();
#if DEBUG
                st.Stop();
                Debug.WriteLine("loading settings.xml and template.xml: " + st.ElapsedMilliseconds + "ms");
#endif

                //whidbey color table (gray colors of menustrip and tabstrip)
                ProfessionalColorTable whidbeyColorTable = new ProfessionalColorTable
                {
                    UseSystemColors = true
                };
                ToolStripManager.Renderer = new ToolStripProfessionalRenderer(whidbeyColorTable);

                //remove installed update if it exists
                if (Settings.Data.Data.General.AutoUpdate.Update.Installed)
                {
                    AutoUpdate.AutoUpdate.RemoveUpdate();
                }

                //check for update
                if (Settings.Data.Data.General.AutoUpdate.Enabled && Settings.Data.Data.General.AutoUpdate.UpdateFile != null && Settings.Data.Data.General.AutoUpdate.LastCheck.Date.AddDays(Settings.Data.Data.General.AutoUpdate.CheckInterval) <= DateTime.Now.Date)
                {
                    Update.Check(true, Settings.Data.Data.General.AutoUpdate.SilentDownload);
                }

                //start main form
                Application.Run(new frmMain());

                //save settings
                Settings.Save();
            }
Exemple #19
0
        public void UpdateRenderer()
        {
            bool pro = PropertyService.Get("FanHai.Gui.Framework.Gui.UseProfessionalRenderer", true);

            if (pro)
            {
                ToolStripManager.Renderer = new ToolStripProfessionalRenderer();
            }
            else
            {
                ProfessionalColorTable colorTable = new ProfessionalColorTable();
                colorTable.UseSystemColors = true;
                ToolStripManager.Renderer  = new ToolStripProfessionalRenderer(colorTable);
            }
        }
Exemple #20
0
        private void setProfessionalVisualStyle()
        {
            ProfessionalColorTable t = new ProfessionalColorTable();

            t.UseSystemColors         = guiProps.Get <bool>("useSystemColors").Value;
            ToolStripManager.Renderer = new ToolStripProfessionalRenderer(t);

            MenuTabsPanel.BackColor = t.MenuStripGradientBegin;

            this.txtDetailsMessage.BackColor  = t.MenuStripGradientEnd;
            this.txtDetailsLogger.BackColor   = t.MenuStripGradientEnd;
            this.txtDetailsSeverity.BackColor = t.MenuStripGradientEnd;
            this.txtDetailsThread.BackColor   = t.MenuStripGradientEnd;
            this.txtDetailsTime.BackColor     = t.MenuStripGradientEnd;
        }
        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);
            }
        }
        public void ProfessionalColorTable_Properties_GetToolStripManagerVisualStylesEnabled_ReturnsExpected(Func <ProfessionalColorTable, Color> factory)
        {
            bool oldValue = ToolStripManager.VisualStylesEnabled;

            try
            {
                ToolStripManager.VisualStylesEnabled = true;

                var   table  = new ProfessionalColorTable();
                Color result = factory(table);
                Assert.Equal(result, factory(table));
            }
            finally
            {
                ToolStripManager.VisualStylesEnabled = oldValue;
            }
        }
        private void InitColours()
        {
            try
            //myCustom Renderer
            {
                Office2007Renderer      renderer     = (Office2007Renderer)ToolStripManager.Renderer;
                ProfessionalColourTable _colourTable = (ProfessionalColourTable)renderer.ColorTable;
                //Set Colors
                GradientTop          = _colourTable.ToolStripGradientBegin;
                GradientBottom       = _colourTable.ToolStripGradientMiddle;
                GradientBorderColour = _colourTable.ToolStripBorder;
                if (GradientBorderColour == Color.White)
                {
                    GradientBorderColour = Color.LightGray;
                }

                this.ForeColor    = _colourTable.MenuItemText;
                HotForeColour     = _colourTable.MenuItemText;
                PressedForeColour = _colourTable.MenuItemText;
            }
            catch (Exception ex)
            {
                try
                {
                    ToolStripProfessionalRenderer renderer     = (ToolStripProfessionalRenderer)ToolStripManager.Renderer;
                    ProfessionalColorTable        _colourTable = renderer.ColorTable;
                    //Set Colors
                    GradientTop          = _colourTable.ToolStripGradientBegin;
                    GradientBottom       = _colourTable.ToolStripGradientMiddle;
                    GradientBorderColour = _colourTable.ToolStripBorder;
                    if (GradientBorderColour == Color.White)
                    {
                        GradientBorderColour = Color.LightGray;
                    }

                    this.ForeColor    = _colourTable.SeparatorDark;
                    HotForeColour     = _colourTable.SeparatorDark;
                    PressedForeColour = _colourTable.SeparatorDark;
                }
                catch (Exception ex3)
                {
                    Console.WriteLine(ex3.Message);
                }
                Console.WriteLine(ex.Message);
            }
        }
        public void ProfessionalColorTable_UseSystemColors_Set_GetReturnsExpected(bool value)
        {
            var table = new ProfessionalColorTable
            {
                UseSystemColors = value
            };

            Assert.Equal(value, table.UseSystemColors);

            // Set same.
            table.UseSystemColors = value;
            Assert.Equal(value, table.UseSystemColors);

            // Set different.
            table.UseSystemColors = !value;
            Assert.Equal(!value, table.UseSystemColors);
        }
        /// <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);
        }
Exemple #26
0
        public void InitFrom(ProfessionalColorTable colorTable, bool makeColorsDefault)
        {
            // Instead of "colors[ColorTableGroup.ButtonSelectedBorder] = colorTable.ButtonSelectedBorder"...
            // use reflection.
            var colorTableType      = colorTable.GetType();
            var colorTableGroupType = typeof(ColorTableGroup);

            foreach (ColorTableGroup colorTableGroup in Enum.GetValues(colorTableGroupType))
            {
                var prop = colorTableType.GetProperty(Enum.GetName(colorTableGroupType, colorTableGroup));
                _colors[colorTableGroup] = (Color)prop.GetValue(colorTable, null);
            }

            if (makeColorsDefault)
            {
                MakeColorsDefault();
            }
        }
Exemple #27
0
        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);
        }
            public static void Start()
            {
                // load settings
                Settings.Load();

                // install downloaded update if it exists
                if (Settings.Data.Data.General.AutoUpdate.Update.Downloaded)
                {
                    if (AutoUpdate.AutoUpdate.InstallUpdate())
                    {
                        return;
                    }
                }

                Template.Load();

                // whidbey color table (gray colors of menustrip and tabstrip)
                ProfessionalColorTable whidbeyColorTable = new ProfessionalColorTable {
                    UseSystemColors = true
                };

                ToolStripManager.Renderer = new ToolStripProfessionalRenderer(whidbeyColorTable);

                //remove installed update if it exists
                if (Settings.Data.Data.General.AutoUpdate.Update.Installed)
                {
                    AutoUpdate.AutoUpdate.RemoveUpdate();
                }

                //check for update
                if (Settings.Data.Data.General.AutoUpdate.Enabled && Settings.Data.Data.General.AutoUpdate.UpdateFile != null &&
                    Settings.Data.Data.General.AutoUpdate.LastCheck.Date.AddDays(Settings.Data.Data.General.AutoUpdate.CheckInterval) <= DateTime.Now.Date)
                {
                    Update.Check(true, Settings.Data.Data.General.AutoUpdate.SilentDownload);
                }

                // start main form
                Application.Run(new MainForm());

                // save settings
                Settings.Save();
            }
Exemple #29
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");
        }
        public void ProfessionalColorTable_UseSystemColors_SetWithKnownColor_GetReturnsExpected(bool value)
        {
            var table = new ProfessionalColorTable
            {
                UseSystemColors = !value
            };
            Color result = table.ButtonCheckedGradientBegin;

            Assert.Equal(result, table.ButtonCheckedGradientBegin);

            table.UseSystemColors = value;
            Assert.Equal(value, table.UseSystemColors);

            // Set same.
            table.UseSystemColors = value;
            Assert.Equal(value, table.UseSystemColors);

            // Set different.
            table.UseSystemColors = !value;
            Assert.Equal(!value, table.UseSystemColors);
        }
Exemple #31
0
 /// <summary>
 /// Initializes a new instance of the BseRenderer class.
 /// </summary>
 /// <param name="professionalColorTable">A <see cref="BSE.Windows.Forms.ProfessionalColorTable"/> to be used for painting.</param>
 public BseRenderer(ProfessionalColorTable professionalColorTable)
     : base(professionalColorTable)
 {
 }
 /// <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(ProfessionalColorTable professionalColorTable)
     : base(professionalColorTable)
 {
 }
 public ToolStripProfessionalRenderer(ProfessionalColorTable professionalColorTable)
 {
 }