private void AddTagsToRibbonMenu(List<MenuInfo> tags)
        {
            foreach (var tag in tags)
            {
                RibbonTab tab = new RibbonTab()
                {
                    Text = tag.TagName
                };
                ribbon1.Tabs.Add(tab);
                
                foreach (var button in tag.Downloaders)
                {
                    var pnl = new RibbonPanel()
                    {
                       Text = (button.Tag as Downloader).Name,
                    };

                   


                    pnl.Items.Add(button);
                    tab.Panels.Add(pnl);

                }

                
            }
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Esempio n. 2
0
        private RibbonTab CreateMenu()
        {
            this.PersonMainMenu = new ButtonCommand();
            this.PersonMainGroup = new RibbonGroup();
            this.PersonMainTab = new RibbonTab();
            this.AddPersonMenu = new ButtonCommand();

            PersonMainTab.Text = "Администрација";
            PersonMainTab.Name = "rtabAdministration";
            PersonMainTab.Key = "rtabAdministration";

            PersonMainGroup.Text = "Вработени";
            PersonMainGroup.Name = "rgEmployee";
            PersonMainGroup.Key = "rgEmployee";

            PersonMainMenu.Text = "Вработени";
            PersonMainMenu.Name = "pcbPersonMainMenu";
            PersonMainMenu.Click += AdministrationCommandFacade.PersonList;
            PersonMainMenu.SizeStyle = CommandSizeStyle.Large;

            AddPersonMenu.Text = "Додади Вработен";
            AddPersonMenu.Name = "pcbAddPersonMenu";
            AddPersonMenu.Click += AdministrationCommandFacade.AddPerson;
            AddPersonMenu.SizeStyle = CommandSizeStyle.Small;

            PersonMainGroup.Commands.Add(PersonMainMenu);
            PersonMainGroup.Commands.Add(AddPersonMenu);
            PersonMainTab.Groups.Add(PersonMainGroup);

            return PersonMainTab;
        }
Esempio n. 3
0
 public RibbonPanelGlyph(BehaviorService behaviorService, RibbonTabDesigner designer, RibbonTab tab)
     : base(new RibbonPanelGlyphBehavior(designer, tab))
 {
     _behaviorService = behaviorService;
     _componentDesigner = designer;
     _tab = tab;
     size = new Size(60, 16);
 }
        /// <summary>
        /// Creates a new Sensor for the specified RibbonTab
        /// </summary>
        /// <param name="control">Control to listen to mouse events</param>
        /// <param name="ribbon">Ribbon that will be affected</param>
        /// <param name="tab">Tab that will be sensed, from which all panels and items will be extracted to sensing also.</param>
        public RibbonMouseSensor(Control control, Ribbon ribbon, RibbonTab tab)
            : this(control, ribbon)
        {
            Tabs.Add(tab);
            Panels.AddRange(tab.Panels);

            foreach (RibbonPanel panel in tab.Panels)
            {
                Items.AddRange(panel.Items);
            }
        }
Esempio n. 5
0
        public RibbonSensor(Control control, Ribbon ribbon, RibbonTab tabToSense)
        {
            _ribbon = ribbon;
            _control = control;
            _tab = tabToSense;

            _control.MouseMove += new MouseEventHandler(_control_MouseMove);
            _control.MouseDown += new MouseEventHandler(_control_MouseDown);
            _control.MouseUp += new MouseEventHandler(_control_MouseUp);
            _control.MouseLeave += new EventHandler(_control_MouseLeave);
        }
        public override Microsoft.Office.Tools.Ribbon.RibbonGroup ModuleRibbonGroup(RibbonBase MyRibbon, RibbonTab MyRibbonTab)
        {
            RibbonGroup rGroup = MyRibbon.Factory.CreateRibbonGroup();
            rGroup.Name = this.Name;
            rGroup.Label = this.Label;

            exportButton = MyRibbon.Factory.CreateRibbonButton();
            exportButton.Name = "ExportButton";
            exportButton.Label = "Exportbutton";

            rGroup.Items.Add(exportButton);
            return rGroup;
        }
Esempio n. 7
0
        //modulhoz ribbon group létrehozása
        public override RibbonGroup ModuleRibbonGroup(RibbonBase MyRibbon, RibbonTab MyRibbonTab)
        {
            RibbonGroup myGroup = MyRibbon.Factory.CreateRibbonGroup();
            myGroup.Name = this.Name;
            myGroup.Label = this.Label;

            testButton = MyRibbon.Factory.CreateRibbonButton();
            testButton.Name = "tesztGomb";
            testButton.Label = "Teszt";

            myGroup.Items.Add(testButton);
            return myGroup;
        }
Esempio n. 8
0
        private void loadform()
        {
            RibbonTab hometab = new RibbonTab("Home");
            this.ultToolsbarmgr.Ribbon.Tabs.Add(hometab);

            RibbonGroup newgroup = new RibbonGroup("New");
            this.ultToolsbarmgr.Ribbon.Tabs["Home"].Groups.Add(newgroup);

            //RibbonGroupCollection collection= new RibbonGroupCollection();
            //collection.Add("Customer");

            //FontListTool fontFaceTool = new FontListTool("Fontface");
            //this.ultToolsbarmgr.Tools.Add(fontFaceTool);
            //fontgrop.Tools.AddTool(fontFaceTool.Key, false);
        }
Esempio n. 9
0
        private RibbonTab CreateMenu()
        {
            this.PlanningMainMenu = new ButtonCommand();
            this.PlanningMainGroup = new RibbonGroup();
            this.PlanningMainTab = new RibbonTab();

            PlanningMainTab.Text = "Планирање";
            PlanningMainTab.Name = "rtabPlanning";
            PlanningMainTab.Key = "rtabPlanning";

            PlanningMainGroup.Text = "Планирање";
            PlanningMainGroup.Name = "rgPlanning";
            PlanningMainGroup.Key = "rgPlanning";

            PlanningMainMenu.Text = "Форма";
            PlanningMainMenu.Name = "pcbPlanning";
            PlanningMainMenu.Click += PlanningCommandFacade.ViewPlanning;
            PlanningMainMenu.SizeStyle = CommandSizeStyle.Large;

            PlanningMainGroup.Commands.Add(PlanningMainMenu);
            PlanningMainTab.Groups.Add(PlanningMainGroup);

            return PlanningMainTab;
        }
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateCompleteTabPath(RibbonTab t)
        {
            GraphicsPath path = new GraphicsPath();
            int corner = 6;

            path.AddLine(t.TabBounds.Left + corner, t.TabBounds.Top,
                 t.TabBounds.Right - corner, t.TabBounds.Top);
            path.AddArc(
                 Rectangle.FromLTRB(t.TabBounds.Right - corner, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Top + corner),
                 -90, 90);
            path.AddLine(t.TabBounds.Right, t.TabBounds.Top + corner,
                 t.TabBounds.Right, t.TabBounds.Bottom - corner);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabBounds.Right, t.TabBounds.Bottom - corner, t.TabBounds.Right + corner, t.TabBounds.Bottom),
                 -180, -90);
            path.AddLine(t.TabBounds.Right + corner, t.TabBounds.Bottom, t.TabContentBounds.Right - corner, t.TabBounds.Bottom);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Right - corner, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom + corner),
                 -90, 90);
            path.AddLine(t.TabContentBounds.Right, t.TabContentBounds.Top + corner, t.TabContentBounds.Right, t.TabContentBounds.Bottom - corner);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Right - corner, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Right, t.TabContentBounds.Bottom),
                 0, 90);
            path.AddLine(t.TabContentBounds.Right - corner, t.TabContentBounds.Bottom, t.TabContentBounds.Left + corner, t.TabContentBounds.Bottom);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Left, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Left + corner, t.TabContentBounds.Bottom),
                 90, 90);
            path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Left, t.TabBounds.Bottom + corner);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Left, t.TabBounds.Bottom, t.TabContentBounds.Left + corner, t.TabBounds.Bottom + corner),
                 180, 90);
            path.AddLine(t.TabContentBounds.Left + corner, t.TabContentBounds.Top, t.TabBounds.Left - corner, t.TabBounds.Bottom);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabBounds.Left - corner, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Bottom),
                 90, -90);
            path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Top + corner);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Left + corner, t.TabBounds.Top + corner),
                 180, 90);
            path.CloseFigure();

            return path;
        }
