Beispiel #1
0
        public override void PaintButtonText(ButtonItem button, ItemPaintArgs pa, Color textColor, CompositeImage image)
        {
            Rectangle r = button.DisplayRectangle;
            r.Inflate(-1, -1);
            r.Width--;

            Office2007ButtonItemColorTable colorTable = GetColorTable(button, eButtonContainer.RibbonStrip);
            Color shadowColor = Color.FromArgb(32, Color.Black);
            if (colorTable.Default != null && colorTable.Default.OuterBorder != null && !colorTable.Default.OuterBorder.IsEmpty)
                shadowColor = colorTable.Default.OuterBorder.Start;
            if (pa.GlassEnabled)
            {
                ThemeTextFormat textFormat = ThemeTextFormat.Center | ThemeTextFormat.VCenter | ThemeTextFormat.HidePrefix | ThemeTextFormat.SingleLine;
                Office2007RibbonControlPainter.PaintShadowTextOnGlass(pa.Graphics, button.Text, pa.Font, r, textFormat,textColor, shadowColor , true);
            }
            else
            {
                eTextFormat format = eTextFormat.HorizontalCenter | eTextFormat.VerticalCenter | eTextFormat.HidePrefix;
                // Shadow
                r.Offset(1, 1);
                TextDrawing.DrawString(pa.Graphics, button.Text, pa.Font, shadowColor, r, format);
                r.Offset(-1, -1);
                TextDrawing.DrawString(pa.Graphics, button.Text, pa.Font, textColor, r, format);
            }
        }
Beispiel #2
0
 protected override Rectangle GetTextRectangle(ButtonItem button, ItemPaintArgs pa, eTextFormat stringFormat, CompositeImage image)
 {
     Rectangle r = base.GetTextRectangle(button, pa, stringFormat, image);
     r.Offset(0, 12);
     //r.Height -= 18;
     return r;
 }
 public static ButtonItem GenerateButtonItem(string text, EventHandler e = null)
 {
     ButtonItem button = new ButtonItem();
     button.Text = text;
     if (e != null) button.Activate += e;
     return button;
 }
Beispiel #4
0
 public override void PaintButtonImage(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle imagebounds)
 {
     if (!string.IsNullOrEmpty(button.Text)) return;
     Rectangle r = button.DisplayRectangle;
     r.X = r.X + (r.Width - imagebounds.Width) / 2;
     r.Y = r.Y + (r.Height - imagebounds.Height) / 2;
     r.Width = imagebounds.Width;
     r.Height = imagebounds.Height;
     base.PaintButtonImage(button, pa, image, r);
 }
Beispiel #5
0
        protected override IShapeDescriptor GetButtonShape(ButtonItem button, ItemPaintArgs pa)
        {
            IShapeDescriptor shape = MetroButtonItemPainter.GetButtonShape(button);

            if (pa.ContainerControl is ButtonX)
                shape = ((ButtonX)pa.ContainerControl).GetButtonShape();
            else if (pa.ContainerControl is NavigationBar)
                shape = ((NavigationBar)pa.ContainerControl).ButtonShape;
            return shape;
        }
