protected override void InitViewCommands(RibbonPanel panel) { _ribbonList = new RibbonButtonList(); _ribbonList.ItemsWideInMediumMode = 3; _ribbonList.ItemsWideInLargeMode = 3; FillCategoriesList(); panel.Items.Add(_ribbonList); RibbonButton btnExport = new RibbonButton("Export Selected"); RibbonButton btnExportAs = new RibbonButton("Export To..."); RibbonButton btnExportEach = new RibbonButton("Export Each"); RibbonButton btnSelectAll = new RibbonButton("Select All"); panel.Items.Add(btnSelectAll); btnSelectAll.Click += new EventHandler(btnSelectAll_Clicked); btnSelectAll.MinSizeMode = RibbonElementSizeMode.Medium; btnSelectAll.MaxSizeMode = RibbonElementSizeMode.Medium; btnSelectAll.SmallImage = RegScoreCalc.Properties.Resources.SelectAll; btnSelectAll.MouseEnter += _views.MainForm.RibbonButton_MouseEnter; RibbonButton btnDeselectAll = new RibbonButton("Deselect All"); panel.Items.Add(btnDeselectAll); btnDeselectAll.Click += new EventHandler(btnDeselectAll_Clicked); btnDeselectAll.MinSizeMode = RibbonElementSizeMode.Medium; btnDeselectAll.MaxSizeMode = RibbonElementSizeMode.Medium; btnDeselectAll.SmallImage = RegScoreCalc.Properties.Resources.DeselectAll; btnDeselectAll.MouseEnter += _views.MainForm.RibbonButton_MouseEnter; panel.Items.Add(new RibbonSeparator()); panel.Items.Add(btnExport); panel.Items.Add(btnExportEach); panel.Items.Add(btnExportAs); btnExport.Click += new EventHandler(btnExport_Clicked); btnExport.Image = RegScoreCalc.Properties.Resources.Export; btnExport.SmallImage = RegScoreCalc.Properties.Resources.Export; btnExport.MouseEnter += _views.MainForm.RibbonButton_MouseEnter; btnExportAs.Click += new EventHandler(btnExportAs_Clicked); btnExportAs.Image = RegScoreCalc.Properties.Resources.Export; btnExportAs.SmallImage = RegScoreCalc.Properties.Resources.Export; btnExportAs.MouseEnter += _views.MainForm.RibbonButton_MouseEnter; btnExportEach.Click += new EventHandler(btnExportEach_Clicked); btnExportEach.Image = RegScoreCalc.Properties.Resources.Export; btnExportEach.SmallImage = RegScoreCalc.Properties.Resources.Export; btnExportEach.MouseEnter += _views.MainForm.RibbonButton_MouseEnter; }
private void InitList() { Image[] images = new Image[50]; RibbonProfessionalRenderer rend = new RibbonProfessionalRenderer(); Random r = new Random(); using (GraphicsPath path = rend.RoundRectangle(new Rectangle(3, 3, 26, 26), 4)) { using (GraphicsPath outer = rend.RoundRectangle(new Rectangle(0,0,32,32), 4)) { for (int i = 0; i < images.Length; i++) { Bitmap b = new Bitmap(32, 32); using (Graphics g = Graphics.FromImage(b)) { g.SmoothingMode = SmoothingMode.AntiAlias; using (SolidBrush br = new SolidBrush(Color.FromKnownColor((KnownColor)r.Next(1, 150)))) { g.FillPath(br, path); } using (Pen p = new Pen(Color.White, 3)) { g.DrawPath(p, path); } g.DrawPath(Pens.Wheat, path); } images[i] = b; RibbonButton btn = new RibbonButton(); btn.Image = b; lst.Buttons.Add(btn); } } } //lst.DropDownItems.Add(new RibbonSeparator("Available styles")); RibbonButtonList lst2 = new RibbonButtonList(); for (int i = 0; i < images.Length; i++) { RibbonButton btn = new RibbonButton(); btn.Image = images[i]; lst2.Buttons.Add(btn); } lst.DropDownItems.Add(lst2); //lst.DropDownItems.Add(new RibbonSeparator("Style Options")); lst.DropDownItems.Add(new RibbonButton("Save style...")); lst.DropDownItems.Add(new RibbonButton("Create style")); lst.DropDownItems.Add(new RibbonButton("Apply style...")); }
private void InitList() { Image[] images = new Image[50]; RibbonProfessionalRenderer rend = new RibbonProfessionalRenderer(); Random r = new Random(); using (GraphicsPath path = rend.RoundRectangle(new Rectangle(3, 3, 26, 26), 4)) { using (GraphicsPath outer = rend.RoundRectangle(new Rectangle(0, 0, 32, 32), 4)) { for (int i = 0; i < images.Length; i++) { Bitmap b = new Bitmap(32, 32); using (Graphics g = Graphics.FromImage(b)) { g.SmoothingMode = SmoothingMode.AntiAlias; using (SolidBrush br = new SolidBrush(Color.FromKnownColor((KnownColor)r.Next(1, 150)))) { g.FillPath(br, path); } using (Pen p = new Pen(Color.White, 3)) { g.DrawPath(p, path); } g.DrawPath(Pens.Wheat, path); } images[i] = b; RibbonButton btn = new RibbonButton(); btn.Image = b; lst.Buttons.Add(btn); } } } //lst.DropDownItems.Add(new RibbonSeparator("Available styles")); RibbonButtonList lst2 = new RibbonButtonList(); for (int i = 0; i < images.Length; i++) { RibbonButton btn = new RibbonButton(); btn.Image = images[i]; lst2.Buttons.Add(btn); } lst.DropDownItems.Add(lst2); //lst.DropDownItems.Add(new RibbonSeparator("Style Options")); lst.DropDownItems.Add(new RibbonButton("Save style...")); lst.DropDownItems.Add(new RibbonButton("Create style")); lst.DropDownItems.Add(new RibbonButton("Apply style...")); }
/// <summary> /// /// </summary> /// <param name="items"></param> private void TranslateRibbonItems(RibbonButtonList items) { if (items == null || items.Buttons.Count <= 0) { return; } foreach (RibbonButton item in items.Buttons) { item.Text = I18N._(item.Text); item.ToolTip = I18N._(item.ToolTip); item.ToolTipTitle = I18N._(item.ToolTipTitle); } }
private void InitLists() { Image[] images = new Image[255]; RibbonProfessionalRenderer rend = new RibbonProfessionalRenderer(); BackColor = rend.ColorTable.RibbonBackground; Random r = new Random(); #region Color Squares using (GraphicsPath path = RibbonProfessionalRenderer.RoundRectangle(new Rectangle(3, 3, 26, 26), 4)) { using (GraphicsPath outer = RibbonProfessionalRenderer.RoundRectangle(new Rectangle(0, 0, 32, 32), 4)) { for (int i = 0; i < images.Length; i++) { Bitmap b = new Bitmap(32, 32); using (Graphics g = Graphics.FromImage(b)) { g.SmoothingMode = SmoothingMode.AntiAlias; using (SolidBrush br = new SolidBrush(Color.FromArgb(255, i * (255 / images.Length), 0))) { g.FillPath(br, path); } using (Pen p = new Pen(Color.White, 3)) { g.DrawPath(p, path); } g.DrawPath(Pens.Wheat, path); g.DrawString(Convert.ToString(i + 1), Font, Brushes.White, new Point(10, 10)); } images[i] = b; RibbonButton btn = new RibbonButton(); btn.Image = b; lst.Buttons.Add(btn); } } } //lst.DropDownItems.Add(new RibbonSeparator("Available styles")); RibbonButtonList lst2 = new RibbonButtonList(); for (int i = 0; i < images.Length; i++) { RibbonButton btn = new RibbonButton(); btn.Image = images[i]; lst2.Buttons.Add(btn); } lst.DropDownItems.Add(lst2); lst.DropDownItems.Add(new RibbonButton("Save selection as a new quick style...")); lst.DropDownItems.Add(new RibbonButton("Erase Format")); lst.DropDownItems.Add(new RibbonButton("Apply style...")); #endregion #region Theme Colors RibbonButton[] buttons = new RibbonButton[30]; int square = 16; int squares = 4; int sqspace = 2; for (int i = 0; i < buttons.Length; i++) { #region Create color squares Bitmap colors = new Bitmap((square + sqspace) * squares, square + 1); string[] colorss = new string[squares]; using (Graphics g = Graphics.FromImage(colors)) { for (int j = 0; j < 4; j++) { Color sqcolor = GetRandomColor(r); colorss[j] = sqcolor.Name; using (SolidBrush b = new SolidBrush(sqcolor)) { g.FillRectangle(b, new Rectangle(j * (square + sqspace), 0, square, square)); } g.DrawRectangle(Pens.Gray, new Rectangle(j * (square + sqspace), 0, square, square)); } } #endregion buttons[i] = new RibbonButton(colors); buttons[i].Text = string.Join(", ", colorss);; buttons[i].MaxSizeMode = RibbonElementSizeMode.Medium; buttons[i].MinSizeMode = RibbonElementSizeMode.Medium; } RibbonButtonList blst = new RibbonButtonList(buttons); blst.FlowToBottom = false; blst.ItemsSizeInDropwDownMode = new Size(1, 10); itemColors.DropDownItems.Insert(0, blst); itemColors.DropDownResizable = true; #endregion }
/// <summary> /// Add windows and tools to the control ribbon. /// </summary> private void AddRibbonItems() { foreach (var aTool in this.toolItems) { var tool = aTool; RibbonPanel group = GetRibbonPanel(tool); RibbonButton toolItem = new RibbonButton(tool.Caption); SetupToolbarItem(tool, toolItem); group.Items.Add(toolItem); tool.ToolbarItemInitialized(); } foreach (var aGroupedTool in this.groupedToolItems) { var groupedTool = aGroupedTool; RibbonPanel group = GetRibbonPanel(groupedTool); RibbonButtonList hostList = null; if (groupedTool.IsButtonList) { hostList = new RibbonButtonList(); hostList.ButtonsSizeMode = RibbonElementSizeMode.DropDown; //hostList.MaxSizeMode = RibbonElementSizeMode.Compact; //hostList.MinSizeMode = RibbonElementSizeMode.Compact; //hostList.Text = "Hello"; group.Items.Add(hostList); } foreach (var tool in groupedTool.ToolbarItems) { RibbonButton toolItem = new RibbonButton(tool.Caption); if (groupedTool.IsButtonList) { hostList.Buttons.Add(toolItem); } else { group.Items.Add(toolItem); } SetupToolbarItem(tool, toolItem); } groupedTool.ToolbarItemInitialized(); } foreach (var aMenuTool in this.menuButtonToolItems) { var menuTool = aMenuTool.Value; RibbonPanel group = GetRibbonPanel(menuTool); RibbonButton theButton = new RibbonButton(menuTool.Caption); theButton.Style = RibbonButtonStyle.SplitDropDown; theButton.DropDownItemClicked += delegate(object sender, RibbonItemEventArgs e) { menuTool.MenuItemClicked(e.Item.Text); }; SetupToolbarItem(menuTool, theButton); group.Items.Add(theButton); foreach (var menuItem in menuTool.MenuItems) { RibbonItem item = new RibbonButton(menuItem); theButton.DropDownItems.Add(item); } if (theButton.DropDownItems.Count == 0) { theButton.Style = RibbonButtonStyle.Normal; } menuTool.ToolbarItemInitialized(); } foreach (var aComboTool in this.comboToolItems) { var comboTool = aComboTool; RibbonPanel group = GetRibbonPanel(comboTool); RibbonComboBox theButton = new RibbonComboBox(); theButton.Text = ""; // comboTool.Caption; theButton.AllowTextEdit = false; //if (theButton.Text.Length == 0) //{ // theButton.LabelWidth = 1; //} //else if (comboTool.Image == null) { RibbonLabel label = new RibbonLabel(); label.Text = comboTool.Caption; group.Items.Add(label); } theButton.Image = comboTool.Image; //theButton.SmallImage = comboTool.SmallImage; //theButton.CheckOnClick = comboTool.CheckOnClick; //theButton.Style = RibbonButtonStyle.SplitDropDown; theButton.DropDownItemClicked += delegate(object sender, RibbonItemEventArgs e) { comboTool.ComboItemClicked(e.Item.Text); }; comboTool.ComboSelectedTextChanged += delegate(object o, Core.Window.Events.ComboSelectedTextChangedEventArgs e) { //theButton.SelectedValue = e.Text; theButton.TextBoxText = e.Text; }; this.toolToUiMap[comboTool] = theButton; group.Items.Add(theButton); //comboTool.ComboItemsChanged; foreach (var comboItem in comboTool.ComboItems) { RibbonItem item = new RibbonButton(comboItem); theButton.DropDownItems.Add(item); } comboTool.ComboItemsAdded += delegate(object sender, Core.Window.Events.ComboItemsAddedEvent e) { theButton.DropDownItems.Clear(); foreach (var item in comboTool.ComboItems) { theButton.DropDownItems.Add(new RibbonButton(item)); } }; comboTool.ToolbarItemInitialized(); } foreach (var aUpDownTool in this.upDownToolItems) { var upDownTool = aUpDownTool; RibbonPanel group = GetRibbonPanel(upDownTool); RibbonUpDown theButton = new RibbonUpDown(); theButton.Text = upDownTool.Caption; theButton.Image = upDownTool.Image; this.toolToUiMap[upDownTool] = theButton; theButton.Value = upDownTool.InitialValue.ToString(); theButton.UpButtonClicked += delegate(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { int val = 0; if (int.TryParse(theButton.Value, out val)) { val += upDownTool.Interval; if (val <= upDownTool.MaximumValue) { upDownTool.Value = val; theButton.Value = val.ToString(); theButton.TextBoxText = theButton.Value; upDownTool.Click(); } } } }; theButton.DownButtonClicked += delegate(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { int val = 0; if (int.TryParse(theButton.Value, out val)) { val -= upDownTool.Interval; if (val >= upDownTool.MinimumValue) { upDownTool.Value = val; theButton.Value = val.ToString(); theButton.TextBoxText = theButton.Value; upDownTool.Click(); } } } }; ////theButton. ////theButton.SmallImage = comboTool.SmallImage; ////theButton.CheckOnClick = comboTool.CheckOnClick; ////theButton.Style = RibbonButtonStyle.SplitDropDown; //theButton.DropDownItemClicked += // delegate(object sender, RibbonItemEventArgs e) // { // upDownTool.ComboItemClicked(e.Item.Text); // }; //group.Items.Add(theButton); //upDownTool.ButtonStatusChanged += // delegate(object o, Window.ToolbarItemEvent e) // { // theButton.Enabled = e.IsEnabled; // }; ////comboTool.ComboItemsChanged; //foreach (var comboItem in upDownTool.ComboItems) //{ // RibbonItem item = new RibbonButton(comboItem); // theButton.DropDownItems.Add(item); //} //upDownTool.ComboItemsAdded += // delegate(object sender, ComboItemsAddedEvent e) // { // theButton.DropDownItems.Clear(); // foreach (var item in upDownTool.ComboItems) // { // theButton.DropDownItems.Add(new RibbonButton(item)); // } // }; upDownTool.ToolbarItemInitialized(); } foreach (var hostItem in this.hostedItems) { RibbonPanel group = GetRibbonPanel(hostItem); RibbonButton theButton = new RibbonButton(); theButton.Text = hostItem.Caption; theButton.Image = hostItem.Image; theButton.SmallImage = hostItem.SmallImage; theButton.Style = RibbonButtonStyle.DropDown; this.toolToUiMap[hostItem] = theButton; var uiHost = new RibbonHost(); uiHost.HostedControl = hostItem.UserControl; theButton.DropDownItems.Add(uiHost); hostItem.UserControlFinished += delegate { uiHost.HostCompleted(); }; group.Items.Add(theButton); hostItem.ToolbarItemInitialized(); } this.ribbon.Tabs.Sort(TabSorter); }
private void Initsymbol_list() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestForm)); Image[] images = new Image[13]; // RibbonProfessionalRenderer rend = new RibbonProfessionalRenderer(); // BackColor = rend.ColorTable.RibbonBackground; Random r = new Random(); for (int i = 0; i < images.Length; i++) { Bitmap b = new Bitmap((System.Drawing.Image)(resources.GetObject("ribbonButton_s" + (i + 1) + ".SmallImage"))); Bitmap c = new Bitmap((System.Drawing.Image)(resources.GetObject("ribbonButton_s" + (i + 1) + ".Image"))); images[i] = c; RibbonButton btn = new RibbonButton(); // btn.SmallImage = b; btn.Image = b; btn.Name = "symbols" + (i + 1); symbol_lst.Buttons.Add(btn); } RibbonButtonList lst2 = new RibbonButtonList(); for (int i = 0; i < images.Length; i++) { RibbonButton btn = new RibbonButton(); btn.Image = images[i]; btn.Name = "symbols" + (i + 1); btn.Click += new System.EventHandler(OnToolSelect); lst2.Buttons.Add(btn); } symbol_lst.DropDownItems.Add(lst2); /* RibbonButton[] buttons = new RibbonButton[30]; int square = 16; int squares = 4; int sqspace = 2; for (int i = 0; i < buttons.Length; i++) { #region Create color squares Bitmap colors = new Bitmap((System.Drawing.Image)(resources.GetObject("ribbonButton_s"+(i+1)+".Image"))); buttons[i] = new RibbonButton(colors);; buttons[i].MaxSizeMode = RibbonElementSizeMode.Medium; buttons[i].MinSizeMode = RibbonElementSizeMode.Medium; } RibbonButtonList blst = new RibbonButtonList(buttons); blst.FlowToBottom = false; blst.ItemsSizeInDropwDownMode = new Size(1, 10); itemColors.DropDownItems.Insert(0, blst); itemColors.DropDownResizable = true; #endregion*/ }
private void InitLists() { Image[] images = new Image[255]; RibbonProfessionalRenderer rend = new RibbonProfessionalRenderer(); BackColor = rend.ColorTable.RibbonBackground; Random r = new Random(); #region Color Squares using (GraphicsPath path = RibbonProfessionalRenderer.RoundRectangle(new Rectangle(3, 3, 26, 26), 4)) { using (GraphicsPath outer = RibbonProfessionalRenderer.RoundRectangle(new Rectangle(0, 0, 32, 32), 4)) { for (int i = 0; i < images.Length; i++) { Bitmap b = new Bitmap(32, 32); using (Graphics g = Graphics.FromImage(b)) { g.SmoothingMode = SmoothingMode.AntiAlias; using (SolidBrush br = new SolidBrush(Color.FromArgb(255, i * (255 / images.Length), 0))) { g.FillPath(br, path); } using (Pen p = new Pen(Color.White, 3)) { g.DrawPath(p, path); } g.DrawPath(Pens.Wheat, path); g.DrawString(Convert.ToString(i + 1), Font, Brushes.White, new Point(10, 10)); } images[i] = b; RibbonButton btn = new RibbonButton(); btn.Image = b; lst.Buttons.Add(btn); } } } //lst.DropDownItems.Add(new RibbonSeparator("Available styles")); RibbonButtonList lst2 = new RibbonButtonList(); for (int i = 0; i < images.Length; i++) { RibbonButton btn = new RibbonButton(); btn.Image = images[i]; lst2.Buttons.Add(btn); } lst.DropDownItems.Add(lst2); lst.DropDownItems.Add(new RibbonButton("Save selection as a new quick style...")); lst.DropDownItems.Add(new RibbonButton("Erase Format")); lst.DropDownItems.Add(new RibbonButton("Apply style...")); #endregion #region Theme Colors RibbonButton[] buttons = new RibbonButton[30]; int square = 16; int squares = 4; int sqspace = 2; for (int i = 0; i < buttons.Length; i++) { #region Create color squares Bitmap colors = new Bitmap((square + sqspace) * squares, square + 1); string[] colorss = new string[squares]; using (Graphics g = Graphics.FromImage(colors)) { for (int j = 0; j < 4; j++) { Color sqcolor = GetRandomColor(r); colorss[j] = sqcolor.Name; using (SolidBrush b = new SolidBrush(sqcolor)) { g.FillRectangle(b, new Rectangle(j * (square + sqspace), 0, square, square)); } g.DrawRectangle(Pens.Gray, new Rectangle(j * (square + sqspace), 0, square, square)); } } #endregion buttons[i] = new RibbonButton(colors); buttons[i].Text = string.Join(", ", colorss); ; buttons[i].MaxSizeMode = RibbonElementSizeMode.Medium; buttons[i].MinSizeMode = RibbonElementSizeMode.Medium; } RibbonButtonList blst = new RibbonButtonList(buttons); blst.FlowToBottom = false; blst.ItemsSizeInDropwDownMode = new Size(1, 10); itemColors.DropDownItems.Insert(0, blst); itemColors.DropDownResizable = true; #endregion }
internal RibbonButtonCollection(RibbonButtonList list) { _ownerList = list; }
public void DrawButtonList(Graphics g, RibbonButtonList list) { Rectangle outerR = Rectangle.FromLTRB( list.Bounds.Left, list.Bounds.Top, list.Bounds.Right - 1, list.Bounds.Bottom); using (GraphicsPath path = RoundRectangle(outerR, 3, Corners.East)) { Color bgcolor = list.Selected ? ColorTable.ButtonListBgSelected : ColorTable.ButtonListBg; if (list.Canvas is RibbonDropDown) bgcolor = ColorTable.DropDownBg; using (SolidBrush b = new SolidBrush(bgcolor)) { g.FillPath(b, path); } using (Pen p = new Pen(ColorTable.ButtonListBorder)) { g.DrawPath(p, path); } } if (list.ScrollType == RibbonButtonList.ListScrollType.Scrollbar && ScrollBarRenderer.IsSupported) { ScrollBarRenderer.DrawUpperVerticalTrack(g, list.ScrollBarBounds, ScrollBarState.Normal); if (list.ThumbPressed) { ScrollBarRenderer.DrawVerticalThumb(g, list.ThumbBounds, ScrollBarState.Pressed); ScrollBarRenderer.DrawVerticalThumbGrip(g, list.ThumbBounds, ScrollBarState.Pressed); } else if (list.ThumbSelected) { ScrollBarRenderer.DrawVerticalThumb(g, list.ThumbBounds, ScrollBarState.Hot); ScrollBarRenderer.DrawVerticalThumbGrip(g, list.ThumbBounds, ScrollBarState.Hot); } else { ScrollBarRenderer.DrawVerticalThumb(g, list.ThumbBounds, ScrollBarState.Normal); ScrollBarRenderer.DrawVerticalThumbGrip(g, list.ThumbBounds, ScrollBarState.Normal); } if (list.ButtonUpPressed) { ScrollBarRenderer.DrawArrowButton(g, list.ButtonUpBounds, ScrollBarArrowButtonState.UpPressed); } else if (list.ButtonUpSelected) { ScrollBarRenderer.DrawArrowButton(g, list.ButtonUpBounds, ScrollBarArrowButtonState.UpHot); } else { ScrollBarRenderer.DrawArrowButton(g, list.ButtonUpBounds, ScrollBarArrowButtonState.UpNormal); } if (list.ButtonDownPressed) { ScrollBarRenderer.DrawArrowButton(g, list.ButtonDownBounds, ScrollBarArrowButtonState.DownPressed); } else if (list.ButtonDownSelected) { ScrollBarRenderer.DrawArrowButton(g, list.ButtonDownBounds, ScrollBarArrowButtonState.DownHot); } else { ScrollBarRenderer.DrawArrowButton(g, list.ButtonDownBounds, ScrollBarArrowButtonState.DownNormal); } } else { #region Control Buttons if (list.ScrollType == RibbonButtonList.ListScrollType.Scrollbar) { using (SolidBrush b = new SolidBrush(ColorTable.ButtonGlossyNorth)) { g.FillRectangle(b, list.ScrollBarBounds); } } if (!list.ButtonDownEnabled) { DrawButtonDisabled(g, list.ButtonDownBounds, list.ButtonDropDownPresent ? Corners.None : Corners.SouthEast); } else if (list.ButtonDownPressed) { DrawButtonPressed(g, list.ButtonDownBounds, list.ButtonDropDownPresent ? Corners.None : Corners.SouthEast); } else if (list.ButtonDownSelected) { DrawButtonSelected(g, list.ButtonDownBounds, list.ButtonDropDownPresent ? Corners.None : Corners.SouthEast); } else { DrawButton(g, list.ButtonDownBounds, Corners.None); } if (!list.ButtonUpEnabled) { DrawButtonDisabled(g, list.ButtonUpBounds, Corners.NorthEast); } else if (list.ButtonUpPressed) { DrawButtonPressed(g, list.ButtonUpBounds, Corners.NorthEast); } else if (list.ButtonUpSelected) { DrawButtonSelected(g, list.ButtonUpBounds, Corners.NorthEast); } else { DrawButton(g, list.ButtonUpBounds, Corners.NorthEast); } if (list.ButtonDropDownPresent) { if (list.ButtonDropDownPressed) { DrawButtonPressed(g, list.ButtonDropDownBounds, Corners.SouthEast); } else if (list.ButtonDropDownSelected) { DrawButtonSelected(g, list.ButtonDropDownBounds, Corners.SouthEast); } else { DrawButton(g, list.ButtonDropDownBounds, Corners.SouthEast); } } if (list.ScrollType == RibbonButtonList.ListScrollType.Scrollbar && list.ScrollBarEnabled) { if (list.ThumbPressed) { DrawButtonPressed(g, list.ThumbBounds, Corners.All); } else if (list.ThumbSelected) { DrawButtonSelected(g, list.ThumbBounds, Corners.All); } else { DrawButton(g, list.ThumbBounds, Corners.All); } } Color dk = ColorTable.Arrow; Color lt = ColorTable.ArrowLight; Color ds = ColorTable.ArrowDisabled; Rectangle arrUp = CenterOn(list.ButtonUpBounds, new Rectangle(Point.Empty, arrowSize)); arrUp.Offset(0, 1); Rectangle arrD = CenterOn(list.ButtonDownBounds, new Rectangle(Point.Empty, arrowSize)); arrD.Offset(0, 1); Rectangle arrdd = CenterOn(list.ButtonDropDownBounds, new Rectangle(Point.Empty, arrowSize)); arrdd.Offset(0, 3); DrawArrow(g, arrUp, list.ButtonUpEnabled ? lt : Color.Transparent, RibbonArrowDirection.Up); arrUp.Offset(0, -1); DrawArrow(g, arrUp, list.ButtonUpEnabled ? dk : ds, RibbonArrowDirection.Up); DrawArrow(g, arrD, list.ButtonDownEnabled ? lt : Color.Transparent, RibbonArrowDirection.Down); arrD.Offset(0, -1); DrawArrow(g, arrD, list.ButtonDownEnabled ? dk : ds, RibbonArrowDirection.Down); if (list.ButtonDropDownPresent) { using (SolidBrush b = new SolidBrush(ColorTable.Arrow)) { SmoothingMode sm = g.SmoothingMode; g.SmoothingMode = SmoothingMode.None; g.FillRectangle(b, new Rectangle(new Point(arrdd.Left - 1, arrdd.Top - 4), new Size(arrowSize.Width + 2, 1))); g.SmoothingMode = sm; } DrawArrow(g, arrdd, lt, RibbonArrowDirection.Down); arrdd.Offset(0, -1); DrawArrow(g, arrdd, dk, RibbonArrowDirection.Down); } #endregion } }