Esempio n. 11
0
        /// <summary>
        /// Redraws the specified tab
        /// </summary>
        /// <param name="tab"></param>
        internal void RedrawTab(RibbonTab tab)
        {
            using (Graphics g = CreateGraphics())
            {
                Rectangle clip = Rectangle.FromLTRB(
                     tab.TabBounds.Left,
                     tab.TabBounds.Top,
                     tab.TabBounds.Right,
                     tab.TabBounds.Bottom);

                g.SetClip(clip);
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
                g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                tab.OnPaint(this, new RibbonElementPaintEventArgs(tab.TabBounds, g, RibbonElementSizeMode.None));
            }
        }
Esempio n. 12
0
 public RibbonPanelGlyphBehavior(RibbonTabDesigner designer, RibbonTab tab)
 {
     _designer = designer;
     _tab = tab;
 }
        /// <summary>
        /// Sets the value of the OwnerTab property
        /// </summary>
        /// <param name="ownerTab">RibbonTab where this item is located</param>
        internal void SetOwnerTab(RibbonTab ownerTab)
        {
            _ownerTab = ownerTab;

             Items.SetOwnerTab(OwnerTab);
        }
 public RibbonTabRenderEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonTab tab)
     : base(owner, g, clip)
 {
     Tab = tab;
 }
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateTabPath_2010(RibbonTab t)
        {
            //Michael Spradlin - 05/03/2013 Office 2013 Style Changes
            GraphicsPath path = new GraphicsPath();
            int corner = 6;
            int rightOffset = 1;

            path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabBounds.Left, t.TabBounds.Top + corner);
            path.AddArc(new Rectangle(t.TabBounds.Left, t.TabBounds.Top, corner, corner), 180, 90);
            path.AddLine(t.TabBounds.Left + corner, t.TabBounds.Top, t.TabBounds.Right - corner - rightOffset, t.TabBounds.Top);
            path.AddArc(new Rectangle(t.TabBounds.Right - corner - rightOffset, t.TabBounds.Top, corner, corner), -90, 90);
            path.AddLine(t.TabBounds.Right - rightOffset, t.TabBounds.Top + corner, t.TabBounds.Right - rightOffset, t.TabBounds.Bottom);

            return path;
        }
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateCompleteTopTabPath_2010(RibbonTab t)
        {
            GraphicsPath path = new GraphicsPath();
            int corner = 6;

            path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Top, t.TabBounds.Left - corner, t.TabBounds.Bottom);

            if (t.Invisible)
            {
                path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabContentBounds.Right - corner, t.TabBounds.Bottom);
            }
            else
            {
                path.AddArc(Rectangle.FromLTRB(
                     t.TabBounds.Left - corner, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Bottom),
                     90, -90);
                path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Top + corner);
                path.AddArc(Rectangle.FromLTRB(
                    t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Left + corner, t.TabBounds.Top + corner),
                    180, 90);
                path.AddLine(t.TabBounds.Left + corner, t.TabBounds.Top,
                     t.TabBounds.Right - corner, t.TabBounds.Top);
                path.AddArc(
                     Rectangle.FromLTRB(t.TabBounds.Right - corner, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Top + corner),
                     -90, 90);
                path.AddLine(t.TabBounds.Right, t.TabBounds.Top + corner,
                     t.TabBounds.Right, t.TabBounds.Bottom - corner);
                path.AddArc(Rectangle.FromLTRB(
                     t.TabBounds.Right, t.TabBounds.Bottom - corner, t.TabBounds.Right + corner, t.TabBounds.Bottom),
                     -180, -90);
                path.AddLine(t.TabBounds.Right + corner, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom);
            }

            return path;
        }
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateTabPath(RibbonTab t)
        {
            GraphicsPath path = new GraphicsPath();
            int corner = 6;
            int rightOffset = 1;

            path.AddLine(
                 t.TabBounds.Left, t.TabBounds.Bottom,
                 t.TabBounds.Left, t.TabBounds.Top + corner);
            path.AddArc(
                 new Rectangle(
                 t.TabBounds.Left, t.TabBounds.Top,
                 corner, corner),
                 180, 90);
            path.AddLine(
                 t.TabBounds.Left + corner, t.TabBounds.Top,
                 t.TabBounds.Right - corner - rightOffset, t.TabBounds.Top);
            path.AddArc(
                 new Rectangle(
                 t.TabBounds.Right - corner - rightOffset, t.TabBounds.Top,
                 corner, corner),
                 -90, 90);
            path.AddLine(
                 t.TabBounds.Right - rightOffset, t.TabBounds.Top + corner,
                 t.TabBounds.Right - rightOffset, t.TabBounds.Bottom);

            return path;
        }
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateCompleteTabPath_2007(RibbonTab t)
        {
            //Michael Spradlin - 05/03/2013 Office 2013 Style Changes
            GraphicsPath path = new GraphicsPath();
            int corner = 6;

            if (t.Invisible)
            {
                path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabContentBounds.Right - corner, t.TabBounds.Bottom);
            }
            else
            {
                path.AddArc(Rectangle.FromLTRB(
                     t.TabBounds.Left - corner, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Bottom),
                     90, -90);
                path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Top + corner);
                path.AddArc(Rectangle.FromLTRB(
                    t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Left + corner, t.TabBounds.Top + corner),
                    180, 90);
                path.AddLine(t.TabBounds.Left + corner, t.TabBounds.Top,
                     t.TabBounds.Right - corner, t.TabBounds.Top);
                path.AddArc(
                     Rectangle.FromLTRB(t.TabBounds.Right - corner, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Top + corner),
                     -90, 90);
                path.AddLine(t.TabBounds.Right, t.TabBounds.Top + corner,
                     t.TabBounds.Right, t.TabBounds.Bottom - corner);
                path.AddArc(Rectangle.FromLTRB(
                     t.TabBounds.Right, t.TabBounds.Bottom - corner, t.TabBounds.Right + corner, t.TabBounds.Bottom),
                     -180, -90);
                path.AddLine(t.TabBounds.Right + corner, t.TabBounds.Bottom, t.TabContentBounds.Right - corner, t.TabBounds.Bottom);
            }
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Right - corner, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom + corner),
                 -90, 90);
            path.AddLine(t.TabContentBounds.Right, t.TabContentBounds.Top + corner, t.TabContentBounds.Right, t.TabContentBounds.Bottom - corner);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Right - corner, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Right, t.TabContentBounds.Bottom),
                 0, 90);
            path.AddLine(t.TabContentBounds.Right - corner, t.TabContentBounds.Bottom, t.TabContentBounds.Left + corner, t.TabContentBounds.Bottom);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Left, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Left + corner, t.TabContentBounds.Bottom),
                 90, 90);
            path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Left, t.TabBounds.Bottom + corner);
            path.AddArc(Rectangle.FromLTRB(
                 t.TabContentBounds.Left, t.TabBounds.Bottom, t.TabContentBounds.Left + corner, t.TabBounds.Bottom + corner),
                 180, 90);
            path.AddLine(t.TabContentBounds.Left + corner, t.TabContentBounds.Top, t.TabBounds.Left - corner, t.TabBounds.Bottom);
            path.CloseFigure();

            return path;
        }
 /// <summary>
 /// Sets the value of the OwnerTab property
 /// </summary>
 /// <param name="ownerTab">RibbonTab where this item is located</param>
 internal virtual void SetOwnerTab(RibbonTab ownerTab)
 {
     _ownerTab = ownerTab;
 }
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateCompleteTabPath_2013(RibbonTab t)
        {
            GraphicsPath path = new GraphicsPath();

            path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Top, t.TabBounds.Left, t.TabBounds.Bottom);
            if (t.Invisible)
            {
                path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom);
            }
            else
            {
                path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabBounds.Left, t.TabBounds.Top);
                path.AddLine(t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Top);
                path.AddLine(t.TabBounds.Right, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Bottom);
                path.AddLine(t.TabBounds.Right, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom);
            }
            return path;
        }
Esempio n. 21
0
		private void InitHomeTab()
		{
			//Clipboard panel
			RibbonButton btnPaste = new RibbonButton("Paste");
			btnPaste.Image = Resources.paste_32;
			btnPaste.Click += new EventHandler(pasteRibbonButton_Click);

			RibbonButton btnCut = new RibbonButton("Cut");
			btnCut.MaxSizeMode = RibbonElementSizeMode.Medium;
			btnCut.SmallImage = Resources.cut_16;
			btnCut.Click += new EventHandler(cutRibbonButton_Click);

			RibbonButton btnCopy = new RibbonButton("Copy");
			btnCopy.MaxSizeMode = RibbonElementSizeMode.Medium;
			btnCopy.SmallImage = Resources.copy_16;
			btnCopy.Click += new EventHandler(copyRibbonButton_Click);

			RibbonButton btnDelete = new RibbonButton("Delete");
			btnDelete.MaxSizeMode = RibbonElementSizeMode.Medium;
			btnDelete.SmallImage = Resources.delete_16;
			btnDelete.Click += new EventHandler(deleteRibbonButton_Click);

			panelClipboard = new RibbonPanel("Clipboard");
			panelClipboard.Items.Add(btnPaste);
			panelClipboard.Items.Add(btnCut);
			panelClipboard.Items.Add(btnCopy);
			panelClipboard.Items.Add(btnDelete);

			//Arrange
			RibbonButton btnAlignHorizontally = new RibbonButton();
			btnAlignHorizontally.SmallImage = Resources.align_horizontally_16;
			btnAlignHorizontally.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnAlignHorizontally.Click += new EventHandler(alignHorizontallyRibbonButton_Click);

			RibbonButton btnAlignVertically = new RibbonButton();
			btnAlignVertically.SmallImage = Resources.align_vertically_16;
			btnAlignVertically.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnAlignVertically.Click += new EventHandler(alignVerticallyRibbonButton_Click);

			RibbonButton btnSpaceHorizontally = new RibbonButton();
			btnSpaceHorizontally.SmallImage = Resources.space_horizontally_16;
			btnSpaceHorizontally.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnSpaceHorizontally.Click += new EventHandler(spaceHorizontallyRibbonButton_Click);

			RibbonButton btnSpaceVertically = new RibbonButton();
			btnSpaceVertically.SmallImage = Resources.space_vertically_16;
			btnSpaceVertically.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnSpaceVertically.Click += new EventHandler(spaceVerticallyRibbonButton_Click);

			RibbonItemGroup itemgroupAlignment = new RibbonItemGroup();
			itemgroupAlignment.Items.Add(btnAlignHorizontally);
			itemgroupAlignment.Items.Add(btnAlignVertically);
			itemgroupAlignment.Items.Add(btnSpaceHorizontally);
			itemgroupAlignment.Items.Add(btnSpaceVertically);

			RibbonButton btnFlipHorizontally = new RibbonButton();
			btnFlipHorizontally.SmallImage = Resources.flip_horizontally_16;
			btnFlipHorizontally.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnFlipHorizontally.Click += new EventHandler(flipHorizontallyRibbonButton_Click);

			RibbonButton btnFlipVertically = new RibbonButton();
			btnFlipVertically.SmallImage = Resources.flip_vertically_16;
			btnFlipVertically.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnFlipVertically.Click += new EventHandler(flipVerticallyRibbonButton_Click);

			RibbonItemGroup itemgroupTransform = new RibbonItemGroup();
			itemgroupTransform.Items.Add(btnFlipHorizontally);
			itemgroupTransform.Items.Add(btnFlipVertically);

			RibbonButton btnRotateAntiClockwise = new RibbonButton();
			btnRotateAntiClockwise.SmallImage = Resources.rotate_acw_16;
			btnRotateAntiClockwise.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnRotateAntiClockwise.Click += new EventHandler(rotateACwRibbonButton_Click);

			RibbonButton btnRotateClockwise = new RibbonButton();
			btnRotateClockwise.SmallImage = Resources.rotate_cw_16;
			btnRotateClockwise.MaxSizeMode = RibbonElementSizeMode.Compact;
			btnRotateClockwise.Click += new EventHandler(rotateCwRibbonButton_Click);

			RibbonItemGroup itemgroupRotatation = new RibbonItemGroup();
			itemgroupRotatation.Items.Add(btnRotateAntiClockwise);
			itemgroupRotatation.Items.Add(btnRotateClockwise);

			panelAlignment = new RibbonPanel("Alignment");
			panelAlignment.FlowsTo = RibbonPanelFlowDirection.Right;
			panelAlignment.Items.Add(itemgroupAlignment);
			panelAlignment.Items.Add(itemgroupTransform);
			panelAlignment.Items.Add(itemgroupRotatation);

			RibbonButton btnBringForward = new RibbonButton("Bring Forwards");
			btnBringForward.Image = Resources.bring_forward_32;
			btnBringForward.Click += new EventHandler(bringForwardRibbonButton_Click);

			RibbonButton btnSendBackward = new RibbonButton("Send Backwards");
			btnSendBackward.Image = Resources.send_backward_32;
			btnSendBackward.Click += new EventHandler(sendBackwardRibbonButton_Click);

			RibbonButton btnBringToFront = new RibbonButton("Bring to Front");
			btnBringToFront.Image = Resources.bring_to_front_32;
			btnBringToFront.Click += new EventHandler(bringToFrontRibbonButton_Click);

			RibbonButton btnSendToBack = new RibbonButton("Send to Back");
			btnSendToBack.Image = Resources.send_to_back_32;
			btnSendToBack.Click += new EventHandler(sendToBackRibbonButton_Click);

			panelZOrder = new RibbonPanel("Z Order");
			panelZOrder.Items.Add(btnBringForward);
			panelZOrder.Items.Add(btnSendBackward);
			panelZOrder.Items.Add(btnBringToFront);
			panelZOrder.Items.Add(btnSendToBack);

			RibbonButton btnLaunchPeggleNights = new RibbonButton("Nights");
			btnLaunchPeggleNights.Image = Resources.PeggleNights_32;
			btnLaunchPeggleNights.Click += new EventHandler(peggleNightsRibbonButton_Click);

			RibbonPanel panelPeggle = new RibbonPanel("Launch Peggle");
			panelPeggle.Items.Add(btnLaunchPeggleNights);

			RibbonTab tabHome = new RibbonTab(mRibbon, "Home");
			tabHome.Panels.Add(panelClipboard);
			tabHome.Panels.Add(panelAlignment);
			tabHome.Panels.Add(panelZOrder);
			tabHome.Panels.Add(panelPeggle);

			mRibbon.Tabs.Add(tabHome);
		}
        /// <summary>
        /// Creates the path of the tab and its contents
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public GraphicsPath CreateTabPath_2013(RibbonTab t)
        {
            //Michael Spradlin - 05/03/2013 Office 2013 Style Changes
            GraphicsPath path = new GraphicsPath();
            int rightOffset = 1;

            path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabBounds.Left, t.TabBounds.Top);
            path.AddLine(t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Right - rightOffset, t.TabBounds.Top);
            path.AddLine(t.TabBounds.Right - rightOffset, t.TabBounds.Top, t.TabBounds.Right - rightOffset, t.TabBounds.Bottom);

            return path;
        }