Beispiel #6
0
        public override void PaintButtonBackground(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
        {
            Office2007ButtonItemColorTable colors = GetColorTable(button, eButtonContainer.RibbonStrip);
            Office2007ButtonItemStateColorTable stateColors = colors.Default;
            if (button.IsMouseDown)
                stateColors = colors.Pressed;
            else if (button.IsMouseOver)
                stateColors = colors.MouseOver;
            Rectangle bounds = button.DisplayRectangle;
            bounds.Width--;
            Graphics g = pa.Graphics;

            using (GraphicsPath borderPath = DisplayHelp.GetRoundedRectanglePath(bounds, 2, 2, 0, 0))
            {
                DisplayHelp.FillPath(g, borderPath, stateColors.Background);

                if (stateColors.BottomBackgroundHighlight != null && !stateColors.BottomBackgroundHighlight.IsEmpty)
                {
                    Rectangle ellipse = new Rectangle(bounds.X - 12, bounds.Y + bounds.Height / 2 - 4, bounds.Width + 24, bounds.Height + 4);
                    using (GraphicsPath path = new GraphicsPath())
                    {
                        path.AddEllipse(ellipse);
                        using (PathGradientBrush brush = new PathGradientBrush(path))
                        {
                            brush.CenterColor = stateColors.BottomBackgroundHighlight.Start;
                            brush.SurroundColors = new Color[] { stateColors.BottomBackgroundHighlight.End };
                            brush.CenterPoint = new PointF(ellipse.X + ellipse.Width / 2, bounds.Bottom - 1);
                            
                            g.FillRectangle(brush, bounds);
                        }
                    }
                }

                if (stateColors.InnerBorder != null && !stateColors.InnerBorder.IsEmpty)
                {
                    Rectangle innerBorder = bounds;
                    innerBorder.Y += 1;
                    innerBorder.Width -= 1;
                    innerBorder.X++;
                    DisplayHelp.DrawGradientRectangle(g, innerBorder, stateColors.InnerBorder, 1);
                    //using (GraphicsPath innerBorderPath = DisplayHelp.GetRoundedRectanglePath(innerBorder, 1, 1, 0, 0))
                    //{
                    //    DisplayHelp.DrawGradientPathBorder(g, innerBorderPath, stateColors.InnerBorder, 1);
                    //}
                    using (Pen pen = new Pen(ColorScheme.GetColor(10, 0xffffff)))
                    {
                        g.DrawLine(pen, innerBorder.X + 1, innerBorder.Y + 1, innerBorder.X + 1, innerBorder.Bottom - 1);
                        g.DrawLine(pen, innerBorder.Right - 2, innerBorder.Y + 1, innerBorder.Right - 2, innerBorder.Bottom - 1);
                    }
                }

                DisplayHelp.DrawGradientPathBorder(g, borderPath, stateColors.OuterBorder, 1);
            }
        }
Beispiel #7
0
        public override void PaintButtonBackground(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
        {
            Office2007ButtonItemColorTable colors = GetColorTable(button, eButtonContainer.RibbonStrip);
            Office2007ButtonItemStateColorTable stateColors = colors.Default;
            if (button.IsMouseDown)
                stateColors = colors.Pressed;
            else if (button.IsMouseOver)
                stateColors = colors.MouseOver;
            Rectangle bounds = button.DisplayRectangle;
            bounds.Width--;
            //bounds.Height--;
            Graphics g = pa.Graphics;

            if (pa.ContainerControl.FindForm() is RibbonForm)
                bounds.Width -= RibbonFormWidthOffset;

            //using (GraphicsPath borderPath = DisplayHelp.GetRoundedRectanglePath(bounds, 0, 2, 2, 0))
            {
                //DisplayHelp.FillPath(g, borderPath, stateColors.Background);
                DisplayHelp.FillRectangle(g, bounds, stateColors.Background);

                if (stateColors.BottomBackgroundHighlight != null && !stateColors.BottomBackgroundHighlight.IsEmpty)
                {
                    Rectangle ellipse = new Rectangle(bounds.X - 12, bounds.Y + bounds.Height / 2 - 4, bounds.Width + 24, bounds.Height + 4);
                    using (GraphicsPath path = new GraphicsPath())
                    {
                        path.AddEllipse(ellipse);
                        using (PathGradientBrush brush = new PathGradientBrush(path))
                        {
                            brush.CenterColor = stateColors.BottomBackgroundHighlight.Start;
                            brush.SurroundColors = new Color[] { stateColors.BottomBackgroundHighlight.End };
                            brush.CenterPoint = new PointF(ellipse.X + ellipse.Width / 2, bounds.Bottom - 1);

                            g.FillRectangle(brush, bounds);
                        }
                    }
                }

                if (stateColors.InnerBorder != null && !stateColors.InnerBorder.IsEmpty)
                {
                    Rectangle innerBorder = bounds;
                    innerBorder.Inflate(-1, -1);
                    using (GraphicsPath innerBorderPath = new GraphicsPath())
                    {
                        innerBorderPath.AddRectangle(innerBorder);
                        DisplayHelp.DrawGradientPath(g, innerBorderPath, innerBorder, stateColors.InnerBorder, 1);
                    }
                }

                if (stateColors.OuterBorder != null && !stateColors.OuterBorder.IsEmpty)
                    DisplayHelp.DrawRectangle(g, stateColors.OuterBorder.Start, bounds); //DisplayHelp.DrawGradientPathBorder(g, borderPath, stateColors.OuterBorder, 1);
            }
        }
Beispiel #8
0
        public override Rectangle GetImageRectangle(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
        {
            Rectangle imageRect = Rectangle.Empty;
            bool isOnMenu = IsOnMenu(button, pa);

            // Calculate image position
            if (image != null)
            {
                imageRect.Width = image.Width + 16;
                imageRect.Height = image.Height + 16;
                imageRect.X = button.DisplayRectangle.X + (button.DisplayRectangle.Width - imageRect.Width) / 2;
                imageRect.Y = button.DisplayRectangle.Y + 3;
            }

            return imageRect;
        }
Beispiel #9
0
        public override void PaintButtonImage(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle imagebounds)
        {
            if (imagebounds.Width <= 0 || imagebounds.Height <= 0) return;

            // Paint image background
            RibbonOverflowButtonItem overflow = button as RibbonOverflowButtonItem;
            if (overflow == null || overflow.RibbonBar==null)
            {
                base.PaintButtonImage(button, pa, image, imagebounds);
                return;
            }
            ElementStyle backStyle = overflow.RibbonBar.GetPaintBackgroundStyle();
            ElementStyle titleStyle = overflow.RibbonBar.TitleStyle;

            int cornerSize = 3;

            if (backStyle.BackColorBlend.Count > 0)
                DisplayHelp.FillRoundedRectangle(pa.Graphics, imagebounds, cornerSize, backStyle.BackColorBlend[0].Color, backStyle.BackColorBlend[backStyle.BackColorBlend.Count-1].Color, overflow.RibbonBar.BackgroundStyle.BackColorGradientAngle);
            else
                DisplayHelp.FillRoundedRectangle(pa.Graphics, imagebounds, cornerSize, backStyle.BackColor, backStyle.BackColor2, backStyle.BackColorGradientAngle);
            if(!button.Expanded)
                DisplayHelp.FillRectangle(pa.Graphics, new Rectangle(imagebounds.X+1, imagebounds.Bottom - 8, imagebounds.Width-2, 7), titleStyle.BackColor, titleStyle.BackColor2, titleStyle.BackColorGradientAngle);
            
            if (!backStyle.BorderColor.IsEmpty)
            {
                using (GraphicsPath path = new GraphicsPath())
                {
                    path.AddLine(imagebounds.X, imagebounds.Bottom - 8, imagebounds.Right, imagebounds.Bottom - 8);
                    ElementStyleDisplay.AddCornerArc(path, imagebounds, cornerSize, eCornerArc.BottomRight);
                    ElementStyleDisplay.AddCornerArc(path, imagebounds, cornerSize, eCornerArc.BottomLeft);
                    path.CloseAllFigures();
                    using (SolidBrush brush = new SolidBrush(Color.FromArgb(192, backStyle.BorderColor)))
                        pa.Graphics.FillPath(brush, path);
                }
            }

            DisplayHelp.DrawRoundGradientRectangle(pa.Graphics, imagebounds, backStyle.BorderColor, backStyle.BorderColor2, backStyle.BorderGradientAngle, 1, cornerSize);

            imagebounds.X += (imagebounds.Width - image.Width) / 2;
            imagebounds.Y += 4;
            imagebounds.Width = image.Width;
            imagebounds.Height = image.Height;

            image.DrawImage(pa.Graphics, imagebounds);
        }
Beispiel #10
0
        public override Office2007ButtonItemColorTable GetColorTable(ButtonItem button, eButtonContainer buttonCont)
        {
            Office2007ColorTable colorTable = this.ColorTable;
            Office2007ButtonItemColorTable buttonColorTable = null;

            if (button.CustomColorName != "")
                buttonColorTable = colorTable.ApplicationButtonColors[button.CustomColorName];

            if (buttonColorTable == null)
                buttonColorTable = colorTable.ApplicationButtonColors[button.GetColorTableName()];

            if (buttonColorTable == null && colorTable.ApplicationButtonColors.Count > 0)
                buttonColorTable = colorTable.ApplicationButtonColors[0];

            if (buttonColorTable == null) // Return fall-back color table
                buttonColorTable = Office2010ColorTable.GetFallBackAppButtonColorTable();

            return buttonColorTable;
        }
Beispiel #11
0
        public override Office2007ButtonItemColorTable GetColorTable(ButtonItem button, eButtonContainer buttonCont)
        {
            Office2007ColorTable colorTable = this.ColorTable;
            Office2007ButtonItemColorTable buttonColorTable = null;

            if (button.CustomColorName != "")
                buttonColorTable = colorTable.ApplicationButtonColors[button.CustomColorName];

            if (buttonColorTable == null)
                buttonColorTable = colorTable.ApplicationButtonColors[button.GetColorTableName()];

            if (buttonColorTable == null && colorTable.ApplicationButtonColors.Count > 0)
                buttonColorTable = colorTable.ApplicationButtonColors[0];

            if (buttonColorTable == null) // Return fall back static table
                buttonColorTable = DevComponents.DotNetBar.Metro.ColorTables.MetroOfficeColorTableInitializer.GetAppFallBackColorTable();

            return buttonColorTable;
        }
Beispiel #12
0
        /// <summary>
        /// Creates new instance of the class and initializes it with the parent RibbonStrip control.
        /// </summary>
        /// <param name="parent">Reference to parent MetroToolbar control</param>
        public MetroToolbarContainer(MetroToolbar parent)
        {
            _MetroToolbar = parent;

            // We contain other controls
            m_IsContainer = true;
            this.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;

            _MainItemsContainer = new ItemContainer();
            _MainItemsContainer.LayoutOrientation = eOrientation.Horizontal;
            _MainItemsContainer.GlobalItem = false;
            _MainItemsContainer.Displayed = true;
            _MainItemsContainer.ItemSpacing = 0;
            _MainItemsContainer.SetSystemContainer(true);
            _MainItemsContainer.ContainerControl = parent;
            _MainItemsContainer.DesignTimeVisible = false;
            _MainItemsContainer.Name = "_MainItemsContainer";
            this.SubItems.Add(_MainItemsContainer);

            _ExpandButton = new ButtonItem();
            _ExpandButton.Click += new EventHandler(ExpandButtonClick);
            _ExpandButton.ImagePaddingHorizontal = 12;
            _ExpandButton.ImagePaddingVertical = 10;
            _ExpandButton.Name = "sysMetroToolbarExpandButton";
            _ExpandButton.SetSystemItem(true);
            _ExpandButton.ContainerControl = parent;
            _ExpandButton.DesignTimeVisible = false;
            UpdateExpandButtonImage();
            this.SubItems.Add(_ExpandButton);

            _ExtraItemsContainer = new ItemContainer();
            _ExtraItemsContainer.LayoutOrientation = eOrientation.Horizontal;
            _ExtraItemsContainer.GlobalItem = false;
            _ExtraItemsContainer.Displayed = true;
            _ExtraItemsContainer.MultiLine = true;
            _ExtraItemsContainer.SetSystemContainer(true);
            _ExtraItemsContainer.ContainerControl = parent;
            _ExtraItemsContainer.DesignTimeVisible = false;
            _ExtraItemsContainer.Name = "_ExtraItemsContainer";
            this.SubItems.Add(_ExtraItemsContainer);
        }
Beispiel #13
0
        /// <summary>
        /// Create a ButtonItem for the sidebar.
        /// </summary>
        /// <param name="panelItem"></param>
        /// <param name="control"></param>
        protected void MakeButton(SideBarPanelItem panelItem, ChoiceBase control)
        {
            UIItemDisplayProperties display = control.GetDisplayProperties();

            display.Text = display.Text.Replace("_", "");
            ButtonItem button = new ButtonItem(control.Id, display.Text);

            button.Tag = control;
            control.ReferenceWidget = button;

            if (panelItem.ItemImageSize == eBarImageSize.Large)
            {
                if (m_largeImages.ImageList.Images.Count > 0)
                {
                    button.ImageIndex = m_largeImages.GetImageIndex(display.ImageLabel);
                }
            }
            else
            {
                if (m_smallImages.ImageList.Images.Count > 0)
                {
                    button.ImageIndex = m_smallImages.GetImageIndex(display.ImageLabel);
                }
            }

            button.Text        = display.Text;
            button.ButtonStyle = eButtonStyle.ImageAndText;

            if (!display.Enabled)
            {
                button.Text = button.Text + " NA";
            }

            button.Click += new EventHandler(OnClick);
            panelItem.SubItems.Add(button);

            //a button in this framework not really a Control... so I don't know how to use
            //(the same company's) balloon tip control on a sidebar button!
            //	m_mediator.SendMessage("RegisterHelpTarget", button.ContainerControl);
        }
Beispiel #14
0
 /// <summary>
 /// 根据命令或工具的Caption查找菜单栏中对应的ButtonItem
 /// </summary>
 /// <param name="cmdOrToolCaption"></param>
 /// <returns></returns>
 private ButtonItem GetButtonItemFromMenus(string cmdOrToolCaption)
 {
     try
     {
         //获取菜单栏中MenuPanel集合
         Control.ControlCollection c1 = this.MainMenu.Controls;
         foreach (Control item1 in c1)
         {
             if (item1 is RibbonPanel)
             {
                 //获取当前MenuPanel中的MenuBar集合
                 Control.ControlCollection c2 = (item1 as RibbonPanel).Controls;
                 foreach (Control item2 in c2)
                 {
                     if (item2 is RibbonBar)
                     {
                         //获取当前MenuBar中的菜单项集合
                         SubItemsCollection c3 = (item2 as RibbonBar).Items;
                         foreach (BaseItem item3 in c3)
                         {
                             if (item3 is ButtonItem)
                             {
                                 ButtonItem btnItem = item3 as ButtonItem;
                                 if (btnItem.Text == cmdOrToolCaption)
                                 {
                                     return(btnItem);
                                 }
                             }
                         }
                     }
                 }
             }
         }
         return(null);
     }
     catch (System.Exception ex)
     {
         return(null);
     }
 }
Beispiel #15
0
        protected void MakePanelToGoWithButton(NavigationPane np, ButtonItem button, ListPropertyChoice choice)
        {
            m_suspendEvents = true;
            NavigationPanePanel p = new DevComponents.DotNetBar.NavigationPanePanel();

            p.Dock       = System.Windows.Forms.DockStyle.Fill;
            p.Location   = new System.Drawing.Point(0, 24);
            p.ParentItem = button;

            p.Style.Alignment = System.Drawing.StringAlignment.Center;
            p.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
            p.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
            p.Style.BackgroundImagePosition    = DevComponents.DotNetBar.eBackgroundImagePosition.Tile;
            p.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
            p.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
            p.Style.ForeColor.ColorSchemePart   = DevComponents.DotNetBar.eColorSchemePart.ItemText;
            p.Style.GradientAngle      = 90;
            p.Style.WordWrap           = true;
            p.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
            p.StyleMouseDown.WordWrap  = true;
            p.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
            p.StyleMouseOver.WordWrap  = true;
            p.TabIndex = 3;

            //			Object maker =m_mediator.PropertyTable.GetValue("PanelMaker");
            //			if (maker == null)
            //			{
            //				p.Text = "You must provide a PanelMaker in the property table to create panels";
            //				p.Name = "navigationPanePanel2";
            //			}
            //			else
            //			{
            AddControlsToPanel(choice, p);
            //			}

            //p.VisibleChanged +=new EventHandler(OnPanelVisibleChanged);
            np.Controls.Add(p);
            p.Layout       += new LayoutEventHandler(OnPanelLayout);
            m_suspendEvents = false;
        }
Beispiel #16
0
        private void buttonItem_Click(object sender, EventArgs e)
        {
            ButtonItem bt = sender as ButtonItem;

            if (bt == null)
            {
                return;
            }
            SystemMenu menu = bt.Tag as SystemMenu;

            if (bt != null)
            {
                IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage(menu.URL);
                if (f == null)
                {
                    return;
                }
                if (menu.IsDialog)
                {
                    f.WindowState   = FormWindowState.Normal;
                    f.Size          = this.Size;
                    f.StartPosition = FormStartPosition.CenterParent;
                    f.ShowDialog();
                }
                else
                {
                    f.MdiParent = this;
                    this.ActivateMdiChild(f);
                    f.Show();
                }
                if (!string.IsNullOrEmpty(menu.ParentURL))
                {
                    IVX.Live.MainForm.UILogics.FormBase f1 = c.GetContentPage(menu.ParentURL);
                    f1.MdiParent = this;
                    this.ActivateMdiChild(f1);
                    f1.Show();
                    f1.UpdateUI();
                }
            }
        }
Beispiel #17
0
        /// <summary>
        /// 左侧的SildeBar点击事件
        /// </summary>
        private void toolStripButton_Click(object sender, EventArgs e)
        {
            ButtonItem button = (sender as ButtonItem);

            tvMain.Nodes.Clear();
            TreeNode treeNode = new TreeNode();

            //treeNode.Text = (button.Tag as DataRow)[BaseModuleEntity.FieldFullName].ToString();
            //treeNode.Tag = button.Tag;

            // 改进为:保存实体类
            BaseModuleEntity baseModuleEntity = (BaseModuleEntity)button.Tag;

            treeNode.Text = baseModuleEntity.FullName;
            treeNode.Tag  = baseModuleEntity;

            treeNode.ImageIndex         = 0;
            treeNode.SelectedImageIndex = 0;
            tvMain.Nodes.Add(treeNode);
            AddSonNode(treeNode);
            // tvMain.ExpandAll();
        }
Beispiel #18
0
        protected override void PaintStateBackground(ButtonItem button, Graphics g, Office2007ButtonItemStateColorTable stateColors, Rectangle r, IShapeDescriptor shape, bool isDefault, bool paintBorder)
        {
            if (stateColors == null || stateColors.Background == null || stateColors.Background.IsEmpty)
                return;

            Rectangle shadowRect = r;
            ShadowPaintInfo spi = new ShadowPaintInfo();
            spi.Graphics = g;
            spi.Rectangle = shadowRect;
            ShadowPainter.Paint3(spi);

            r.Width -= 4;
            r.Height -= 4;
            r.Offset(1, 1);

            DisplayHelp.FillRectangle(g, r, stateColors.Background);
            if (stateColors.BottomBackgroundHighlight != null && !stateColors.BottomBackgroundHighlight.IsEmpty)
            {
                Rectangle ellipse = new Rectangle(r.X, r.Y + r.Height / 2 - 2, r.Width, r.Height + 4);
                GraphicsPath path = new GraphicsPath();
                path.AddEllipse(ellipse);
                PathGradientBrush brush = new PathGradientBrush(path);
                brush.CenterColor = stateColors.BottomBackgroundHighlight.Start;
                brush.SurroundColors = new Color[] { stateColors.BottomBackgroundHighlight.End };
                brush.CenterPoint = new PointF(ellipse.X + ellipse.Width / 2, r.Bottom);
                Blend blend = new Blend();
                blend.Factors = new float[] { 0f, .5f, .6f };
                blend.Positions = new float[] { .0f, .4f, 1f };
                brush.Blend = blend;

                g.FillRectangle(brush, r);
                brush.Dispose();
                path.Dispose();
            }

            DisplayHelp.DrawGradientRectangle(g, r, stateColors.OuterBorder, 1);
            r.Inflate(-1, -1);
            DisplayHelp.DrawGradientRectangle(g, r, stateColors.InnerBorder, 1);
        }
Beispiel #19
0
        public GroupHeaderBandMenu(Designer designer) : base(designer)
        {
            FSelection = Designer.SelectedObjects;

            miKeepTogether = CreateMenuItem(Res.Get("ComponentMenu,DataBand,KeepTogether"), new EventHandler(miKeepTogether_Click));
            miKeepTogether.AutoCheckOnClick = true;
            miResetPageNumber = CreateMenuItem(Res.Get("ComponentMenu,GroupHeaderBand,ResetPageNumber"), new EventHandler(miResetPageNumber_Click));
            miResetPageNumber.AutoCheckOnClick = true;

            int insertPos = Items.IndexOf(miStartNewPage);

            Items.Insert(insertPos, miKeepTogether);
            Items.Insert(insertPos + 1, miResetPageNumber);

            GroupHeaderBand band    = FSelection[0] as GroupHeaderBand;
            bool            enabled = !band.HasRestriction(Restrictions.DontModify);

            miKeepTogether.Enabled    = enabled;
            miResetPageNumber.Enabled = enabled;
            miKeepTogether.Checked    = band.KeepTogether;
            miResetPageNumber.Checked = band.ResetPageNumber;
        }
Beispiel #20
0
        //================载入皮肤===============================

        #region  系统主题皮肤设置

        private void LoadSkinMenu(object sender, System.EventArgs e)
        {
            #region 载入skin菜单和skin设置

            string[] styles = Enum.GetNames(typeof(eStyle));
            foreach (string sname in styles)
            {
                ButtonItem item = new ButtonItem(sname, sname);
                this.MenuSkin.SubItems.Add(item);
                item.Click += new EventHandler(new Action <object, EventArgs>((x, y) =>
                {
                    ButtonItem btn = x as ButtonItem;
                    this.styleManager1.ManagerStyle = (eStyle)Enum.Parse(typeof(eStyle), btn.Name);
                    this.MenuBar.Refresh();
                    XMLHelper.SetInnerText("./config.xml", "MESConfig/skin/style", item.Name);
                }));
            }

            this.LoadSkinCfg();

            #endregion
        }
Beispiel #21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="group"></param>
        /// <param name="location"></param>
        /// <param name="temporaryColleagueParam"></param>
        /// <param name="sequencer"></param>
        public void ShowContextMenu(ChoiceGroup group, Point location,
                                    TemporaryColleagueParameter temporaryColleagueParam,
                                    MessageSequencer sequencer)
        {
            // Store optional parameter values.
            m_temporaryColleagueParam = temporaryColleagueParam; // Nulls are just fine.
            m_sequencer = sequencer;                             // Nulls are just fine.

            ButtonItem b = new ButtonItem();

            b.PopupType = DevComponents.DotNetBar.ePopupType.Menu;
            //ContextMenu menu = new ContextMenu();

            b.Tag = group;
            group.ReferenceWidget = b;
            b.SubItems.Add(new ButtonItem("just to make popup happen"));

            Manager.RegisterPopup(b);
            // This will be populated when this event fires, just to make it parallel to how menubar menus work.
            b.PopupOpen += new DevComponents.DotNetBar.DotNetBarManager.PopupOpenEventHandler(menu_PopupOpen);
            // It's too early to remove the temporary colleague, even in these event handlers,
            // since the Mediator hasn't invoked anything on it yet.
            // b.PopupClose += new EventHandler(OnContextMenuClose);
            // b.PopupFinalized += new EventHandler(b_PopupFinalized);

            // 'b' is not modal, so if we have either a temporaryColleagueParam,
            // or a sequecner, or both, we need to preprocess them, before showing the menu.
            // We also need to do some post-processing with them, after the menu closes.
            // That is done in the OnContextMenuClose handler.
            if (m_temporaryColleagueParam != null)
            {
                m_temporaryColleagueParam.Mediator.AddTemporaryColleague(m_temporaryColleagueParam.TemporaryColleague);
            }
            m_sequencerIsPaused = false;
            //if (m_sequencer != null)
            //	m_sequencerIsPaused = m_sequencer.PauseMessageQueueing();

            b.Popup(location.X, location.Y);
        }
Beispiel #22
0
        private void InitModules()
        {
            List <ButtonItem> btnItems = new List <ButtonItem>();

            foreach (var tabItem in ribbonControl1.Items)
            {
                RibbonTabItem ribbonTabItem = tabItem as RibbonTabItem;
                if (ribbonTabItem == null)
                {
                    continue;
                }
                foreach (RibbonBar ribbonBar in ribbonTabItem.Panel.Controls)
                {
                    foreach (var item in ribbonBar.Items)
                    {
                        ButtonItem btnItem = item as ButtonItem;
                        if (btnItem != null)
                        {
                            btnItems.Add(btnItem);
                        }
                        else
                        {
                            ItemContainer itemContainer = item as ItemContainer;

                            foreach (var subitem in itemContainer.SubItems)
                            {
                                ButtonItem btnItem1 = subitem as ButtonItem;
                                btnItems.Add(btnItem1);
                            }
                        }
                    }
                }
            }

            foreach (var btnitem in btnItems)
            {
                btnitem.Enabled = Singleton.Instance.Modules.Exists(o => o.ModuleName == btnitem.Text);
            }
        }
Beispiel #23
0
        // Note: Init method is handled by superclass.

        /// <summary>
        /// Create a menu, but not its items.
        /// </summary>
        /// <param name="groupCollection">Collection of menu definitions to create.</param>
        public override void CreateUIForChoiceGroupCollection(ChoiceGroupCollection groupCollection)
        {
            //for the automated gui testing
            bool accessibilityMode = GetStringRegistryValue("AccessibilityTestingMode", "false") == "true";

            foreach (ChoiceGroup group in groupCollection)
            {
                Bar        bar   = MyBar;
                string     label = group.Label.Replace("_", "&");
                ButtonItem menu  = new ButtonItem(group.Id, label);
                bar.Items.Add(menu);
                menu.Tag = group;
                group.ReferenceWidget = menu;

                menu.SubItems.Add(new ButtonItem("just to make popup happen"));
                menu.PopupOpen += new DevComponents.DotNetBar.DotNetBarManager.PopupOpenEventHandler(menu_PopupOpen);
                if (!accessibilityMode)
                {
                    menu.PopupClose += new EventHandler(menu_PopupClose);
                }
            }
        }
Beispiel #24
0
        public FormMain()
        {
            InitializeComponent();

            _buttonItemDock               = new ButtonItem();
            _buttonItemDock.Visible       = false;
            _buttonItemDock.ItemAlignment = eItemAlignment.Far;
            _buttonItemDock.Tooltip       = "Dock";
            _buttonItemDock.Click        += OnDockButtonClick;

            _buttonItemUndock               = new ButtonItem();
            _buttonItemUndock.Visible       = false;
            _buttonItemUndock.ItemAlignment = eItemAlignment.Far;
            _buttonItemUndock.Tooltip       = "Undock";
            _buttonItemUndock.Click        += OnUndockButtonClick;

            _buttonItemCollapse               = new ButtonItem();
            _buttonItemCollapse.Visible       = false;
            _buttonItemCollapse.ItemAlignment = eItemAlignment.Far;
            _buttonItemCollapse.Tooltip       = "Mini-Floater";
            _buttonItemCollapse.Click        += OnCollapseClick;
        }
Beispiel #25
0
        /// <summary>
        ///
        /// </summary>
        public TD.SandBar.ButtonItem AddFlipButton()
        {
            if (objectsToolbar == null)
            {
                return(null);
            }

            ButtonItem flipButton = new ButtonItem();

            flipButton.Text       = "Flip";
            flipButton.BeginGroup = true;

            try {
                Stream s = Assembly.GetAssembly(typeof(Sussex.Flip.UI.AboutWindow)).GetManifestResourceStream("fliplogoicon");
                flipButton.Icon = new Icon(s);
            }
            catch (Exception) {}

            flipButton.ToolTipText = "Create and edit scripts";
            objectsToolbar.Items.Add(flipButton);
            return(flipButton);
        }
Beispiel #26
0
 private void _decisionTree_DragEnter(object sender, DragEventArgs e)
 {
     if (e.Data.GetData(typeof(Node)) is Node)
     {
         e.Effect = DragDropEffects.Move;
     }
     else
     {
         ButtonItem item = (ButtonItem)e.Data.GetData(typeof(ButtonItem));
         if (item == null)
         {
             e.Effect = DragDropEffects.None;
         }
         else
         {
             var node = RuleEditorHelper.CreateNode(item, _model);
             e.Data.SetData(typeof(Node), node);
             e.Effect = DragDropEffects.Copy;
             _validator.ClearFailedValidations();
         }
     }
 }
Beispiel #27
0
        /// <summary>
        /// Builds the button.
        /// </summary>
        /// <param name="PlugIn">The plug in.</param>
        private void BuildButton(IAddIn PlugIn)
        {
            ButtonItem PlugInButton = new ButtonItem();

            PlugInButton.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            PlugInButton.ColorTable     = DevComponents.DotNetBar.eButtonColor.Office2007WithBackground;
            if (!string.IsNullOrEmpty(PlugIn.ImageIcon))
            {
                PlugInButton.Image = new Bitmap(new FileStream(PlugIn.ImageIcon, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
            }
            PlugInButton.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.F5);
            PlugInButton.Size   = new System.Drawing.Size(158, 23);
            PlugInButton.Style  = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            PlugInButton.Text   = PlugIn.ButtonName;
            PlugInButton.Tag    = PlugIn;
            PlugInButton.Click += new EventHandler(
                delegate(object sender, EventArgs e)
            {
                dockAddIn.Visible  = true;
                dockAddIn.Selected = true;
                dockAddIn.Control.Controls.Clear();
                if (!string.IsNullOrEmpty(((sender as ButtonItem).Tag as BaseAddIn).ImageIcon))
                {
                    dockAddIn.Image = (sender as ButtonItem).Image;
                }
                dockAddIn.Text = (sender as ButtonItem).Text;
                ((sender as ButtonItem).Tag as BaseAddIn).ASyncSetup = LicenceManager.Instance.LicenceBody;
                dockAddIn.Control.Controls.Add((sender as ButtonItem).Tag as BaseAddIn);
            }
                );
            PlugInButton.MouseHover += new EventHandler(
                delegate(object sender, EventArgs e) {
                PlugInBar.Text = ((sender as ButtonItem).Tag as BaseAddIn).ButtonName;
            }
                );
            PlugInButton.ButtonStyle = eButtonStyle.ImageAndText;
            PlugInButton.Name        = string.Format(@"btn_{0}", PlugIn.ButtonName);
            AppendAddInButton(PlugInButton);
        }
Beispiel #28
0
        void buttonItem_Click(object sender, EventArgs e)
        {
            ButtonItem buttonItem = sender as ButtonItem;

            if (buttonItem.Tag is INavigateModule)
            {
                INavigateModule nv = buttonItem.Tag as INavigateModule;
                EAS.Application.Instance.OpenModule(new Guid(nv.Guid));
            }
            else if (buttonItem.Tag is System.Type)
            {
                System.Type t = buttonItem.Tag as System.Type;
                if (t == typeof(LoginForm))
                {
                    (EAS.Application.Instance as EAS.Windows.Application).Login();
                }
                else if (t == typeof(AboutForm))
                {
                    new AboutForm().ShowDialog(this);
                }
            }
        }
Beispiel #29
0
        private void itemPanel2_ItemDoubleClick(object sender, MouseEventArgs e)
        {
            //若是左建双击缩放至要素:
            if (e.Clicks == 2)
            {
                ButtonItem item = new ButtonItem();
                item = sender as ButtonItem;
                if (item == null)
                {
                    return;
                }
                string FeatureClassName = item.Tooltip.Substring(item.Tooltip.IndexOf('.') + 1);
                string strOID           = item.Tooltip.Substring(0, item.Tooltip.IndexOf('.'));
                int    OID = Convert.ToInt32(strOID);

                IFeature   feature  = DBOperator.getFeatureFrom(OID, FeatureClassName, m_GlobalWorkspace);
                IGeometry5 geometry = feature.Shape as IGeometry5;
                this.m_MapCtrls.CenterAt(geometry.CentroidEx);
                this.m_MapCtrls.ActiveView.Extent = geometry.Envelope;
                ILayer iLayer = null;

                if (FeatureClassName.Contains("CheckItemPtn"))
                {
                    iLayer = m_MapCtrls.Map.Layer[1];
                }
                else if (FeatureClassName.Contains("CheckItemPtn"))
                {
                    iLayer = m_MapCtrls.Map.Layer[2];
                }
                else
                {
                    iLayer = m_MapCtrls.Map.Layer[3];
                }

                clearFeatureSelection();

                m_MapCtrls.Map.SelectFeature(iLayer, feature);
            }
        }
Beispiel #30
0
        public void method_6()
        {
            List <GClass6.GClass10> .Enumerator enumerator;

            if (InvokeRequired)
            {
                base.Invoke(new Login.GDelegate2(method_6));
                return;
            }
            ButtonItem buttonItem        = null;
            List <GClass6.GClass10> list = GClass6.list_0;

            try
            {
                enumerator = list.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    GClass6.GClass10 gclass10 = enumerator.get_Current();
                    if (gclass10.method_2().Visible)
                    {
                        gclass10.method_2().Visible = false;
                    }
                    else
                    {
                        if (Operators.CompareString(gclass10.method_2().Name, "buttonGrinder", false) == 0)
                        {
                            buttonItem = gclass10.method_2();
                        }
                        gclass10.method_2().Visible = true;
                        gclass10.method_0().RecalcLayout();
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
            buttonItem.RaiseClick();
        }
Beispiel #31
0
        /// <summary>
        /// Create a ButtonItem for the sidebar.
        /// </summary>
        /// <param name="panelItem"></param>
        /// <param name="control"></param>
        protected void MakeAreaButton(ListPropertyChoice choice)
        {
            UIItemDisplayProperties display = choice.GetDisplayProperties();

            display.Text = display.Text.Replace("_", "");
            ButtonItem button = new ButtonItem(choice.Id, display.Text);

            button.Tag             = choice;
            choice.ReferenceWidget = button;

            button.ImageIndex = m_largeImages.GetImageIndex(display.ImageLabel);

            button.Text = display.Text;
            button.Name = choice.Value;

            button.ButtonStyle = eButtonStyle.ImageAndText;

            if (!display.Enabled)
            {
                button.Text = button.Text + " NA";
            }

            button.Click += new EventHandler(OnClickAreaButton);

            button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
            //button.Image = ((System.Drawing.Image)(resources.GetObject("buttonItem2.Image")));
            //	button.Name = "buttonItem2";
            button.OptionGroup = "navBar";
            button.Style       = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;

            button.Checked = display.Checked;

            MakePanelToGoWithButton(NavPane, button, choice);

            NavPane.Items.Add(button);
            //a button in this framework not really a Control... so I don't know how to use
            //(the same company's) balloon tip control on a sidebar button!
            //	m_mediator.SendMessage("RegisterHelpTarget", button.ContainerControl);
        }
Beispiel #32
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     ButtonItem[] contextMenu = null;
     if (e.Button == MouseButtons.Right)
     {
         try
         {
             contextMenu = (ButtonItem[])(AddInTreeSingleton.AddInTree.GetTreeNode(contextMenuPath).BuildChildItems(this)).ToArray(typeof(ButtonItem));
         }
         catch
         {
             return;
         }
         ButtonItem item = new ButtonItem();
         item.SubItems.AddRange(contextMenu);
         dotNetBarManager1.RegisterPopup(item);
         Control ctrl = this as Control;
         Point   p    = this.PointToScreen(new Point(e.X, e.Y));
         item.PopupMenu(p);
     }
 }
Beispiel #33
0
 public void LoadBookmarksAsButton()
 {
     try
     {
         BookmarksNamesList.Clear(); //清空之前保存的
         BookmarksNamesList = getBookmarksNames(pSceneBookmarks);
         if (BookmarksNamesList.Count == 0)
         {
             return;
         }
         foreach (string name in BookmarksNamesList)
         {
             if (btnItem.SubItems.Contains(name)) //如果已经包含了这个按钮
             {
                 continue;                        //继续下一次循环
             }
             ButtonItem bi = AddSubItemScene(name);
             btnItem.SubItems.Add(bi);
         }
     }
     catch { }
 }
Beispiel #34
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="tabProps"></param>
        /// <param name="infoBarButton"></param>
        /// ------------------------------------------------------------------------------------
        public void AddTab(SBTabProperties tabProps)
        {
            if (tabProps == null)
            {
                return;
            }

            SideBarTab tab = new SideBarTab(this, m_mediator, tabProps);

            tab.ItemImageListSmall        = ItemImageListSmall;
            tab.ItemImageListLarge        = ItemImageListLarge;
            tab.InfoBarButton.MouseEnter += new EventHandler(InfoBarButton_MouseEnter);
            m_dnbMngr.ContextMenus.Add(tab.Menu);
            m_infoBar.Controls.Add(tab.InfoBarButton);
            PositionInfoBarButtons();

            // Add the new tab's configure menu item to the side bar's context menu.
            ButtonItem tabCfgMenuItem = (ButtonItem)tab.ConfigureMenuItem.Copy();

            tabCfgMenuItem.Visible = true;
            m_contextMenu.SubItems.Add(tabCfgMenuItem);
        }
        private void RefreshItemPanel(string id)
        {
            JHAssessmentSetupRecord record = JHAssessmentSetup.SelectByID(id);
            ButtonItem updateItem          = null;

            foreach (ButtonItem item in ipList.Items)
            {
                JHAssessmentSetupRecord r = item.Tag as JHAssessmentSetupRecord;
                if (r.ID == id)
                {
                    updateItem = item;
                    break;
                }
            }

            if (record != null && updateItem == null) //Insert
            {
                AddToList(record);
                ipList.Refresh();
                ipList.EnsureVisible(ipList.Items[ipList.Items.Count - 1]);
            }
            else if (record != null && updateItem != null) //Update
            {
                updateItem.Tag  = record;
                updateItem.Text = record.Name;
                SelectAssessmentSetup(updateItem);
            }
            else if (record == null && updateItem != null) //Delete
            {
                updateItem.Click       -= new EventHandler(AssessmentSetup_Click);
                updateItem.DoubleClick -= new EventHandler(AssessmentSetup_DoubleClick);
                ipList.Items.Remove(updateItem);
                ipList.Refresh();
                SelectAssessmentSetup(null);
                CurrentItem = null;
                Listener.Reset();
            }
        }
Beispiel #36
0
        public void Init()
        {
            E_VDA_TASK_STATUS    totalstatus     = 0;
            E_VIDEO_ANALYZE_TYPE totalalaysetype = 0;

            foreach (var s in m_viewModel.CurrentTask.StatusList)
            {
                totalstatus     = s.Status;
                totalalaysetype = s.AlgthmType;
            }
            textBoxAnlyse.Text     = DataModel.Constant.VideoAnalyzeTypeInfo.Single(item => item.Type == totalalaysetype).Name;
            textBoxFilePath.Text   = m_viewModel.CurrentTask.OriFilePath;
            textBoxTaskId.Text     = m_viewModel.CurrentTask.TaskId.ToString();
            textBoxTaskName.Text   = m_viewModel.CurrentTask.TaskName;
            textBoxTaskStatus.Text = DataModel.Constant.TaskStatusInfos.Single(item => item.Status == totalstatus).Name;
            int    index   = m_viewModel.CurrentTask.TaskName.LastIndexOf('_');
            string camName = (index < 0) ? m_viewModel.CurrentTask.TaskName : m_viewModel.CurrentTask.TaskName.Substring(index + 1);

            textBoxCameraID.Text           = camName;
            textBoxTaskType.Text           = DataModel.Constant.TaskTypeInfos.Single(item => item.Status == m_viewModel.CurrentTask.TaskType).Name;
            comboBoxPriority.SelectedIndex = (int)(m_viewModel.CurrentTask.Priority - 1);
            TitleText = string.Format("[{0}] {1}", m_viewModel.CurrentTask.TaskId, m_viewModel.CurrentTask.TaskName);
            isInited  = true;
            foreach (var item in m_viewModel.CurrentTask.StatusList)
            {
                if (item.AlgthmType == E_VIDEO_ANALYZE_TYPE.E_ANALYZE_NOUSE)
                {
                    continue;
                }
                DevComponents.DotNetBar.ButtonItem buttonItem = new ButtonItem();
                buttonItem.GlobalItem = false;
                buttonItem.Text       = "设置分析参数并重新分析...";
                buttonItem.Click     += new System.EventHandler(this.buttonItem1_Click);
                buttonItem.Tag        = item;
                buttonReAnalyse.SubItems.Add(buttonItem); buttonReAnalyse.SplitButton = true;
            }
            buttonReAnalyse.Refresh();
        }
Beispiel #37
0
        /// <summary>
        /// 设置操作按钮可显示
        /// </summary>
        public void SetToolButtonVisible()
        {
            ButtonItem p_Query        = ToolBarItemGet(-1, ToolButtonName.btnQuery.ToString());
            ButtonItem p_Insert       = ToolBarItemGet(-1, ToolButtonName.btnInsert.ToString());
            ButtonItem p_Update       = ToolBarItemGet(-1, ToolButtonName.btnUpdate.ToString());
            ButtonItem p_Delete       = ToolBarItemGet(-1, ToolButtonName.btnDelete.ToString());
            ButtonItem p_InsertExis   = ToolBarItemGet(-1, ToolButtonName.btnInsertExist.ToString());
            ButtonItem p_Browse       = ToolBarItemGet(-1, ToolButtonName.btnBrowse.ToString());
            ButtonItem p_QueryAdvance = ToolBarItemGet(-1, ToolButtonName.btnQueryAdvance.ToString());
            ButtonItem p_ToExcel      = ToolBarItemGet(-1, ToolButtonName.btnToExcel.ToString());

            ButtonItem   p_Preview   = ToolBarItemGet(-1, ToolButtonName.btnPreview.ToString());
            ButtonItem   p_Print     = ToolBarItemGet(-1, ToolButtonName.btnPrint.ToString());
            ButtonItem   p_Design    = ToolBarItemGet(-1, ToolButtonName.btnDesign.ToString());
            ComboBoxItem p_PrintFile = ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString());

            p_Query.Visible        = _btnQueryVisible;
            p_QueryAdvance.Visible = _btnQueryAdvanceVisible;

            p_Insert.Visible     = _btnInsertVisible;
            p_Delete.Visible     = _btnDeleteVisible;
            p_Update.Visible     = _btnUpdateVisible;
            p_InsertExis.Visible = _btnInsertExistVisible;
            p_ToExcel.Visible    = _btnToExcelVisible;



            p_Browse.Visible = _btnBrowseVisible;


            p_Preview.Visible   = _btnPrintVisible;
            p_Print.Visible     = _btnPrintVisible;
            p_Design.Visible    = _btnPrintVisible;
            p_PrintFile.Visible = _btnPrintVisible;


            BaseToolBar.Refresh();
        }
        /// <summary>
        /// Initializes a new instance of the <b>ReportComponentMenuBase</b>
        /// class with default settings.
        /// </summary>
        /// <param name="designer">The reference to a report designer.</param>
        public ReportComponentBaseMenu(Designer designer) : base(designer)
        {
            miCanGrow = CreateMenuItem(Res.Get("ComponentMenu,ReportComponent,CanGrow"), new EventHandler(miCanGrow_Click));
            miCanGrow.AutoCheckOnClick = true;
            miCanGrow.BeginGroup       = true;
            miCanShrink = CreateMenuItem(Res.Get("ComponentMenu,ReportComponent,CanShrink"), new EventHandler(miCanShrink_Click));
            miCanShrink.AutoCheckOnClick = true;
            miGrowToBottom = CreateMenuItem(Res.Get("ComponentMenu,ReportComponent,GrowToBottom"), new EventHandler(miGrowToBottom_Click));
            miGrowToBottom.AutoCheckOnClick = true;
            miHyperlink = CreateMenuItem(Res.GetImage(167), Res.Get("ComponentMenu,ReportComponent,Hyperlink"), new EventHandler(miHyperlink_Click));

            int insertPos = Items.IndexOf(miEdit) + 1;

            Items.Insert(insertPos, miHyperlink);
            insertPos = Items.IndexOf(miCut);
            Items.Insert(insertPos, miCanGrow);
            Items.Insert(insertPos + 1, miCanShrink);
            Items.Insert(insertPos + 2, miGrowToBottom);

            if (!miEdit.Visible)
            {
                miHyperlink.BeginGroup = true;
            }

            bool enabled = Designer.SelectedReportComponents.Enabled;

            miCanGrow.Enabled      = enabled;
            miCanShrink.Enabled    = enabled;
            miGrowToBottom.Enabled = enabled;

            if (enabled)
            {
                ReportComponentBase first = Designer.SelectedReportComponents.First;
                miCanGrow.Checked      = first.CanGrow;
                miCanShrink.Checked    = first.CanShrink;
                miGrowToBottom.Checked = first.GrowToBottom;
            }
        }
Beispiel #39
0
        private void miWindow_PopupOpen(object sender, PopupOpenEventArgs e)
        {
            // delete list of windows
            while (miWindow.SubItems[0] != miWindowCloseAll)
            {
                miWindow.SubItems[0].Dispose();
                miWindow.SubItems.RemoveAt(0);
            }

            // create list of windows
            int i = 0;

            foreach (DocumentWindow c in Designer.Documents)
            {
                ButtonItem menuItem = new ButtonItem();
                menuItem.Text    = (i + 1).ToString() + " " + c.Text;
                menuItem.Tag     = c;
                menuItem.Checked = c == Designer.ActiveReportTab;
                menuItem.Click  += window_Click;
                miWindow.SubItems.Insert(i, menuItem);
                i++;
            }
        }
Beispiel #40
0
        /// <summary>
        /// 初始化状态栏等控件信息
        /// </summary>
        private void InitialWindowsInfo()
        {
            //初始化主题菜单选项
            foreach (string name in Enum.GetNames(typeof(eStyle)))
            {
                if (name != "Metro")
                {
                    ButtonItem button = new ButtonItem(name, name);
                    button.Click += new EventHandler(theme_Changed);
                    this.theme.SubItems.Add(button);
                }
            }
            ColorPickerDropDown colorPickerCustomScheme = new ColorPickerDropDown("colorPickerCustomScheme", "自定义");

            this.theme.SubItems.Add(colorPickerCustomScheme);
            colorPickerCustomScheme.ColorPreview         += new ColorPreviewEventHandler(colorPickerCustomScheme_ColorPreview);
            colorPickerCustomScheme.SelectedColorChanged += new EventHandler(colorPickerCustomScheme_SelectedColorChanged);

            //初始化登录信息
            this.loginUser.Text   = "登录用户:" + LoginForm.user.UsersName;
            this.loginServer.Text = "服务器地址:" + LoginForm.user.LoginServer;
            this.loginDate.Text   = "服务器日期:" + DateTime.ParseExact(LoginForm.user.LoginDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture).ToString("yyyy年MM月dd日");
        }
Beispiel #41
0
        private void btnItemSearch_Click(object sender, EventArgs e)
        {
            ButtonItem buttonItem = sender as ButtonItem;

            if (buttonItem != null)
            {
                buttonItem.Focus();
            }

            try
            {
                if (string.IsNullOrEmpty(tbItemStart.Text) || string.IsNullOrEmpty(tbItemEnd.Text))
                {
                    throw new Exception("任务查询失败:请选择起止日期!");
                }

                pagerControlTask.Bind();
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #42
0
        public IEnumerable <ElementsGroup> GetSettings()
        {
            var items = new List <Element>();

            var openSettingsButton = new ButtonItem("openSettings", "Open Configurator");

            items.Add(openSettingsButton);

            var pathToProcessExe = new TextItem("pathToProcessExe", "Post Process Program Path")
            {
                Value           = PostProcessProgramPath,
                InformativeText = "Copy and paste this path into process recipes so that it runs once Capture One has finished processing the image."
            };

            items.Add(pathToProcessExe);

            var settings = new ElementsGroup("settings", "", items.ToArray());

            return(new[]
            {
                settings,
            });
        }
        void item_Click(object sender, EventArgs e)
        {
            if (_SelectItem != null)
            {
                _SelectItem.Checked = false;
            }
            btn_update.Enabled           = false;
            btn_delete.Enabled           = false;
            scoreCalcRuleEditor1.Visible = (sender != null);
            if (sender != null)
            {
                ButtonItem        item = (ButtonItem)sender;
                ScoreCalcRuleInfo info = (ScoreCalcRuleInfo)item.Tag;
                _SelectItem  = item;
                item.Checked = true;

                this.scoreCalcRuleEditor1.SetSource(info.ScoreCalcRuleElement);
                this.scoreCalcRuleEditor1.ScoreCalcRuleName = info.Name;
                btn_update.Enabled           = true;
                btn_delete.Enabled           = true;
                scoreCalcRuleEditor1.Visible = true;
            }
        }
Beispiel #44
0
 private void InitializeComponent()
 {
     this.components = new Container();
     this.codeMapViewerDock1 = new CodeMapViewerDock();
     this.sandDockManager1 = new SandDockManager();
     this.statusStrip1 = new StatusStrip();
     this.toolStripStatusLabel1 = new ToolStripStatusLabel();
     this.lineStatusLabel = new ToolStripStatusLabel();
     this.columnStatusLabel = new ToolStripStatusLabel();
     this.sandBarManager1 = new SandBarManager(this.components);
     this.leftSandBarDock = new ToolBarContainer();
     this.rightSandBarDock = new ToolBarContainer();
     this.bottomSandBarDock = new ToolBarContainer();
     this.topSandBarDock = new ToolBarContainer();
     this.menuBar1 = new MenuBar();
     this.menuBarItem1 = new MenuBarItem();
     this.newFileMenuItem = new MenuButtonItem();
     this.openScriptMenuItem = new MenuButtonItem();
     this.saveScriptMenuItem = new MenuButtonItem();
     this.exitMenuItem = new MenuButtonItem();
     this.menuBarItem2 = new MenuBarItem();
     this.undoMenuItem = new MenuButtonItem();
     this.redoMenuItem = new MenuButtonItem();
     this.cutMenuItem = new MenuButtonItem();
     this.copyMenuItem = new MenuButtonItem();
     this.pasteMenuItem = new MenuButtonItem();
     this.menuBarItem3 = new MenuBarItem();
     this.mapViewerMenuItem = new MenuButtonItem();
     this.menuBarItem4 = new MenuBarItem();
     this.runMenuItem = new MenuButtonItem();
     this.menuBarItem5 = new MenuBarItem();
     this.toolBar1 = new TD.SandBar.ToolBar();
     this.buttonItem1 = new ButtonItem();
     this.buttonItem3 = new ButtonItem();
     this.buttonItem2 = new ButtonItem();
     this.buttonItem4 = new ButtonItem();
     this.buttonItem5 = new ButtonItem();
     this.buttonItem6 = new ButtonItem();
     this.buttonItem8 = new ButtonItem();
     this.buttonItem9 = new ButtonItem();
     this.buttonItem7 = new ButtonItem();
     this.openFileDialog = new OpenFileDialog();
     this.contextMenuStrip1 = new ContextMenuStrip(this.components);
     this.cutToolStripMenuItem = new ToolStripMenuItem();
     this.copyToolStripMenuItem = new ToolStripMenuItem();
     this.pasteToolStripMenuItem = new ToolStripMenuItem();
     this.toolStripSeparator1 = new ToolStripSeparator();
     this.insertFunctionToolStripMenuItem = new ToolStripMenuItem();
     this.insertTextureEntryIDToolStripMenuItem = new ToolStripMenuItem();
     this.insertCollectionEntryIDToolStripMenuItem = new ToolStripMenuItem();
     DockContainer dockContainer = new DockContainer();
     dockContainer.SuspendLayout();
     this.statusStrip1.SuspendLayout();
     this.topSandBarDock.SuspendLayout();
     this.contextMenuStrip1.SuspendLayout();
     base.SuspendLayout();
     dockContainer.Controls.Add(this.codeMapViewerDock1);
     dockContainer.Dock = DockStyle.Right;
     dockContainer.LayoutSystem = new SplitLayoutSystem(250, 312, Orientation.Horizontal, new LayoutSystemBase[]
     {
         new ControlLayoutSystem(250, 312, new DockControl[]
         {
             this.codeMapViewerDock1
         }, this.codeMapViewerDock1)
     });
     dockContainer.Location = new Point(274, 49);
     dockContainer.Manager = this.sandDockManager1;
     dockContainer.Name = "dockContainer1";
     dockContainer.Size = new Size(254, 312);
     dockContainer.TabIndex = 6;
     this.codeMapViewerDock1.Guid = new Guid("40b77176-f5ac-44ce-a28c-d2f296197e1d");
     this.codeMapViewerDock1.Image = null;
     this.codeMapViewerDock1.Location = new Point(4, 18);
     this.codeMapViewerDock1.Name = "codeMapViewerDock1";
     this.codeMapViewerDock1.Size = new Size(250, 270);
     this.codeMapViewerDock1.TabIndex = 0;
     this.codeMapViewerDock1.Text = "Map Viewer";
     this.sandDockManager1.DockSystemContainer = this;
     this.sandDockManager1.OwnerForm = this;
     this.sandDockManager1.ActiveTabbedDocumentChanged += new EventHandler(this.sandDockManager1_ActiveTabbedDocumentChanged);
     this.statusStrip1.Items.AddRange(new ToolStripItem[]
     {
         this.toolStripStatusLabel1,
         this.lineStatusLabel,
         this.columnStatusLabel
     });
     this.statusStrip1.Location = new Point(0, 361);
     this.statusStrip1.Name = "statusStrip1";
     this.statusStrip1.Size = new Size(528, 22);
     this.statusStrip1.TabIndex = 1;
     this.statusStrip1.Text = "statusStrip1";
     this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
     this.toolStripStatusLabel1.Size = new Size(447, 17);
     this.toolStripStatusLabel1.Spring = true;
     this.lineStatusLabel.Name = "lineStatusLabel";
     this.lineStatusLabel.Size = new Size(35, 17);
     this.lineStatusLabel.Text = "Line 0";
     this.columnStatusLabel.Name = "columnStatusLabel";
     this.columnStatusLabel.Size = new Size(31, 17);
     this.columnStatusLabel.Text = "Col 0";
     this.sandBarManager1.OwnerForm = this;
     this.leftSandBarDock.Dock = DockStyle.Left;
     this.leftSandBarDock.Guid = new Guid("f51f9d3c-d12d-4b04-b3c1-dba150a785e6");
     this.leftSandBarDock.Location = new Point(0, 49);
     this.leftSandBarDock.Manager = this.sandBarManager1;
     this.leftSandBarDock.Name = "leftSandBarDock";
     this.leftSandBarDock.Size = new Size(0, 334);
     this.leftSandBarDock.TabIndex = 2;
     this.rightSandBarDock.Dock = DockStyle.Right;
     this.rightSandBarDock.Guid = new Guid("c3e7b6e1-de74-4788-aa84-badf07d4feb3");
     this.rightSandBarDock.Location = new Point(528, 49);
     this.rightSandBarDock.Manager = this.sandBarManager1;
     this.rightSandBarDock.Name = "rightSandBarDock";
     this.rightSandBarDock.Size = new Size(0, 334);
     this.rightSandBarDock.TabIndex = 3;
     this.bottomSandBarDock.Dock = DockStyle.Bottom;
     this.bottomSandBarDock.Guid = new Guid("214365d9-c066-4c57-b2e9-f4e9b8b58fd5");
     this.bottomSandBarDock.Location = new Point(0, 383);
     this.bottomSandBarDock.Manager = this.sandBarManager1;
     this.bottomSandBarDock.Name = "bottomSandBarDock";
     this.bottomSandBarDock.Size = new Size(528, 0);
     this.bottomSandBarDock.TabIndex = 4;
     this.topSandBarDock.Controls.Add(this.menuBar1);
     this.topSandBarDock.Controls.Add(this.toolBar1);
     this.topSandBarDock.Dock = DockStyle.Top;
     this.topSandBarDock.Guid = new Guid("31bfec4a-f321-4810-8e02-c4eccad1d7f9");
     this.topSandBarDock.Location = new Point(0, 0);
     this.topSandBarDock.Manager = this.sandBarManager1;
     this.topSandBarDock.Name = "topSandBarDock";
     this.topSandBarDock.Size = new Size(528, 49);
     this.topSandBarDock.TabIndex = 5;
     this.menuBar1.Guid = new Guid("0188290c-f307-4042-a99f-b3a2a1517a38");
     this.menuBar1.Items.AddRange(new ToolbarItemBase[]
     {
         this.menuBarItem1,
         this.menuBarItem2,
         this.menuBarItem3,
         this.menuBarItem4,
         this.menuBarItem5
     });
     this.menuBar1.Location = new Point(2, 0);
     this.menuBar1.Name = "menuBar1";
     this.menuBar1.OwnerForm = this;
     this.menuBar1.Size = new Size(526, 23);
     this.menuBar1.TabIndex = 0;
     this.menuBar1.Text = "menuBar1";
     this.menuBarItem1.Items.AddRange(new ToolbarItemBase[]
     {
         this.newFileMenuItem,
         this.openScriptMenuItem,
         this.saveScriptMenuItem,
         this.exitMenuItem
     });
     this.menuBarItem1.Text = "&File";
     this.newFileMenuItem.Image = Resources.newMap;
     this.newFileMenuItem.Shortcut = Shortcut.CtrlN;
     this.newFileMenuItem.Text = "New script";
     this.newFileMenuItem.Activate += new EventHandler(this.newFileMenuItem_Activate);
     this.openScriptMenuItem.Image = Resources.openMap;
     this.openScriptMenuItem.Shortcut = Shortcut.CtrlO;
     this.openScriptMenuItem.Text = "Open script";
     this.openScriptMenuItem.Activate += new EventHandler(this.openScriptMenuItem_Activate);
     this.saveScriptMenuItem.BeginGroup = true;
     this.saveScriptMenuItem.Image = Resources.save;
     this.saveScriptMenuItem.Shortcut = Shortcut.CtrlS;
     this.saveScriptMenuItem.Text = "Save script";
     this.saveScriptMenuItem.Activate += new EventHandler(this.saveScriptMenuItem_Activate);
     this.exitMenuItem.Text = "Exit";
     this.menuBarItem2.Items.AddRange(new ToolbarItemBase[]
     {
         this.undoMenuItem,
         this.redoMenuItem,
         this.cutMenuItem,
         this.copyMenuItem,
         this.pasteMenuItem
     });
     this.menuBarItem2.Text = "&Edit";
     this.undoMenuItem.Image = Resources.undo;
     this.undoMenuItem.Shortcut = Shortcut.CtrlZ;
     this.undoMenuItem.Text = "&Undo";
     this.undoMenuItem.Activate += new EventHandler(this.undoMenuItem_Activate);
     this.redoMenuItem.Image = Resources.redo;
     this.redoMenuItem.Shortcut = Shortcut.CtrlShiftZ;
     this.redoMenuItem.Text = "&Redo";
     this.cutMenuItem.BeginGroup = true;
     this.cutMenuItem.Image = Resources.cut;
     this.cutMenuItem.Shortcut = Shortcut.CtrlX;
     this.cutMenuItem.Text = "C&ut";
     this.cutMenuItem.Activate += new EventHandler(this.cutMenuItem_Activate);
     this.copyMenuItem.Image = Resources.copy;
     this.copyMenuItem.Shortcut = Shortcut.CtrlC;
     this.copyMenuItem.Text = "&Copy";
     this.copyMenuItem.Activate += new EventHandler(this.copyMenuItem_Activate);
     this.pasteMenuItem.Image = Resources.paste;
     this.pasteMenuItem.Shortcut = Shortcut.CtrlV;
     this.pasteMenuItem.Text = "&Paste";
     this.pasteMenuItem.Activate += new EventHandler(this.pasteMenuItem_Activate);
     this.menuBarItem3.Items.AddRange(new ToolbarItemBase[]
     {
         this.mapViewerMenuItem
     });
     this.menuBarItem3.Text = "&View";
     this.mapViewerMenuItem.Text = "Map Viewer";
     this.mapViewerMenuItem.Activate += new EventHandler(this.mapViewerMenuItem_Activate);
     this.menuBarItem4.Items.AddRange(new ToolbarItemBase[]
     {
         this.runMenuItem
     });
     this.menuBarItem4.MdiWindowList = true;
     this.menuBarItem4.Text = "&Script";
     this.runMenuItem.Image = Resources.PlayHS;
     this.runMenuItem.Shortcut = Shortcut.F5;
     this.runMenuItem.Text = "&Run";
     this.runMenuItem.Activate += new EventHandler(this.runMenuItem_Activate);
     this.menuBarItem5.Text = "&Help";
     this.toolBar1.DockLine = 1;
     this.toolBar1.Guid = new Guid("46756475-373b-4e41-8b89-f8ab1b41c370");
     this.toolBar1.Items.AddRange(new ToolbarItemBase[]
     {
         this.buttonItem1,
         this.buttonItem3,
         this.buttonItem2,
         this.buttonItem4,
         this.buttonItem5,
         this.buttonItem6,
         this.buttonItem8,
         this.buttonItem9,
         this.buttonItem7
     });
     this.toolBar1.Location = new Point(2, 23);
     this.toolBar1.Name = "toolBar1";
     this.toolBar1.Size = new Size(252, 26);
     this.toolBar1.TabIndex = 1;
     this.toolBar1.Text = "toolBar1";
     this.buttonItem1.BuddyMenu = this.newFileMenuItem;
     this.buttonItem1.Image = Resources.newMap;
     this.buttonItem3.BuddyMenu = this.openScriptMenuItem;
     this.buttonItem3.Image = Resources.openMap;
     this.buttonItem2.BuddyMenu = this.saveScriptMenuItem;
     this.buttonItem2.Image = Resources.save;
     this.buttonItem4.BeginGroup = true;
     this.buttonItem4.BuddyMenu = this.cutMenuItem;
     this.buttonItem4.Image = Resources.cut;
     this.buttonItem5.BuddyMenu = this.copyMenuItem;
     this.buttonItem5.Image = Resources.copy;
     this.buttonItem6.BuddyMenu = this.pasteMenuItem;
     this.buttonItem6.Image = Resources.paste;
     this.buttonItem8.BeginGroup = true;
     this.buttonItem8.BuddyMenu = this.undoMenuItem;
     this.buttonItem8.Image = Resources.undo;
     this.buttonItem9.BuddyMenu = this.redoMenuItem;
     this.buttonItem9.Image = Resources.redo;
     this.buttonItem7.BeginGroup = true;
     this.buttonItem7.BuddyMenu = this.runMenuItem;
     this.buttonItem7.Image = Resources.PlayHS;
     this.openFileDialog.DefaultExt = "lua";
     this.openFileDialog.FileName = "openFileDialog1";
     this.openFileDialog.Filter = "Far Cry 2 script files (*.lua)|*.lua|All files (*.*)|*.*";
     this.openFileDialog.Title = "Open script";
     this.contextMenuStrip1.Items.AddRange(new ToolStripItem[]
     {
         this.cutToolStripMenuItem,
         this.copyToolStripMenuItem,
         this.pasteToolStripMenuItem,
         this.toolStripSeparator1,
         this.insertFunctionToolStripMenuItem,
         this.insertTextureEntryIDToolStripMenuItem,
         this.insertCollectionEntryIDToolStripMenuItem
     });
     this.contextMenuStrip1.Name = "contextMenuStrip1";
     this.contextMenuStrip1.Size = new Size(194, 164);
     this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
     this.cutToolStripMenuItem.Size = new Size(193, 22);
     this.cutToolStripMenuItem.Text = "Cut";
     this.cutToolStripMenuItem.Click += new EventHandler(this.cutToolStripMenuItem_Click);
     this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
     this.copyToolStripMenuItem.Size = new Size(193, 22);
     this.copyToolStripMenuItem.Text = "Copy";
     this.copyToolStripMenuItem.Click += new EventHandler(this.copyToolStripMenuItem_Click);
     this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
     this.pasteToolStripMenuItem.Size = new Size(193, 22);
     this.pasteToolStripMenuItem.Text = "Paste";
     this.pasteToolStripMenuItem.Click += new EventHandler(this.pasteToolStripMenuItem_Click);
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new Size(190, 6);
     this.insertFunctionToolStripMenuItem.Name = "insertFunctionToolStripMenuItem";
     this.insertFunctionToolStripMenuItem.Size = new Size(193, 22);
     this.insertFunctionToolStripMenuItem.Text = "Insert function";
     this.insertTextureEntryIDToolStripMenuItem.Name = "insertTextureEntryIDToolStripMenuItem";
     this.insertTextureEntryIDToolStripMenuItem.Size = new Size(193, 22);
     this.insertTextureEntryIDToolStripMenuItem.Text = "Insert texture entry ID";
     this.insertCollectionEntryIDToolStripMenuItem.Name = "insertCollectionEntryIDToolStripMenuItem";
     this.insertCollectionEntryIDToolStripMenuItem.Size = new Size(193, 22);
     this.insertCollectionEntryIDToolStripMenuItem.Text = "Insert collection entry ID";
     base.AutoScaleDimensions = new SizeF(6f, 13f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(528, 383);
     base.Controls.Add(dockContainer);
     base.Controls.Add(this.statusStrip1);
     base.Controls.Add(this.leftSandBarDock);
     base.Controls.Add(this.rightSandBarDock);
     base.Controls.Add(this.bottomSandBarDock);
     base.Controls.Add(this.topSandBarDock);
     base.Name = "CodeEditor";
     this.Text = "Far Cry 2 Script Editor";
     dockContainer.ResumeLayout(false);
     this.statusStrip1.ResumeLayout(false);
     this.statusStrip1.PerformLayout();
     this.topSandBarDock.ResumeLayout(false);
     this.contextMenuStrip1.ResumeLayout(false);
     base.ResumeLayout(false);
     base.PerformLayout();
 }
Beispiel #45
0
		private void TreeMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if(e.Button!=MouseButtons.Right)
				return;

			TreeView tree=sender as TreeView;
            
			TreeNode node=tree.GetNodeAt(e.X,e.Y);
			if(node!=null)
				tree.SelectedNode=node;
			else if(tree==treeMenus)
				tree.SelectedNode=null;

			// Popup menu
			ButtonItem popup=dotNetBarManager1.ContextMenus[CONTEXT_MENU] as ButtonItem;
			
			// If MoveTo and CopyTo are visible add items to them
			if(popup.SubItems[COPY_TO].Visible)
			{
				BaseItem itemCopyTo=popup.SubItems[COPY_TO];
				BaseItem itemMoveTo=popup.SubItems[MOVE_TO];
				
				itemCopyTo.SubItems.Clear();
				itemMoveTo.SubItems.Clear();
				bool bBars=true,bCategories=false, bPopups=false;
				// Don't show categories for category items...
				
				if(buttonContext.Visible)
					bPopups=true;
				if(buttonCategories.Visible)
					bCategories=true;

				if(bBars)
				{
					foreach(TreeNode barNode in treeBars.Nodes)
					{
						BaseItem newItem=new ButtonItem();
						newItem.Text=barNode.Text;
						newItem.Tag=barNode;
						newItem.Click+=new System.EventHandler(this.CopyMoveToClick);
						itemCopyTo.SubItems.Add(newItem);
						itemMoveTo.SubItems.Add(newItem.Copy());
					}
				}

				if(bCategories)
				{
					ButtonItem cat=new ButtonItem(TO_CATEGORIES);
					cat.Text="Categories";
					cat.BeginGroup=true;
					cat.Click+=new System.EventHandler(this.CopyMoveToClick);
					itemCopyTo.SubItems.Add(cat);
					itemMoveTo.SubItems.Add(cat.Copy());

					foreach(TreeNode catNode in treeCategories.Nodes)
					{
						BaseItem newItem=new ButtonItem();
						newItem.Text=catNode.Text;
						newItem.Click+=new System.EventHandler(this.CopyMoveToClick);
						newItem.Tag="cat";
						itemCopyTo.SubItems.Add(newItem);
						itemMoveTo.SubItems.Add(newItem.Copy());
					}
				}
				if(bPopups)
				{
					BaseItem pi=new ButtonItem(TO_CONTEXTMENUS);
					pi.BeginGroup=true;
					pi.Text="Popups";
					pi.Click+=new System.EventHandler(this.CopyMoveToClick);
					itemCopyTo.SubItems.Add(pi);
					itemMoveTo.SubItems.Add(pi.Copy());

					foreach(BaseItem objItem in this.GetDesignManager().ContextMenus)
					{
						BaseItem newItem=new ButtonItem();
						newItem.Text=(objItem.Text=="")?objItem.Name:objItem.Text;
						newItem.Tag=objItem;
						newItem.Click+=new System.EventHandler(this.CopyMoveToClick);
						itemCopyTo.SubItems.Add(newItem);
						itemMoveTo.SubItems.Add(newItem.Copy());						
					}
				}
			}

			Point pt=new Point(e.X,e.Y);
			pt=tree.PointToScreen(pt);
			popup.PopupMenu(pt);
		}
Beispiel #46
0
        public void Show(int x, int y, int width, int height)
        {
            if (GlobalManager.Renderer is Office2007Renderer)
            {
                Office2007ColorTable table = ((Office2007Renderer)GlobalManager.Renderer).ColorTable;
                _ResizeGripColors = new ResizeGripColors(table.Form.BackColor, table.LegacyColors.SplitterBackground2, table.LegacyColors.BarStripeColor);
            }
            else
                _ResizeGripColors = new ResizeGripColors(SystemColors.ButtonFace, Color.White, SystemColors.ControlDark);

            Control hostControl = GetHostedControl();
            if (hostControl == null)
                return;

            _CanResizeHostControl = true;
            _CanResizePopup = true;

            this.Size = new Size(1, 1);
            base.Show(x, y);

            _CanResizeHostControl = false;
            _CanResizePopup = false;

            UpdateContentBasedSize(width);

            if (_CloseButtonVisible && IsResizeGripShown)
            {
                if (_CloseButtonController == null)
                {
                    ButtonItem button = new ButtonItem();
                    button.Symbol = "\uf00d";
                    button.SymbolSize = 8;
                    button.Style = eDotNetBarStyle.StyleManagerControlled;
                    button.ButtonStyle = eButtonStyle.ImageAndText;
                    button.LeftInternal = 1;
                    button.Click += new EventHandler(ClosePopupButtonClick);
                    _CloseButtonController = new BaseItemController(button, this);
                    button.RecalcSize();
                    button.TopInternal = this.Height - button.HeightInternal - 1;
                }
            }
            else if (_CloseButtonController != null)
            {
                _CloseButtonController.Dispose();
                _CloseButtonController = null;
            }

            if (_RefreshSize)
                UpdateHostControlSize();

            if (y > Top && y <= Bottom)
            {
                Top = y - Height - (height != -1 ? height : 0);

                ePopupResizeEdge previous = ResizeEdge;
                if (ResizeEdge == ePopupResizeEdge.BottomLeft)
                    ResizeEdge = ePopupResizeEdge.TopLeft;
                else if (ResizeEdge == ePopupResizeEdge.BottomRight)
                    ResizeEdge = ePopupResizeEdge.TopRight;

                if (ResizeEdge != previous)
                    UpdateHostControlSize();
            }

            hostControl.SizeChanged += HostControlSizeChanged;
        }
Beispiel #47
0
 protected override void PaintState(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r, bool isMouseDown)
 {
     
 }
Beispiel #48
0
        private void LoadComboItems()
        {
            _VisButtonItem = null;

            ComboBox cbx = _GridColumn.EditControl as ComboBox;

            if (cbx != null && cbx.Items.Count > 0)
            {
                FilterPopupItem[] items = new FilterPopupItem[cbx.Items.Count];

                for (int i = 0; i < cbx.Items.Count; i++)
                {
                    FilterPopupItem bi = new FilterPopupItem("CbxEntry",
                        cbx.GetItemText(cbx.Items[i]), FilterItemType.ComboBoxEntry,i);

                    items[i] = bi;

                    if (bi.Text.Equals(_GridColumn.FilterDisplayValue) == true)
                    {
                        _VisButtonItem = bi;

                        bi.FontBold = true;
                    }
                }

                ItemPanel itemPanel = GetBaseItemPanel();

                LoadCustomFilterItems(itemPanel);

                if (itemPanel.Items.Count > 0)
                {
                    items[0].BeginGroup = true;

                    itemPanel.Items.AddRange(items);
                }

                Control = itemPanel;
            }
        }
Beispiel #49
0
 protected override Color GetTextColor(ButtonItem button, ItemPaintArgs pa)
 {
     return base.GetTextColor(button, pa, GetColorTable(button, eButtonContainer.RibbonStrip));
 }
Beispiel #50
0
        private void LoadDefaultItems()
        {
            _VisButtonItem = null;

            ItemPanel itemPanel = GetBaseItemPanel();

            LoadCustomFilterItems(itemPanel);

            if (_GridColumn.FilterAutoScan == true)
            {
                List<object> list = GetScanItems();

                if (list != null)
                {
                    int n = Math.Min(list.Count, _GridColumn.FilterPopupMaxItems);

                    for (int i = 0; i < n; i++)
                    {
                        object o = list[i];

                        FilterPopupItem fpi;

                        if (o is DateTime)
                        {
                            DateTime dt = (DateTime)o;
                            dt = dt.Date;

                            string s = dt.Date.ToShortDateString();

                            fpi = new FilterPopupItem(s, s, FilterItemType.ScanDateEntry, dt);
                        }
                        else
                        {
                            string s = o.ToString();

                            fpi = new FilterPopupItem(s, s, FilterItemType.ScanTextEntry, o);
                        }

                        if (i == 0)
                            fpi.BeginGroup = true;

                        if (fpi.Text.Equals(_GridColumn.FilterDisplayValue) == true)
                        {
                            fpi.FontBold = true;

                            _VisButtonItem = fpi;
                        }

                        itemPanel.Items.Add(fpi);
                    }
                }
            }

            Control = itemPanel;
        }
Beispiel #51
0
        /// <summary>
        /// Creates new instance of the class and initializes it with the parent RibbonStrip control.
        /// </summary>
        /// <param name="parent">Reference to parent RibbonStrip control</param>
        public MetroStripContainerItem(MetroTabStrip parent)
        {
            _TabStrip = parent;

            // We contain other controls
            m_IsContainer = true;
            this.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;

            _ItemContainer = new MetroTabItemContainer();
            _ItemContainer.ContainerControl = parent;
            _ItemContainer.GlobalItem = false;
            _ItemContainer.WrapItems = false;
            _ItemContainer.EventHeight = false;
            _ItemContainer.UseMoreItemsButton = false;
            _ItemContainer.Stretch = true;
            _ItemContainer.Displayed = true;
            _ItemContainer.SystemContainer = true;
            _ItemContainer.PaddingTop = 0;
            _ItemContainer.PaddingBottom = 0;
            _ItemContainer.PaddingLeft = 0;
            _ItemContainer.ItemSpacing = 1;

            _CaptionContainer = new CaptionItemContainer();
            _CaptionContainer.ContainerControl = parent;
            _CaptionContainer.GlobalItem = false;
            _CaptionContainer.WrapItems = false;
            _CaptionContainer.EventHeight = false;
            _CaptionContainer.EqualButtonSize = false;
            _CaptionContainer.ToolbarItemsAlign = eContainerVerticalAlignment.Top;
            _CaptionContainer.UseMoreItemsButton = false;
            _CaptionContainer.Stretch = true;
            _CaptionContainer.Displayed = true;
            _CaptionContainer.SystemContainer = true;
            _CaptionContainer.PaddingBottom = 0;
            _CaptionContainer.PaddingTop = 0;
            _CaptionContainer.PaddingLeft = 6;
            _CaptionContainer.ItemSpacing = 1;
            _CaptionContainer.TrackSubItemsImageSize = false;
            _CaptionContainer.ItemAdded += new EventHandler(this.CaptionContainerNewItemAdded);
            this.SubItems.Add(_CaptionContainer);
            this.SubItems.Add(_ItemContainer);

            _Settings = new ButtonItem("sysSettingsButton");
            _Settings.Text=DefaultSettingsButtonText;
            //_Settings.HotTrackingStyle = eHotTrackingStyle.None;
            _Settings.ItemAlignment = eItemAlignment.Far;
            _Settings.Click += new EventHandler(SettingsButtonClick);
            _Settings.SetSystemItem(true);
            _Settings.CanCustomize = false;
            _CaptionContainer.SubItems.Add(_Settings);

            _Help = new ButtonItem("sysHelpButton");
            _Help.Text = DefaultHelpButtonText;
            _Help.SetSystemItem(true);
            _Help.CanCustomize = false;
            //_Help.HotTrackingStyle = eHotTrackingStyle.None;
            _Help.ItemAlignment = eItemAlignment.Far;
            _Help.Click += new EventHandler(HelpButtonClick);
            _CaptionContainer.SubItems.Add(_Help);

            SystemCaptionItem sc = new SystemCaptionItem();
            sc.RestoreEnabled = false;
            sc.IsSystemIcon = false;
            sc.ItemAlignment = eItemAlignment.Far;
            _CaptionContainer.SubItems.Add(sc);
            _SystemCaptionItem = sc;
        }
Beispiel #52
0
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            this.inputText = new System.Windows.Forms.TextBox();
            this.previewPanel = new DevComponents.DotNetBar.PanelEx();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.buttonOK = new System.Windows.Forms.Button();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.label2 = new System.Windows.Forms.Label();
            this.bar1 = new DevComponents.DotNetBar.Bar();
            this.buttonBold = new DevComponents.DotNetBar.ButtonItem();
            this.buttonItalic = new DevComponents.DotNetBar.ButtonItem();
            this.buttonUnderline = new DevComponents.DotNetBar.ButtonItem();
            this.buttonColor = new DevComponents.DotNetBar.ColorPickerDropDown();
            ((System.ComponentModel.ISupportInitialize)(this.bar1)).BeginInit();
            this.SuspendLayout();
            // 
            // inputText
            // 
            this.inputText.AcceptsReturn = true;
            this.inputText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.inputText.Location = new System.Drawing.Point(8, 8);
            this.inputText.Multiline = true;
            this.inputText.Name = "inputText";
            this.inputText.Size = new System.Drawing.Size(332, 110);
            this.inputText.TabIndex = 0;
            this.inputText.TextChanged += new System.EventHandler(this.inputText_TextChanged);
            // 
            // previewPanel
            // 
            this.previewPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.previewPanel.AutoScroll = true;
            this.previewPanel.CanvasColor = System.Drawing.SystemColors.Control;
            this.previewPanel.Location = new System.Drawing.Point(8, 152);
            this.previewPanel.Name = "previewPanel";
            this.previewPanel.Size = new System.Drawing.Size(332, 75);
            this.previewPanel.Style.BackColor1.Color = System.Drawing.Color.White;
            this.previewPanel.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Tile;
            this.previewPanel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
            this.previewPanel.Style.BorderColor.Color = System.Drawing.Color.DarkGray;
            this.previewPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
            this.previewPanel.Style.GradientAngle = 90;
            this.previewPanel.Style.LineAlignment = System.Drawing.StringAlignment.Near;
            this.previewPanel.TabIndex = 1;
            // 
            // buttonCancel
            // 
            this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.buttonCancel.Location = new System.Drawing.Point(269, 233);
            this.buttonCancel.Name = "buttonCancel";
            this.buttonCancel.Size = new System.Drawing.Size(71, 24);
            this.buttonCancel.TabIndex = 4;
            this.buttonCancel.Text = "Cancel";
            this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
            // 
            // buttonOK
            // 
            this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.buttonOK.Location = new System.Drawing.Point(194, 233);
            this.buttonOK.Name = "buttonOK";
            this.buttonOK.Size = new System.Drawing.Size(71, 24);
            this.buttonOK.TabIndex = 3;
            this.buttonOK.Text = "OK";
            this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
            // 
            // timer1
            // 
            this.timer1.Interval = 1000;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            // 
            // label2
            // 
            this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.label2.BackColor = System.Drawing.Color.WhiteSmoke;
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(316, 133);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(24, 16);
            this.label2.TabIndex = 5;
            this.label2.Text = "?";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.label2.MouseLeave += new System.EventHandler(this.label2_MouseLeave);
            this.label2.MouseEnter += new System.EventHandler(this.label2_MouseEnter);
            // 
            // bar1
            // 
            this.bar1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
            this.buttonBold,
            this.buttonItalic,
            this.buttonUnderline,
            this.buttonColor});
            this.bar1.Location = new System.Drawing.Point(8, 124);
            this.bar1.Name = "bar1";
            this.bar1.Size = new System.Drawing.Size(174, 25);
            this.bar1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
            this.bar1.TabIndex = 6;
            this.bar1.TabStop = false;
            this.bar1.Text = "bar1";
            // 
            // buttonBold
            // 
            this.buttonBold.Name = "buttonBold";
            this.buttonBold.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlB);
            this.buttonBold.Text = "Bold";
            this.buttonBold.Click += new System.EventHandler(this.buttonBold_Click);
            // 
            // buttonItalic
            // 
            this.buttonItalic.Name = "buttonItalic";
            this.buttonItalic.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlI);
            this.buttonItalic.Text = "Italic";
            this.buttonItalic.Click += new System.EventHandler(this.buttonItalic_Click);
            // 
            // buttonUnderline
            // 
            this.buttonUnderline.Name = "buttonUnderline";
            this.buttonUnderline.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlU);
            this.buttonUnderline.Text = "Underline";
            this.buttonUnderline.Click += new System.EventHandler(this.buttonUnderline_Click);
            // 
            // buttonColor
            // 
            this.buttonColor.Name = "buttonColor";
            this.buttonColor.Tooltip = "Sets the text color";
            this.buttonColor.Image = Helpers.LoadBitmap("SystemImages.ColorPickerButtonImage.png");
            this.buttonColor.SelectedColorImageRectangle = new System.Drawing.Rectangle(2, 2, 12, 12);
            this.buttonColor.Click += new System.EventHandler(this.buttonColor_SelectedColorChanged);
            // 
            // TextMarkupEditor
            // 
            this.Controls.Add(this.bar1);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.buttonOK);
            this.Controls.Add(this.buttonCancel);
            this.Controls.Add(this.previewPanel);
            this.Controls.Add(this.inputText);
            this.Name = "TextMarkupEditor";
            this.Size = new System.Drawing.Size(348, 263);
            ((System.ComponentModel.ISupportInitialize)(this.bar1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
Beispiel #53
0
        private ButtonItem GetCustomizeRepresentation(BaseItem item)
        {
            ButtonItem ret = new ButtonItem(item.Name);
            ret.Text = item.Text;
            ret.ButtonStyle = eButtonStyle.ImageAndText;
            ret.ImagePaddingVertical = 4;
            ret.OptionGroup = "sys";
            ret.GlobalItem = false;
            if (ret.Text == "")
                ret.Text = "Unassigned";
            ret.Tag = item;

            if (item is ButtonItem)
            {
                ButtonItem b = item as ButtonItem;
                if (b.ImageSmall != null)
                {
                    ret.Image = b.ImageSmall;
                    if (b.ImageSmall.Width != 16 || b.ImageSmall.Height != 16)
                        ret.ImageFixedSize = new Size(16, 16);
                }
                else
                {
                    CompositeImage image = b.GetImage(ImageState.Default, Color.Black);
                    if (image != null)
                    {
                        if (image.IsIcon)
                            ret.Icon = (Icon)image.Icon.Clone();
                        else
                            ret.Image = image.Image;
                        ret.ImageFixedSize = new Size(16, 16);
                    }
                }
            }
            else if (item is ComboBoxItem || item is TextBoxItem || item is ControlContainerItem)
            {
                ret.ImagePosition = eImagePosition.Right;
                ret.Image = BarFunctions.LoadBitmap("SystemImages.QatCustomizeItemCombo.png");
            }

            return ret;
        }
Beispiel #54
0
        /// <summary>
        /// Displays popup customize context menu for given customization object.
        /// </summary>
        /// <param name="o">Object that should be customized, usually an instance of BaseItem.</param>
        /// <param name="isTabStrip">Indicates whether customize menu is displayed over metro tab strip</param>
        internal virtual void ShowCustomizeContextMenu(object o, bool isTabStrip)
        {
            if (o == null || !_UseCustomizeDialog)
                return;

            _TabStrip.ClosePopup(SYS_CUSTOMIZE_POPUP_MENU);

            ButtonItem cont = new ButtonItem(SYS_CUSTOMIZE_POPUP_MENU);
            cont.Style = eDotNetBarStyle.StyleManagerControlled;
            cont.SetOwner(_TabStrip);

            if ((CanCustomizeItem(o as BaseItem)) && !_UseExternalCustomization)
            {
                if (o is BaseItem && this.QuickToolbarItems.Contains((BaseItem)o))
                {

                    ButtonItem b = new ButtonItem(SysQatRemoveFromItemName);
                    b.Text = this.SystemText.QatRemoveItemText;
                    b.Click += new System.EventHandler(CustomizeRemoveFromQuickAccessToolbar);
                    b.Tag = o;
                    cont.SubItems.Add(b);
                }
                else
                {
                    BaseItem itemToCustomize = o as BaseItem;

                    ButtonItem b = new ButtonItem(SysQatAddToItemName);
                    b.Text = this.SystemText.QatAddItemText;
                    b.Click += new System.EventHandler(CustomizeAddToQuickAccessToolbar);
                    b.Tag = o;
                    cont.SubItems.Add(b);

                    if (itemToCustomize != null && this.QuickToolbarItems.Contains(itemToCustomize.Name))
                        b.Enabled = false;

                    if (itemToCustomize != null && BaseItem.IsOnPopup(itemToCustomize) && itemToCustomize.Parent != null)
                    {
                        Control c = itemToCustomize.ContainerControl as Control;
                        if (c != null) c.VisibleChanged += new EventHandler(CustomizePopupItemParentVisibleChange);
                    }
                }
            }

            if (_UseCustomizeDialog)
            {
                ButtonItem b = new ButtonItem(SysQatCustomizeItemName);
                b.Text = this.SystemText.QatCustomizeText;
                b.BeginGroup = true;
                b.Click += new EventHandler(CustomizeQuickAccessToolbarDialog);
                cont.SubItems.Add(b);
            }

            RibbonCustomizeEventArgs e = new RibbonCustomizeEventArgs(o, cont);
            OnBeforeCustomizeMenuPopup(e);
            if (e.Cancel)
            {
                cont.Dispose();
                return;
            }

            ((IOwnerMenuSupport)_TabStrip).RegisterPopup(cont);
            cont.Popup(Control.MousePosition);
        }
Beispiel #55
0
        protected override void CreateAdditionalCaptionItems(GenericItemContainer captionContainer)
        {
            // Add Settings and Help buttons
            _Settings = new ButtonItem("sysSettingsButton");
            _Settings.Text = DefaultSettingsButtonText;
            //_Settings.ItemAlignment = eItemAlignment.Far;
            _Settings.Click += InternalSettingsButtonClick;
            _Settings.SetSystemItem(true);
            _Settings.CanCustomize = false;
            _Settings.Visible = false;
            captionContainer.SubItems.Add(_Settings);

            _Help = new ButtonItem("sysHelpButton");
            _Help.Text = DefaultHelpButtonText;
            _Help.SetSystemItem(true);
            _Help.CanCustomize = false;
            _Help.Visible = false;
            //_Help.ItemAlignment = eItemAlignment.Far;
            _Help.Click += InternalHelpButtonClick;
            captionContainer.SubItems.Add(_Help);

            base.CreateAdditionalCaptionItems(captionContainer);
        }
Beispiel #56
0
 protected override PopupItem CreatePopupItem()
 {
     ButtonItem button = new ButtonItem("sysPopupProvider");
     button.PopupFinalized += new EventHandler(DropDownPopupClose);
     _PopupItem = button;
     return button;
 }
Beispiel #57
0
        private void CreateContextMenuBar()
        {
            if (_ContextMenuBar != null || this.DesignMode) return;
            _ContextMenuBar = new ContextMenuBar();
            _ContextMenuBar.Style = eDotNetBarStyle.StyleManagerControlled;
            this.Controls.Add(_ContextMenuBar);

            ButtonItem sysMenu = new ButtonItem(SysMenu);
            _ContextMenuBar.Items.Add(sysMenu);
            ButtonItem sysItem = new ButtonItem(SysMenuRestore, GetLocalizedString(LocalizationKeys.FormSystemMenuRestore));
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinRestore.png");
            sysItem.Click += new EventHandler(SysItemClick);
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuMove, GetLocalizedString(LocalizationKeys.FormSystemMenuMove));
            sysItem.Click += new EventHandler(SysItemClick);
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuSize, GetLocalizedString(LocalizationKeys.FormSystemMenuSize));
            sysItem.Click += new EventHandler(SysItemClick);
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuMinimize, GetLocalizedString(LocalizationKeys.FormSystemMenuMinimize));
            sysItem.Click += new EventHandler(SysItemClick);
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinMin.png");
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuMaximize, GetLocalizedString(LocalizationKeys.FormSystemMenuMaximize));
            sysItem.Click += new EventHandler(SysItemClick);
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinMax.png");
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuClose, GetLocalizedString(LocalizationKeys.FormSystemMenuClose));
            sysItem.Click += new EventHandler(SysItemClick);
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinClose.png");
            sysItem.BeginGroup = true;
            sysItem.FontBold = true;
            sysItem.HotFontBold = true;
            sysItem.Shortcuts.Add(eShortcut.CtrlF4);
            sysMenu.SubItems.Add(sysItem);
        }