Esempio n. 23
0
		private void InitToolTab()
		{
			//Tool panel
			btnSelectTool = new RibbonButton("Select");
			btnSelectTool.Image = Resources.pointer_32;
			btnSelectTool.Click += new EventHandler(selectRibbonButton_Click);

			btnPegTool = new RibbonButton("Peg");
			btnPegTool.Image = Resources.peg_32;
			btnPegTool.Click += new EventHandler(pegRibbonButton_Click);

			btnBrickTool = new RibbonButton("Brick");
			btnBrickTool.Image = Resources.brick_32;
			btnBrickTool.Click += new EventHandler(brickRibbonButton_Click);

			btnCircle = new RibbonButton("Circle");
			btnCircle.Image = Resources.material_32;
			btnCircle.Click += new EventHandler(circleRibbonButton_Click);

			btnPolygon = new RibbonButton("Polygon");
			btnPolygon.Image = Resources.polygon_32;
			btnPolygon.Click += new EventHandler(polygonRibbonButton_Click);

			btnRod = new RibbonButton("Rod");
			btnRod.Image = Resources.rod_32;
			btnRod.Click += new EventHandler(rodRibbonButton_Click);

			btnTeleport = new RibbonButton("Teleport");
			btnTeleport.Image = Resources.teleport_32;
			btnTeleport.Click += new EventHandler(teleportRibbonButton_Click);

			btnEmitter = new RibbonButton("Emitter");
			btnEmitter.Image = Resources.emitter_32;
			btnEmitter.Click += new EventHandler(emitterRibbonButton_Click);

			RibbonButton btnGenerator = new RibbonButton("Generator");
			btnGenerator.Style = RibbonButtonStyle.DropDown;
			btnGenerator.Image = Resources.peg_circle_32;

			btnPegGenerator = new RibbonButton("Peg Generator");
			btnPegGenerator.SmallImage = Resources.peg_16;
			btnPegGenerator.Click += new EventHandler(pegGeneratorRibbonButton_Click);

			btnBrickGenerator = new RibbonButton("Brick Generator");
			btnBrickGenerator.SmallImage = Resources.brick_16;
			btnBrickGenerator.Click += new EventHandler(brickGeneratorRibbonButton_Click);

			btnGenerator.DropDownItems.Add(btnPegGenerator);
			btnGenerator.DropDownItems.Add(btnBrickGenerator);

			panelInsert = new RibbonPanel("Tools");
			panelInsert.Items.Add(btnSelectTool);
			panelInsert.Items.Add(btnPegTool);
			panelInsert.Items.Add(btnBrickTool);
			panelInsert.Items.Add(btnCircle);
			panelInsert.Items.Add(btnPolygon);
			panelInsert.Items.Add(btnRod);
			panelInsert.Items.Add(btnTeleport);
			panelInsert.Items.Add(btnEmitter);
			panelInsert.Items.Add(btnGenerator);

			RibbonPanel panelFunctions = new RibbonPanel("Functions");

			RibbonButton btnApplyFunction = new RibbonButton("Apply");
			btnApplyFunction.Image = Resources.execute_32;
			btnApplyFunction.Click += new EventHandler(applyFunctionRibbonButton_Click);

			btnScript = new RibbonButton("Script");
			btnScript.Image = Resources.script_32;
			btnScript.Click += new EventHandler(scriptRibbonButton_Click);

			panelFunctions.Items.Add(btnApplyFunction);
			panelFunctions.Items.Add(btnScript);

			RibbonButton btnRemove = new RibbonButton("Remove");
			btnRemove.Image = Resources.remove_peg_32;
			btnRemove.Style = RibbonButtonStyle.DropDown;

			RibbonButton btnDuplicatePegs = new RibbonButton("Duplicate Pegs");
			btnDuplicatePegs.Click += new EventHandler(removeDuplicatePegsRibbonButton_Click);

			RibbonButton btnOffscreenPegs = new RibbonButton("Offscreen Pegs");
			btnOffscreenPegs.Click += new EventHandler(removeOffscreenPegsRibbonButton_Click);

			btnRemove.DropDownItems.Add(btnDuplicatePegs);
			btnRemove.DropDownItems.Add(btnOffscreenPegs);

			panelRemove = new RibbonPanel("Remove");
			panelRemove.Items.Add(btnRemove);

			RibbonTab tabTools = new RibbonTab(mRibbon, "Tools");
			tabTools.Panels.Add(panelInsert);
			tabTools.Panels.Add(panelFunctions);
			tabTools.Panels.Add(panelRemove);

			mRibbon.Tabs.Add(tabTools);
		}
Esempio n. 24
0
        internal override void SetOwnerTab(RibbonTab ownerTab)
        {
            base.SetOwnerTab(ownerTab);

            if (_dropDownItems != null) _dropDownItems.SetOwnerTab(ownerTab);
        }
Esempio n. 25
0
		private void InitObjectTab()
		{
			RibbonButton btnSameLocation = new RibbonButton("Relocate");
			btnSameLocation.Image = Resources.properties_32;
			btnSameLocation.Click += new EventHandler(sameLocationRibbonButton_Click);

			RibbonPanel panelProperties = new RibbonPanel("Properties");
			panelProperties.Items.Add(btnSameLocation);

			RibbonButton btnMovementType = new RibbonButton("Type");
			btnMovementType.Image = Resources.peg_move_type_32;
			btnMovementType.Style = RibbonButtonStyle.DropDown;

			for (int i = 0; i <= (int)MovementType.WeirdShape; i++) {
				RibbonButton ritem = new RibbonButton();
				ritem.Text = ((MovementType)i).ToString();
				ritem.Tag = i;
				ritem.Click += new EventHandler(movementTypeRibbonButton_Click);

				btnMovementType.DropDownItems.Add(ritem);
			}

			RibbonButton btnSpreadPhase = new RibbonButton("Phase");
			btnSpreadPhase.Image = Resources.spread_phase_32;
			btnSpreadPhase.Click += new EventHandler(spreadPhaseRibbonButton_Click);

			RibbonButton btnDuplicateAndPhase = new RibbonButton("Duplicate & Phase");
			btnDuplicateAndPhase.Image = Resources.duplicate_and_phase_32;
			btnDuplicateAndPhase.Click += new EventHandler(duplicateAndPhaseRibbonButton_Click);

			RibbonButton btnLinkSubMovements = new RibbonButton("Link Sub-movements");
			btnLinkSubMovements.Image = Resources.link_sub_movements_32;
			btnLinkSubMovements.Click += new EventHandler(linkSubMovementsRibbonButton_Click);

			RibbonPanel panelMovement = new RibbonPanel("Movement");
			panelMovement.Items.Add(btnMovementType);
			panelMovement.Items.Add(btnSpreadPhase);
			panelMovement.Items.Add(btnDuplicateAndPhase);
			panelMovement.Items.Add(btnLinkSubMovements);

			RibbonTab tabObject = new RibbonTab(mRibbon, "Object");
			tabObject.Panels.Add(panelProperties);
			tabObject.Panels.Add(panelMovement);
			mRibbon.Tabs.Add(tabObject);
		}
Esempio n. 26
0
		private void InitViewTab()
		{
			chkBackground = new RibbonCheckBox("Background");
			chkBackground.Checked = true;
			chkBackground.CheckedChanged += new EventHandler(showBackgroundRibbonButton_Click);

			chkInterface = new RibbonCheckBox("Interface");
			chkInterface.Checked = true;
			chkInterface.CheckedChanged += new EventHandler(showInterfaceRibbonButton_Click);

			chkObjects = new RibbonCheckBox("Objects");
			chkObjects.Checked = true;
			chkObjects.CheckedChanged += new EventHandler(showPegsRibbonButton_Click);

			chkCollision = new RibbonCheckBox("Collision");
			chkCollision.CheckedChanged += new EventHandler(showCollisionRibbonButton_Click);

			chkPreview = new RibbonCheckBox("Preview");
			chkPreview.CheckedChanged += new EventHandler(showPreviewRibbonButton_Click);

			RibbonPanel panelShowHide = new RibbonPanel("Show / Hide");
			panelShowHide.Items.Add(chkBackground);
			panelShowHide.Items.Add(chkInterface);
			panelShowHide.Items.Add(chkObjects);
			panelShowHide.Items.Add(chkCollision);
			panelShowHide.Items.Add(chkPreview);

			RibbonButton btnPackExplorer = new RibbonButton("Pack Explorer");
			btnPackExplorer.Image = Resources.pack_explorer_32;
			btnPackExplorer.Click += new EventHandler(packExplorerRibbonButton_Click);

			RibbonButton btnProperties = new RibbonButton("Properties");
			btnProperties.Image = Resources.properties_32;
			btnProperties.Click += new EventHandler(propertiesRibbonButton_Click);

			RibbonButton btnEntryList = new RibbonButton("Entry List");
			btnEntryList.Image = Resources.properties_32;
			btnEntryList.Click += new EventHandler(entryListRibbonButton_Click);

			RibbonPanel panelWindow = new RibbonPanel("Window");
			panelWindow.Items.Add(btnPackExplorer);
			panelWindow.Items.Add(btnProperties);
			panelWindow.Items.Add(btnEntryList);

			RibbonTab tabView = new RibbonTab(mRibbon, "View");
			tabView.Panels.Add(panelShowHide);
			tabView.Panels.Add(panelWindow);
			mRibbon.Tabs.Add(tabView);
		}
Esempio n. 27
0
		private void InitHelpTab()
		{
			RibbonButton btnReadme = new RibbonButton("Readme.txt");
			btnReadme.Image = Resources.readme_32;
			btnReadme.Click += new EventHandler(readmeRibbonButton_Click);

			RibbonButton btnAbout = new RibbonButton("About");
			btnAbout.Image = Resources.orca_32;
			btnAbout.Click += new EventHandler(aboutRibbonButton_Click);

			RibbonPanel panelHelp = new RibbonPanel();
			panelHelp.Items.Add(btnReadme);
			panelHelp.Items.Add(btnAbout);

			RibbonTab tabHelp = new RibbonTab(mRibbon, "Help");
			tabHelp.Panels.Add(panelHelp);
			mRibbon.Tabs.Add(tabHelp);
		}
      internal override void SetOwnerTab(RibbonTab ownerTab)
      {
         base.SetOwnerTab(ownerTab);

         _buttons.SetOwnerTab(ownerTab);
         _dropDownItems.SetOwnerTab(OwnerTab);
      }
        public GraphicsPath CreateCompleteTabPath_2013(RibbonTab t)
        {
            //Michael Spradlin - 05/03/2013 Office 2013 Style Changes
            GraphicsPath path = new GraphicsPath();
            //int corner = 6;

            path.AddLine(t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Top);
            path.AddLine(t.TabBounds.Right, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Bottom);
            path.AddLine(t.TabBounds.Right, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom);
            path.AddLine(t.TabContentBounds.Right, t.TabContentBounds.Top, t.TabContentBounds.Right, t.TabContentBounds.Bottom);
            path.AddLine(t.TabContentBounds.Right, t.TabContentBounds.Bottom, t.TabContentBounds.Left, t.TabContentBounds.Bottom);
            path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Bottom, t.TabContentBounds.Left, t.TabBounds.Bottom);
            path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Top, t.TabBounds.Left, t.TabBounds.Bottom);
            path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom, t.TabBounds.Left, t.TabBounds.Top);

            path.CloseFigure();

            return path;
        }
Esempio n. 30
0
        /// <summary>
        /// Sets the currently selected tab
        /// </summary>
        /// <param name="tab"></param>
        private void SetSelectedTab(RibbonTab tab)
        {
            if (tab == _lastSelectedTab) return;

            if (_lastSelectedTab != null)
            {
                _lastSelectedTab.SetSelected(false);
                RedrawTab(_lastSelectedTab);
            }

            if (tab != null)
            {
                tab.SetSelected(true);
                RedrawTab(tab);
            }

            _lastSelectedTab = tab;
        }
Esempio n. 31
0
        internal override void SetOwnerTab(RibbonTab ownerTab)
        {
            base.SetOwnerTab(ownerTab);

            DropDownItems.SetOwnerTab(OwnerTab);
        }