Beispiel #58
0
 private bool AddButtonToToolbar(string toolbarName, ButtonItem buttonToAdd)
 {
     if (this.AllToolbars.ContainsKey(toolbarName))
         {
         this.AllToolbars[toolbarName].toolBar.Items.Add(buttonToAdd);
         return true;
         }
     return false;
 }
Beispiel #59
0
 private void buildToolbars()
 {
     AllToolbars = new Dictionary<string, ToolBarDef>();
     CreateToolBar("SafeSave", ToolBarInitialPos.Top);
     ButtonItem item = new ButtonItem();
     item.Text = "Safe Save";
     item.ToolTipText = "Save your module in a new file";
     item.Activate += new EventHandler(SaveInNewFile);
     AddButtonToToolbar("SafeSave", item);
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.menuBarItem1 = new TD.SandBar.MenuBarItem();
     this.menuBarItem2 = new TD.SandBar.MenuBarItem();
     this.menuBarItem3 = new TD.SandBar.MenuBarItem();
     this.menuBarItem4 = new TD.SandBar.MenuBarItem();
     this.menuBarItem5 = new TD.SandBar.MenuBarItem();
     this.sandDockManager = new TD.SandDock.SandDockManager();
     this.leftSandDock = new TD.SandDock.DockContainer();
     this.rightSandDock = new TD.SandDock.DockContainer();
     this.dockElementInsert = new TD.SandDock.DockableWindow();
     this.elementInsertPanel = new XEditNet.Widgets.ElementInsertPanel();
     this.dockElementChange = new TD.SandDock.DockableWindow();
     this.elementChangePanel = new XEditNet.Widgets.ElementChangePanel();
     this.dockAttributes = new TD.SandDock.DockableWindow();
     this.attributeChangePanel = new XEditNet.Widgets.AttributeChangePanel();
     this.bottomSandDock = new TD.SandDock.DockContainer();
     this.topSandDock = new TD.SandDock.DockContainer();
     this.menuBar1 = new TD.SandBar.MenuBar();
     this.menuBarItem6 = new TD.SandBar.MenuBarItem();
     this.menuFileSave = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem1 = new TD.SandBar.MenuButtonItem();
     this.menuBarItem7 = new TD.SandBar.MenuBarItem();
     this.menuButtonItem2 = new TD.SandBar.MenuButtonItem();
     this.menuBarItem8 = new TD.SandBar.MenuBarItem();
     this.menuButtonItem3 = new TD.SandBar.MenuButtonItem();
     this.toolBar1 = new TD.SandBar.ToolBar();
     this.toolBar2 = new TD.SandBar.ToolBar();
     this.buttonItem1 = new TD.SandBar.ButtonItem();
     this.quickFixBar = new TD.SandBar.ContainerBar();
     this.containerBarClientPanel1 = new TD.SandBar.ContainerBarClientPanel();
     this.quickFixPanel = new XEditNet.Widgets.QuickFixPanel();
     this.quickFixImageList = new System.Windows.Forms.ImageList(this.components);
     this.quickFixPreceeding = new TD.SandBar.ButtonItem();
     this.quickFixFollowing = new TD.SandBar.ButtonItem();
     this.commandImageList = new System.Windows.Forms.ImageList(this.components);
     this.rightSandDock.SuspendLayout();
     this.dockElementInsert.SuspendLayout();
     this.dockElementChange.SuspendLayout();
     this.dockAttributes.SuspendLayout();
     this.quickFixBar.SuspendLayout();
     this.containerBarClientPanel1.SuspendLayout();
     this.SuspendLayout();
     //
     // menuBarItem1
     //
     this.menuBarItem1.Text = "&File";
     //
     // menuBarItem2
     //
     this.menuBarItem2.Text = "&Edit";
     //
     // menuBarItem3
     //
     this.menuBarItem3.Text = "&View";
     //
     // menuBarItem4
     //
     this.menuBarItem4.MdiWindowList = true;
     this.menuBarItem4.Text = "&Window";
     //
     // menuBarItem5
     //
     this.menuBarItem5.Text = "&Help";
     //
     // sandDockManager
     //
     this.sandDockManager.OwnerForm = this;
     this.sandDockManager.Renderer = new TD.SandDock.Rendering.Office2003Renderer();
     //
     // leftSandDock
     //
     this.leftSandDock.Dock = System.Windows.Forms.DockStyle.Left;
     this.leftSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.leftSandDock.Location = new System.Drawing.Point(0, 22);
     this.leftSandDock.Manager = this.sandDockManager;
     this.leftSandDock.Name = "leftSandDock";
     this.leftSandDock.Size = new System.Drawing.Size(0, 480);
     this.leftSandDock.TabIndex = 0;
     //
     // rightSandDock
     //
     this.rightSandDock.Controls.Add(this.dockElementInsert);
     this.rightSandDock.Controls.Add(this.dockElementChange);
     this.rightSandDock.Controls.Add(this.dockAttributes);
     this.rightSandDock.Dock = System.Windows.Forms.DockStyle.Right;
     this.rightSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400, System.Windows.Forms.Orientation.Horizontal, new TD.SandDock.LayoutSystemBase[] {
                                                                                                                                                                       new TD.SandDock.ControlLayoutSystem(212, 238, new TD.SandDock.DockableWindow[] {
                                                                                                                                                                                                                                                       this.dockElementInsert,
                                                                                                                                                                                                                                                       this.dockElementChange}, this.dockElementInsert),
                                                                                                                                                                       new TD.SandDock.ControlLayoutSystem(212, 238, new TD.SandDock.DockableWindow[] {
                                                                                                                                                                                                                                                       this.dockAttributes}, this.dockAttributes)});
     this.rightSandDock.Location = new System.Drawing.Point(600, 22);
     this.rightSandDock.Manager = this.sandDockManager;
     this.rightSandDock.Name = "rightSandDock";
     this.rightSandDock.Size = new System.Drawing.Size(216, 480);
     this.rightSandDock.TabIndex = 1;
     //
     // dockElementInsert
     //
     this.dockElementInsert.Controls.Add(this.elementInsertPanel);
     this.dockElementInsert.Guid = new System.Guid("63fe64f8-5444-45cb-b17d-17f8baf0c91d");
     this.dockElementInsert.Location = new System.Drawing.Point(4, 25);
     this.dockElementInsert.Name = "dockElementInsert";
     this.dockElementInsert.Size = new System.Drawing.Size(212, 190);
     this.dockElementInsert.TabIndex = 1;
     this.dockElementInsert.Text = "Insert";
     //
     // elementInsertPanel
     //
     this.elementInsertPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.elementInsertPanel.Location = new System.Drawing.Point(0, 0);
     this.elementInsertPanel.Name = "elementInsertPanel";
     this.elementInsertPanel.Size = new System.Drawing.Size(212, 190);
     this.elementInsertPanel.TabIndex = 0;
     //
     // dockElementChange
     //
     this.dockElementChange.Controls.Add(this.elementChangePanel);
     this.dockElementChange.Guid = new System.Guid("cb2f6fbf-41de-4588-a08b-f4f00d505fa7");
     this.dockElementChange.Location = new System.Drawing.Point(4, 25);
     this.dockElementChange.Name = "dockElementChange";
     this.dockElementChange.Size = new System.Drawing.Size(212, 190);
     this.dockElementChange.TabIndex = 1;
     this.dockElementChange.Text = "Change";
     //
     // elementChangePanel
     //
     this.elementChangePanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.elementChangePanel.Location = new System.Drawing.Point(0, 0);
     this.elementChangePanel.Name = "elementChangePanel";
     this.elementChangePanel.Size = new System.Drawing.Size(212, 190);
     this.elementChangePanel.TabIndex = 0;
     //
     // dockAttributes
     //
     this.dockAttributes.Controls.Add(this.attributeChangePanel);
     this.dockAttributes.Guid = new System.Guid("7a4f064f-d569-4ab2-8133-ca0b6b8c4151");
     this.dockAttributes.Location = new System.Drawing.Point(4, 267);
     this.dockAttributes.Name = "dockAttributes";
     this.dockAttributes.Size = new System.Drawing.Size(212, 190);
     this.dockAttributes.TabIndex = 2;
     this.dockAttributes.Text = "Attributes";
     //
     // attributeChangePanel
     //
     this.attributeChangePanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.attributeChangePanel.Location = new System.Drawing.Point(0, 0);
     this.attributeChangePanel.Name = "attributeChangePanel";
     this.attributeChangePanel.Size = new System.Drawing.Size(212, 190);
     this.attributeChangePanel.TabIndex = 0;
     //
     // bottomSandDock
     //
     this.bottomSandDock.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.bottomSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.bottomSandDock.Location = new System.Drawing.Point(0, 502);
     this.bottomSandDock.Manager = this.sandDockManager;
     this.bottomSandDock.Name = "bottomSandDock";
     this.bottomSandDock.Size = new System.Drawing.Size(816, 0);
     this.bottomSandDock.TabIndex = 2;
     //
     // topSandDock
     //
     this.topSandDock.Dock = System.Windows.Forms.DockStyle.Top;
     this.topSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.topSandDock.Location = new System.Drawing.Point(0, 22);
     this.topSandDock.Manager = this.sandDockManager;
     this.topSandDock.Name = "topSandDock";
     this.topSandDock.Size = new System.Drawing.Size(816, 0);
     this.topSandDock.TabIndex = 3;
     //
     // menuBar1
     //
     this.menuBar1.AllowMerge = true;
     this.menuBar1.Guid = new System.Guid("dc0a091b-fb9a-4a33-8bf0-a9a24af4064c");
     this.menuBar1.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
                                                                       this.menuBarItem6,
                                                                       this.menuBarItem7,
                                                                       this.menuBarItem8});
     this.menuBar1.Location = new System.Drawing.Point(232, 22);
     this.menuBar1.Name = "menuBar1";
     this.menuBar1.OwnerForm = this;
     this.menuBar1.Size = new System.Drawing.Size(368, 22);
     this.menuBar1.TabIndex = 0;
     this.menuBar1.Text = "menuBar1";
     this.menuBar1.Visible = false;
     //
     // menuBarItem6
     //
     this.menuBarItem6.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
                                                                           this.menuFileSave,
                                                                           this.menuButtonItem1});
     this.menuBarItem6.Text = "&File";
     //
     // menuFileSave
     //
     this.menuFileSave.BeginGroup = true;
     this.menuFileSave.MergeAction = TD.SandBar.ItemMergeAction.Insert;
     this.menuFileSave.MergeIndex = 2;
     this.menuFileSave.Text = "Save";
     this.menuFileSave.Activate += new System.EventHandler(this.SaveFile);
     //
     // menuButtonItem1
     //
     this.menuButtonItem1.MergeAction = TD.SandBar.ItemMergeAction.Insert;
     this.menuButtonItem1.MergeIndex = 3;
     this.menuButtonItem1.Text = "&Close";
     this.menuButtonItem1.Activate += new System.EventHandler(this.CloseFile);
     //
     // menuBarItem7
     //
     this.menuBarItem7.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
                                                                           this.menuButtonItem2});
     this.menuBarItem7.Text = "&Edit";
     //
     // menuButtonItem2
     //
     this.menuButtonItem2.MergeAction = TD.SandBar.ItemMergeAction.Add;
     this.menuButtonItem2.MergeIndex = 0;
     this.menuButtonItem2.Text = "&Test";
     //
     // menuBarItem8
     //
     this.menuBarItem8.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
                                                                           this.menuButtonItem3});
     this.menuBarItem8.Text = "&View";
     //
     // menuButtonItem3
     //
     this.menuButtonItem3.MergeAction = TD.SandBar.ItemMergeAction.Add;
     this.menuButtonItem3.MergeIndex = 0;
     this.menuButtonItem3.Text = "&ViewTest";
     //
     // toolBar1
     //
     this.toolBar1.DockLine = 1;
     this.toolBar1.Guid = new System.Guid("88196026-7bd7-4954-85b7-34999dcd37cd");
     this.toolBar1.Location = new System.Drawing.Point(2, 24);
     this.toolBar1.Name = "toolBar1";
     this.toolBar1.Size = new System.Drawing.Size(24, 18);
     this.toolBar1.TabIndex = 1;
     this.toolBar1.Text = "toolBar1";
     //
     // toolBar2
     //
     this.toolBar2.Guid = new System.Guid("458f1dcc-720e-4fb6-b794-41d5a9f186e2");
     this.toolBar2.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
                                                                       this.buttonItem1});
     this.toolBar2.Location = new System.Drawing.Point(0, 0);
     this.toolBar2.Name = "toolBar2";
     this.toolBar2.Size = new System.Drawing.Size(816, 22);
     this.toolBar2.TabIndex = 4;
     this.toolBar2.Text = "";
     this.toolBar2.Visible = false;
     //
     // buttonItem1
     //
     this.buttonItem1.MergeAction = TD.SandBar.ItemMergeAction.Insert;
     this.buttonItem1.MergeIndex = 2;
     this.buttonItem1.Text = "xxxx";
     //
     // quickFixBar
     //
     this.quickFixBar.AddRemoveButtonsVisible = false;
     this.quickFixBar.AllowHorizontalDock = false;
     this.quickFixBar.Controls.Add(this.containerBarClientPanel1);
     this.quickFixBar.Dock = System.Windows.Forms.DockStyle.Left;
     this.quickFixBar.Flow = TD.SandBar.ToolBarLayout.Horizontal;
     this.quickFixBar.Guid = new System.Guid("0e1e9ede-d2fe-4307-a683-d2e3ea4f4e5f");
     this.quickFixBar.ImageList = this.quickFixImageList;
     this.quickFixBar.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
                                                                          this.quickFixPreceeding,
                                                                          this.quickFixFollowing});
     this.quickFixBar.Location = new System.Drawing.Point(0, 22);
     this.quickFixBar.Name = "quickFixBar";
     this.quickFixBar.Size = new System.Drawing.Size(232, 480);
     this.quickFixBar.TabIndex = 5;
     this.quickFixBar.Text = "Quick Fix";
     //
     // containerBarClientPanel1
     //
     this.containerBarClientPanel1.Controls.Add(this.quickFixPanel);
     this.containerBarClientPanel1.Location = new System.Drawing.Point(2, 45);
     this.containerBarClientPanel1.Name = "containerBarClientPanel1";
     this.containerBarClientPanel1.Size = new System.Drawing.Size(228, 433);
     this.containerBarClientPanel1.TabIndex = 0;
     //
     // quickFixPanel
     //
     this.quickFixPanel.BackColor = System.Drawing.Color.Transparent;
     this.quickFixPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.quickFixPanel.Location = new System.Drawing.Point(0, 0);
     this.quickFixPanel.Name = "quickFixPanel";
     this.quickFixPanel.Size = new System.Drawing.Size(228, 433);
     this.quickFixPanel.TabIndex = 0;
     this.quickFixPanel.FinishUpdate += new System.EventHandler(this.QuickFixUpdated);
     //
     // quickFixImageList
     //
     this.quickFixImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.quickFixImageList.ImageSize = new System.Drawing.Size(16, 16);
     this.quickFixImageList.TransparentColor = System.Drawing.Color.Transparent;
     //
     // quickFixPreceeding
     //
     this.quickFixPreceeding.ImageIndex = 0;
     this.quickFixPreceeding.Activate += new System.EventHandler(this.GotoPrecedingError);
     //
     // quickFixFollowing
     //
     this.quickFixFollowing.ImageIndex = 1;
     this.quickFixFollowing.Activate += new System.EventHandler(this.GotoFollowingError);
     //
     // commandImageList
     //
     this.commandImageList.ImageSize = new System.Drawing.Size(16, 16);
     this.commandImageList.TransparentColor = System.Drawing.Color.Transparent;
     //
     // XEditNetChildForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(816, 502);
     this.Controls.Add(this.menuBar1);
     this.Controls.Add(this.quickFixBar);
     this.Controls.Add(this.leftSandDock);
     this.Controls.Add(this.rightSandDock);
     this.Controls.Add(this.bottomSandDock);
     this.Controls.Add(this.topSandDock);
     this.Controls.Add(this.toolBar2);
     this.Name = "XEditNetChildForm";
     this.Text = "XEditNetChildForm";
     this.rightSandDock.ResumeLayout(false);
     this.dockElementInsert.ResumeLayout(false);
     this.dockElementChange.ResumeLayout(false);
     this.dockAttributes.ResumeLayout(false);
     this.quickFixBar.ResumeLayout(false);
     this.containerBarClientPanel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }