Esempio n. 1
0
        public ToolStripEx AddToolStripEx(string name, string caption, string headerName)
        {
            ToolStripTabItem item = GetHeaderItem(headerName);
            ToolStripEx      stripEx;

            for (int i = 0; i < item.Panel.Controls.Count; i++)
            {
                Control control = item.Panel.Controls[i];
                if (control.Name == name)
                {
                    return(control as ToolStripEx);
                }
            }
            ToolStripEx ex = new ToolStripEx();

            ex.Name        = name;
            ex.Text        = caption;
            ex.AutoSize    = true;
            ex.CanOverflow = true;
            ex.Stretch     = true;
            ex.Dock        = DockStyle.None;
            ex.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
            item.Panel.Controls.Add(ex);
            return(ex);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds this MenuInfo object to m_menus field and creates a ToolStrip for it</summary>
        /// <param name="info">MenuInfo object to add</param>
        sealed protected override void RegisterMenuInfo(MenuInfo info)
        {
            base.RegisterMenuInfo(info);

            // If it wasn't already done, create a WinForms ToolStrip for this MenuInfo
            ToolStrip toolStrip;

            if (m_menuToolStrips.TryGetValue(info, out toolStrip) == false)
            {
                toolStrip             = new ToolStripEx();
                toolStrip.MouseHover += ToolStripOnMouseHover;
                m_menuToolStrips.Add(info, toolStrip);
            }

            // build toolbar corresponding to menu
            {
                string str = info.MenuText.Replace("&", "");
                str                        = str.Replace(";", "");
                toolStrip.Name             = str + "_toolbar";
                toolStrip.AllowItemReorder = true; // magic, to enable customization with Alt key
            }

            // build menu
            ToolStripMenuItem menuItem = new ToolStripMenuItem(info.MenuText);

            menuItem.Visible = false;
            menuItem.Name    = info.MenuText + "_menu";
            menuItem.Tag     = info.MenuTag;
            m_menuToolStripItems.Add(info, menuItem);

            // Associate the registered MenuInfo with this CommandService.  Only can be registered once.
            info.CommandService = this;
        }
Esempio n. 3
0
        public static ToolStripSeparator AddSeparator(this ToolStripEx parent)
        {
            var item = new ToolStripSeparator();

            parent.Items.Add(item);
            return(item);
        }
Esempio n. 4
0
        private void AddVisualStyleMenu(SpreadsheetRibbon ribbon)
        {
            ToolStripEx panel = new ToolStripEx();

            panel.GripStyle                   = ToolStripGripStyle.Hidden;
            panel.Office12Mode                = false;
            panel.Size                        = new Size(143, 0);
            panel.ShowLauncher                = false;
            panel.Text                        = "Visual Style";
            visualStyleComboBox               = new ToolStripComboBoxEx();
            visualStyleComboBox.Size          = new Size(140, 0);
            visualStyleComboBox.Style         = ToolStripExStyle.Metro;
            visualStyleComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            visualStyleComboBox.Font          = new Font("Segoe UI", 9, FontStyle.Regular);
            visualStyleComboBox.Items.Add("Default");
            visualStyleComboBox.Items.Add("Office 2016 Colorful");
            visualStyleComboBox.Items.Add("Office 2016 DarkGray");
            visualStyleComboBox.Items.Add("Office 2016 Black");
            visualStyleComboBox.Items.Add("Office 2016 White");
            visualStyleComboBox.SelectedIndex         = 3;
            visualStyleComboBox.SelectedIndexChanged += visualStyleComboBox_SelectedIndexChanged;
            visualStyleComboBox.DropDownClosed       += visualStyleComboBox_DropDownClosed;
            panel.Items.Add(visualStyleComboBox);
            var tab = ribbon.Header.MainItems[2] as ToolStripTabItem;

            tab.Panel.Controls.Add(panel);
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sourceControl"></param>
        /// <param name="parent"></param>
        /// <returns></returns>
        private Control CreatetToolStripForForm(ToolStripEx sourceControl, ToolStripEx parent)
        {
            ToolStripEx newToolBox = null;

            if (sourceControl is ToolStripEx && sourceControl.Visible == true)
            {
                newToolBox = new ToolStripEx();
                ToolStripItem msiNew = null;

                foreach (ToolStripItem msi in sourceControl.Items)
                {
                    if ((msi is ToolStripSeparator))
                    {
                        msiNew = new ToolStripSeparator();
                    }
                    else if ((msi is ToolStripButton))
                    {
                        msiNew              = new ToolStripButton();
                        msiNew.Image        = msi.Image;
                        msiNew.DisplayStyle = msi.DisplayStyle;
                        msiNew.Text         = msi.Text;
                        msiNew.Visible      = msi.Visible;
                        msiNew.Enabled      = msi.Enabled;
                    }

                    if (msiNew != null)
                    {
                        newToolBox.Items.Add(msiNew);
                    }
                }
            }

            CurrentToolBar = newToolBox;
            return(newToolBox);
        }
Esempio n. 6
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.toolStripEx      = new ToolStripEx();
     this.onePxSpacingLeft = new Control();
     this.SuspendLayout();
     //
     // toolStripEx
     //
     this.toolStripEx.Dock             = System.Windows.Forms.DockStyle.Top;
     this.toolStripEx.GripStyle        = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.toolStripEx.LayoutStyle      = System.Windows.Forms.ToolStripLayoutStyle.Flow;
     this.toolStripEx.ItemClicked     += new ToolStripItemClickedEventHandler(ToolStripEx_ItemClicked);
     this.toolStripEx.Name             = "toolStripEx";
     this.toolStripEx.AutoSize         = true;
     this.toolStripEx.RelinquishFocus += new EventHandler(ToolStripEx_RelinquishFocus);
     //
     // onePxSpacingLeft
     //
     this.onePxSpacingLeft.Dock  = System.Windows.Forms.DockStyle.Left;
     this.onePxSpacingLeft.Width = 1;
     this.onePxSpacingLeft.Name  = "onePxSpacingLeft";
     //
     // MainToolBar
     //
     this.Controls.Add(this.toolStripEx);
     this.Controls.Add(this.onePxSpacingLeft);
     this.AutoScaleDimensions = new SizeF(96F, 96F);
     this.AutoScaleMode       = AutoScaleMode.Dpi;
     this.Name = "MainToolBar";
     this.Size = new System.Drawing.Size(48, 328);
     this.ResumeLayout(false);
 }
Esempio n. 7
0
        public static ToolStripPanelItem AddPanel(this ToolStripEx parent)
        {
            var item = new ToolStripPanelItem();

            parent.Items.Add(item);
            return(item);
        }
Esempio n. 8
0
        internal ToolbarRowConfiguration(ToolStripPanelRow row, int index)
        {
            m_Index = index;
            m_ToolbarConfigurations = new ToolbarConfiguration[row.Controls.Length];
            for (int position = 0; position < (row.Controls.Length); position++)
            {
                ToolStripEx toolStripEx = row.Controls[position] as ToolStripEx;
                if (toolStripEx == null)
                {
                    throw new InvalidCastException("Controls in this ToolStripPanelRow must be DockToolStrips!");                      //Why?
                }

                int offset;

                if (row.Orientation == Orientation.Horizontal)
                {
                    offset = toolStripEx.Left;
                }
                else                 //(row.Orientation == Orientation.Vertical)
                {
                    offset = toolStripEx.Top;
                }

                m_ToolbarConfigurations[position] = new ToolbarConfiguration(toolStripEx, offset);
            }
        }
Esempio n. 9
0
        void toolStripEx1_LauncherMouseEnter(object o, MouseEventArgs e)
        {
            ToolStripEx tool = o as ToolStripEx;

            switch (tool.Text)
            {
            case "Type":
                this.toolTip1.ToolTipTitle = "Sparkline Type";
                this.toolTip1.Show("Type of sparkline", o as ToolStripEx, e.Location);
                break;

            case "Marker":
                this.toolTip1.ToolTipTitle = "Marker";
                this.toolTip1.Show("Display or hide marker for high, low, start, \nend and negative points or all points", o as ToolStripEx, e.Location);
                break;

            case "Style":
                this.toolTip1.ToolTipTitle = "Style";
                this.toolTip1.Show("Styles for spark line", o as ToolStripEx, e.Location);
                break;

            case "Custom Color":
                this.toolTip1.ToolTipTitle = "Marker";
                this.toolTip1.Show("Customize the color of\n marker and spark line", o as ToolStripEx, e.Location);
                break;
            }
        }
Esempio n. 10
0
        public ToolStripAbstractList(string text, ScrapBook scrapbook) : base(text)
        {
            this._scrapbook = scrapbook;
            base.DropDownItems.Clear();
            base.DropDownItems.Insert(0, new ToolStripMenuItem("无"));

            ToolStripEx.BigButtons(this.DropDown);
        }
Esempio n. 11
0
        public static ToolStripButton AddButton(this ToolStripEx parent, string text, string imagePath)
        {
            var item = new ToolStripButton();

            Appearances.MainRibbonButton(item, text, imagePath);
            parent.Items.Add(item);
            return(item);
        }
Esempio n. 12
0
        public static ToolStripDropDownButton AddDropDownButton(this ToolStripEx parent, string text, Image image = null)
        {
            var item = new ToolStripDropDownButton();

            Appearances.MainRibbonButton(item, text, image);
            parent.Items.Add(item);
            return(item);
        }
Esempio n. 13
0
        public static ToolStripPanelItem AddPanel(this ToolStripEx parent, int count = 3)
        {
            var item = new ToolStripPanelItem();

            item.RowCount = count;
            item.AutoSize = true;
            parent.Items.Add(item);
            return(item);
        }
Esempio n. 14
0
        /// <summary>
        /// Gets a tool strip from the specified xml file
        /// </summary>
        public static ToolStrip GetToolStrip(String file)
        {
            ToolStripEx toolStrip = new ToolStripEx();            
			toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
            XmlNode rootNode = XmlHelper.LoadXmlDocument(file);
            foreach (XmlNode subNode in rootNode.ChildNodes)
            {
                FillToolItems(toolStrip.Items, subNode);
            }
            return toolStrip;
        }
Esempio n. 15
0
        public static ToolStripButton AddButton(this ToolStripEx parent, string name, string text, Image image = null)
        {
            var item = new ToolStripButton()
            {
                Name = name, Text = text
            };

            Appearances.MainRibbonButton(item, text, image);
            parent.Items.Add(item);
            return(item);
        }
Esempio n. 16
0
        public static ToolStripEx AddGroup(this ToolStripTabItem parent, string text = null)
        {
            var item = new ToolStripEx();

            item.AutoSize    = true;
            item.GripStyle   = ToolStripGripStyle.Hidden;
            item.CaptionFont = Appearances.DefaultFont;
            item.Font        = Appearances.DefaultFont;
            item.Text        = text;
            parent.Panel.Controls.Add(item);
            return(item);
        }
Esempio n. 17
0
        public ToolStripLabel AddLabel(IMenuItem menuItem)
        {
            ToolStripEx    ex  = AddToolStripEx(menuItem.ToolStripExName, menuItem.ToolStripExName, menuItem.HeaderName);
            ToolStripLabel btn = new ToolStripLabel(menuItem.Text, menuItem.Icon.Image);

            btn.Name = menuItem.UniqueKey;
            ToolStripItem item = btn as ToolStripItem;

            item.Tag = menuItem;
            ex.Items.Add(btn);
            return(btn);
        }
Esempio n. 18
0
        public ToolStripComboBoxEx AddComboBox(IMenuItem menuItem)
        {
            ToolStripEx         ex  = AddToolStripEx(menuItem.ToolStripExName, menuItem.ToolStripExName, menuItem.HeaderName);
            ToolStripComboBoxEx btn = new ToolStripComboBoxEx();

            btn.Name = menuItem.UniqueKey;
            ToolStripItem item = btn as ToolStripItem;

            item.Tag    = menuItem;
            item.Click += Item_Click;
            ex.Items.Add(btn);
            return(btn);
        }
Esempio n. 19
0
        public ToolStripDropDownButton AddDropDownButton(IMenuItem menuItem)
        {
            ToolStripEx             ex  = AddToolStripEx(menuItem.ToolStripExName, menuItem.ToolStripExName, menuItem.HeaderName);
            ToolStripDropDownButton btn = new ToolStripDropDownButton(menuItem.Text, menuItem.Icon.Image);

            btn.Name = menuItem.UniqueKey;
            ToolStripItem item = btn as ToolStripItem;

            item.Tag    = menuItem;
            item.Click += Item_Click;
            ex.Items.Add(btn);
            return(btn);
        }
Esempio n. 20
0
        /// <summary>
        /// Gets a tool strip from the specified xml file
        /// </summary>
        public static ToolStrip GetToolStrip(String file)
        {
            ToolStripEx toolStrip = new ToolStripEx();

            toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
            XmlNode rootNode = XmlHelper.LoadXmlDocument(file);

            foreach (XmlNode subNode in rootNode.ChildNodes)
            {
                FillToolItems(toolStrip.Items, subNode);
            }
            return(toolStrip);
        }
Esempio n. 21
0
 private void Launcher_Click(object sender, EventArgs e)
 {
     ToolStripEx toolStripEx = sender as ToolStripEx;
     if (toolStripEx.Text == "Launcher")
     {
         this.statusStripLabel1.Text = "Launcher ToolStripEx Launcher clicked";
     }
     else if (toolStripEx.Text == "3 Rows")
     {
         this.statusStripLabel1.Text = "Panel - 3 Rows, Launcher clicked";
     }
     else
     {
         this.statusStripLabel1.Text = toolStripEx.Text + " Launcher clicked";
     }
 }
Esempio n. 22
0
        public ToolStripItem FindToolStripItem(string key, PluginIdentity identity)
        {
            ICommand command = _commands.FirstOrDefault(c => c.Key == key);

            if (command != null && command.PluginIdentity.Guid == identity.Guid)
            {
                ToolStripEx item = GetToolStripEx(command.ToolStripExName, command.HeaderName);
                if (item == null)
                {
                    return(null);
                }
                ToolStripItem toolItem = item.Items[key];
                return(toolItem);
            }
            return(null);
        }
Esempio n. 23
0
        public ToolStripButton AddButton(IMenuItem menuItem)
        {
            ToolStripEx     ex  = AddToolStripEx(menuItem.ToolStripExName, menuItem.ToolStripExName, menuItem.HeaderName);
            ToolStripButton btn = new ToolStripButton(menuItem.Text, menuItem.Icon.Image);

            btn.Name = menuItem.UniqueKey;
            ToolStripItem item = btn as ToolStripItem;

            item.Tag              = new MenuItemMetadata(menuItem.PluginIdentity, menuItem.Key);
            item.Click           += Item_Click;
            btn.DisplayStyle      = ToolStripItemDisplayStyle.ImageAndText;
            btn.AutoSize          = false;
            btn.ImageScaling      = ToolStripItemImageScaling.SizeToFit;
            btn.TextAlign         = ContentAlignment.TopCenter;
            btn.TextImageRelation = TextImageRelation.ImageAboveText;
            ex.Items.Add(btn);
            return(btn);
        }
Esempio n. 24
0
 private void InitializeComponent()
 {
     this.toolStripEx = new ToolStripEx();
     base.SuspendLayout();
     this.toolStripEx.Dock             = DockStyle.Top;
     this.toolStripEx.GripStyle        = ToolStripGripStyle.Hidden;
     this.toolStripEx.LayoutStyle      = ToolStripLayoutStyle.Flow;
     this.toolStripEx.ItemClicked     += new ToolStripItemClickedEventHandler(this.OnToolStripExItemClicked);
     this.toolStripEx.Name             = "toolStripEx";
     this.toolStripEx.AutoSize         = true;
     this.toolStripEx.RelinquishFocus += new EventHandler(this.OnToolStripExRelinquishFocus);
     this.toolStripEx.Padding          = new Padding(0, 0, 1, 1);
     base.Controls.Add(this.toolStripEx);
     base.AutoScaleDimensions = new SizeF(96f, 96f);
     base.AutoScaleMode       = AutoScaleMode.Dpi;
     base.Name = "MainToolBar";
     base.Size = new Size(0x30, 0x148);
     base.ResumeLayout(false);
 }
Esempio n. 25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="retControl"></param>
        private void PrepeareToolBar(Form CurrentForm)
        {
            if (CurrentToolBar != null)
            {
                CurrentForm.Controls.Add(CurrentToolBar);
                //find menustrip
                foreach (Control control in CurrentForm.Controls)
                {
                    if (control is MenuStrip)
                    {
                        //QCR #779146, make sure pulldown menu always above the toolbar
                        int idx = CurrentForm.Controls.IndexOf(CurrentForm.MainMenuStrip);
                        CurrentForm.Controls.SetChildIndex(CurrentToolBar, idx);
                        break;
                    }
                }

                CurrentToolBar = null;
            }
        }
Esempio n. 26
0
        public ToolStripButton AddButton(ICommand menuCommand)
        {
            ToolStripEx ex = AddToolStripEx(menuCommand.ToolStripExName, menuCommand.ToolStripExName, menuCommand.HeaderName);

            ToolStripButton btn = new ToolStripButton(menuCommand.Text, menuCommand.Icon);

            btn.Name = menuCommand.Key;
            ToolStripItem item = btn as ToolStripItem;

            item.Tag         = new MenuItemMetadata(menuCommand.PluginIdentity, menuCommand.Key);
            item.Click      += Item_Click;
            btn.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            //btn.AutoSize = false;
            btn.ImageScaling      = ToolStripItemImageScaling.None;
            btn.TextAlign         = ContentAlignment.BottomCenter;
            btn.TextImageRelation = TextImageRelation.ImageAboveText;
            btn.Visible           = true;
            ex.Items.Add(btn);
            _commands.Add(menuCommand);
            //ex.Refresh();
            return(btn);
        }
Esempio n. 27
0
        private void CreateToolbar()
        {
            menuForm = new Form()
            {
                AutoScaleDimensions = new SizeF(6F, 13F),
                AutoScaleMode = AutoScaleMode.Font,
                AutoSize = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                ClientSize = new Size(759, 509),
                FormBorderStyle = FormBorderStyle.None,
                Location = new Point(200, 200),
                ShowInTaskbar = false,
                StartPosition = FormStartPosition.Manual,
                Text = "ShareX - Region capture menu",
                TopMost = true
            };

            menuForm.KeyUp += MenuForm_KeyUp;
            menuForm.LocationChanged += MenuForm_LocationChanged;

            menuForm.SuspendLayout();

            tsMain = new ToolStripEx()
            {
                AutoSize = true,
                CanOverflow = false,
                ClickThrough = true,
                Dock = DockStyle.None,
                GripStyle = ToolStripGripStyle.Hidden,
                Location = new Point(0, 0),
                MinimumSize = new Size(10, 30),
                Padding = new Padding(0, 0, 0, 0),
                Renderer = new CustomToolStripProfessionalRenderer(),
                TabIndex = 0,
                ShowItemToolTips = false
            };

            tsMain.MouseLeave += TsMain_MouseLeave;

            tsMain.SuspendLayout();

            // https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
            using (Graphics g = menuForm.CreateGraphics())
            {
                double scale = Math.Max(g.DpiX, g.DpiY) / 96.0;
                double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
                if (newScale > 1)
                {
                    int newWidth = (int)(tsMain.ImageScalingSize.Width * newScale);
                    int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
                    tsMain.ImageScalingSize = new Size(newWidth, newHeight);
                }
            }

            menuForm.Controls.Add(tsMain);

            tslDragLeft = new ToolStripLabel()
            {
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image = Resources.ui_radio_button_uncheck,
                Margin = new Padding(2, 0, 2, 0),
                Padding = new Padding(2)
            };

            tsMain.Items.Add(tslDragLeft);

            if (form.Mode == RegionCaptureMode.Editor)
            {
                #region Editor mode

                ToolStripButton tsbCompleteEdit = new ToolStripButton("Run after capture tasks");
                tsbCompleteEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCompleteEdit.Image = Resources.tick;
                tsbCompleteEdit.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateRunAfterCaptureTasks);
                tsMain.Items.Add(tsbCompleteEdit);

                ToolStripButton tsbSaveImage = new ToolStripButton("Save image");
                tsbSaveImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImage.Enabled = !string.IsNullOrEmpty(form.ImageFilePath);
                tsbSaveImage.Image = Resources.disk_black;
                tsbSaveImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateSaveImage);
                tsMain.Items.Add(tsbSaveImage);

                ToolStripButton tsbSaveImageAs = new ToolStripButton("Save image as...");
                tsbSaveImageAs.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImageAs.Image = Resources.disks_black;
                tsbSaveImageAs.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateSaveImageAs);
                tsMain.Items.Add(tsbSaveImageAs);

                ToolStripButton tsbCopyImage = new ToolStripButton("Copy image to clipboard");
                tsbCopyImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCopyImage.Image = Resources.clipboard;
                tsbCopyImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateCopyImage);
                tsMain.Items.Add(tsbCopyImage);

                ToolStripButton tsbUploadImage = new ToolStripButton("Upload image");
                tsbUploadImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbUploadImage.Image = Resources.drive_globe;
                tsbUploadImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateUploadImage);
                tsMain.Items.Add(tsbUploadImage);

                ToolStripButton tsbPrintImage = new ToolStripButton("Print image...");
                tsbPrintImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbPrintImage.Image = Resources.printer;
                tsbPrintImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotatePrintImage);
                tsMain.Items.Add(tsbPrintImage);

                tsMain.Items.Add(new ToolStripSeparator());

                #endregion Editor mode
            }

            #region Tools

            foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
            {
                if (form.Mode == RegionCaptureMode.Editor)
                {
                    if (IsShapeTypeRegion(shapeType))
                    {
                        continue;
                    }
                }
                else if (shapeType == ShapeType.DrawingRectangle)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }

                ToolStripButton tsbShapeType = new ToolStripButton(shapeType.GetLocalizedDescription());
                tsbShapeType.DisplayStyle = ToolStripItemDisplayStyle.Image;

                Image img = null;

                switch (shapeType)
                {
                    case ShapeType.RegionRectangle:
                        img = Resources.layer_shape_region;
                        break;
                    case ShapeType.RegionEllipse:
                        img = Resources.layer_shape_ellipse_region;
                        break;
                    case ShapeType.RegionFreehand:
                        img = Resources.layer_shape_polygon;
                        break;
                    case ShapeType.DrawingRectangle:
                        img = Resources.layer_shape;
                        break;
                    case ShapeType.DrawingEllipse:
                        img = Resources.layer_shape_ellipse;
                        break;
                    case ShapeType.DrawingFreehand:
                        img = Resources.layer_shape_curve;
                        break;
                    case ShapeType.DrawingLine:
                        img = Resources.layer_shape_line;
                        break;
                    case ShapeType.DrawingArrow:
                        img = Resources.layer_shape_arrow;
                        break;
                    case ShapeType.DrawingText:
                        img = Resources.layer_shape_text;
                        break;
                    case ShapeType.DrawingSpeechBalloon:
                        img = Resources.balloon_box_left;
                        break;
                    case ShapeType.DrawingStep:
                        img = Resources.counter_reset;
                        break;
                    case ShapeType.DrawingImage:
                        img = Resources.image;
                        break;
                    case ShapeType.EffectBlur:
                        img = Resources.layer_shade;
                        break;
                    case ShapeType.EffectPixelate:
                        img = Resources.grid;
                        break;
                    case ShapeType.EffectHighlight:
                        img = Resources.highlighter_text;
                        break;
                }

                tsbShapeType.Image = img;
                tsbShapeType.Checked = shapeType == CurrentShapeType;
                tsbShapeType.Tag = shapeType;

                tsbShapeType.MouseDown += (sender, e) =>
                {
                    tsbShapeType.RadioCheck();
                    CurrentShapeType = shapeType;
                };

                tsMain.Items.Add(tsbShapeType);
            }

            #endregion Tools

            #region Shape options

            tsMain.Items.Add(new ToolStripSeparator());

            tsbBorderColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Border_color___);
            tsbBorderColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbBorderColor.Click += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color borderColor;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    borderColor = AnnotationOptions.TextBorderColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    borderColor = AnnotationOptions.StepBorderColor;
                }
                else
                {
                    borderColor = AnnotationOptions.BorderColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(borderColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextBorderColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepBorderColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.BorderColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbBorderColor);

            tsbFillColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Fill_color___);
            tsbFillColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbFillColor.Click += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color fillColor;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    fillColor = AnnotationOptions.TextFillColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    fillColor = AnnotationOptions.StepFillColor;
                }
                else
                {
                    fillColor = AnnotationOptions.FillColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(fillColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextFillColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepFillColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.FillColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbFillColor);

            tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
            tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbHighlightColor.Click += (sender, e) =>
            {
                PauseForm();

                using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        AnnotationOptions.HighlightColor = dialogColor.NewColor;
                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbHighlightColor);

            tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
            tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbShapeOptions.Image = Resources.layer__pencil;
            tsMain.Items.Add(tsddbShapeOptions);

            tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
            tslnudBorderSize.Content.Minimum = 0;
            tslnudBorderSize.Content.Maximum = 20;
            tslnudBorderSize.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                int borderSize = (int)tslnudBorderSize.Content.Value;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    AnnotationOptions.TextBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    AnnotationOptions.StepBorderSize = borderSize;
                }
                else
                {
                    AnnotationOptions.BorderSize = borderSize;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);

            tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
            tslnudCornerRadius.Content.Minimum = 0;
            tslnudCornerRadius.Content.Maximum = 150;
            tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                if (shapeType == ShapeType.RegionRectangle)
                {
                    AnnotationOptions.RegionCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }
                else if (shapeType == ShapeType.DrawingRectangle || shapeType == ShapeType.DrawingText)
                {
                    AnnotationOptions.DrawingCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudCornerRadius);

            tslnudBlurRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Blur_radius_);
            tslnudBlurRadius.Content.Minimum = 3;
            tslnudBlurRadius.Content.Maximum = 199;
            tslnudBlurRadius.Content.Increment = 2;
            tslnudBlurRadius.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.BlurRadius = (int)tslnudBlurRadius.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBlurRadius);

            tslnudPixelateSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Pixel_size_);
            tslnudPixelateSize.Content.Minimum = 2;
            tslnudPixelateSize.Content.Maximum = 10000;
            tslnudPixelateSize.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.PixelateSize = (int)tslnudPixelateSize.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);

            tsmiShadow = new ToolStripMenuItem("Drop shadow");
            tsmiShadow.Checked = true;
            tsmiShadow.CheckOnClick = true;
            tsmiShadow.Click += (sender, e) =>
            {
                AnnotationOptions.Shadow = tsmiShadow.Checked;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiShadow);

            // In dropdown menu if only last item is visible then menu opens at 0, 0 position on first open, so need to add dummy item to solve this weird bug...
            tsddbShapeOptions.DropDownItems.Add(new ToolStripSeparator() { Visible = false });

            #endregion Shape options

            #region Edit

            ToolStripDropDownButton tsddbEdit = new ToolStripDropDownButton("Edit");
            tsddbEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbEdit.Image = Resources.wrench_screwdriver;
            tsMain.Items.Add(tsddbEdit);

            tsmiUndo = new ToolStripMenuItem("Undo");
            tsmiUndo.Image = Resources.arrow_circle_225_left;
            tsmiUndo.ShortcutKeyDisplayString = "Ctrl+Z";
            tsmiUndo.MouseDown += (sender, e) => UndoShape();
            tsddbEdit.DropDownItems.Add(tsmiUndo);

            tsddbEdit.DropDownItems.Add(new ToolStripSeparator());

            tsmiDelete = new ToolStripMenuItem("Delete");
            tsmiDelete.Image = Resources.layer__minus;
            tsmiDelete.ShortcutKeyDisplayString = "Del";
            tsmiDelete.MouseDown += (sender, e) => DeleteCurrentShape();
            tsddbEdit.DropDownItems.Add(tsmiDelete);

            tsmiDeleteAll = new ToolStripMenuItem("Delete all");
            tsmiDeleteAll.Image = Resources.eraser;
            tsmiDeleteAll.ShortcutKeyDisplayString = "Shift+Del";
            tsmiDeleteAll.MouseDown += (sender, e) => DeleteAllShapes();
            tsddbEdit.DropDownItems.Add(tsmiDeleteAll);

            tsddbEdit.DropDownItems.Add(new ToolStripSeparator());

            tsmiMoveTop = new ToolStripMenuItem("Bring to front");
            tsmiMoveTop.Image = Resources.layers_stack_arrange;
            tsmiMoveTop.ShortcutKeyDisplayString = "Home";
            tsmiMoveTop.MouseDown += (sender, e) => MoveCurrentShapeTop();
            tsddbEdit.DropDownItems.Add(tsmiMoveTop);

            tsmiMoveUp = new ToolStripMenuItem("Bring forward");
            tsmiMoveUp.Image = Resources.layers_arrange;
            tsmiMoveUp.ShortcutKeyDisplayString = "Page up";
            tsmiMoveUp.MouseDown += (sender, e) => MoveCurrentShapeUp();
            tsddbEdit.DropDownItems.Add(tsmiMoveUp);

            tsmiMoveDown = new ToolStripMenuItem("Send backward");
            tsmiMoveDown.Image = Resources.layers_arrange_back;
            tsmiMoveDown.ShortcutKeyDisplayString = "Page down";
            tsmiMoveDown.MouseDown += (sender, e) => MoveCurrentShapeDown();
            tsddbEdit.DropDownItems.Add(tsmiMoveDown);

            tsmiMoveBottom = new ToolStripMenuItem("Send to back");
            tsmiMoveBottom.Image = Resources.layers_stack_arrange_back;
            tsmiMoveBottom.ShortcutKeyDisplayString = "End";
            tsmiMoveBottom.MouseDown += (sender, e) => MoveCurrentShapeBottom();
            tsddbEdit.DropDownItems.Add(tsmiMoveBottom);

            #endregion Edit

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                #region Capture

                ToolStripDropDownButton tsddbCapture = new ToolStripDropDownButton("Capture");
                tsddbCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbCapture.Image = Resources.camera;
                tsMain.Items.Add(tsddbCapture);

                tsmiRegionCapture = new ToolStripMenuItem("Capture regions");
                tsmiRegionCapture.Image = Resources.layer;
                tsmiRegionCapture.ShortcutKeyDisplayString = "Enter";
                tsmiRegionCapture.MouseDown += (sender, e) =>
                {
                    form.UpdateRegionPath();
                    form.Close(RegionResult.Region);
                };
                tsddbCapture.DropDownItems.Add(tsmiRegionCapture);

                if (RegionCaptureForm.LastRegionFillPath != null)
                {
                    ToolStripMenuItem tsmiLastRegionCapture = new ToolStripMenuItem("Capture last region");
                    tsmiLastRegionCapture.Image = Resources.layers;
                    tsmiLastRegionCapture.MouseDown += (sender, e) => form.Close(RegionResult.LastRegion);
                    tsddbCapture.DropDownItems.Add(tsmiLastRegionCapture);
                }

                ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
                tsmiFullscreenCapture.Image = Resources.layer_fullscreen;
                tsmiFullscreenCapture.ShortcutKeyDisplayString = "Space";
                tsmiFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
                tsddbCapture.DropDownItems.Add(tsmiFullscreenCapture);

                ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
                tsmiActiveMonitorCapture.Image = Resources.monitor;
                tsmiActiveMonitorCapture.ShortcutKeyDisplayString = "~";
                tsmiActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
                tsddbCapture.DropDownItems.Add(tsmiActiveMonitorCapture);

                ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
                tsmiMonitorCapture.HideImageMargin();
                tsmiMonitorCapture.Image = Resources.monitor_window;
                tsddbCapture.DropDownItems.Add(tsmiMonitorCapture);

                Screen[] screens = Screen.AllScreens;

                for (int i = 0; i < screens.Length; i++)
                {
                    Screen screen = screens[i];
                    ToolStripMenuItem tsmi = new ToolStripMenuItem($"{screen.Bounds.Width}x{screen.Bounds.Height}");
                    tsmi.ShortcutKeyDisplayString = (i + 1).ToString();
                    int index = i;
                    tsmi.MouseDown += (sender, e) =>
                    {
                        form.MonitorIndex = index;
                        form.Close(RegionResult.Monitor);
                    };
                    tsmiMonitorCapture.DropDownItems.Add(tsmi);
                }

                #endregion Capture

                #region Options

                ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
                tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbOptions.Image = Resources.gear;
                tsMain.Items.Add(tsddbOptions);

                tsmiQuickCrop = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
                tsmiQuickCrop.Checked = !Config.QuickCrop;
                tsmiQuickCrop.CheckOnClick = true;
                tsmiQuickCrop.ShortcutKeyDisplayString = "Q";
                tsmiQuickCrop.Click += (sender, e) => Config.QuickCrop = !tsmiQuickCrop.Checked;
                tsddbOptions.DropDownItems.Add(tsmiQuickCrop);

                tsmiTips = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_tips);
                tsmiTips.Checked = Config.ShowHotkeys;
                tsmiTips.CheckOnClick = true;
                tsmiTips.ShortcutKeyDisplayString = "F1";
                tsmiTips.Click += (sender, e) => Config.ShowHotkeys = tsmiTips.Checked;
                tsddbOptions.DropDownItems.Add(tsmiTips);

                ToolStripMenuItem tsmiShowInfo = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_position_and_size_info);
                tsmiShowInfo.Checked = Config.ShowInfo;
                tsmiShowInfo.CheckOnClick = true;
                tsmiShowInfo.Click += (sender, e) => Config.ShowInfo = tsmiShowInfo.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowInfo);

                ToolStripMenuItem tsmiShowMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_magnifier);
                tsmiShowMagnifier.Checked = Config.ShowMagnifier;
                tsmiShowMagnifier.CheckOnClick = true;
                tsmiShowMagnifier.Click += (sender, e) => Config.ShowMagnifier = tsmiShowMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowMagnifier);

                ToolStripMenuItem tsmiUseSquareMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Square_shape_magnifier);
                tsmiUseSquareMagnifier.Checked = Config.UseSquareMagnifier;
                tsmiUseSquareMagnifier.CheckOnClick = true;
                tsmiUseSquareMagnifier.Click += (sender, e) => Config.UseSquareMagnifier = tsmiUseSquareMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiUseSquareMagnifier);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelCount = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_count_);
                tslnudMagnifierPixelCount.Content.Minimum = RegionCaptureOptions.MagnifierPixelCountMinimum;
                tslnudMagnifierPixelCount.Content.Maximum = RegionCaptureOptions.MagnifierPixelCountMaximum;
                tslnudMagnifierPixelCount.Content.Increment = 2;
                tslnudMagnifierPixelCount.Content.Value = Config.MagnifierPixelCount;
                tslnudMagnifierPixelCount.Content.ValueChanged = (sender, e) => Config.MagnifierPixelCount = (int)tslnudMagnifierPixelCount.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelCount);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_size_);
                tslnudMagnifierPixelSize.Content.Minimum = RegionCaptureOptions.MagnifierPixelSizeMinimum;
                tslnudMagnifierPixelSize.Content.Maximum = RegionCaptureOptions.MagnifierPixelSizeMaximum;
                tslnudMagnifierPixelSize.Content.Value = Config.MagnifierPixelSize;
                tslnudMagnifierPixelSize.Content.ValueChanged = (sender, e) => Config.MagnifierPixelSize = (int)tslnudMagnifierPixelSize.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelSize);

                ToolStripMenuItem tsmiShowCrosshair = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_screen_wide_crosshair);
                tsmiShowCrosshair.Checked = Config.ShowCrosshair;
                tsmiShowCrosshair.CheckOnClick = true;
                tsmiShowCrosshair.Click += (sender, e) => Config.ShowCrosshair = tsmiShowCrosshair.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowCrosshair);

                ToolStripMenuItem tsmiFixedSize = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fixed_size_region_mode);
                tsmiFixedSize.Checked = Config.IsFixedSize;
                tsmiFixedSize.CheckOnClick = true;
                tsmiFixedSize.Click += (sender, e) => Config.IsFixedSize = tsmiFixedSize.Checked;
                tsddbOptions.DropDownItems.Add(tsmiFixedSize);

                ToolStripDoubleLabeledNumericUpDown tslnudFixedSize = new ToolStripDoubleLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Width_,
                    Resources.ShapeManager_CreateContextMenu_Height_);
                tslnudFixedSize.Content.Minimum = 10;
                tslnudFixedSize.Content.Maximum = 10000;
                tslnudFixedSize.Content.Increment = 10;
                tslnudFixedSize.Content.Value = Config.FixedSize.Width;
                tslnudFixedSize.Content.Value2 = Config.FixedSize.Height;
                tslnudFixedSize.Content.ValueChanged = (sender, e) => Config.FixedSize = new Size((int)tslnudFixedSize.Content.Value, (int)tslnudFixedSize.Content.Value2);
                tsddbOptions.DropDownItems.Add(tslnudFixedSize);

                ToolStripMenuItem tsmiShowFPS = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_FPS);
                tsmiShowFPS.Checked = Config.ShowFPS;
                tsmiShowFPS.CheckOnClick = true;
                tsmiShowFPS.Click += (sender, e) => Config.ShowFPS = tsmiShowFPS.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowFPS);

                ToolStripMenuItem tsmiRememberMenuState = new ToolStripMenuItem("Remember menu state");
                tsmiRememberMenuState.Checked = Config.RememberMenuState;
                tsmiRememberMenuState.CheckOnClick = true;
                tsmiRememberMenuState.Click += (sender, e) => Config.RememberMenuState = tsmiRememberMenuState.Checked;
                tsddbOptions.DropDownItems.Add(tsmiRememberMenuState);

                #endregion Options
            }

            ToolStripLabel tslDragRight = new ToolStripLabel()
            {
                Alignment = ToolStripItemAlignment.Right,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image = Resources.ui_radio_button_uncheck,
                Margin = new Padding(0, 0, 2, 0),
                Padding = new Padding(2)
            };

            tsMain.Items.Add(tslDragRight);

            tslDragLeft.MouseDown += TslDrag_MouseDown;
            tslDragRight.MouseDown += TslDrag_MouseDown;
            tslDragLeft.MouseEnter += TslDrag_MouseEnter;
            tslDragRight.MouseEnter += TslDrag_MouseEnter;
            tslDragLeft.MouseLeave += TslDrag_MouseLeave;
            tslDragRight.MouseLeave += TslDrag_MouseLeave;

            tsMain.ResumeLayout(false);
            tsMain.PerformLayout();
            menuForm.ResumeLayout(false);

            menuForm.Show(form);

            foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>())
            {
                if (!string.IsNullOrEmpty(tsi.Text))
                {
                    tsi.MouseEnter += (sender, e) =>
                    {
                        Point pos = CaptureHelpers.ScreenToClient(menuForm.PointToScreen(tsi.Bounds.Location));
                        pos.Y += tsi.Height + 8;
                        MenuTextAnimation.Position = pos;
                        MenuTextAnimation.Start(tsi.Text);
                    };

                    tsi.MouseLeave += TsMain_MouseLeave;
                }
            }

            UpdateMenu();

            CurrentShapeChanged += shape => UpdateMenu();
            CurrentShapeTypeChanged += shapeType => UpdateMenu();
            ShapeCreated += shape => UpdateMenu();

            ConfigureMenuState();

            form.Activate();
        }
Esempio n. 28
0
        /// <summary>
        /// Adds this MenuInfo object to m_menus field and creates a ToolStrip for it</summary>
        /// <param name="info">MenuInfo object to add</param>
        sealed protected override void RegisterMenuInfo(MenuInfo info)
        {
            base.RegisterMenuInfo(info);

            // If it wasn't already done, create a WinForms ToolStrip for this MenuInfo
            ToolStrip toolStrip;
            if (m_menuToolStrips.TryGetValue(info, out toolStrip) == false)
            {
                toolStrip = new ToolStripEx();
                toolStrip.MouseHover += ToolStripOnMouseHover;
                m_menuToolStrips.Add(info, toolStrip);
            }

            // build toolbar corresponding to menu
            {
                string str = info.MenuText.Replace("&", "");
                str = str.Replace(";", "");
                toolStrip.Name = str + "_toolbar";
                toolStrip.AllowItemReorder = true; // magic, to enable customization with Alt key
            }

            // build menu
            ToolStripMenuItem menuItem = new ToolStripMenuItem(info.MenuText);
            menuItem.Visible = false;
            menuItem.Name = info.MenuText + "_menu";
            menuItem.Tag = info.MenuTag;
            m_menuToolStripItems.Add(info, menuItem);
            
            // Associate the registered MenuInfo with this CommandService.  Only can be registered once.
            info.CommandService = this;
        }
Esempio n. 29
0
 private void InitializeComponent()
 {
     this.tsActions            = new PluginCore.Controls.ToolStripEx();
     this.tsbRemoveSelected    = new System.Windows.Forms.ToolStripButton();
     this.tsbRemoveFiltered    = new System.Windows.Forms.ToolStripButton();
     this.tsbAlternateFiltered = new System.Windows.Forms.ToolStripButton();
     this.tsSeparator          = new System.Windows.Forms.ToolStripSeparator();
     this.tsbExportFiltered    = new System.Windows.Forms.ToolStripButton();
     this.tsbImport            = new System.Windows.Forms.ToolStripButton();
     this.tstxtFilter          = new System.Windows.Forms.ToolStripTextBox();
     this.tscbFilterColumns    = new System.Windows.Forms.ToolStripComboBoxEx();
     this.tsActions.SuspendLayout();
     this.SuspendLayout();
     //
     // tsActions
     //
     this.tsActions.GripStyle        = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.tsActions.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
     this.tsActions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsbRemoveSelected,
         this.tsbRemoveFiltered,
         this.tsbAlternateFiltered,
         this.tsSeparator,
         this.tsbExportFiltered,
         this.tsbImport,
         this.tstxtFilter,
         this.tscbFilterColumns
     });
     this.tsActions.Location = new System.Drawing.Point(1, 0);
     this.tsActions.Name     = "tsActions";
     this.tsActions.Size     = new System.Drawing.Size(148, 27);
     this.tsActions.TabIndex = 0;
     this.tsActions.Text     = "toolStrip1";
     //
     // tsbRemoveSelected
     //
     this.tsbRemoveSelected.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbRemoveSelected.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbRemoveSelected.Name   = "tsbRemoveSelected";
     this.tsbRemoveSelected.Size   = new System.Drawing.Size(23, 24);
     this.tsbRemoveSelected.Text   = "toolStripButton1";
     this.tsbRemoveSelected.Click += new System.EventHandler(this.TsbRemoveSelected_Click);
     //
     // tsbRemoveFiltered
     //
     this.tsbRemoveFiltered.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbRemoveFiltered.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbRemoveFiltered.Name   = "tsbRemoveFiltered";
     this.tsbRemoveFiltered.Size   = new System.Drawing.Size(23, 24);
     this.tsbRemoveFiltered.Text   = "toolStripButton2";
     this.tsbRemoveFiltered.Click += new System.EventHandler(this.TsbRemoveFiltered_Click);
     //
     // tsbAlternateFiltered
     //
     this.tsbAlternateFiltered.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbAlternateFiltered.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbAlternateFiltered.Name   = "tsbAlternateFiltered";
     this.tsbAlternateFiltered.Size   = new System.Drawing.Size(23, 24);
     this.tsbAlternateFiltered.Text   = "toolStripButton3";
     this.tsbAlternateFiltered.Click += new System.EventHandler(this.TsbAlternateFiltered_Click);
     //
     // tsSeparator
     //
     this.tsSeparator.Name = "tsSeparator";
     this.tsSeparator.Size = new System.Drawing.Size(6, 27);
     //
     // tsbExportFiltered
     //
     this.tsbExportFiltered.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbExportFiltered.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbExportFiltered.Name   = "tsbExportFiltered";
     this.tsbExportFiltered.Size   = new System.Drawing.Size(23, 24);
     this.tsbExportFiltered.Text   = "toolStripButton4";
     this.tsbExportFiltered.Click += new System.EventHandler(this.TsbExportFiltered_Click);
     //
     // tsbImport
     //
     this.tsbImport.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbImport.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbImport.Name   = "tsbImport";
     this.tsbImport.Size   = new System.Drawing.Size(23, 24);
     this.tsbImport.Text   = "toolStripButton5";
     this.tsbImport.Click += new System.EventHandler(this.TsbImport_Click);
     //
     // tstxtFilter
     //
     this.tstxtFilter.Name     = "tstxtFilter";
     this.tstxtFilter.Size     = new System.Drawing.Size(ScaleHelper.Scale(90), 23);
     this.tstxtFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TstxtFilter_KeyDown);
     //
     // tscbFilterColumns
     //
     this.tscbFilterColumns.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.tscbFilterColumns.Name          = "tscbFilterColumns";
     this.tscbFilterColumns.Size          = new System.Drawing.Size(ScaleHelper.Scale(116), 23);
     //
     // BreakPointUI
     //
     this.Controls.Add(this.tsActions);
     this.Name = "BreakPointUI";
     this.tsActions.ResumeLayout(false);
     this.tsActions.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Esempio n. 30
0
        private void InitializeComponent()
        {
            SuspendLayout();

            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode       = AutoScaleMode.Font;
            AutoSize            = true;
            AutoSizeMode        = AutoSizeMode.GrowAndShrink;
            BackColor           = SystemColors.ActiveBorder;
            ClientSize          = new Size(284, 261);
            FormBorderStyle     = FormBorderStyle.None;
            Icon          = ShareXResources.Icon;
            ShowInTaskbar = false;
            StartPosition = FormStartPosition.Manual;
            Text          = "ShareX - Simple actions";
            TopMost       = Program.Settings.SimpleActionsFormStayTopMost;

            LocationChanged += SimpleActionsForm_LocationChanged;
            Shown           += SimpleActionsForm_Shown;

            tsMain = new ToolStripEx()
            {
                AutoSize         = true,
                CanOverflow      = false,
                ClickThrough     = true,
                Dock             = DockStyle.None,
                GripStyle        = ToolStripGripStyle.Hidden,
                Location         = new Point(1, 1),
                Margin           = new Padding(1),
                MinimumSize      = new Size(10, 30),
                Padding          = new Padding(0),
                Renderer         = new CustomToolStripProfessionalRenderer(),
                TabIndex         = 0,
                ShowItemToolTips = false
            };

            // https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
            using (Graphics g = CreateGraphics())
            {
                double scale    = Math.Max(g.DpiX, g.DpiY) / 96.0;
                double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
                if (newScale > 1)
                {
                    int newWidth  = (int)(tsMain.ImageScalingSize.Width * newScale);
                    int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
                    tsMain.ImageScalingSize = new Size(newWidth, newHeight);
                }
            }

            tsMain.MouseLeave += tsMain_MouseLeave;

            Controls.Add(tsMain);

            components = new Container();

            ttMain = new ToolTip(components)
            {
                AutoPopDelay = 15000,
                InitialDelay = 300,
                ReshowDelay  = 100,
                ShowAlways   = true
            };

            cmsTitle = new ContextMenuStrip(components);

            ToolStripMenuItem tsmiClose = new ToolStripMenuItem("Close");

            tsmiClose.Click += TsmiClose_Click;
            cmsTitle.Items.Add(tsmiClose);

            cmsTitle.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem tsmiLock = new ToolStripMenuItem("Lock position");

            tsmiLock.CheckOnClick = true;
            tsmiLock.Checked      = Program.Settings.SimpleActionsFormLockPosition;
            tsmiLock.Click       += TsmiLock_Click;
            cmsTitle.Items.Add(tsmiLock);

            ToolStripMenuItem tsmiTopMost = new ToolStripMenuItem("Stay top most");

            tsmiTopMost.CheckOnClick = true;
            tsmiTopMost.Checked      = Program.Settings.SimpleActionsFormStayTopMost;
            tsmiTopMost.Click       += TsmiTopMost_Click;
            cmsTitle.Items.Add(tsmiTopMost);

            ToolStripMenuItem tsmiRunAtStartup = new ToolStripMenuItem("Open at ShareX startup");

            tsmiRunAtStartup.CheckOnClick = true;
            tsmiRunAtStartup.Checked      = Program.Settings.SimpleActionsFormRunAtStartup;
            tsmiRunAtStartup.Click       += TsmiRunAtStartup_Click;
            cmsTitle.Items.Add(tsmiRunAtStartup);

            cmsTitle.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem tsmiEdit = new ToolStripMenuItem("Edit...");

            tsmiEdit.Click += TsmiEdit_Click;
            cmsTitle.Items.Add(tsmiEdit);

            UpdateToolbar(Program.Settings.SimpleActionsList);

            ResumeLayout(false);
            PerformLayout();

            UpdatePosition();
        }
Esempio n. 31
0
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
			this.ssMainStatus = new System.Windows.Forms.StatusStrip();
			this.tsLblStatus = new System.Windows.Forms.ToolStripStatusLabel();
			this.tsLblSeparator1 = new System.Windows.Forms.ToolStripStatusLabel();
			this.tsLblChipVersion = new System.Windows.Forms.ToolStripStatusLabel();
			this.tsLblSeparator2 = new System.Windows.Forms.ToolStripStatusLabel();
			this.tsLblConfigFileName = new System.Windows.Forms.ToolStripStatusLabel();
			this.msMainMenu = new SemtechLib.Controls.MenuStripEx();
			this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.mFileSeparator1 = new System.Windows.Forms.ToolStripSeparator();
			this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.mFileSeparator2 = new System.Windows.Forms.ToolStripSeparator();
			this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.actionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.resetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.showRegistersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.monitorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.monitorOffToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.monitorOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.rssiAnalyserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.spectrumAnalyserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.showHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.mHelpSeparator1 = new System.Windows.Forms.ToolStripSeparator();
			this.usersGuideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.mHelpSeparator2 = new System.Windows.Forms.ToolStripSeparator();
			this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.tsMainToolbar = new SemtechLib.Controls.ToolStripEx();
			this.tsBtnOpenFile = new System.Windows.Forms.ToolStripButton();
			this.tsBtnSaveFile = new System.Windows.Forms.ToolStripButton();
			this.tbFileSeparator1 = new System.Windows.Forms.ToolStripSeparator();
			this.tsBtnOpenDevice = new System.Windows.Forms.ToolStripButton();
			this.tsBtnRefresh = new System.Windows.Forms.ToolStripButton();
			this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
			this.ofConfigFileOpenDlg = new System.Windows.Forms.OpenFileDialog();
			this.sfConfigFileSaveDlg = new System.Windows.Forms.SaveFileDialog();
			this.tipMainForm = new System.Windows.Forms.ToolTip(this.components);
			this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
			this.tsHelpToolbar = new SemtechLib.Controls.ToolStripEx();
			this.tsBtnShowHelp = new System.Windows.Forms.ToolStripButton();
			this.tsActionToolbar = new SemtechLib.Controls.ToolStripEx();
			this.tsBtnReset = new System.Windows.Forms.ToolStripButton();
			this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
			this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
			this.tsBtnShowRegisters = new System.Windows.Forms.ToolStripButton();
			this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
			this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
			this.tsBtnMonitorOn = new System.Windows.Forms.ToolStripButton();
			this.tsBtnMonitorOff = new System.Windows.Forms.ToolStripButton();
			this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
			this.sx1231ViewControl = new SemtechLib.Devices.SX1231.Controls.DeviceViewControl();
			this.ssMainStatus.SuspendLayout();
			this.msMainMenu.SuspendLayout();
			this.tsMainToolbar.SuspendLayout();
			this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();
			this.toolStripContainer1.ContentPanel.SuspendLayout();
			this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
			this.toolStripContainer1.SuspendLayout();
			this.tsHelpToolbar.SuspendLayout();
			this.tsActionToolbar.SuspendLayout();
			this.SuspendLayout();
			// 
			// ssMainStatus
			// 
			this.ssMainStatus.Dock = System.Windows.Forms.DockStyle.None;
			this.ssMainStatus.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsLblStatus,
            this.tsLblSeparator1,
            this.tsLblChipVersion,
            this.tsLblSeparator2,
            this.tsLblConfigFileName});
			this.ssMainStatus.Location = new System.Drawing.Point(0, 0);
			this.ssMainStatus.Name = "ssMainStatus";
			this.ssMainStatus.ShowItemToolTips = true;
			this.ssMainStatus.Size = new System.Drawing.Size(1008, 22);
			this.ssMainStatus.SizingGrip = false;
			this.ssMainStatus.TabIndex = 3;
			this.ssMainStatus.Text = "statusStrip1";
			// 
			// tsLblStatus
			// 
			this.tsLblStatus.Name = "tsLblStatus";
			this.tsLblStatus.Size = new System.Drawing.Size(433, 17);
			this.tsLblStatus.Spring = true;
			this.tsLblStatus.Text = "-";
			this.tsLblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.tsLblStatus.ToolTipText = "Shows EVK messages.";
			// 
			// tsLblSeparator1
			// 
			this.tsLblSeparator1.Name = "tsLblSeparator1";
			this.tsLblSeparator1.Size = new System.Drawing.Size(11, 17);
			this.tsLblSeparator1.Text = "|";
			// 
			// tsLblChipVersion
			// 
			this.tsLblChipVersion.Name = "tsLblChipVersion";
			this.tsLblChipVersion.Size = new System.Drawing.Size(105, 17);
			this.tsLblChipVersion.Text = "Chip version: --.-";
			// 
			// tsLblSeparator2
			// 
			this.tsLblSeparator2.Name = "tsLblSeparator2";
			this.tsLblSeparator2.Size = new System.Drawing.Size(11, 17);
			this.tsLblSeparator2.Text = "|";
			// 
			// tsLblConfigFileName
			// 
			this.tsLblConfigFileName.AutoToolTip = true;
			this.tsLblConfigFileName.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			this.tsLblConfigFileName.Name = "tsLblConfigFileName";
			this.tsLblConfigFileName.Size = new System.Drawing.Size(433, 17);
			this.tsLblConfigFileName.Spring = true;
			this.tsLblConfigFileName.Text = "Config File:";
			this.tsLblConfigFileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.tsLblConfigFileName.ToolTipText = "Shows the active Config file when File-> Open/Save is used";
			// 
			// msMainMenu
			// 
			this.msMainMenu.ClickThrough = true;
			this.msMainMenu.Dock = System.Windows.Forms.DockStyle.None;
			this.msMainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem,
            this.actionToolStripMenuItem,
            this.toolsToolStripMenuItem,
            this.helpToolStripMenuItem});
			this.msMainMenu.Location = new System.Drawing.Point(0, 25);
			this.msMainMenu.Name = "msMainMenu";
			this.msMainMenu.Size = new System.Drawing.Size(1008, 25);
			this.msMainMenu.SuppressHighlighting = false;
			this.msMainMenu.TabIndex = 0;
			this.msMainMenu.Text = "File";
			// 
			// actionToolStripMenuItem
			// 
			this.actionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.resetToolStripMenuItem,
            this.refreshToolStripMenuItem,
            this.showRegistersToolStripMenuItem,
            this.monitorToolStripMenuItem});
			this.actionToolStripMenuItem.Name = "actionToolStripMenuItem";
			this.actionToolStripMenuItem.Size = new System.Drawing.Size(56, 21);
			this.actionToolStripMenuItem.Text = "&Action";
			// 
			// fileToolStripMenuItem
			// 
			this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.connectToolStripMenuItem,
            this.mFileSeparator1,
            this.loadToolStripMenuItem,
            this.saveToolStripMenuItem,
            this.saveAsToolStripMenuItem,
            this.mFileSeparator2,
            this.exitToolStripMenuItem});
			this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
			this.fileToolStripMenuItem.Size = new System.Drawing.Size(39, 21);
			this.fileToolStripMenuItem.Text = "&File";
			// 
			// connectToolStripMenuItem
			// 
			this.connectToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("connectToolStripMenuItem.Image")));
			this.connectToolStripMenuItem.Name = "connectToolStripMenuItem";
			this.connectToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
			this.connectToolStripMenuItem.Text = "&Connect";
			this.connectToolStripMenuItem.Click += new System.EventHandler(this.tsBtnOpenDevice_Click);
			// 
			// mFileSeparator1
			// 
			this.mFileSeparator1.Name = "mFileSeparator1";
			this.mFileSeparator1.Size = new System.Drawing.Size(169, 6);
			// 
			// loadToolStripMenuItem
			// 
			this.loadToolStripMenuItem.Enabled = false;
			this.loadToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("loadToolStripMenuItem.Image")));
			this.loadToolStripMenuItem.Name = "loadToolStripMenuItem";
			this.loadToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
			this.loadToolStripMenuItem.Text = "&Open Config...";
			this.loadToolStripMenuItem.Click += new System.EventHandler(this.loadToolStripMenuItem_Click);
			// 
			// saveToolStripMenuItem
			// 
			this.saveToolStripMenuItem.Enabled = false;
			this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
			this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
			this.saveToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
			this.saveToolStripMenuItem.Text = "&Save Config";
			this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
			// 
			// saveAsToolStripMenuItem
			// 
			this.saveAsToolStripMenuItem.Enabled = false;
			this.saveAsToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveAsToolStripMenuItem.Image")));
			this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
			this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
			this.saveAsToolStripMenuItem.Text = "Save Config &As...";
			this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
			// 
			// mFileSeparator2
			// 
			this.mFileSeparator2.Name = "mFileSeparator2";
			this.mFileSeparator2.Size = new System.Drawing.Size(169, 6);
			// 
			// exitToolStripMenuItem
			// 
			this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
			this.exitToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
			this.exitToolStripMenuItem.Text = "&Exit";
			this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
			// 
			// resetToolStripMenuItem
			// 
			this.resetToolStripMenuItem.Enabled = false;
			this.resetToolStripMenuItem.Name = "resetToolStripMenuItem";
			this.resetToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
			this.resetToolStripMenuItem.Text = "R&eset";
			this.resetToolStripMenuItem.Click += new System.EventHandler(this.resetToolStripMenuItem_Click);
			// 
			// refreshToolStripMenuItem
			// 
			this.refreshToolStripMenuItem.Enabled = false;
			this.refreshToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("refreshToolStripMenuItem.Image")));
			this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
			this.refreshToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
			this.refreshToolStripMenuItem.Text = "&Refresh";
			this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
			// 
			// showRegistersToolStripMenuItem
			// 
			this.showRegistersToolStripMenuItem.Enabled = false;
			this.showRegistersToolStripMenuItem.Name = "showRegistersToolStripMenuItem";
			this.showRegistersToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
			this.showRegistersToolStripMenuItem.Text = "&Show registers";
			this.showRegistersToolStripMenuItem.Click += new System.EventHandler(this.showRegistersToolStripMenuItem_Click);
			// 
			// monitorToolStripMenuItem
			// 
			this.monitorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.monitorOffToolStripMenuItem,
            this.monitorOnToolStripMenuItem});
			this.monitorToolStripMenuItem.Enabled = false;
			this.monitorToolStripMenuItem.Name = "monitorToolStripMenuItem";
			this.monitorToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
			this.monitorToolStripMenuItem.Text = "&Monitor";
			// 
			// monitorOffToolStripMenuItem
			// 
			this.monitorOffToolStripMenuItem.Name = "monitorOffToolStripMenuItem";
			this.monitorOffToolStripMenuItem.Size = new System.Drawing.Size(98, 22);
			this.monitorOffToolStripMenuItem.Text = "OFF";
			this.monitorOffToolStripMenuItem.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
			// 
			// monitorOnToolStripMenuItem
			// 
			this.monitorOnToolStripMenuItem.Checked = true;
			this.monitorOnToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
			this.monitorOnToolStripMenuItem.Name = "monitorOnToolStripMenuItem";
			this.monitorOnToolStripMenuItem.Size = new System.Drawing.Size(98, 22);
			this.monitorOnToolStripMenuItem.Text = "&ON";
			this.monitorOnToolStripMenuItem.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
			// 
			// toolsToolStripMenuItem
			// 
			this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.rssiAnalyserToolStripMenuItem,
            this.spectrumAnalyserToolStripMenuItem});
			this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
			this.toolsToolStripMenuItem.Size = new System.Drawing.Size(52, 21);
			this.toolsToolStripMenuItem.Text = "Tools";
			// 
			// rssiAnalyserToolStripMenuItem
			// 
			this.rssiAnalyserToolStripMenuItem.Enabled = false;
			this.rssiAnalyserToolStripMenuItem.Name = "rssiAnalyserToolStripMenuItem";
			this.rssiAnalyserToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
			this.rssiAnalyserToolStripMenuItem.Text = "RSSI analyser";
			this.rssiAnalyserToolStripMenuItem.Click += new System.EventHandler(this.rssiAnalyserToolStripMenuItem_Click);
			// 
			// spectrumAnalyserToolStripMenuItem
			// 
			this.spectrumAnalyserToolStripMenuItem.Enabled = false;
			this.spectrumAnalyserToolStripMenuItem.Name = "spectrumAnalyserToolStripMenuItem";
			this.spectrumAnalyserToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
			this.spectrumAnalyserToolStripMenuItem.Text = "Spectrum analyser";
			this.spectrumAnalyserToolStripMenuItem.Click += new System.EventHandler(this.spectrumAnalyserToolStripMenuItem_Click);
			// 
			// helpToolStripMenuItem
			// 
			this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.showHelpToolStripMenuItem,
            this.mHelpSeparator1,
            this.usersGuideToolStripMenuItem,
            this.mHelpSeparator2,
            this.aboutToolStripMenuItem});
			this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
			this.helpToolStripMenuItem.Size = new System.Drawing.Size(47, 21);
			this.helpToolStripMenuItem.Text = "&Help";
			// 
			// showHelpToolStripMenuItem
			// 
			this.showHelpToolStripMenuItem.Enabled = false;
			this.showHelpToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("showHelpToolStripMenuItem.Image")));
			this.showHelpToolStripMenuItem.Name = "showHelpToolStripMenuItem";
			this.showHelpToolStripMenuItem.Size = new System.Drawing.Size(249, 22);
			this.showHelpToolStripMenuItem.Text = "Help";
			this.showHelpToolStripMenuItem.Click += new System.EventHandler(this.showHelpToolStripMenuItem_Click);
			// 
			// mHelpSeparator1
			// 
			this.mHelpSeparator1.Name = "mHelpSeparator1";
			this.mHelpSeparator1.Size = new System.Drawing.Size(246, 6);
			// 
			// usersGuideToolStripMenuItem
			// 
			this.usersGuideToolStripMenuItem.Name = "usersGuideToolStripMenuItem";
			this.usersGuideToolStripMenuItem.Size = new System.Drawing.Size(249, 22);
			this.usersGuideToolStripMenuItem.Text = "&User\'s Guide...";
			this.usersGuideToolStripMenuItem.Click += new System.EventHandler(this.usersGuideToolStripMenuItem_Click);
			// 
			// mHelpSeparator2
			// 
			this.mHelpSeparator2.Name = "mHelpSeparator2";
			this.mHelpSeparator2.Size = new System.Drawing.Size(246, 6);
			// 
			// aboutToolStripMenuItem
			// 
			this.aboutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("aboutToolStripMenuItem.Image")));
			this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
			this.aboutToolStripMenuItem.Size = new System.Drawing.Size(249, 22);
			this.aboutToolStripMenuItem.Text = "&About SX1231 Evaluation Kit...";
			this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
			// 
			// tsMainToolbar
			// 
			this.tsMainToolbar.ClickThrough = true;
			this.tsMainToolbar.Dock = System.Windows.Forms.DockStyle.None;
			this.tsMainToolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
			this.tsMainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsBtnOpenFile,
            this.tsBtnSaveFile,
            this.tbFileSeparator1,
            this.tsBtnOpenDevice});
			this.tsMainToolbar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
			this.tsMainToolbar.Location = new System.Drawing.Point(3, 0);
			this.tsMainToolbar.Name = "tsMainToolbar";
			this.tsMainToolbar.Size = new System.Drawing.Size(78, 25);
			this.tsMainToolbar.SuppressHighlighting = false;
			this.tsMainToolbar.TabIndex = 1;
			this.tsMainToolbar.Text = "Main";
			// 
			// tsBtnOpenFile
			// 
			this.tsBtnOpenFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			this.tsBtnOpenFile.Enabled = false;
			this.tsBtnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnOpenFile.Image")));
			this.tsBtnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnOpenFile.Name = "tsBtnOpenFile";
			this.tsBtnOpenFile.Size = new System.Drawing.Size(23, 22);
			this.tsBtnOpenFile.Text = "Open Config file";
			this.tsBtnOpenFile.Click += new System.EventHandler(this.loadToolStripMenuItem_Click);
			// 
			// tsBtnSaveFile
			// 
			this.tsBtnSaveFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			this.tsBtnSaveFile.Enabled = false;
			this.tsBtnSaveFile.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnSaveFile.Image")));
			this.tsBtnSaveFile.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnSaveFile.Name = "tsBtnSaveFile";
			this.tsBtnSaveFile.Size = new System.Drawing.Size(23, 22);
			this.tsBtnSaveFile.Text = "Save Config file";
			this.tsBtnSaveFile.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
			// 
			// tbFileSeparator1
			// 
			this.tbFileSeparator1.Name = "tbFileSeparator1";
			this.tbFileSeparator1.Size = new System.Drawing.Size(6, 25);
			// 
			// tsBtnOpenDevice
			// 
			this.tsBtnOpenDevice.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			this.tsBtnOpenDevice.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnOpenDevice.Image")));
			this.tsBtnOpenDevice.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnOpenDevice.Name = "tsBtnOpenDevice";
			this.tsBtnOpenDevice.Size = new System.Drawing.Size(23, 22);
			this.tsBtnOpenDevice.Text = "Connect";
			this.tsBtnOpenDevice.Click += new System.EventHandler(this.tsBtnOpenDevice_Click);
			// 
			// tsBtnRefresh
			// 
			this.tsBtnRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			this.tsBtnRefresh.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnRefresh.Image")));
			this.tsBtnRefresh.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnRefresh.Name = "tsBtnRefresh";
			this.tsBtnRefresh.Size = new System.Drawing.Size(23, 22);
			this.tsBtnRefresh.Text = "Refresh";
			this.tsBtnRefresh.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
			// 
			// toolStripSeparator3
			// 
			this.toolStripSeparator3.Name = "toolStripSeparator3";
			this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
			// 
			// ofConfigFileOpenDlg
			// 
			this.ofConfigFileOpenDlg.DefaultExt = "*.cfg";
			this.ofConfigFileOpenDlg.Filter = "Config Files(*.cfg)|*.cfg|AllFiles(*.*)|*.*";
			// 
			// sfConfigFileSaveDlg
			// 
			this.sfConfigFileSaveDlg.DefaultExt = "*.cfg";
			this.sfConfigFileSaveDlg.Filter = "Config Files(*.cfg)|*.cfg|AllFiles(*.*)|*.*";
			// 
			// tipMainForm
			// 
			this.tipMainForm.ShowAlways = true;
			// 
			// toolStripContainer1
			// 
			// 
			// toolStripContainer1.BottomToolStripPanel
			// 
			this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.ssMainStatus);
			// 
			// toolStripContainer1.ContentPanel
			// 
			this.toolStripContainer1.ContentPanel.AutoScroll = true;
			this.toolStripContainer1.ContentPanel.Controls.Add(this.sx1231ViewControl);
			this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(1008, 524);
			this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.toolStripContainer1.LeftToolStripPanelVisible = false;
			this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
			this.toolStripContainer1.Name = "toolStripContainer1";
			this.toolStripContainer1.RightToolStripPanelVisible = false;
			this.toolStripContainer1.Size = new System.Drawing.Size(1008, 596);
			this.toolStripContainer1.TabIndex = 4;
			this.toolStripContainer1.Text = "toolStripContainer1";
			// 
			// tsHelpToolbar
			// 
			this.tsHelpToolbar.ClickThrough = true;
			this.tsHelpToolbar.Dock = System.Windows.Forms.DockStyle.None;
			this.tsHelpToolbar.Enabled = false;
			this.tsHelpToolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
			this.tsHelpToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsBtnShowHelp});
			this.tsHelpToolbar.Location = new System.Drawing.Point(81, 0);
			this.tsHelpToolbar.Name = "tsHelpToolbar";
			this.tsHelpToolbar.Size = new System.Drawing.Size(26, 25);
			this.tsHelpToolbar.SuppressHighlighting = false;
			this.tsHelpToolbar.TabIndex = 3;
			// 
			// tsBtnShowHelp
			// 
			this.tsBtnShowHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			this.tsBtnShowHelp.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnShowHelp.Image")));
			this.tsBtnShowHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnShowHelp.Name = "tsBtnShowHelp";
			this.tsBtnShowHelp.Size = new System.Drawing.Size(23, 22);
			this.tsBtnShowHelp.Text = "Help";
			this.tsBtnShowHelp.Click += new System.EventHandler(this.showHelpToolStripMenuItem_Click);
			// 
			// tsActionToolbar
			// 
			this.tsActionToolbar.ClickThrough = true;
			this.tsActionToolbar.Dock = System.Windows.Forms.DockStyle.None;
			this.tsActionToolbar.Enabled = false;
			this.tsActionToolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
			this.tsActionToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsBtnReset,
            this.toolStripSeparator1,
            this.tsBtnRefresh,
            this.toolStripSeparator2,
            this.tsBtnShowRegisters,
            this.toolStripSeparator4,
            this.toolStripLabel2,
            this.tsBtnMonitorOn,
            this.tsBtnMonitorOff});
			this.tsActionToolbar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
			this.tsActionToolbar.Location = new System.Drawing.Point(109, 0);
			this.tsActionToolbar.Name = "tsActionToolbar";
			this.tsActionToolbar.Size = new System.Drawing.Size(245, 25);
			this.tsActionToolbar.SuppressHighlighting = false;
			this.tsActionToolbar.TabIndex = 2;
			this.tsActionToolbar.Text = "Action";
			// 
			// toolStripContainer1.TopToolStripPanel
			// 
			this.toolStripContainer1.TopToolStripPanel.MaximumSize = new System.Drawing.Size(0, 50);
			this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.msMainMenu);
			this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.tsMainToolbar);
			this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.tsHelpToolbar);
			this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.tsActionToolbar);
			// 
			// tsBtnReset
			// 
			this.tsBtnReset.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			this.tsBtnReset.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnReset.Image")));
			this.tsBtnReset.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnReset.Name = "tsBtnReset";
			this.tsBtnReset.Size = new System.Drawing.Size(44, 22);
			this.tsBtnReset.Text = "Reset";
			this.tsBtnReset.Click += new System.EventHandler(this.resetToolStripMenuItem_Click);
			// 
			// toolStripSeparator1
			// 
			this.toolStripSeparator1.Name = "toolStripSeparator1";
			this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
			// 
			// toolStripSeparator2
			// 
			this.toolStripSeparator2.Name = "toolStripSeparator2";
			this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
			// 
			// tsBtnShowRegisters
			// 
			this.tsBtnShowRegisters.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			this.tsBtnShowRegisters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
			this.tsBtnShowRegisters.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnShowRegisters.Image")));
			this.tsBtnShowRegisters.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnShowRegisters.Name = "tsBtnShowRegisters";
			this.tsBtnShowRegisters.Size = new System.Drawing.Size(33, 22);
			this.tsBtnShowRegisters.Text = "Reg";
			this.tsBtnShowRegisters.ToolTipText = "Displays SX1231 raw registers window";
			this.tsBtnShowRegisters.Click += new System.EventHandler(this.showRegistersToolStripMenuItem_Click);
			// 
			// toolStripSeparator4
			// 
			this.toolStripSeparator4.Name = "toolStripSeparator4";
			this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
			// 
			// toolStripLabel2
			// 
			this.toolStripLabel2.Name = "toolStripLabel2";
			this.toolStripLabel2.Size = new System.Drawing.Size(58, 22);
			this.toolStripLabel2.Text = "Monitor:";
			// 
			// tsBtnMonitorOn
			// 
			this.tsBtnMonitorOn.Checked = true;
			this.tsBtnMonitorOn.CheckState = System.Windows.Forms.CheckState.Checked;
			this.tsBtnMonitorOn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			this.tsBtnMonitorOn.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnMonitorOn.Image")));
			this.tsBtnMonitorOn.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnMonitorOn.Name = "tsBtnMonitorOn";
			this.tsBtnMonitorOn.Size = new System.Drawing.Size(32, 22);
			this.tsBtnMonitorOn.Text = "ON";
			this.tsBtnMonitorOn.ToolTipText = "Enables the SX1231 monitor mode";
			this.tsBtnMonitorOn.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
			// 
			// tsBtnMonitorOff
			// 
			this.tsBtnMonitorOff.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			this.tsBtnMonitorOff.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnMonitorOff.Image")));
			this.tsBtnMonitorOff.ImageTransparentColor = System.Drawing.Color.Magenta;
			this.tsBtnMonitorOff.Name = "tsBtnMonitorOff";
			this.tsBtnMonitorOff.Size = new System.Drawing.Size(34, 22);
			this.tsBtnMonitorOff.Text = "OFF";
			this.tsBtnMonitorOff.ToolTipText = "Disables the SX1231 monitor mode";
			this.tsBtnMonitorOff.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
			// 
			// toolStripLabel1
			// 
			this.toolStripLabel1.Name = "toolStripLabel1";
			this.toolStripLabel1.Size = new System.Drawing.Size(62, 22);
			this.toolStripLabel1.Text = "Product ID:";
			// 
			// sx1231ViewControl
			// 
			this.sx1231ViewControl.Dock = System.Windows.Forms.DockStyle.Fill;
			this.sx1231ViewControl.Enabled = false;
			this.sx1231ViewControl.Location = new System.Drawing.Point(0, 0);
			this.sx1231ViewControl.Name = "sx1231ViewControl";
			this.sx1231ViewControl.Size = new System.Drawing.Size(1008, 524);
			this.sx1231ViewControl.TabIndex = 0;
			this.sx1231ViewControl.DocumentationChanged += new SemtechLib.General.Interfaces.DocumentationChangedEventHandler(this.sx1231ViewControl_DocumentationChanged);
			this.sx1231ViewControl.Error += new SemtechLib.General.Events.ErrorEventHandler(this.sx1231ViewControl_Error);
			// 
			// MainForm
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(1008, 596);
			this.Controls.Add(this.toolStripContainer1);
			this.DoubleBuffered = true;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.KeyPreview = true;
			this.MainMenuStrip = this.msMainMenu;
			this.MaximizeBox = false;
			this.Name = "MainForm";
			this.Text = "SX1231 Evaluation Kit";
			this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Mainform_FormClosing);
			this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
			this.Load += new System.EventHandler(this.MainForm_Load);
			this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Mainform_KeyDown);
			this.ssMainStatus.ResumeLayout(false);
			this.ssMainStatus.PerformLayout();
			this.msMainMenu.ResumeLayout(false);
			this.msMainMenu.PerformLayout();
			this.tsMainToolbar.ResumeLayout(false);
			this.tsMainToolbar.PerformLayout();
			this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);
			this.toolStripContainer1.BottomToolStripPanel.PerformLayout();
			this.toolStripContainer1.ContentPanel.ResumeLayout(false);
			this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
			this.toolStripContainer1.TopToolStripPanel.PerformLayout();
			this.toolStripContainer1.ResumeLayout(false);
			this.toolStripContainer1.PerformLayout();
			this.tsHelpToolbar.ResumeLayout(false);
			this.tsHelpToolbar.PerformLayout();
			this.tsActionToolbar.ResumeLayout(false);
			this.tsActionToolbar.PerformLayout();
			this.ResumeLayout(false);

		}
Esempio n. 32
0
 private void InitializeComponent() {
     this.components = new Container();
     this.toolStrip = new ToolStripEx();
     this.contextMenu = new ContextMenuStripEx(this.components, true);
     this.menuCustomize = new ToolStripMenuItem(ResBBOption[9]);
     this.menuLockItem = new ToolStripMenuItem(ResBBOption[10]);
     this.menuLockToolbar = new ToolStripMenuItem(QTUtility.ResMain[0x20]);
     this.toolStrip.SuspendLayout();
     this.contextMenu.SuspendLayout();
     base.SuspendLayout();
     this.toolStrip.Dock = DockStyle.Fill;
     this.toolStrip.GripStyle = ToolStripGripStyle.Hidden;
     this.toolStrip.ImeMode = ImeMode.Disable;
     this.toolStrip.Renderer = new ToolbarRenderer();
     this.toolStrip.BackColor = System.Drawing.Color.Transparent;
     this.toolStrip.ItemClicked += new ToolStripItemClickedEventHandler(this.toolStrip_ItemClicked);
     this.toolStrip.GotFocus += new EventHandler(this.toolStrip_GotFocus);
     this.toolStrip.MouseDoubleClick += new MouseEventHandler(this.toolStrip_MouseDoubleClick);
     this.toolStrip.MouseActivated += new EventHandler(this.toolStrip_MouseActivated);
     this.toolStrip.PreviewKeyDown += new PreviewKeyDownEventHandler(this.toolStrip_PreviewKeyDown);
     this.menuLockItem.Checked = LockDropDownItems;
     this.contextMenu.Items.Add(this.menuCustomize);
     this.contextMenu.Items.Add(this.menuLockItem);
     this.contextMenu.Items.Add(this.menuLockToolbar);
     this.contextMenu.ShowImageMargin = false;
     this.contextMenu.Opening += new CancelEventHandler(this.contextMenu_Opening);
     this.contextMenu.ItemClicked += new ToolStripItemClickedEventHandler(this.contextMenu_ItemClicked);
     base.Controls.Add(this.toolStrip);
     base.Height = BarHeight;
     base.MinSize = new Size(20, BarHeight);
     this.ContextMenuStrip = this.contextMenu;
     this.toolStrip.ResumeLayout(false);
     this.contextMenu.ResumeLayout(false);
     base.ResumeLayout();
 }
Esempio n. 33
0
        private void CreateMenu()
        {
            menuForm = new Form()
            {
                AutoScaleDimensions = new SizeF(6F, 13F),
                AutoScaleMode = AutoScaleMode.Font,
                AutoSize = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                ClientSize = new Size(759, 509),
                FormBorderStyle = FormBorderStyle.None,
                Location = new Point(200, 200),
                ShowInTaskbar = false,
                StartPosition = FormStartPosition.Manual,
                Text = "RegionCaptureFormMenu"
            };

            menuForm.SuspendLayout();

            tsMain = new ToolStripEx()
            {
                AutoSize = true,
                CanOverflow = false,
                ClickThrough = true,
                Dock = DockStyle.None,
                GripStyle = ToolStripGripStyle.Hidden,
                Location = new Point(0, 0),
                MinimumSize = new Size(300, 30),
                Padding = new Padding(0, 0, 0, 0),
                Renderer = new CustomToolStripProfessionalRenderer(),
                TabIndex = 0
            };

            tsMain.SuspendLayout();

            menuForm.Controls.Add(tsMain);

            ToolStripLabel tslDragLeft = new ToolStripLabel()
            {
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image = Resources.ui_radio_button_uncheck,
                Margin = new Padding(0),
                Padding = new Padding(2)
            };

            tslDragLeft.MouseDown += (sender, e) =>
            {
                NativeMethods.ReleaseCapture();
                NativeMethods.DefWindowProc(menuForm.Handle, (uint)WindowsMessages.SYSCOMMAND, (UIntPtr)NativeConstants.MOUSE_MOVE, IntPtr.Zero);
            };

            tsMain.Items.Add(tslDragLeft);

            #region Editor mode

            if (form.Mode == RegionCaptureMode.Editor)
            {
                ToolStripButton tsbCompleteEdit = new ToolStripButton("Run after capture tasks");
                tsbCompleteEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCompleteEdit.Image = Resources.tick;
                tsbCompleteEdit.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateRunAfterCaptureTasks);
                tsMain.Items.Add(tsbCompleteEdit);

                ToolStripButton tsbSaveImage = new ToolStripButton("Save image");
                tsbSaveImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImage.Enabled = !string.IsNullOrEmpty(form.ImageFilePath);
                tsbSaveImage.Image = Resources.disk_black;
                tsbSaveImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateSaveImage);
                tsMain.Items.Add(tsbSaveImage);

                ToolStripButton tsbSaveImageAs = new ToolStripButton("Save image as...");
                tsbSaveImageAs.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImageAs.Image = Resources.disks_black;
                tsbSaveImageAs.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateSaveImageAs);
                tsMain.Items.Add(tsbSaveImageAs);

                ToolStripButton tsbCopyImage = new ToolStripButton("Copy image to clipboard");
                tsbCopyImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCopyImage.Image = Resources.clipboard;
                tsbCopyImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateCopyImage);
                tsMain.Items.Add(tsbCopyImage);

                ToolStripButton tsbUploadImage = new ToolStripButton("Upload image");
                tsbUploadImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbUploadImage.Image = Resources.drive_globe;
                tsbUploadImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotateUploadImage);
                tsMain.Items.Add(tsbUploadImage);

                ToolStripButton tsbPrintImage = new ToolStripButton("Print image...");
                tsbPrintImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbPrintImage.Image = Resources.printer;
                tsbPrintImage.MouseDown += (sender, e) => form.Close(RegionResult.AnnotatePrintImage);
                tsMain.Items.Add(tsbPrintImage);

                tsMain.Items.Add(new ToolStripSeparator());
            }

            #endregion Editor mode

            #region Tools

            foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
            {
                if (form.Mode == RegionCaptureMode.Editor)
                {
                    if (IsShapeTypeRegion(shapeType))
                    {
                        continue;
                    }
                }
                else if (shapeType == ShapeType.DrawingRectangle)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }

                ToolStripButton tsbShapeType = new ToolStripButton(shapeType.GetLocalizedDescription());
                tsbShapeType.DisplayStyle = ToolStripItemDisplayStyle.Image;

                Image img = null;

                switch (shapeType)
                {
                    case ShapeType.RegionRectangle:
                        img = Resources.layer_shape_region;
                        break;
                    case ShapeType.RegionRoundedRectangle:
                        img = Resources.layer_shape_round_region;
                        break;
                    case ShapeType.RegionEllipse:
                        img = Resources.layer_shape_ellipse_region;
                        break;
                    case ShapeType.RegionFreehand:
                        img = Resources.layer_shape_polygon;
                        break;
                    case ShapeType.DrawingRectangle:
                        img = Resources.layer_shape;
                        break;
                    case ShapeType.DrawingRoundedRectangle:
                        img = Resources.layer_shape_round;
                        break;
                    case ShapeType.DrawingEllipse:
                        img = Resources.layer_shape_ellipse;
                        break;
                    case ShapeType.DrawingFreehand:
                        img = Resources.layer_shape_curve;
                        break;
                    case ShapeType.DrawingLine:
                        img = Resources.layer_shape_line;
                        break;
                    case ShapeType.DrawingArrow:
                        img = Resources.layer_shape_arrow;
                        break;
                    case ShapeType.DrawingText:
                        img = Resources.layer_shape_text;
                        break;
                    case ShapeType.DrawingSpeechBalloon:
                        img = Resources.balloon_box_left;
                        break;
                    case ShapeType.DrawingStep:
                        img = Resources.counter_reset;
                        break;
                    case ShapeType.DrawingImage:
                        img = Resources.image;
                        break;
                    case ShapeType.EffectBlur:
                        img = Resources.layer_shade;
                        break;
                    case ShapeType.EffectPixelate:
                        img = Resources.grid;
                        break;
                    case ShapeType.EffectHighlight:
                        img = Resources.highlighter_text;
                        break;
                }

                tsbShapeType.Image = img;
                tsbShapeType.Checked = shapeType == CurrentShapeType;
                tsbShapeType.Tag = shapeType;

                tsbShapeType.MouseDown += (sender, e) =>
                {
                    tsbShapeType.RadioCheck();
                    CurrentShapeType = shapeType;
                };

                tsMain.Items.Add(tsbShapeType);
            }

            #endregion Tools

            #region Selected object

            tsMain.Items.Add(new ToolStripSeparator());

            tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
            tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbShapeOptions.Image = Resources.layer__pencil;
            tsMain.Items.Add(tsddbShapeOptions);

            tsmiBorderColor = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Border_color___);
            tsmiBorderColor.Click += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color borderColor;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    borderColor = AnnotationOptions.TextBorderColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    borderColor = AnnotationOptions.StepBorderColor;
                }
                else
                {
                    borderColor = AnnotationOptions.BorderColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(borderColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextBorderColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepBorderColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.BorderColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                        UpdateCursor();
                    }
                }

                ResumeForm();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiBorderColor);

            tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
            tslnudBorderSize.Content.Minimum = 0;
            tslnudBorderSize.Content.Maximum = 20;
            tslnudBorderSize.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                int borderSize = (int)tslnudBorderSize.Content.Value;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    AnnotationOptions.TextBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    AnnotationOptions.StepBorderSize = borderSize;
                }
                else
                {
                    AnnotationOptions.BorderSize = borderSize;
                }

                UpdateCurrentShape();
                UpdateCursor();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);

            tsmiFillColor = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fill_color___);
            tsmiFillColor.Click += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color fillColor;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    fillColor = AnnotationOptions.TextFillColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    fillColor = AnnotationOptions.StepFillColor;
                }
                else
                {
                    fillColor = AnnotationOptions.FillColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(fillColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextFillColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepFillColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.FillColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiFillColor);

            tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
            tslnudCornerRadius.Content.Minimum = 0;
            tslnudCornerRadius.Content.Maximum = 150;
            tslnudCornerRadius.Content.Increment = 3;
            tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                if (shapeType == ShapeType.RegionRoundedRectangle || shapeType == ShapeType.DrawingRoundedRectangle)
                {
                    AnnotationOptions.RoundedRectangleRadius = (int)tslnudCornerRadius.Content.Value;
                }
                else if (shapeType == ShapeType.DrawingText)
                {
                    AnnotationOptions.TextCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudCornerRadius);

            tslnudBlurRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Blur_radius_);
            tslnudBlurRadius.Content.Minimum = 2;
            tslnudBlurRadius.Content.Maximum = 100;
            tslnudBlurRadius.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.BlurRadius = (int)tslnudBlurRadius.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBlurRadius);

            tslnudPixelateSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Pixel_size_);
            tslnudPixelateSize.Content.Minimum = 2;
            tslnudPixelateSize.Content.Maximum = 100;
            tslnudPixelateSize.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.PixelateSize = (int)tslnudPixelateSize.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);

            tsmiHighlightColor = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
            tsmiHighlightColor.Click += (sender, e) =>
            {
                PauseForm();

                using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        AnnotationOptions.HighlightColor = dialogColor.NewColor;
                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiHighlightColor);

            tsbDeleteSelected = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_selected_object);
            tsbDeleteSelected.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbDeleteSelected.Image = Resources.layer__minus;
            tsbDeleteSelected.MouseDown += (sender, e) => DeleteCurrentShape();
            tsMain.Items.Add(tsbDeleteSelected);

            tsbDeleteAll = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_all_objects);
            tsbDeleteAll.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbDeleteAll.Image = Resources.eraser;
            tsbDeleteAll.MouseDown += (sender, e) => DeleteAllShapes();
            tsMain.Items.Add(tsbDeleteAll);

            #endregion Selected object

            #region Capture

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                ToolStripButton tsbFullscreenCapture = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
                tsbFullscreenCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbFullscreenCapture.Image = Resources.layer_fullscreen;
                tsbFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
                tsMain.Items.Add(tsbFullscreenCapture);

                ToolStripButton tsbActiveMonitorCapture = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
                tsbActiveMonitorCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbActiveMonitorCapture.Image = Resources.monitor;
                tsbActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
                tsMain.Items.Add(tsbActiveMonitorCapture);

                ToolStripDropDownButton tsddbMonitorCapture = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
                tsddbMonitorCapture.HideImageMargin();
                tsddbMonitorCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbMonitorCapture.Image = Resources.monitor_window;
                tsMain.Items.Add(tsddbMonitorCapture);

                tsddbMonitorCapture.DropDownItems.Clear();

                Screen[] screens = Screen.AllScreens;

                for (int i = 0; i < screens.Length; i++)
                {
                    Screen screen = screens[i];
                    ToolStripMenuItem tsmi = new ToolStripMenuItem(string.Format("{0}. {1}x{2}", i + 1, screen.Bounds.Width, screen.Bounds.Height));
                    int index = i;
                    tsmi.MouseDown += (sender, e) =>
                    {
                        form.MonitorIndex = index;
                        form.Close(RegionResult.Monitor);
                    };
                    tsddbMonitorCapture.DropDownItems.Add(tsmi);
                }
            }

            #endregion Capture

            #region Options

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
                tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbOptions.Image = Resources.gear;
                tsMain.Items.Add(tsddbOptions);

                tsmiQuickCrop = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
                tsmiQuickCrop.Checked = !Config.QuickCrop;
                tsmiQuickCrop.CheckOnClick = true;
                tsmiQuickCrop.Click += (sender, e) => Config.QuickCrop = !tsmiQuickCrop.Checked;
                tsddbOptions.DropDownItems.Add(tsmiQuickCrop);

                ToolStripMenuItem tsmiTips = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_tips);
                tsmiTips.Checked = Config.ShowTips;
                tsmiTips.CheckOnClick = true;
                tsmiTips.Click += (sender, e) => Config.ShowTips = tsmiTips.Checked;
                tsddbOptions.DropDownItems.Add(tsmiTips);

                ToolStripMenuItem tsmiShowInfo = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_position_and_size_info);
                tsmiShowInfo.Checked = Config.ShowInfo;
                tsmiShowInfo.CheckOnClick = true;
                tsmiShowInfo.Click += (sender, e) => Config.ShowInfo = tsmiShowInfo.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowInfo);

                ToolStripMenuItem tsmiShowMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_magnifier);
                tsmiShowMagnifier.Checked = Config.ShowMagnifier;
                tsmiShowMagnifier.CheckOnClick = true;
                tsmiShowMagnifier.Click += (sender, e) => Config.ShowMagnifier = tsmiShowMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowMagnifier);

                ToolStripMenuItem tsmiUseSquareMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Square_shape_magnifier);
                tsmiUseSquareMagnifier.Checked = Config.UseSquareMagnifier;
                tsmiUseSquareMagnifier.CheckOnClick = true;
                tsmiUseSquareMagnifier.Click += (sender, e) => Config.UseSquareMagnifier = tsmiUseSquareMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiUseSquareMagnifier);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelCount = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_count_);
                tslnudMagnifierPixelCount.Content.Minimum = RegionCaptureOptions.MagnifierPixelCountMinimum;
                tslnudMagnifierPixelCount.Content.Maximum = RegionCaptureOptions.MagnifierPixelCountMaximum;
                tslnudMagnifierPixelCount.Content.Increment = 2;
                tslnudMagnifierPixelCount.Content.Value = Config.MagnifierPixelCount;
                tslnudMagnifierPixelCount.Content.ValueChanged = (sender, e) => Config.MagnifierPixelCount = (int)tslnudMagnifierPixelCount.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelCount);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_size_);
                tslnudMagnifierPixelSize.Content.Minimum = RegionCaptureOptions.MagnifierPixelSizeMinimum;
                tslnudMagnifierPixelSize.Content.Maximum = RegionCaptureOptions.MagnifierPixelSizeMaximum;
                tslnudMagnifierPixelSize.Content.Value = Config.MagnifierPixelSize;
                tslnudMagnifierPixelSize.Content.ValueChanged = (sender, e) => Config.MagnifierPixelSize = (int)tslnudMagnifierPixelSize.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelSize);

                ToolStripMenuItem tsmiShowCrosshair = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_screen_wide_crosshair);
                tsmiShowCrosshair.Checked = Config.ShowCrosshair;
                tsmiShowCrosshair.CheckOnClick = true;
                tsmiShowCrosshair.Click += (sender, e) => Config.ShowCrosshair = tsmiShowCrosshair.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowCrosshair);

                ToolStripMenuItem tsmiFixedSize = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fixed_size_region_mode);
                tsmiFixedSize.Checked = Config.IsFixedSize;
                tsmiFixedSize.CheckOnClick = true;
                tsmiFixedSize.Click += (sender, e) => Config.IsFixedSize = tsmiFixedSize.Checked;
                tsddbOptions.DropDownItems.Add(tsmiFixedSize);

                ToolStripDoubleLabeledNumericUpDown tslnudFixedSize = new ToolStripDoubleLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Width_,
                    Resources.ShapeManager_CreateContextMenu_Height_);
                tslnudFixedSize.Content.Minimum = 10;
                tslnudFixedSize.Content.Maximum = 10000;
                tslnudFixedSize.Content.Increment = 10;
                tslnudFixedSize.Content.Value = Config.FixedSize.Width;
                tslnudFixedSize.Content.Value2 = Config.FixedSize.Height;
                tslnudFixedSize.Content.ValueChanged = (sender, e) => Config.FixedSize = new Size((int)tslnudFixedSize.Content.Value, (int)tslnudFixedSize.Content.Value2);
                tsddbOptions.DropDownItems.Add(tslnudFixedSize);

                ToolStripMenuItem tsmiShowFPS = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_FPS);
                tsmiShowFPS.Checked = Config.ShowFPS;
                tsmiShowFPS.CheckOnClick = true;
                tsmiShowFPS.Click += (sender, e) => Config.ShowFPS = tsmiShowFPS.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowFPS);
            }

            #endregion Options

            ToolStripLabel tslDragRight = new ToolStripLabel()
            {
                Alignment = ToolStripItemAlignment.Right,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image = Resources.ui_radio_button_uncheck,
                Margin = new Padding(0),
                Padding = new Padding(2)
            };

            tslDragRight.MouseDown += (sender, e) =>
            {
                NativeMethods.ReleaseCapture();
                NativeMethods.DefWindowProc(menuForm.Handle, (uint)WindowsMessages.SYSCOMMAND, (UIntPtr)NativeConstants.MOUSE_MOVE, IntPtr.Zero);
            };

            tsMain.Items.Add(tslDragRight);

            tsMain.ResumeLayout(false);
            tsMain.PerformLayout();
            menuForm.ResumeLayout(false);

            menuForm.Show(form);

            Rectangle rectActiveScreen = CaptureHelpers.GetActiveScreenBounds0Based();

            if (tsMain.Width < rectActiveScreen.Width)
            {
                menuForm.Location = new Point(rectActiveScreen.X + rectActiveScreen.Width / 2 - tsMain.Width / 2, rectActiveScreen.Y + 20);

                menuForm.LocationChanged += (sender, e) =>
                {
                    Rectangle rectMenu = menuForm.Bounds;
                    Rectangle rectScreen = CaptureHelpers.GetScreenBounds();
                    Point pos = rectMenu.Location;

                    if (rectMenu.X < rectScreen.X)
                    {
                        pos.X = rectScreen.X;
                    }
                    else if (rectMenu.Right > rectScreen.Right)
                    {
                        pos.X = rectScreen.Right - rectMenu.Width;
                    }

                    if (rectMenu.Y < rectScreen.Y)
                    {
                        pos.Y = rectScreen.Y;
                    }
                    else if (rectMenu.Bottom > rectScreen.Bottom)
                    {
                        pos.Y = rectScreen.Bottom - rectMenu.Height;
                    }

                    if (pos != rectMenu.Location)
                    {
                        menuForm.Location = pos;
                    }
                };
            }
            else
            {
                menuForm.Location = rectActiveScreen.Location;
            }

            form.Activate();

            UpdateMenu();

            CurrentShapeTypeChanged += shapeType => UpdateMenu();

            CurrentShapeChanged += shape => UpdateMenu();
        }
Esempio n. 34
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
     this.ssMainStatus = new System.Windows.Forms.StatusStrip();
     this.tsLblVersion = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsVersion = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblSeparator1 = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblFwVersion = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsFwVersion = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsBtnFwUpdate = new System.Windows.Forms.ToolStripButton();
     this.tsLblSeparator2 = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblChipVersion = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsChipVersion = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblSeparator3 = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblConfigFileName = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblSeparator4 = new System.Windows.Forms.ToolStripStatusLabel();
     this.tsLblConnectionStatus = new System.Windows.Forms.ToolStripStatusLabel();
     this.ledStatus = new SemtechLib.Controls.ToolStripLed();
     this.tsLblStatus = new System.Windows.Forms.ToolStripStatusLabel();
     this.ssMainStatus1 = new System.Windows.Forms.StatusStrip();
     this.msMainMenu = new SemtechLib.Controls.MenuStripEx();
     this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.mFileSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.btnOpenConfig = new System.Windows.Forms.ToolStripMenuItem();
     this.btnSaveConfig = new System.Windows.Forms.ToolStripMenuItem();
     this.btnSaveAsConfig = new System.Windows.Forms.ToolStripMenuItem();
     this.mFileSeparator2 = new System.Windows.Forms.ToolStripSeparator();
     this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.actionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.modemToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.miModemFSK = new System.Windows.Forms.ToolStripMenuItem();
     this.miModemLoRa = new System.Windows.Forms.ToolStripMenuItem();
     this.resetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.showRegistersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.monitorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.monitorOffToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.monitorOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.startuptimeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.rssiAnalyserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.spectrumAnalyserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.showHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.mHelpSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.usersGuideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.mHelpSeparator2 = new System.Windows.Forms.ToolStripSeparator();
     this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.tsBtnRefresh = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
     this.ofConfigFileOpenDlg = new System.Windows.Forms.OpenFileDialog();
     this.sfConfigFileSaveDlg = new System.Windows.Forms.SaveFileDialog();
     this.tipMainForm = new System.Windows.Forms.ToolTip(this.components);
     this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
     this.tsActionToolbar = new SemtechLib.Controls.ToolStripEx();
     this.tsBtnOpenFile = new System.Windows.Forms.ToolStripButton();
     this.tsBtnSaveFile = new System.Windows.Forms.ToolStripButton();
     this.tbFileSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.btnOpenDevice = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
     this.tsLblModem = new System.Windows.Forms.ToolStripLabel();
     this.tsModemLoRa = new System.Windows.Forms.ToolStripButton();
     this.tsModemFSK = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
     this.tsBtnReset = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.tsBtnStartupTime = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
     this.tsBtnShowRegisters = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
     this.tsLblMonitor = new System.Windows.Forms.ToolStripLabel();
     this.tsBtnMonitorOn = new System.Windows.Forms.ToolStripButton();
     this.tsBtnMonitorOff = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
     this.tsBtnShowHelp = new System.Windows.Forms.ToolStripButton();
     this.tsSeparatorPerModeOn = new System.Windows.Forms.ToolStripSeparator();
     this.tsLblPerModeOn = new System.Windows.Forms.ToolStripLabel();
     this.tsSeparatorDebugOn = new System.Windows.Forms.ToolStripSeparator();
     this.tsLblDebugOn = new System.Windows.Forms.ToolStripLabel();
     this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
     this.ssMainStatus.SuspendLayout();
     this.ssMainStatus1.SuspendLayout();
     this.msMainMenu.SuspendLayout();
     this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();
     this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
     this.toolStripContainer1.SuspendLayout();
     this.tsActionToolbar.SuspendLayout();
     this.SuspendLayout();
     //
     // ssMainStatus
     //
     this.ssMainStatus.Dock = System.Windows.Forms.DockStyle.None;
     this.ssMainStatus.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.tsLblVersion,
     this.tsVersion,
     this.tsLblSeparator1,
     this.tsLblFwVersion,
     this.tsFwVersion,
     this.tsBtnFwUpdate,
     this.tsLblSeparator2,
     this.tsLblChipVersion,
     this.tsChipVersion,
     this.tsLblSeparator3,
     this.tsLblConfigFileName,
     this.tsLblSeparator4,
     this.tsLblConnectionStatus,
     this.ledStatus});
     this.ssMainStatus.Location = new System.Drawing.Point(0, 22);
     this.ssMainStatus.Name = "ssMainStatus";
     this.ssMainStatus.ShowItemToolTips = true;
     this.ssMainStatus.Size = new System.Drawing.Size(1008, 22);
     this.ssMainStatus.SizingGrip = false;
     this.ssMainStatus.TabIndex = 3;
     this.ssMainStatus.Text = "Main status";
     //
     // tsLblVersion
     //
     this.tsLblVersion.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
     this.tsLblVersion.Name = "tsLblVersion";
     this.tsLblVersion.Size = new System.Drawing.Size(49, 16);
     this.tsLblVersion.Text = "Version:";
     //
     // tsVersion
     //
     this.tsVersion.AutoSize = false;
     this.tsVersion.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
     this.tsVersion.Name = "tsVersion";
     this.tsVersion.Size = new System.Drawing.Size(48, 16);
     this.tsVersion.Text = "-";
     //
     // tsLblSeparator1
     //
     this.tsLblSeparator1.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblSeparator1.Name = "tsLblSeparator1";
     this.tsLblSeparator1.Size = new System.Drawing.Size(10, 16);
     this.tsLblSeparator1.Text = "|";
     //
     // tsLblFwVersion
     //
     this.tsLblFwVersion.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
     this.tsLblFwVersion.Name = "tsLblFwVersion";
     this.tsLblFwVersion.Size = new System.Drawing.Size(101, 16);
     this.tsLblFwVersion.Text = "Firmware Version:";
     //
     // tsFwVersion
     //
     this.tsFwVersion.AutoSize = false;
     this.tsFwVersion.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
     this.tsFwVersion.Name = "tsFwVersion";
     this.tsFwVersion.Size = new System.Drawing.Size(48, 16);
     this.tsFwVersion.Text = "-";
     //
     // tsBtnFwUpdate
     //
     this.tsBtnFwUpdate.Name = "tsBtnFwUpdate";
     this.tsBtnFwUpdate.Size = new System.Drawing.Size(23, 20);
     //
     // tsLblSeparator2
     //
     this.tsLblSeparator2.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblSeparator2.Name = "tsLblSeparator2";
     this.tsLblSeparator2.Size = new System.Drawing.Size(10, 16);
     this.tsLblSeparator2.Text = "|";
     //
     // tsLblChipVersion
     //
     this.tsLblChipVersion.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
     this.tsLblChipVersion.Name = "tsLblChipVersion";
     this.tsLblChipVersion.Size = new System.Drawing.Size(76, 16);
     this.tsLblChipVersion.Text = "Chip version:";
     //
     // tsChipVersion
     //
     this.tsChipVersion.AutoSize = false;
     this.tsChipVersion.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
     this.tsChipVersion.Name = "tsChipVersion";
     this.tsChipVersion.Size = new System.Drawing.Size(48, 16);
     this.tsChipVersion.Text = "-";
     //
     // tsLblSeparator3
     //
     this.tsLblSeparator3.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblSeparator3.Name = "tsLblSeparator3";
     this.tsLblSeparator3.Size = new System.Drawing.Size(10, 16);
     this.tsLblSeparator3.Text = "|";
     //
     // tsLblConfigFileName
     //
     this.tsLblConfigFileName.AutoToolTip = true;
     this.tsLblConfigFileName.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsLblConfigFileName.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblConfigFileName.Name = "tsLblConfigFileName";
     this.tsLblConfigFileName.Size = new System.Drawing.Size(379, 16);
     this.tsLblConfigFileName.Spring = true;
     this.tsLblConfigFileName.Text = "Config File:";
     this.tsLblConfigFileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.tsLblConfigFileName.ToolTipText = "Shows the active Config file when File-> Open/Save is used";
     //
     // tsLblSeparator4
     //
     this.tsLblSeparator4.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblSeparator4.Name = "tsLblSeparator4";
     this.tsLblSeparator4.Size = new System.Drawing.Size(10, 16);
     this.tsLblSeparator4.Text = "|";
     //
     // tsLblConnectionStatus
     //
     this.tsLblConnectionStatus.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblConnectionStatus.Name = "tsLblConnectionStatus";
     this.tsLblConnectionStatus.Size = new System.Drawing.Size(106, 16);
     this.tsLblConnectionStatus.Text = "Connection status:";
     //
     // ledStatus
     //
     this.ledStatus.BackColor = System.Drawing.Color.Transparent;
     this.ledStatus.Checked = false;
     this.ledStatus.LedAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.ledStatus.LedColor = System.Drawing.Color.Green;
     this.ledStatus.LedSize = new System.Drawing.Size(11, 11);
     this.ledStatus.Margin = new System.Windows.Forms.Padding(3);
     this.ledStatus.Name = "ledStatus";
     this.ledStatus.Size = new System.Drawing.Size(15, 16);
     this.ledStatus.Text = "Connection status";
     //
     // tsLblStatus
     //
     this.tsLblStatus.Margin = new System.Windows.Forms.Padding(3);
     this.tsLblStatus.Name = "tsLblStatus";
     this.tsLblStatus.Size = new System.Drawing.Size(12, 16);
     this.tsLblStatus.Text = "-";
     this.tsLblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.tsLblStatus.ToolTipText = "Shows SKA messages.";
     //
     // ssMainStatus1
     //
     this.ssMainStatus1.Dock = System.Windows.Forms.DockStyle.None;
     this.ssMainStatus1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.tsLblStatus});
     this.ssMainStatus1.Location = new System.Drawing.Point(0, 0);
     this.ssMainStatus1.Name = "ssMainStatus1";
     this.ssMainStatus1.ShowItemToolTips = true;
     this.ssMainStatus1.Size = new System.Drawing.Size(1008, 22);
     this.ssMainStatus1.SizingGrip = false;
     this.ssMainStatus1.TabIndex = 3;
     this.ssMainStatus1.Text = "Main status 1";
     //
     // msMainMenu
     //
     this.msMainMenu.ClickThrough = true;
     this.msMainMenu.Dock = System.Windows.Forms.DockStyle.None;
     this.msMainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.fileToolStripMenuItem,
     this.actionToolStripMenuItem,
     this.toolsToolStripMenuItem,
     this.helpToolStripMenuItem});
     this.msMainMenu.Location = new System.Drawing.Point(0, 0);
     this.msMainMenu.Name = "msMainMenu";
     this.msMainMenu.Size = new System.Drawing.Size(1008, 24);
     this.msMainMenu.SuppressHighlighting = false;
     this.msMainMenu.TabIndex = 0;
     this.msMainMenu.Text = "File";
     //
     // fileToolStripMenuItem
     //
     this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.connectToolStripMenuItem,
     this.mFileSeparator1,
     this.btnOpenConfig,
     this.btnSaveConfig,
     this.btnSaveAsConfig,
     this.mFileSeparator2,
     this.exitToolStripMenuItem});
     this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
     this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
     this.fileToolStripMenuItem.Text = "&File";
     //
     // connectToolStripMenuItem
     //
     this.connectToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("connectToolStripMenuItem.Image")));
     this.connectToolStripMenuItem.Name = "connectToolStripMenuItem";
     this.connectToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
     this.connectToolStripMenuItem.Text = "&Connect";
     this.connectToolStripMenuItem.Visible = false;
     this.connectToolStripMenuItem.Click += new System.EventHandler(this.btnOpenDevice_Click);
     //
     // mFileSeparator1
     //
     this.mFileSeparator1.Name = "mFileSeparator1";
     this.mFileSeparator1.Size = new System.Drawing.Size(159, 6);
     this.mFileSeparator1.Visible = false;
     //
     // btnOpenConfig
     //
     this.btnOpenConfig.Enabled = false;
     this.btnOpenConfig.Image = ((System.Drawing.Image)(resources.GetObject("loadToolStripMenuItem.Image")));
     this.btnOpenConfig.Name = "btnOpenConfig";
     this.btnOpenConfig.Size = new System.Drawing.Size(162, 22);
     this.btnOpenConfig.Text = "&Open Config...";
     this.btnOpenConfig.Click += new System.EventHandler(this.btnOpenConfig_Click);
     //
     // btnSaveConfig
     //
     this.btnSaveConfig.Enabled = false;
     this.btnSaveConfig.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
     this.btnSaveConfig.Name = "btnSaveConfig";
     this.btnSaveConfig.Size = new System.Drawing.Size(162, 22);
     this.btnSaveConfig.Text = "&Save Config";
     this.btnSaveConfig.Click += new System.EventHandler(this.btnSaveConfig_Click);
     //
     // btnSaveAsConfig
     //
     this.btnSaveAsConfig.Enabled = false;
     this.btnSaveAsConfig.Image = ((System.Drawing.Image)(resources.GetObject("saveAsToolStripMenuItem.Image")));
     this.btnSaveAsConfig.Name = "btnSaveAsConfig";
     this.btnSaveAsConfig.Size = new System.Drawing.Size(162, 22);
     this.btnSaveAsConfig.Text = "Save Config &As...";
     this.btnSaveAsConfig.Click += new System.EventHandler(this.btnSaveAsConfig_Click);
     //
     // mFileSeparator2
     //
     this.mFileSeparator2.Name = "mFileSeparator2";
     this.mFileSeparator2.Size = new System.Drawing.Size(159, 6);
     //
     // exitToolStripMenuItem
     //
     this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
     this.exitToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
     this.exitToolStripMenuItem.Text = "&Exit";
     this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
     //
     // actionToolStripMenuItem
     //
     this.actionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.modemToolStripMenuItem,
     this.resetToolStripMenuItem,
     this.refreshToolStripMenuItem,
     this.showRegistersToolStripMenuItem,
     this.monitorToolStripMenuItem,
     this.startuptimeToolStripMenuItem});
     this.actionToolStripMenuItem.Name = "actionToolStripMenuItem";
     this.actionToolStripMenuItem.Size = new System.Drawing.Size(54, 20);
     this.actionToolStripMenuItem.Text = "&Action";
     //
     // modemToolStripMenuItem
     //
     this.modemToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.miModemFSK,
     this.miModemLoRa});
     this.modemToolStripMenuItem.Enabled = false;
     this.modemToolStripMenuItem.Name = "modemToolStripMenuItem";
     this.modemToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
     this.modemToolStripMenuItem.Text = "M&odem";
     //
     // modemFskToolStripMenuItem
     //
     this.miModemFSK.Name = "modemFskToolStripMenuItem";
     this.miModemFSK.Size = new System.Drawing.Size(100, 22);
     this.miModemFSK.Text = "FSK";
     this.miModemFSK.Click += new System.EventHandler(this.modemToolStripMenuItem_Click);
     //
     // modemLoRaToolStripMenuItem
     //
     this.miModemLoRa.Checked = true;
     this.miModemLoRa.CheckState = System.Windows.Forms.CheckState.Checked;
     this.miModemLoRa.Name = "modemLoRaToolStripMenuItem";
     this.miModemLoRa.Size = new System.Drawing.Size(100, 22);
     this.miModemLoRa.Text = "&LoRa";
     this.miModemLoRa.Click += new System.EventHandler(this.modemToolStripMenuItem_Click);
     //
     // resetToolStripMenuItem
     //
     this.resetToolStripMenuItem.Enabled = false;
     this.resetToolStripMenuItem.Name = "resetToolStripMenuItem";
     this.resetToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
     this.resetToolStripMenuItem.Text = "R&eset";
     this.resetToolStripMenuItem.Click += new System.EventHandler(this.resetToolStripMenuItem_Click);
     //
     // refreshToolStripMenuItem
     //
     this.refreshToolStripMenuItem.Enabled = false;
     this.refreshToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("refreshToolStripMenuItem.Image")));
     this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
     this.refreshToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
     this.refreshToolStripMenuItem.Text = "&Refresh";
     this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
     //
     // showRegistersToolStripMenuItem
     //
     this.showRegistersToolStripMenuItem.Enabled = false;
     this.showRegistersToolStripMenuItem.Name = "showRegistersToolStripMenuItem";
     this.showRegistersToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
     this.showRegistersToolStripMenuItem.Text = "&Show registers";
     this.showRegistersToolStripMenuItem.Click += new System.EventHandler(this.showRegistersToolStripMenuItem_Click);
     //
     // monitorToolStripMenuItem
     //
     this.monitorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.monitorOffToolStripMenuItem,
     this.monitorOnToolStripMenuItem});
     this.monitorToolStripMenuItem.Enabled = false;
     this.monitorToolStripMenuItem.Name = "monitorToolStripMenuItem";
     this.monitorToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
     this.monitorToolStripMenuItem.Text = "&Monitor";
     //
     // monitorOffToolStripMenuItem
     //
     this.monitorOffToolStripMenuItem.Name = "monitorOffToolStripMenuItem";
     this.monitorOffToolStripMenuItem.Size = new System.Drawing.Size(95, 22);
     this.monitorOffToolStripMenuItem.Text = "OFF";
     this.monitorOffToolStripMenuItem.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
     //
     // monitorOnToolStripMenuItem
     //
     this.monitorOnToolStripMenuItem.Checked = true;
     this.monitorOnToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
     this.monitorOnToolStripMenuItem.Name = "monitorOnToolStripMenuItem";
     this.monitorOnToolStripMenuItem.Size = new System.Drawing.Size(95, 22);
     this.monitorOnToolStripMenuItem.Text = "&ON";
     this.monitorOnToolStripMenuItem.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
     //
     // startuptimeToolStripMenuItem
     //
     this.startuptimeToolStripMenuItem.Enabled = false;
     this.startuptimeToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("startuptimeToolStripMenuItem.Image")));
     this.startuptimeToolStripMenuItem.Name = "startuptimeToolStripMenuItem";
     this.startuptimeToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
     this.startuptimeToolStripMenuItem.Text = "Startup &time...";
     this.startuptimeToolStripMenuItem.Click += new System.EventHandler(this.startuptimeToolStripMenuItem_Click);
     //
     // toolsToolStripMenuItem
     //
     this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.rssiAnalyserToolStripMenuItem,
     this.spectrumAnalyserToolStripMenuItem});
     this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
     this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
     this.toolsToolStripMenuItem.Text = "Tools";
     //
     // rssiAnalyserToolStripMenuItem
     //
     this.rssiAnalyserToolStripMenuItem.Enabled = false;
     this.rssiAnalyserToolStripMenuItem.Name = "rssiAnalyserToolStripMenuItem";
     this.rssiAnalyserToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
     this.rssiAnalyserToolStripMenuItem.Text = "RSSI analyser";
     this.rssiAnalyserToolStripMenuItem.Click += new System.EventHandler(this.rssiAnalyserToolStripMenuItem_Click);
     //
     // spectrumAnalyserToolStripMenuItem
     //
     this.spectrumAnalyserToolStripMenuItem.Enabled = false;
     this.spectrumAnalyserToolStripMenuItem.Name = "spectrumAnalyserToolStripMenuItem";
     this.spectrumAnalyserToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
     this.spectrumAnalyserToolStripMenuItem.Text = "Spectrum analyser";
     this.spectrumAnalyserToolStripMenuItem.Click += new System.EventHandler(this.spectrumAnalyserToolStripMenuItem_Click);
     //
     // helpToolStripMenuItem
     //
     this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.showHelpToolStripMenuItem,
     this.mHelpSeparator1,
     this.usersGuideToolStripMenuItem,
     this.mHelpSeparator2,
     this.aboutToolStripMenuItem});
     this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
     this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
     this.helpToolStripMenuItem.Text = "&Help";
     //
     // showHelpToolStripMenuItem
     //
     this.showHelpToolStripMenuItem.Enabled = false;
     this.showHelpToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("showHelpToolStripMenuItem.Image")));
     this.showHelpToolStripMenuItem.Name = "showHelpToolStripMenuItem";
     this.showHelpToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
     this.showHelpToolStripMenuItem.Text = "Help";
     this.showHelpToolStripMenuItem.Click += new System.EventHandler(this.showHelpToolStripMenuItem_Click);
     //
     // mHelpSeparator1
     //
     this.mHelpSeparator1.Name = "mHelpSeparator1";
     this.mHelpSeparator1.Size = new System.Drawing.Size(228, 6);
     //
     // usersGuideToolStripMenuItem
     //
     this.usersGuideToolStripMenuItem.Name = "usersGuideToolStripMenuItem";
     this.usersGuideToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
     this.usersGuideToolStripMenuItem.Text = "&User\'s Guide...";
     this.usersGuideToolStripMenuItem.Click += new System.EventHandler(this.usersGuideToolStripMenuItem_Click);
     //
     // mHelpSeparator2
     //
     this.mHelpSeparator2.Name = "mHelpSeparator2";
     this.mHelpSeparator2.Size = new System.Drawing.Size(228, 6);
     //
     // aboutToolStripMenuItem
     //
     this.aboutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("aboutToolStripMenuItem.Image")));
     this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
     this.aboutToolStripMenuItem.Size = new System.Drawing.Size(231, 22);
     this.aboutToolStripMenuItem.Text = "&About SX1276 Evaluation Kit...";
     this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
     //
     // tsBtnRefresh
     //
     this.tsBtnRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsBtnRefresh.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnRefresh.Image")));
     this.tsBtnRefresh.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnRefresh.Name = "tsBtnRefresh";
     this.tsBtnRefresh.Size = new System.Drawing.Size(23, 22);
     this.tsBtnRefresh.Text = "Refresh";
     this.tsBtnRefresh.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
     //
     // toolStripSeparator3
     //
     this.toolStripSeparator3.Name = "toolStripSeparator3";
     this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
     //
     // ofConfigFileOpenDlg
     //
     this.ofConfigFileOpenDlg.DefaultExt = "*.cfg";
     this.ofConfigFileOpenDlg.Filter = "Config Files(*.cfg)|*.cfg|AllFiles(*.*)|*.*";
     //
     // sfConfigFileSaveDlg
     //
     this.sfConfigFileSaveDlg.DefaultExt = "*.cfg";
     this.sfConfigFileSaveDlg.Filter = "Config Files(*.cfg)|*.cfg|AllFiles(*.*)|*.*";
     //
     // tipMainForm
     //
     this.tipMainForm.ShowAlways = true;
     //
     // toolStripContainer1
     //
     //
     // toolStripContainer1.BottomToolStripPanel
     //
     this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.ssMainStatus1);
     this.toolStripContainer1.BottomToolStripPanel.Controls.Add(this.ssMainStatus);
     this.toolStripContainer1.BottomToolStripPanel.MaximumSize = new System.Drawing.Size(0, 44);
     //
     // toolStripContainer1.ContentPanel
     //
     this.toolStripContainer1.ContentPanel.AutoScroll = true;
     this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(1008, 524);
     this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.toolStripContainer1.LeftToolStripPanelVisible = false;
     this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
     this.toolStripContainer1.Name = "toolStripContainer1";
     this.toolStripContainer1.RightToolStripPanelVisible = false;
     this.toolStripContainer1.Size = new System.Drawing.Size(1008, 618);
     this.toolStripContainer1.TabIndex = 0;
     this.toolStripContainer1.Text = "toolStripContainer1";
     //
     // toolStripContainer1.TopToolStripPanel
     //
     this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.msMainMenu);
     this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.tsActionToolbar);
     this.toolStripContainer1.TopToolStripPanel.MaximumSize = new System.Drawing.Size(0, 50);
     //
     // tsActionToolbar
     //
     this.tsActionToolbar.ClickThrough = true;
     this.tsActionToolbar.Dock = System.Windows.Forms.DockStyle.None;
     this.tsActionToolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.tsActionToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.tsBtnOpenFile,
     this.tsBtnSaveFile,
     this.tbFileSeparator1,
     this.btnOpenDevice,
     this.toolStripSeparator7,
     this.tsLblModem,
     this.tsModemLoRa,
     this.tsModemFSK,
     this.toolStripSeparator5,
     this.tsBtnReset,
     this.toolStripSeparator1,
     this.tsBtnRefresh,
     this.tsBtnStartupTime,
     this.toolStripSeparator2,
     this.tsBtnShowRegisters,
     this.toolStripSeparator4,
     this.tsLblMonitor,
     this.tsBtnMonitorOn,
     this.tsBtnMonitorOff,
     this.toolStripSeparator6,
     this.tsBtnShowHelp,
     this.tsSeparatorPerModeOn,
     this.tsLblPerModeOn,
     this.tsSeparatorDebugOn,
     this.tsLblDebugOn});
     this.tsActionToolbar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
     this.tsActionToolbar.Location = new System.Drawing.Point(3, 24);
     this.tsActionToolbar.Name = "tsActionToolbar";
     this.tsActionToolbar.Size = new System.Drawing.Size(698, 25);
     this.tsActionToolbar.SuppressHighlighting = false;
     this.tsActionToolbar.TabIndex = 2;
     this.tsActionToolbar.Text = "Action";
     //
     // tsBtnOpenFile
     //
     this.tsBtnOpenFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsBtnOpenFile.Enabled = false;
     this.tsBtnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnOpenFile.Image")));
     this.tsBtnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnOpenFile.Name = "tsBtnOpenFile";
     this.tsBtnOpenFile.Size = new System.Drawing.Size(23, 22);
     this.tsBtnOpenFile.Text = "Open Config file";
     this.tsBtnOpenFile.Click += new System.EventHandler(this.btnOpenConfig_Click);
     //
     // tsBtnSaveFile
     //
     this.tsBtnSaveFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsBtnSaveFile.Enabled = false;
     this.tsBtnSaveFile.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnSaveFile.Image")));
     this.tsBtnSaveFile.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnSaveFile.Name = "tsBtnSaveFile";
     this.tsBtnSaveFile.Size = new System.Drawing.Size(23, 22);
     this.tsBtnSaveFile.Text = "Save Config file";
     this.tsBtnSaveFile.Click += new System.EventHandler(this.btnSaveConfig_Click);
     //
     // tbFileSeparator1
     //
     this.tbFileSeparator1.Name = "tbFileSeparator1";
     this.tbFileSeparator1.Size = new System.Drawing.Size(6, 25);
     //
     // btnOpenDevice
     //
     this.btnOpenDevice.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.btnOpenDevice.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnOpenDevice.Image")));
     this.btnOpenDevice.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.btnOpenDevice.Name = "btnOpenDevice";
     this.btnOpenDevice.Size = new System.Drawing.Size(23, 22);
     this.btnOpenDevice.Text = "Connect";
     this.btnOpenDevice.Click += new System.EventHandler(this.btnOpenDevice_Click);
     //
     // toolStripSeparator7
     //
     this.toolStripSeparator7.Name = "toolStripSeparator7";
     this.toolStripSeparator7.Size = new System.Drawing.Size(6, 25);
     //
     // tsLblModem
     //
     this.tsLblModem.Name = "tsLblModem";
     this.tsLblModem.Size = new System.Drawing.Size(52, 22);
     this.tsLblModem.Text = "Modem:";
     //
     // tsBtnModemLoRa
     //
     this.tsModemLoRa.Checked = true;
     this.tsModemLoRa.CheckState = System.Windows.Forms.CheckState.Checked;
     this.tsModemLoRa.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsModemLoRa.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnModemLoRa.Image")));
     this.tsModemLoRa.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsModemLoRa.Name = "tsBtnModemLoRa";
     this.tsModemLoRa.Size = new System.Drawing.Size(37, 22);
     this.tsModemLoRa.Text = "LoRa";
     this.tsModemLoRa.ToolTipText = "Enables the SX1276 LoRa modem";
     this.tsModemLoRa.Click += new System.EventHandler(this.modemToolStripMenuItem_Click);
     //
     // tsBtnModemFsk
     //
     this.tsModemFSK.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsModemFSK.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnModemFsk.Image")));
     this.tsModemFSK.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsModemFSK.Name = "tsBtnModemFsk";
     this.tsModemFSK.Size = new System.Drawing.Size(30, 22);
     this.tsModemFSK.Text = "FSK";
     this.tsModemFSK.ToolTipText = "Enables the SX1276 FSK modem";
     this.tsModemFSK.Click += new System.EventHandler(this.modemToolStripMenuItem_Click);
     //
     // toolStripSeparator5
     //
     this.toolStripSeparator5.Name = "toolStripSeparator5";
     this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25);
     //
     // tsBtnReset
     //
     this.tsBtnReset.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsBtnReset.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnReset.Image")));
     this.tsBtnReset.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnReset.Name = "tsBtnReset";
     this.tsBtnReset.Size = new System.Drawing.Size(39, 22);
     this.tsBtnReset.Text = "Reset";
     this.tsBtnReset.Click += new System.EventHandler(this.resetToolStripMenuItem_Click);
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
     //
     // tsBtnStartupTime
     //
     this.tsBtnStartupTime.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsBtnStartupTime.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnStartupTime.Image")));
     this.tsBtnStartupTime.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnStartupTime.Name = "tsBtnStartupTime";
     this.tsBtnStartupTime.Size = new System.Drawing.Size(23, 22);
     this.tsBtnStartupTime.Text = "Startup time";
     this.tsBtnStartupTime.Click += new System.EventHandler(this.startuptimeToolStripMenuItem_Click);
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
     //
     // tsBtnShowRegisters
     //
     this.tsBtnShowRegisters.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsBtnShowRegisters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
     this.tsBtnShowRegisters.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnShowRegisters.Image")));
     this.tsBtnShowRegisters.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnShowRegisters.Name = "tsBtnShowRegisters";
     this.tsBtnShowRegisters.Size = new System.Drawing.Size(33, 22);
     this.tsBtnShowRegisters.Text = "Reg";
     this.tsBtnShowRegisters.ToolTipText = "Displays SX1276 raw registers window";
     this.tsBtnShowRegisters.Click += new System.EventHandler(this.showRegistersToolStripMenuItem_Click);
     //
     // toolStripSeparator4
     //
     this.toolStripSeparator4.Name = "toolStripSeparator4";
     this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
     //
     // tsLblMonitor
     //
     this.tsLblMonitor.Name = "tsLblMonitor";
     this.tsLblMonitor.Size = new System.Drawing.Size(53, 22);
     this.tsLblMonitor.Text = "Monitor:";
     //
     // tsBtnMonitorOn
     //
     this.tsBtnMonitorOn.Checked = true;
     this.tsBtnMonitorOn.CheckState = System.Windows.Forms.CheckState.Checked;
     this.tsBtnMonitorOn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsBtnMonitorOn.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnMonitorOn.Image")));
     this.tsBtnMonitorOn.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnMonitorOn.Name = "tsBtnMonitorOn";
     this.tsBtnMonitorOn.Size = new System.Drawing.Size(29, 22);
     this.tsBtnMonitorOn.Text = "ON";
     this.tsBtnMonitorOn.ToolTipText = "Enables the SX1276 monitor mode";
     this.tsBtnMonitorOn.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
     //
     // tsBtnMonitorOff
     //
     this.tsBtnMonitorOff.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.tsBtnMonitorOff.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnMonitorOff.Image")));
     this.tsBtnMonitorOff.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnMonitorOff.Name = "tsBtnMonitorOff";
     this.tsBtnMonitorOff.Size = new System.Drawing.Size(32, 22);
     this.tsBtnMonitorOff.Text = "OFF";
     this.tsBtnMonitorOff.ToolTipText = "Disables the SX1276 monitor mode";
     this.tsBtnMonitorOff.Click += new System.EventHandler(this.monitorToolStripMenuItem_Click);
     //
     // toolStripSeparator6
     //
     this.toolStripSeparator6.Name = "toolStripSeparator6";
     this.toolStripSeparator6.Size = new System.Drawing.Size(6, 25);
     //
     // tsBtnShowHelp
     //
     this.tsBtnShowHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsBtnShowHelp.Enabled = false;
     this.tsBtnShowHelp.Image = ((System.Drawing.Image)(resources.GetObject("tsBtnShowHelp.Image")));
     this.tsBtnShowHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsBtnShowHelp.Name = "tsBtnShowHelp";
     this.tsBtnShowHelp.Size = new System.Drawing.Size(23, 22);
     this.tsBtnShowHelp.Text = "Help";
     this.tsBtnShowHelp.Click += new System.EventHandler(this.showHelpToolStripMenuItem_Click);
     //
     // tsSeparatorPerModeOn
     //
     this.tsSeparatorPerModeOn.Name = "tsSeparatorPerModeOn";
     this.tsSeparatorPerModeOn.Size = new System.Drawing.Size(6, 25);
     this.tsSeparatorPerModeOn.Visible = false;
     //
     // tsLblPerModeOn
     //
     this.tsLblPerModeOn.ForeColor = System.Drawing.Color.Red;
     this.tsLblPerModeOn.Name = "tsLblPerModeOn";
     this.tsLblPerModeOn.Size = new System.Drawing.Size(82, 22);
     this.tsLblPerModeOn.Text = "PER mode ON";
     this.tsLblPerModeOn.Visible = false;
     //
     // tsSeparatorDebugOn
     //
     this.tsSeparatorDebugOn.Name = "tsSeparatorDebugOn";
     this.tsSeparatorDebugOn.Size = new System.Drawing.Size(6, 25);
     this.tsSeparatorDebugOn.Visible = false;
     //
     // tsLblDebugOn
     //
     this.tsLblDebugOn.ForeColor = System.Drawing.Color.Red;
     this.tsLblDebugOn.Name = "tsLblDebugOn";
     this.tsLblDebugOn.Size = new System.Drawing.Size(85, 22);
     this.tsLblDebugOn.Text = "DBG mode ON";
     this.tsLblDebugOn.Visible = false;
     //
     // toolStripLabel1
     //
     this.toolStripLabel1.Name = "toolStripLabel1";
     this.toolStripLabel1.Size = new System.Drawing.Size(62, 22);
     this.toolStripLabel1.Text = "Product ID:";
     //
     // MainForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(1008, 618);
     this.Controls.Add(this.toolStripContainer1);
     this.DoubleBuffered = true;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.KeyPreview = true;
     this.MainMenuStrip = this.msMainMenu;
     this.MaximizeBox = false;
     this.Name = "MainForm";
     this.Text = "SX1276 Evaluation Kit";
     this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Mainform_FormClosing);
     this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
     this.Load += new System.EventHandler(this.MainForm_Load);
     this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Mainform_KeyDown);
     this.ssMainStatus.ResumeLayout(false);
     this.ssMainStatus.PerformLayout();
     this.ssMainStatus1.ResumeLayout(false);
     this.ssMainStatus1.PerformLayout();
     this.msMainMenu.ResumeLayout(false);
     this.msMainMenu.PerformLayout();
     this.toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);
     this.toolStripContainer1.BottomToolStripPanel.PerformLayout();
     this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
     this.toolStripContainer1.TopToolStripPanel.PerformLayout();
     this.toolStripContainer1.ResumeLayout(false);
     this.toolStripContainer1.PerformLayout();
     this.tsActionToolbar.ResumeLayout(false);
     this.tsActionToolbar.PerformLayout();
     this.ResumeLayout(false);
 }
Esempio n. 35
0
        private void CreateToolbar()
        {
            menuForm = new Form()
            {
                AutoScaleDimensions = new SizeF(6F, 13F),
                AutoScaleMode       = AutoScaleMode.Font,
                AutoSize            = true,
                AutoSizeMode        = AutoSizeMode.GrowAndShrink,
                ClientSize          = new Size(759, 509),
                FormBorderStyle     = FormBorderStyle.None,
                Location            = new Point(200, 200),
                ShowInTaskbar       = false,
                StartPosition       = FormStartPosition.Manual,
                Text    = "ShareX - Region capture menu",
                TopMost = true
            };

            menuForm.KeyUp           += MenuForm_KeyUp;
            menuForm.LocationChanged += MenuForm_LocationChanged;

            menuForm.SuspendLayout();

            tsMain = new ToolStripEx()
            {
                AutoSize         = true,
                CanOverflow      = false,
                ClickThrough     = true,
                Dock             = DockStyle.None,
                GripStyle        = ToolStripGripStyle.Hidden,
                Location         = new Point(0, 0),
                MinimumSize      = new Size(10, 30),
                Padding          = new Padding(0, 0, 0, 0),
                Renderer         = new CustomToolStripProfessionalRenderer(),
                TabIndex         = 0,
                ShowItemToolTips = false
            };

            tsMain.MouseLeave += TsMain_MouseLeave;

            tsMain.SuspendLayout();

            // https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
            using (Graphics g = menuForm.CreateGraphics())
            {
                double scale    = Math.Max(g.DpiX, g.DpiY) / 96.0;
                double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
                if (newScale > 1)
                {
                    int newWidth  = (int)(tsMain.ImageScalingSize.Width * newScale);
                    int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
                    tsMain.ImageScalingSize = new Size(newWidth, newHeight);
                }
            }

            menuForm.Controls.Add(tsMain);

            tslDragLeft = new ToolStripLabel()
            {
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image        = Resources.ui_radio_button_uncheck,
                Margin       = new Padding(2, 0, 2, 0),
                Padding      = new Padding(2)
            };

            tsMain.Items.Add(tslDragLeft);

            #region Editor mode

            if (form.Mode == RegionCaptureMode.Editor)
            {
                ToolStripButton tsbCompleteEdit = new ToolStripButton("Run after capture tasks");
                tsbCompleteEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCompleteEdit.Image        = Resources.tick;
                tsbCompleteEdit.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateRunAfterCaptureTasks);
                tsMain.Items.Add(tsbCompleteEdit);

                ToolStripButton tsbSaveImage = new ToolStripButton("Save image");
                tsbSaveImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImage.Enabled      = !string.IsNullOrEmpty(form.ImageFilePath);
                tsbSaveImage.Image        = Resources.disk_black;
                tsbSaveImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateSaveImage);
                tsMain.Items.Add(tsbSaveImage);

                ToolStripButton tsbSaveImageAs = new ToolStripButton("Save image as...");
                tsbSaveImageAs.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImageAs.Image        = Resources.disks_black;
                tsbSaveImageAs.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateSaveImageAs);
                tsMain.Items.Add(tsbSaveImageAs);

                ToolStripButton tsbCopyImage = new ToolStripButton("Copy image to clipboard");
                tsbCopyImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCopyImage.Image        = Resources.clipboard;
                tsbCopyImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateCopyImage);
                tsMain.Items.Add(tsbCopyImage);

                ToolStripButton tsbUploadImage = new ToolStripButton("Upload image");
                tsbUploadImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbUploadImage.Image        = Resources.drive_globe;
                tsbUploadImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateUploadImage);
                tsMain.Items.Add(tsbUploadImage);

                ToolStripButton tsbPrintImage = new ToolStripButton("Print image...");
                tsbPrintImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbPrintImage.Image        = Resources.printer;
                tsbPrintImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotatePrintImage);
                tsMain.Items.Add(tsbPrintImage);

                tsMain.Items.Add(new ToolStripSeparator());
            }

            #endregion Editor mode

            #region Tools

            foreach (ShapeType shapeType in Helpers.GetEnums <ShapeType>())
            {
                if (form.Mode == RegionCaptureMode.Editor)
                {
                    if (IsShapeTypeRegion(shapeType))
                    {
                        continue;
                    }
                }
                else if (shapeType == ShapeType.DrawingRectangle)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }

                ToolStripButton tsbShapeType = new ToolStripButton(shapeType.GetLocalizedDescription());
                tsbShapeType.DisplayStyle = ToolStripItemDisplayStyle.Image;

                Image img = null;

                switch (shapeType)
                {
                case ShapeType.RegionRectangle:
                    img = Resources.layer_shape_region;
                    break;

                case ShapeType.RegionRoundedRectangle:
                    img = Resources.layer_shape_round_region;
                    break;

                case ShapeType.RegionEllipse:
                    img = Resources.layer_shape_ellipse_region;
                    break;

                case ShapeType.RegionFreehand:
                    img = Resources.layer_shape_polygon;
                    break;

                case ShapeType.DrawingRectangle:
                    img = Resources.layer_shape;
                    break;

                case ShapeType.DrawingRoundedRectangle:
                    img = Resources.layer_shape_round;
                    break;

                case ShapeType.DrawingEllipse:
                    img = Resources.layer_shape_ellipse;
                    break;

                case ShapeType.DrawingFreehand:
                    img = Resources.layer_shape_curve;
                    break;

                case ShapeType.DrawingLine:
                    img = Resources.layer_shape_line;
                    break;

                case ShapeType.DrawingArrow:
                    img = Resources.layer_shape_arrow;
                    break;

                case ShapeType.DrawingText:
                    img = Resources.layer_shape_text;
                    break;

                case ShapeType.DrawingSpeechBalloon:
                    img = Resources.balloon_box_left;
                    break;

                case ShapeType.DrawingStep:
                    img = Resources.counter_reset;
                    break;

                case ShapeType.DrawingImage:
                    img = Resources.image;
                    break;

                case ShapeType.EffectBlur:
                    img = Resources.layer_shade;
                    break;

                case ShapeType.EffectPixelate:
                    img = Resources.grid;
                    break;

                case ShapeType.EffectHighlight:
                    img = Resources.highlighter_text;
                    break;
                }

                tsbShapeType.Image   = img;
                tsbShapeType.Checked = shapeType == CurrentShapeType;
                tsbShapeType.Tag     = shapeType;

                tsbShapeType.MouseDown += (sender, e) =>
                {
                    tsbShapeType.RadioCheck();
                    CurrentShapeType = shapeType;
                };

                tsMain.Items.Add(tsbShapeType);
            }

            #endregion Tools

            #region Selected object

            tsMain.Items.Add(new ToolStripSeparator());

            tsbBorderColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Border_color___);
            tsbBorderColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbBorderColor.Click       += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color borderColor;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    borderColor = AnnotationOptions.TextBorderColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    borderColor = AnnotationOptions.StepBorderColor;
                }
                else
                {
                    borderColor = AnnotationOptions.BorderColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(borderColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextBorderColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepBorderColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.BorderColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbBorderColor);

            tsbFillColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Fill_color___);
            tsbFillColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbFillColor.Click       += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color fillColor;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    fillColor = AnnotationOptions.TextFillColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    fillColor = AnnotationOptions.StepFillColor;
                }
                else
                {
                    fillColor = AnnotationOptions.FillColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(fillColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextFillColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepFillColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.FillColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbFillColor);

            tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
            tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbHighlightColor.Click       += (sender, e) =>
            {
                PauseForm();

                using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        AnnotationOptions.HighlightColor = dialogColor.NewColor;
                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbHighlightColor);

            tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
            tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbShapeOptions.HideImageMargin();
            tsddbShapeOptions.Image = Resources.layer__pencil;
            tsMain.Items.Add(tsddbShapeOptions);

            tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
            tslnudBorderSize.Content.Minimum      = 0;
            tslnudBorderSize.Content.Maximum      = 20;
            tslnudBorderSize.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                int borderSize = (int)tslnudBorderSize.Content.Value;

                if (shapeType == ShapeType.DrawingText || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    AnnotationOptions.TextBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    AnnotationOptions.StepBorderSize = borderSize;
                }
                else
                {
                    AnnotationOptions.BorderSize = borderSize;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);

            tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
            tslnudCornerRadius.Content.Minimum      = 0;
            tslnudCornerRadius.Content.Maximum      = 150;
            tslnudCornerRadius.Content.Increment    = 3;
            tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                if (shapeType == ShapeType.RegionRoundedRectangle || shapeType == ShapeType.DrawingRoundedRectangle)
                {
                    AnnotationOptions.RoundedRectangleRadius = (int)tslnudCornerRadius.Content.Value;
                }
                else if (shapeType == ShapeType.DrawingText)
                {
                    AnnotationOptions.TextCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudCornerRadius);

            tslnudBlurRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Blur_radius_);
            tslnudBlurRadius.Content.Minimum      = 2;
            tslnudBlurRadius.Content.Maximum      = 100;
            tslnudBlurRadius.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.BlurRadius = (int)tslnudBlurRadius.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBlurRadius);

            tslnudPixelateSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Pixel_size_);
            tslnudPixelateSize.Content.Minimum      = 2;
            tslnudPixelateSize.Content.Maximum      = 100;
            tslnudPixelateSize.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.PixelateSize = (int)tslnudPixelateSize.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);

            // In dropdown menu if only last item is visible then menu opens at 0, 0 position on first open, so need to add dummy item to solve this weird bug...
            tsddbShapeOptions.DropDownItems.Add(new ToolStripSeparator()
            {
                Visible = false
            });

            tsbUndoObject = new ToolStripButton("Undo object");
            tsbUndoObject.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbUndoObject.Image        = Resources.arrow_circle_225_left;
            tsbUndoObject.MouseDown   += (sender, e) => UndoShape();
            tsMain.Items.Add(tsbUndoObject);

            tsbDeleteAll = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Delete_all_objects);
            tsbDeleteAll.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbDeleteAll.Image        = Resources.eraser;
            tsbDeleteAll.MouseDown   += (sender, e) => DeleteAllShapes();
            tsMain.Items.Add(tsbDeleteAll);

            #endregion Selected object

            #region Capture

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                ToolStripDropDownButton tsddbCapture = new ToolStripDropDownButton("Capture");
                tsddbCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbCapture.Image        = Resources.camera;
                tsMain.Items.Add(tsddbCapture);

                tsmiRegionCapture            = new ToolStripMenuItem("Capture regions");
                tsmiRegionCapture.Image      = Resources.layers;
                tsmiRegionCapture.MouseDown += (sender, e) =>
                {
                    form.UpdateRegionPath();
                    form.Close(RegionResult.Region);
                };
                tsddbCapture.DropDownItems.Add(tsmiRegionCapture);

                ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
                tsmiFullscreenCapture.Image      = Resources.layer_fullscreen;
                tsmiFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
                tsddbCapture.DropDownItems.Add(tsmiFullscreenCapture);

                ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
                tsmiActiveMonitorCapture.Image      = Resources.monitor;
                tsmiActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
                tsddbCapture.DropDownItems.Add(tsmiActiveMonitorCapture);

                ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
                tsmiMonitorCapture.HideImageMargin();
                tsmiMonitorCapture.Image = Resources.monitor_window;
                tsddbCapture.DropDownItems.Add(tsmiMonitorCapture);

                Screen[] screens = Screen.AllScreens;

                for (int i = 0; i < screens.Length; i++)
                {
                    Screen            screen = screens[i];
                    ToolStripMenuItem tsmi   = new ToolStripMenuItem(string.Format("{0}. {1}x{2}", i + 1, screen.Bounds.Width, screen.Bounds.Height));
                    int index = i;
                    tsmi.MouseDown += (sender, e) =>
                    {
                        form.MonitorIndex = index;
                        form.Close(RegionResult.Monitor);
                    };
                    tsmiMonitorCapture.DropDownItems.Add(tsmi);
                }
            }

            #endregion Capture

            #region Options

            if (form.Mode != RegionCaptureMode.Editor)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
                tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbOptions.Image        = Resources.gear;
                tsMain.Items.Add(tsddbOptions);

                tsmiQuickCrop              = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
                tsmiQuickCrop.Checked      = !Config.QuickCrop;
                tsmiQuickCrop.CheckOnClick = true;
                tsmiQuickCrop.Click       += (sender, e) => Config.QuickCrop = !tsmiQuickCrop.Checked;
                tsddbOptions.DropDownItems.Add(tsmiQuickCrop);

                ToolStripMenuItem tsmiTips = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_tips);
                tsmiTips.Checked      = Config.ShowHotkeys;
                tsmiTips.CheckOnClick = true;
                tsmiTips.Click       += (sender, e) => Config.ShowHotkeys = tsmiTips.Checked;
                tsddbOptions.DropDownItems.Add(tsmiTips);

                ToolStripMenuItem tsmiShowInfo = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_position_and_size_info);
                tsmiShowInfo.Checked      = Config.ShowInfo;
                tsmiShowInfo.CheckOnClick = true;
                tsmiShowInfo.Click       += (sender, e) => Config.ShowInfo = tsmiShowInfo.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowInfo);

                ToolStripMenuItem tsmiShowMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_magnifier);
                tsmiShowMagnifier.Checked      = Config.ShowMagnifier;
                tsmiShowMagnifier.CheckOnClick = true;
                tsmiShowMagnifier.Click       += (sender, e) => Config.ShowMagnifier = tsmiShowMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowMagnifier);

                ToolStripMenuItem tsmiUseSquareMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Square_shape_magnifier);
                tsmiUseSquareMagnifier.Checked      = Config.UseSquareMagnifier;
                tsmiUseSquareMagnifier.CheckOnClick = true;
                tsmiUseSquareMagnifier.Click       += (sender, e) => Config.UseSquareMagnifier = tsmiUseSquareMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiUseSquareMagnifier);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelCount = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_count_);
                tslnudMagnifierPixelCount.Content.Minimum      = RegionCaptureOptions.MagnifierPixelCountMinimum;
                tslnudMagnifierPixelCount.Content.Maximum      = RegionCaptureOptions.MagnifierPixelCountMaximum;
                tslnudMagnifierPixelCount.Content.Increment    = 2;
                tslnudMagnifierPixelCount.Content.Value        = Config.MagnifierPixelCount;
                tslnudMagnifierPixelCount.Content.ValueChanged = (sender, e) => Config.MagnifierPixelCount = (int)tslnudMagnifierPixelCount.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelCount);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_size_);
                tslnudMagnifierPixelSize.Content.Minimum      = RegionCaptureOptions.MagnifierPixelSizeMinimum;
                tslnudMagnifierPixelSize.Content.Maximum      = RegionCaptureOptions.MagnifierPixelSizeMaximum;
                tslnudMagnifierPixelSize.Content.Value        = Config.MagnifierPixelSize;
                tslnudMagnifierPixelSize.Content.ValueChanged = (sender, e) => Config.MagnifierPixelSize = (int)tslnudMagnifierPixelSize.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelSize);

                ToolStripMenuItem tsmiShowCrosshair = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_screen_wide_crosshair);
                tsmiShowCrosshair.Checked      = Config.ShowCrosshair;
                tsmiShowCrosshair.CheckOnClick = true;
                tsmiShowCrosshair.Click       += (sender, e) => Config.ShowCrosshair = tsmiShowCrosshair.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowCrosshair);

                ToolStripMenuItem tsmiFixedSize = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fixed_size_region_mode);
                tsmiFixedSize.Checked      = Config.IsFixedSize;
                tsmiFixedSize.CheckOnClick = true;
                tsmiFixedSize.Click       += (sender, e) => Config.IsFixedSize = tsmiFixedSize.Checked;
                tsddbOptions.DropDownItems.Add(tsmiFixedSize);

                ToolStripDoubleLabeledNumericUpDown tslnudFixedSize = new ToolStripDoubleLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Width_,
                                                                                                              Resources.ShapeManager_CreateContextMenu_Height_);
                tslnudFixedSize.Content.Minimum      = 10;
                tslnudFixedSize.Content.Maximum      = 10000;
                tslnudFixedSize.Content.Increment    = 10;
                tslnudFixedSize.Content.Value        = Config.FixedSize.Width;
                tslnudFixedSize.Content.Value2       = Config.FixedSize.Height;
                tslnudFixedSize.Content.ValueChanged = (sender, e) => Config.FixedSize = new Size((int)tslnudFixedSize.Content.Value, (int)tslnudFixedSize.Content.Value2);
                tsddbOptions.DropDownItems.Add(tslnudFixedSize);

                ToolStripMenuItem tsmiShowFPS = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_FPS);
                tsmiShowFPS.Checked      = Config.ShowFPS;
                tsmiShowFPS.CheckOnClick = true;
                tsmiShowFPS.Click       += (sender, e) => Config.ShowFPS = tsmiShowFPS.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowFPS);

                ToolStripMenuItem tsmiRememberMenuState = new ToolStripMenuItem("Remember menu state");
                tsmiRememberMenuState.Checked      = Config.RememberMenuState;
                tsmiRememberMenuState.CheckOnClick = true;
                tsmiRememberMenuState.Click       += (sender, e) => Config.RememberMenuState = tsmiRememberMenuState.Checked;
                tsddbOptions.DropDownItems.Add(tsmiRememberMenuState);
            }

            #endregion Options

            ToolStripLabel tslDragRight = new ToolStripLabel()
            {
                Alignment    = ToolStripItemAlignment.Right,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image        = Resources.ui_radio_button_uncheck,
                Margin       = new Padding(0, 0, 2, 0),
                Padding      = new Padding(2)
            };

            tsMain.Items.Add(tslDragRight);

            tslDragLeft.MouseDown   += TslDrag_MouseDown;
            tslDragRight.MouseDown  += TslDrag_MouseDown;
            tslDragLeft.MouseEnter  += TslDrag_MouseEnter;
            tslDragRight.MouseEnter += TslDrag_MouseEnter;
            tslDragLeft.MouseLeave  += TslDrag_MouseLeave;
            tslDragRight.MouseLeave += TslDrag_MouseLeave;

            tsMain.ResumeLayout(false);
            tsMain.PerformLayout();
            menuForm.ResumeLayout(false);

            menuForm.Show(form);

            foreach (ToolStripItem tsi in tsMain.Items.OfType <ToolStripItem>())
            {
                if (!string.IsNullOrEmpty(tsi.Text))
                {
                    tsi.MouseEnter += (sender, e) =>
                    {
                        Point pos = CaptureHelpers.ScreenToClient(menuForm.PointToScreen(tsi.Bounds.Location));
                        pos.Y += tsi.Height + 8;
                        MenuTextAnimation.Position = pos;
                        MenuTextAnimation.Start(tsi.Text);
                    };

                    tsi.MouseLeave += TsMain_MouseLeave;
                }
            }

            UpdateMenu();

            CurrentShapeTypeChanged += shapeType => UpdateMenu();

            CurrentShapeChanged += shape => UpdateMenu();

            ConfigureMenuState();

            form.Activate();
        }
Esempio n. 36
0
 private void InitializeComponent()
 {
     this.tsActions = new PluginCore.Controls.ToolStripEx();
     this.tsbRemoveSelected = new System.Windows.Forms.ToolStripButton();
     this.tsbRemoveFiltered = new System.Windows.Forms.ToolStripButton();
     this.tsbAlternateFiltered = new System.Windows.Forms.ToolStripButton();
     this.tsSeparator = new System.Windows.Forms.ToolStripSeparator();
     this.tsbExportFiltered = new System.Windows.Forms.ToolStripButton();
     this.tsbImport = new System.Windows.Forms.ToolStripButton();
     this.tstxtFilter = new System.Windows.Forms.ToolStripTextBox();
     this.tscbFilterColumns = new System.Windows.Forms.ToolStripComboBoxEx();
     this.tsActions.SuspendLayout();
     this.SuspendLayout();
     // 
     // tsActions
     // 
     this.tsActions.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.tsActions.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
     this.tsActions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.tsbRemoveSelected,
     this.tsbRemoveFiltered,
     this.tsbAlternateFiltered,
     this.tsSeparator,
     this.tsbExportFiltered,
     this.tsbImport,
     this.tstxtFilter,
     this.tscbFilterColumns});
     this.tsActions.Location = new System.Drawing.Point(1, 0);
     this.tsActions.Name = "tsActions";
     this.tsActions.Size = new System.Drawing.Size(148, 27);
     this.tsActions.TabIndex = 0;
     this.tsActions.Text = "toolStrip1";
     // 
     // tsbRemoveSelected
     // 
     this.tsbRemoveSelected.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbRemoveSelected.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbRemoveSelected.Name = "tsbRemoveSelected";
     this.tsbRemoveSelected.Size = new System.Drawing.Size(23, 24);
     this.tsbRemoveSelected.Text = "toolStripButton1";
     this.tsbRemoveSelected.Click += new System.EventHandler(this.TsbRemoveSelected_Click);
     // 
     // tsbRemoveFiltered
     // 
     this.tsbRemoveFiltered.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbRemoveFiltered.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbRemoveFiltered.Name = "tsbRemoveFiltered";
     this.tsbRemoveFiltered.Size = new System.Drawing.Size(23, 24);
     this.tsbRemoveFiltered.Text = "toolStripButton2";
     this.tsbRemoveFiltered.Click += new System.EventHandler(this.TsbRemoveFiltered_Click);
     // 
     // tsbAlternateFiltered
     // 
     this.tsbAlternateFiltered.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbAlternateFiltered.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbAlternateFiltered.Name = "tsbAlternateFiltered";
     this.tsbAlternateFiltered.Size = new System.Drawing.Size(23, 24);
     this.tsbAlternateFiltered.Text = "toolStripButton3";
     this.tsbAlternateFiltered.Click += new System.EventHandler(this.TsbAlternateFiltered_Click);
     // 
     // tsSeparator
     // 
     this.tsSeparator.Name = "tsSeparator";
     this.tsSeparator.Size = new System.Drawing.Size(6, 27);
     // 
     // tsbExportFiltered
     // 
     this.tsbExportFiltered.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbExportFiltered.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbExportFiltered.Name = "tsbExportFiltered";
     this.tsbExportFiltered.Size = new System.Drawing.Size(23, 24);
     this.tsbExportFiltered.Text = "toolStripButton4";
     this.tsbExportFiltered.Click += new System.EventHandler(this.TsbExportFiltered_Click);
     // 
     // tsbImport
     // 
     this.tsbImport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbImport.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbImport.Name = "tsbImport";
     this.tsbImport.Size = new System.Drawing.Size(23, 24);
     this.tsbImport.Text = "toolStripButton5";
     this.tsbImport.Click += new System.EventHandler(this.TsbImport_Click);
     // 
     // tstxtFilter
     // 
     this.tstxtFilter.Name = "tstxtFilter";
     this.tstxtFilter.Size = new System.Drawing.Size(ScaleHelper.Scale(90), 23);
     this.tstxtFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TstxtFilter_KeyDown);
     // 
     // tscbFilterColumns
     // 
     this.tscbFilterColumns.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.tscbFilterColumns.Name = "tscbFilterColumns";
     this.tscbFilterColumns.Size = new System.Drawing.Size(ScaleHelper.Scale(116), 23);
     // 
     // BreakPointUI
     // 
     this.Controls.Add(this.tsActions);
     this.Name = "BreakPointUI";
     this.tsActions.ResumeLayout(false);
     this.tsActions.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Esempio n. 37
0
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.toolStripEx = new ToolStripEx();
     this.onePxSpacingLeft = new Control();
     this.SuspendLayout();
     //
     // toolStripEx
     //
     this.toolStripEx.Dock = System.Windows.Forms.DockStyle.Top;
     this.toolStripEx.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.toolStripEx.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow;
     this.toolStripEx.ItemClicked += new ToolStripItemClickedEventHandler(ToolStripEx_ItemClicked);
     this.toolStripEx.Name = "toolStripEx";
     this.toolStripEx.AutoSize = true;
     this.toolStripEx.RelinquishFocus += new EventHandler(ToolStripEx_RelinquishFocus);
     //
     // onePxSpacingLeft
     //
     this.onePxSpacingLeft.Dock = System.Windows.Forms.DockStyle.Left;
     this.onePxSpacingLeft.Width = 1;
     this.onePxSpacingLeft.Name = "onePxSpacingLeft";
     //
     // MainToolBar
     //
     this.Controls.Add(this.toolStripEx);
     this.Controls.Add(this.onePxSpacingLeft);
     this.AutoScaleDimensions = new SizeF(96F, 96F);
     this.AutoScaleMode = AutoScaleMode.Dpi;
     this.Name = "MainToolBar";
     this.Size = new System.Drawing.Size(48, 328);
     this.ResumeLayout(false);
 }
Esempio n. 38
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.valueGradientControl = new PaintDotNet.ColorGradientControl();
            this.colorWheel = new PaintDotNet.ColorWheel();
            this.redUpDown = new System.Windows.Forms.NumericUpDown();
            this.greenUpDown = new System.Windows.Forms.NumericUpDown();
            this.blueUpDown = new System.Windows.Forms.NumericUpDown();
            this.redLabel = new System.Windows.Forms.Label();
            this.blueLabel = new System.Windows.Forms.Label();
            this.greenLabel = new System.Windows.Forms.Label();
            this.saturationLabel = new System.Windows.Forms.Label();
            this.valueLabel = new System.Windows.Forms.Label();
            this.hueLabel = new System.Windows.Forms.Label();
            this.valueUpDown = new System.Windows.Forms.NumericUpDown();
            this.saturationUpDown = new System.Windows.Forms.NumericUpDown();
            this.hueUpDown = new System.Windows.Forms.NumericUpDown();
            this.hexBox = new System.Windows.Forms.TextBox();
            this.hexLabel = new System.Windows.Forms.Label();
            this.whichUserColorBox = new System.Windows.Forms.ComboBox();
            this.alphaUpDown = new System.Windows.Forms.NumericUpDown();
            this.moreLessButton = new System.Windows.Forms.Button();
            this.lessModeButtonSentinel = new System.Windows.Forms.Control();
            this.moreModeButtonSentinel = new System.Windows.Forms.Control();
            this.lessModeHeaderSentinel = new System.Windows.Forms.Control();
            this.moreModeHeaderSentinel = new System.Windows.Forms.Control();
            this.rgbHeader = new PaintDotNet.HeaderLabel();
            this.hsvHeader = new PaintDotNet.HeaderLabel();
            this.alphaHeader = new PaintDotNet.HeaderLabel();
            this.swatchHeader = new PaintDotNet.HeaderLabel();
            this.swatchControl = new PaintDotNet.SwatchControl();
            this.colorDisplayWidget = new PaintDotNet.ColorDisplayWidget();
            this.toolStrip = new PaintDotNet.SystemLayer.ToolStripEx();
            this.colorAddButton = new System.Windows.Forms.ToolStripButton();
            this.colorPalettesButton = new System.Windows.Forms.ToolStripSplitButton();
            this.hueGradientControl = new PaintDotNet.ColorGradientControl();
            this.saturationGradientControl = new PaintDotNet.ColorGradientControl();
            this.alphaGradientControl = new PaintDotNet.ColorGradientControl();
            this.redGradientControl = new PaintDotNet.ColorGradientControl();
            this.greenGradientControl = new PaintDotNet.ColorGradientControl();
            this.blueGradientControl = new PaintDotNet.ColorGradientControl();
            ((System.ComponentModel.ISupportInitialize)(this.redUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.valueUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.saturationUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.hueUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.alphaUpDown)).BeginInit();
            this.toolStrip.SuspendLayout();
            this.SuspendLayout();
            // 
            // valueGradientControl
            // 
            this.valueGradientControl.Count = 1;
            this.valueGradientControl.CustomGradient = null;
            this.valueGradientControl.DrawFarNub = true;
            this.valueGradientControl.DrawNearNub = false;
            this.valueGradientControl.Location = new System.Drawing.Point(243, 185);
            this.valueGradientControl.MaxColor = System.Drawing.Color.White;
            this.valueGradientControl.MinColor = System.Drawing.Color.Black;
            this.valueGradientControl.Name = "valueGradientControl";
            this.valueGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.valueGradientControl.Size = new System.Drawing.Size(73, 19);
            this.valueGradientControl.TabIndex = 2;
            this.valueGradientControl.TabStop = false;
            this.valueGradientControl.Value = 0;
            this.valueGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.HsvGradientControl_ValueChanged);
            // 
            // colorWheel
            // 
            this.colorWheel.Location = new System.Drawing.Point(65, 35);
            this.colorWheel.Name = "colorWheel";
            this.colorWheel.Size = new System.Drawing.Size(129, 130);
            this.colorWheel.TabIndex = 3;
            this.colorWheel.TabStop = false;
            this.colorWheel.ColorChanged += new System.EventHandler(this.ColorWheel_ColorChanged);
            // 
            // redUpDown
            // 
            this.redUpDown.Location = new System.Drawing.Point(320, 24);
            this.redUpDown.Maximum = new decimal(new int[] {
            255,
            0,
            0,
            0});
            this.redUpDown.Name = "redUpDown";
            this.redUpDown.Size = new System.Drawing.Size(56, 20);
            this.redUpDown.TabIndex = 2;
            this.redUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.redUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.redUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.redUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.redUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // greenUpDown
            // 
            this.greenUpDown.Location = new System.Drawing.Point(320, 48);
            this.greenUpDown.Maximum = new decimal(new int[] {
            255,
            0,
            0,
            0});
            this.greenUpDown.Name = "greenUpDown";
            this.greenUpDown.Size = new System.Drawing.Size(56, 20);
            this.greenUpDown.TabIndex = 3;
            this.greenUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.greenUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.greenUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.greenUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.greenUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // blueUpDown
            // 
            this.blueUpDown.Location = new System.Drawing.Point(320, 72);
            this.blueUpDown.Maximum = new decimal(new int[] {
            255,
            0,
            0,
            0});
            this.blueUpDown.Name = "blueUpDown";
            this.blueUpDown.Size = new System.Drawing.Size(56, 20);
            this.blueUpDown.TabIndex = 4;
            this.blueUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.blueUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.blueUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.blueUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.blueUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // redLabel
            // 
            this.redLabel.AutoSize = true;
            this.redLabel.Location = new System.Drawing.Point(222, 28);
            this.redLabel.Name = "redLabel";
            this.redLabel.Size = new System.Drawing.Size(15, 13);
            this.redLabel.TabIndex = 7;
            this.redLabel.Text = "R";
            this.redLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // blueLabel
            // 
            this.blueLabel.AutoSize = true;
            this.blueLabel.Location = new System.Drawing.Point(222, 76);
            this.blueLabel.Name = "blueLabel";
            this.blueLabel.Size = new System.Drawing.Size(14, 13);
            this.blueLabel.TabIndex = 8;
            this.blueLabel.Text = "B";
            this.blueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // greenLabel
            // 
            this.greenLabel.AutoSize = true;
            this.greenLabel.Location = new System.Drawing.Point(222, 52);
            this.greenLabel.Name = "greenLabel";
            this.greenLabel.Size = new System.Drawing.Size(15, 13);
            this.greenLabel.TabIndex = 9;
            this.greenLabel.Text = "G";
            this.greenLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // saturationLabel
            // 
            this.saturationLabel.AutoSize = true;
            this.saturationLabel.Location = new System.Drawing.Point(222, 164);
            this.saturationLabel.Name = "saturationLabel";
            this.saturationLabel.Size = new System.Drawing.Size(17, 13);
            this.saturationLabel.TabIndex = 16;
            this.saturationLabel.Text = "S:";
            this.saturationLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // valueLabel
            // 
            this.valueLabel.AutoSize = true;
            this.valueLabel.Location = new System.Drawing.Point(222, 188);
            this.valueLabel.Name = "valueLabel";
            this.valueLabel.Size = new System.Drawing.Size(17, 13);
            this.valueLabel.TabIndex = 15;
            this.valueLabel.Text = "V:";
            this.valueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // hueLabel
            // 
            this.hueLabel.AutoSize = true;
            this.hueLabel.Location = new System.Drawing.Point(222, 140);
            this.hueLabel.Name = "hueLabel";
            this.hueLabel.Size = new System.Drawing.Size(18, 13);
            this.hueLabel.TabIndex = 14;
            this.hueLabel.Text = "H:";
            this.hueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // valueUpDown
            // 
            this.valueUpDown.Location = new System.Drawing.Point(320, 184);
            this.valueUpDown.Name = "valueUpDown";
            this.valueUpDown.Size = new System.Drawing.Size(56, 20);
            this.valueUpDown.TabIndex = 8;
            this.valueUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.valueUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.valueUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.valueUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.valueUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // saturationUpDown
            // 
            this.saturationUpDown.Location = new System.Drawing.Point(320, 160);
            this.saturationUpDown.Name = "saturationUpDown";
            this.saturationUpDown.Size = new System.Drawing.Size(56, 20);
            this.saturationUpDown.TabIndex = 7;
            this.saturationUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.saturationUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.saturationUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.saturationUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.saturationUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // hueUpDown
            // 
            this.hueUpDown.Location = new System.Drawing.Point(320, 136);
            this.hueUpDown.Maximum = new decimal(new int[] {
            360,
            0,
            0,
            0});
            this.hueUpDown.Name = "hueUpDown";
            this.hueUpDown.Size = new System.Drawing.Size(56, 20);
            this.hueUpDown.TabIndex = 6;
            this.hueUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.hueUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.hueUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.hueUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.hueUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // hexBox
            // 
            this.hexBox.Location = new System.Drawing.Point(320, 96);
            this.hexBox.Name = "hexBox";
            this.hexBox.Size = new System.Drawing.Size(56, 20);
            this.hexBox.TabIndex = 5;
            this.hexBox.Text = "000000";
            this.hexBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.hexBox.Enter += new System.EventHandler(this.HexUpDown_Enter);
            this.hexBox.Leave += new System.EventHandler(this.HexUpDown_Leave);
            this.hexBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HexUpDown_KeyUp);
            this.hexBox.TextChanged += new System.EventHandler(this.UpDown_ValueChanged);
            // 
            // hexLabel
            // 
            this.hexLabel.AutoSize = true;
            this.hexLabel.Location = new System.Drawing.Point(222, 99);
            this.hexLabel.Name = "hexLabel";
            this.hexLabel.Size = new System.Drawing.Size(26, 13);
            this.hexLabel.TabIndex = 13;
            this.hexLabel.Text = "Hex";
            this.hexLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // whichUserColorBox
            // 
            this.whichUserColorBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.whichUserColorBox.Location = new System.Drawing.Point(8, 8);
            this.whichUserColorBox.Name = "whichUserColorBox";
            this.whichUserColorBox.Size = new System.Drawing.Size(112, 21);
            this.whichUserColorBox.TabIndex = 0;
            this.whichUserColorBox.SelectedIndexChanged += new System.EventHandler(this.WhichUserColorBox_SelectedIndexChanged);
            // 
            // alphaUpDown
            // 
            this.alphaUpDown.Location = new System.Drawing.Point(320, 228);
            this.alphaUpDown.Maximum = new decimal(new int[] {
            255,
            0,
            0,
            0});
            this.alphaUpDown.Name = "alphaUpDown";
            this.alphaUpDown.Size = new System.Drawing.Size(56, 20);
            this.alphaUpDown.TabIndex = 10;
            this.alphaUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.alphaUpDown.Enter += new System.EventHandler(this.UpDown_Enter);
            this.alphaUpDown.ValueChanged += new System.EventHandler(this.UpDown_ValueChanged);
            this.alphaUpDown.Leave += new System.EventHandler(this.UpDown_Leave);
            this.alphaUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UpDown_KeyUp);
            // 
            // moreLessButton
            // 
            this.moreLessButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.moreLessButton.Location = new System.Drawing.Point(126, 7);
            this.moreLessButton.Name = "moreLessButton";
            this.moreLessButton.Size = new System.Drawing.Size(75, 23);
            this.moreLessButton.TabIndex = 1;
            this.moreLessButton.Click += new System.EventHandler(this.MoreLessButton_Click);
            // 
            // lessModeButtonSentinel
            // 
            this.lessModeButtonSentinel.Location = new System.Drawing.Point(128, 7);
            this.lessModeButtonSentinel.Name = "lessModeButtonSentinel";
            this.lessModeButtonSentinel.Size = new System.Drawing.Size(0, 0);
            this.lessModeButtonSentinel.TabIndex = 22;
            this.lessModeButtonSentinel.Text = "we put the lessMore control here when in \"Less\" mode";
            this.lessModeButtonSentinel.Visible = false;
            // 
            // moreModeButtonSentinel
            // 
            this.moreModeButtonSentinel.Location = new System.Drawing.Point(165, 7);
            this.moreModeButtonSentinel.Name = "moreModeButtonSentinel";
            this.moreModeButtonSentinel.Size = new System.Drawing.Size(0, 0);
            this.moreModeButtonSentinel.TabIndex = 23;
            this.moreModeButtonSentinel.Visible = false;
            // 
            // lessModeHeaderSentinel
            // 
            this.lessModeHeaderSentinel.Location = new System.Drawing.Point(8, 40);
            this.lessModeHeaderSentinel.Name = "lessModeHeaderSentinel";
            this.lessModeHeaderSentinel.Size = new System.Drawing.Size(195, 185);
            this.lessModeHeaderSentinel.TabIndex = 24;
            this.lessModeHeaderSentinel.Visible = false;
            // 
            // moreModeHeaderSentinel
            // 
            this.moreModeHeaderSentinel.Location = new System.Drawing.Point(8, 40);
            this.moreModeHeaderSentinel.Name = "moreModeHeaderSentinel";
            this.moreModeHeaderSentinel.Size = new System.Drawing.Size(232, 216);
            this.moreModeHeaderSentinel.TabIndex = 25;
            this.moreModeHeaderSentinel.TabStop = false;
            this.moreModeHeaderSentinel.Visible = false;
            // 
            // rgbHeader
            // 
            this.rgbHeader.Location = new System.Drawing.Point(222, 8);
            this.rgbHeader.Name = "rgbHeader";
            this.rgbHeader.RightMargin = 0;
            this.rgbHeader.Size = new System.Drawing.Size(154, 14);
            this.rgbHeader.TabIndex = 27;
            this.rgbHeader.TabStop = false;
            // 
            // hsvHeader
            // 
            this.hsvHeader.Location = new System.Drawing.Point(222, 120);
            this.hsvHeader.Name = "hsvHeader";
            this.hsvHeader.RightMargin = 0;
            this.hsvHeader.Size = new System.Drawing.Size(154, 14);
            this.hsvHeader.TabIndex = 28;
            this.hsvHeader.TabStop = false;
            // 
            // alphaHeader
            // 
            this.alphaHeader.Location = new System.Drawing.Point(222, 212);
            this.alphaHeader.Name = "alphaHeader";
            this.alphaHeader.RightMargin = 0;
            this.alphaHeader.Size = new System.Drawing.Size(154, 14);
            this.alphaHeader.TabIndex = 29;
            this.alphaHeader.TabStop = false;
            // 
            // swatchHeader
            // 
            this.swatchHeader.Location = new System.Drawing.Point(8, 177);
            this.swatchHeader.Name = "swatchHeader";
            this.swatchHeader.RightMargin = 0;
            this.swatchHeader.Size = new System.Drawing.Size(193, 14);
            this.swatchHeader.TabIndex = 30;
            this.swatchHeader.TabStop = false;
            // 
            // swatchControl
            // 
            this.swatchControl.BlinkHighlight = false;
            this.swatchControl.Colors = new PaintDotNet.ColorBgra[0];
            this.swatchControl.Location = new System.Drawing.Point(8, 189);
            this.swatchControl.Name = "swatchControl";
            this.swatchControl.Size = new System.Drawing.Size(192, 74);
            this.swatchControl.TabIndex = 31;
            this.swatchControl.Text = "swatchControl1";
            this.swatchControl.ColorsChanged += this.SwatchControl_ColorsChanged;
            this.swatchControl.ColorClicked += this.SwatchControl_ColorClicked;
            // 
            // colorDisplayWidget
            // 
            this.colorDisplayWidget.Location = new System.Drawing.Point(4, 32);
            this.colorDisplayWidget.Name = "colorDisplayWidget";
            this.colorDisplayWidget.Size = new System.Drawing.Size(52, 52);
            this.colorDisplayWidget.TabIndex = 32;
            this.colorDisplayWidget.BlackAndWhiteButtonClicked += ColorDisplayWidget_BlackAndWhiteButtonClicked;
            this.colorDisplayWidget.SwapColorsClicked += ColorDisplayWidget_SwapColorsClicked;
            this.colorDisplayWidget.UserPrimaryColorClick += ColorDisplay_PrimaryColorClicked;
            this.colorDisplayWidget.UserSecondaryColorClick += ColorDisplay_SecondaryColorClicked;
            // 
            // toolStrip
            // 
            this.toolStrip.ClickThrough = true;
            this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
            this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.colorAddButton,
                this.colorPalettesButton});
            this.toolStrip.Location = new System.Drawing.Point(5, 157);
            this.toolStrip.ManagedFocus = true;
            this.toolStrip.Name = "toolStrip";
            this.toolStrip.Size = new System.Drawing.Size(65, 25);
            this.toolStrip.TabIndex = 33;
            this.toolStrip.Text = "toolStrip";
            // 
            // colorAddButton
            // 
            this.colorAddButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.colorAddButton.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.colorAddButton.Name = "colorAddButton";
            this.colorAddButton.Size = new System.Drawing.Size(23, 22);
            this.colorAddButton.Text = "colorAddButton";
            this.colorAddButton.Click += new System.EventHandler(this.ColorAddButton_Click);
            // 
            // colorPalettesButton
            // 
            this.colorPalettesButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.colorPalettesButton.Name = "colorPalettesButton";
            this.colorPalettesButton.Size = new System.Drawing.Size(16, 22);
            this.colorPalettesButton.Click += new System.EventHandler(this.ColorPalettesButton_Click);
            this.colorPalettesButton.DropDownOpening += new System.EventHandler(this.ColorPalettesButton_DropDownOpening);
            // 
            // hueGradientControl
            // 
            this.hueGradientControl.Count = 1;
            this.hueGradientControl.CustomGradient = null;
            this.hueGradientControl.DrawFarNub = true;
            this.hueGradientControl.DrawNearNub = false;
            this.hueGradientControl.Location = new System.Drawing.Point(243, 137);
            this.hueGradientControl.MaxColor = System.Drawing.Color.White;
            this.hueGradientControl.MinColor = System.Drawing.Color.Black;
            this.hueGradientControl.Name = "hueGradientControl";
            this.hueGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.hueGradientControl.Size = new System.Drawing.Size(73, 19);
            this.hueGradientControl.TabIndex = 34;
            this.hueGradientControl.TabStop = false;
            this.hueGradientControl.Value = 0;
            this.hueGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.HsvGradientControl_ValueChanged);
            // 
            // saturationGradientControl
            // 
            this.saturationGradientControl.Count = 1;
            this.saturationGradientControl.CustomGradient = null;
            this.saturationGradientControl.DrawFarNub = true;
            this.saturationGradientControl.DrawNearNub = false;
            this.saturationGradientControl.Location = new System.Drawing.Point(243, 161);
            this.saturationGradientControl.MaxColor = System.Drawing.Color.White;
            this.saturationGradientControl.MinColor = System.Drawing.Color.Black;
            this.saturationGradientControl.Name = "saturationGradientControl";
            this.saturationGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.saturationGradientControl.Size = new System.Drawing.Size(73, 19);
            this.saturationGradientControl.TabIndex = 35;
            this.saturationGradientControl.TabStop = false;
            this.saturationGradientControl.Value = 0;
            this.saturationGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.HsvGradientControl_ValueChanged);
            // 
            // alphaGradientControl
            // 
            this.alphaGradientControl.Count = 1;
            this.alphaGradientControl.CustomGradient = null;
            this.alphaGradientControl.DrawFarNub = true;
            this.alphaGradientControl.DrawNearNub = false;
            this.alphaGradientControl.Location = new System.Drawing.Point(243, 229);
            this.alphaGradientControl.MaxColor = System.Drawing.Color.White;
            this.alphaGradientControl.MinColor = System.Drawing.Color.Black;
            this.alphaGradientControl.Name = "alphaGradientControl";
            this.alphaGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.alphaGradientControl.Size = new System.Drawing.Size(73, 19);
            this.alphaGradientControl.TabIndex = 36;
            this.alphaGradientControl.TabStop = false;
            this.alphaGradientControl.Value = 0;
            this.alphaGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.UpDown_ValueChanged);
            // 
            // redGradientControl
            // 
            this.redGradientControl.Count = 1;
            this.redGradientControl.CustomGradient = null;
            this.redGradientControl.DrawFarNub = true;
            this.redGradientControl.DrawNearNub = false;
            this.redGradientControl.Location = new System.Drawing.Point(243, 25);
            this.redGradientControl.MaxColor = System.Drawing.Color.White;
            this.redGradientControl.MinColor = System.Drawing.Color.Black;
            this.redGradientControl.Name = "redGradientControl";
            this.redGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.redGradientControl.Size = new System.Drawing.Size(73, 19);
            this.redGradientControl.TabIndex = 37;
            this.redGradientControl.TabStop = false;
            this.redGradientControl.Value = 0;
            this.redGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.RgbGradientControl_ValueChanged);
            // 
            // greenGradientControl
            // 
            this.greenGradientControl.Count = 1;
            this.greenGradientControl.CustomGradient = null;
            this.greenGradientControl.DrawFarNub = true;
            this.greenGradientControl.DrawNearNub = false;
            this.greenGradientControl.Location = new System.Drawing.Point(243, 49);
            this.greenGradientControl.MaxColor = System.Drawing.Color.White;
            this.greenGradientControl.MinColor = System.Drawing.Color.Black;
            this.greenGradientControl.Name = "greenGradientControl";
            this.greenGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.greenGradientControl.Size = new System.Drawing.Size(73, 19);
            this.greenGradientControl.TabIndex = 38;
            this.greenGradientControl.TabStop = false;
            this.greenGradientControl.Value = 0;
            this.greenGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.RgbGradientControl_ValueChanged);
            // 
            // blueGradientControl
            // 
            this.blueGradientControl.Count = 1;
            this.blueGradientControl.CustomGradient = null;
            this.blueGradientControl.DrawFarNub = true;
            this.blueGradientControl.DrawNearNub = false;
            this.blueGradientControl.Location = new System.Drawing.Point(243, 73);
            this.blueGradientControl.MaxColor = System.Drawing.Color.White;
            this.blueGradientControl.MinColor = System.Drawing.Color.Black;
            this.blueGradientControl.Name = "blueGradientControl";
            this.blueGradientControl.Orientation = System.Windows.Forms.Orientation.Horizontal;
            this.blueGradientControl.Size = new System.Drawing.Size(73, 19);
            this.blueGradientControl.TabIndex = 39;
            this.blueGradientControl.TabStop = false;
            this.blueGradientControl.Value = 0;
            this.blueGradientControl.ValueChanged += new PaintDotNet.IndexEventHandler(this.RgbGradientControl_ValueChanged);
            // 
            // ColorsForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            this.ClientSize = new System.Drawing.Size(386, 266);
            this.Controls.Add(this.valueLabel);
            this.Controls.Add(this.saturationLabel);
            this.Controls.Add(this.hueLabel);
            this.Controls.Add(this.greenLabel);
            this.Controls.Add(this.blueLabel);
            this.Controls.Add(this.redLabel);
            this.Controls.Add(this.hexLabel);
            this.Controls.Add(this.blueGradientControl);
            this.Controls.Add(this.greenGradientControl);
            this.Controls.Add(this.redGradientControl);
            this.Controls.Add(this.alphaGradientControl);
            this.Controls.Add(this.saturationGradientControl);
            this.Controls.Add(this.hueGradientControl);
            this.Controls.Add(this.toolStrip);
            this.Controls.Add(this.colorWheel);
            this.Controls.Add(this.colorDisplayWidget);
            this.Controls.Add(this.swatchControl);
            this.Controls.Add(this.swatchHeader);
            this.Controls.Add(this.alphaHeader);
            this.Controls.Add(this.hsvHeader);
            this.Controls.Add(this.rgbHeader);
            this.Controls.Add(this.valueGradientControl);
            this.Controls.Add(this.moreModeButtonSentinel);
            this.Controls.Add(this.lessModeButtonSentinel);
            this.Controls.Add(this.moreLessButton);
            this.Controls.Add(this.whichUserColorBox);
            this.Controls.Add(this.lessModeHeaderSentinel);
            this.Controls.Add(this.moreModeHeaderSentinel);
            this.Controls.Add(this.blueUpDown);
            this.Controls.Add(this.greenUpDown);
            this.Controls.Add(this.redUpDown);
            this.Controls.Add(this.hexBox);
            this.Controls.Add(this.hueUpDown);
            this.Controls.Add(this.saturationUpDown);
            this.Controls.Add(this.valueUpDown);
            this.Controls.Add(this.alphaUpDown);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            this.Name = "ColorsForm";
            this.Controls.SetChildIndex(this.alphaUpDown, 0);
            this.Controls.SetChildIndex(this.valueUpDown, 0);
            this.Controls.SetChildIndex(this.saturationUpDown, 0);
            this.Controls.SetChildIndex(this.hueUpDown, 0);
            this.Controls.SetChildIndex(this.hexBox, 0);
            this.Controls.SetChildIndex(this.redUpDown, 0);
            this.Controls.SetChildIndex(this.greenUpDown, 0);
            this.Controls.SetChildIndex(this.blueUpDown, 0);
            this.Controls.SetChildIndex(this.moreModeHeaderSentinel, 0);
            this.Controls.SetChildIndex(this.lessModeHeaderSentinel, 0);
            this.Controls.SetChildIndex(this.whichUserColorBox, 0);
            this.Controls.SetChildIndex(this.moreLessButton, 0);
            this.Controls.SetChildIndex(this.lessModeButtonSentinel, 0);
            this.Controls.SetChildIndex(this.moreModeButtonSentinel, 0);
            this.Controls.SetChildIndex(this.valueGradientControl, 0);
            this.Controls.SetChildIndex(this.rgbHeader, 0);
            this.Controls.SetChildIndex(this.hsvHeader, 0);
            this.Controls.SetChildIndex(this.alphaHeader, 0);
            this.Controls.SetChildIndex(this.swatchHeader, 0);
            this.Controls.SetChildIndex(this.swatchControl, 0);
            this.Controls.SetChildIndex(this.colorDisplayWidget, 0);
            this.Controls.SetChildIndex(this.colorWheel, 0);
            this.Controls.SetChildIndex(this.toolStrip, 0);
            this.Controls.SetChildIndex(this.hueGradientControl, 0);
            this.Controls.SetChildIndex(this.saturationGradientControl, 0);
            this.Controls.SetChildIndex(this.alphaGradientControl, 0);
            this.Controls.SetChildIndex(this.redGradientControl, 0);
            this.Controls.SetChildIndex(this.greenGradientControl, 0);
            this.Controls.SetChildIndex(this.blueGradientControl, 0);
            this.Controls.SetChildIndex(this.hexLabel, 0);
            this.Controls.SetChildIndex(this.redLabel, 0);
            this.Controls.SetChildIndex(this.blueLabel, 0);
            this.Controls.SetChildIndex(this.greenLabel, 0);
            this.Controls.SetChildIndex(this.hueLabel, 0);
            this.Controls.SetChildIndex(this.saturationLabel, 0);
            this.Controls.SetChildIndex(this.valueLabel, 0);
            ((System.ComponentModel.ISupportInitialize)(this.redUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.valueUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.saturationUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.hueUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.alphaUpDown)).EndInit();
            this.toolStrip.ResumeLayout(false);
            this.toolStrip.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
Esempio n. 39
0
 private void InitializeComponent()
 {
     this.components = new Container();
     Document document = new Document();
     ComponentResourceManager manager = new ComponentResourceManager(typeof(QueryControl));
     this.splitContainer = new SplitContainer();
     this.panEditor = new Panel();
     this.panError = new Panel();
     this.txtError = new TextBox();
     this.panBottom = new Panel();
     this.panOutput = new PanelEx();
     this.txtSQL = new ActiproSoftware.SyntaxEditor.SyntaxEditor();
     this.statusStrip = new StatusStrip();
     this.lblStatus = new ToolStripStatusLabel();
     this.queryProgressBar = new ToolStripProgressBar();
     this.lblExecTime = new ToolStripStatusLabel();
     this.lblFill = new ToolStripStatusLabel();
     this.lblMiscStatus = new ToolStripStatusLabel();
     this.lblUberCancel = new ToolStripStatusLabel();
     this.lblElapsed = new ToolStripStatusLabel();
     this.lblOptimize = new ToolStripStatusLabel();
     this.tsOutput = new ToolStripEx();
     this.btnArrange = new ToolStripDropDownButton();
     this.miHideResults = new ToolStripMenuItem();
     this.miUndock = new ToolStripMenuItem();
     this.miArrangeVertical = new ToolStripMenuItem();
     this.toolStripMenuItem3 = new ToolStripSeparator();
     this.miScrollStart = new ToolStripMenuItem();
     this.miScrollEnd = new ToolStripMenuItem();
     this.miAutoScroll = new ToolStripMenuItem();
     this.toolStripMenuItem4 = new ToolStripSeparator();
     this.miKeyboardShortcuts = new ToolStripMenuItem();
     this.btnResults = new ToolStripButton();
     this.btnLambda = new ToolStripButton();
     this.btnSql = new ToolStripButton();
     this.btnIL = new ToolStripButton();
     this.btnActivateAutocompletion = new ToolStripButton();
     this.btnAnalyze = new ToolStripDropDownButton();
     this.miOpenSQLQueryNewTab = new ToolStripMenuItem();
     this.miOpenInSSMS = new ToolStripMenuItem();
     this.btnExport = new ToolStripDropDownButton();
     this.btnExportExcelNoFormat = new ToolStripMenuItem();
     this.btnExportExcel = new ToolStripMenuItem();
     this.toolStripSeparator1 = new ToolStripSeparator();
     this.btnExportWordNoFormat = new ToolStripMenuItem();
     this.btnExportWord = new ToolStripMenuItem();
     this.toolStripMenuItem1 = new ToolStripSeparator();
     this.btnExportHtml = new ToolStripMenuItem();
     this.btnFormat = new ToolStripDropDownButton();
     this.btn1NestingLevel = new ToolStripMenuItem();
     this.btn2NestingLevels = new ToolStripMenuItem();
     this.btn3NestingLevels = new ToolStripMenuItem();
     this.btnAllNestingLevels = new ToolStripMenuItem();
     this.toolStripMenuItem2 = new ToolStripSeparator();
     this.btnResultFormattingPreferences = new ToolStripMenuItem();
     this.lblDb = new Label();
     this.cboLanguage = new ComboBox();
     this.cboDb = new ComboBox();
     this.lblType = new Label();
     this.panTopControls = new TableLayoutPanel();
     this.btnExecute = new ImageButton();
     this.btnCancel = new ImageButton();
     this.llDbUseCurrent = new FixedLinkLabel();
     this.lblSyncDb = new Label();
     this.btnText = new ClearButton();
     this.btnGrids = new ClearButton();
     this.panTop = new Panel();
     this.panCloseButton = new Panel();
     this.btnPin = new ClearButton();
     this.btnClose = new ClearButton();
     this.toolTip = new ToolTip(this.components);
     this.panMain = new Panel();
     this.splitContainer.Panel1.SuspendLayout();
     this.splitContainer.Panel2.SuspendLayout();
     this.splitContainer.SuspendLayout();
     this.panEditor.SuspendLayout();
     this.panError.SuspendLayout();
     this.panBottom.SuspendLayout();
     this.panOutput.SuspendLayout();
     this.statusStrip.SuspendLayout();
     this.tsOutput.SuspendLayout();
     this.panTopControls.SuspendLayout();
     this.panTop.SuspendLayout();
     this.panCloseButton.SuspendLayout();
     this.panMain.SuspendLayout();
     base.SuspendLayout();
     this.splitContainer.Dock = DockStyle.Fill;
     this.splitContainer.Location = new Point(0, 0);
     this.splitContainer.Name = "splitContainer";
     this.splitContainer.Orientation = Orientation.Horizontal;
     this.splitContainer.Panel1.Controls.Add(this.panEditor);
     this.splitContainer.Panel2.Controls.Add(this.panBottom);
     this.splitContainer.Size = new Size(0x2cf, 0x192);
     this.splitContainer.SplitterDistance = 0xc5;
     this.splitContainer.SplitterWidth = 5;
     this.splitContainer.TabIndex = 0;
     this.splitContainer.SplitterMoved += new SplitterEventHandler(this.splitContainer_SplitterMoved);
     this.panEditor.Controls.Add(this.panError);
     this.panEditor.Dock = DockStyle.Fill;
     this.panEditor.Location = new Point(0, 0);
     this.panEditor.Name = "panEditor";
     this.panEditor.Size = new Size(0x2cf, 0xc5);
     this.panEditor.TabIndex = 4;
     this.panError.BackColor = SystemColors.Info;
     this.panError.BorderStyle = BorderStyle.Fixed3D;
     this.panError.Controls.Add(this.txtError);
     this.panError.Dock = DockStyle.Top;
     this.panError.Location = new Point(0, 0);
     this.panError.Name = "panError";
     this.panError.Padding = new Padding(3);
     this.panError.Size = new Size(0x2cf, 0x27);
     this.panError.TabIndex = 3;
     this.panError.Visible = false;
     this.panError.Layout += new LayoutEventHandler(this.panError_Layout);
     this.txtError.BackColor = SystemColors.Info;
     this.txtError.BorderStyle = BorderStyle.None;
     this.txtError.Dock = DockStyle.Fill;
     this.txtError.ForeColor = SystemColors.InfoText;
     this.txtError.Location = new Point(3, 3);
     this.txtError.Margin = new Padding(2);
     this.txtError.Multiline = true;
     this.txtError.Name = "txtError";
     this.txtError.ReadOnly = true;
     this.txtError.Size = new Size(0x2c5, 0x1d);
     this.txtError.TabIndex = 0;
     this.panBottom.BorderStyle = BorderStyle.Fixed3D;
     this.panBottom.Controls.Add(this.panOutput);
     this.panBottom.Controls.Add(this.statusStrip);
     this.panBottom.Controls.Add(this.tsOutput);
     this.panBottom.Dock = DockStyle.Fill;
     this.panBottom.Location = new Point(0, 0);
     this.panBottom.Name = "panBottom";
     this.panBottom.Size = new Size(0x2cf, 200);
     this.panBottom.TabIndex = 0;
     this.panOutput.BorderColor = Color.Empty;
     this.panOutput.Controls.Add(this.txtSQL);
     this.panOutput.Dock = DockStyle.Fill;
     this.panOutput.Location = new Point(0, 0x1a);
     this.panOutput.Name = "panOutput";
     this.panOutput.Size = new Size(0x2cb, 0x92);
     this.panOutput.TabIndex = 1;
     this.panOutput.Layout += new LayoutEventHandler(this.panOutput_Layout);
     this.txtSQL.Dock = DockStyle.Fill;
     this.txtSQL.set_Document(document);
     this.txtSQL.set_IndicatorMarginVisible(false);
     this.txtSQL.Location = new Point(0, 0);
     this.txtSQL.Margin = new Padding(2);
     this.txtSQL.Name = "txtSQL";
     this.txtSQL.set_ScrollBarType(0);
     this.txtSQL.Size = new Size(0x2cb, 0x92);
     this.txtSQL.TabIndex = 0;
     this.statusStrip.Items.AddRange(new ToolStripItem[] { this.lblStatus, this.queryProgressBar, this.lblExecTime, this.lblFill, this.lblMiscStatus, this.lblUberCancel, this.lblElapsed, this.lblOptimize });
     this.statusStrip.Location = new Point(0, 0xac);
     this.statusStrip.Name = "statusStrip";
     this.statusStrip.Size = new Size(0x2cb, 0x18);
     this.statusStrip.SizingGrip = false;
     this.statusStrip.TabIndex = 2;
     this.lblStatus.Name = "lblStatus";
     this.lblStatus.Size = new Size(0x2e, 0x13);
     this.lblStatus.Text = "Ready";
     this.queryProgressBar.Name = "queryProgressBar";
     this.queryProgressBar.Size = new Size(100, 0x12);
     this.queryProgressBar.Style = ProgressBarStyle.Marquee;
     this.queryProgressBar.Visible = false;
     this.lblExecTime.Name = "lblExecTime";
     this.lblExecTime.Size = new Size(0x11, 0x13);
     this.lblExecTime.Text = "  ";
     this.lblExecTime.Visible = false;
     this.lblFill.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.lblFill.Name = "lblFill";
     this.lblFill.Size = new Size(0x7a, 0x13);
     this.lblFill.Spring = true;
     this.lblMiscStatus.Alignment = ToolStripItemAlignment.Right;
     this.lblMiscStatus.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.lblMiscStatus.Name = "lblMiscStatus";
     this.lblMiscStatus.Size = new Size(0x15, 0x13);
     this.lblMiscStatus.Text = "   ";
     this.lblMiscStatus.TextAlign = ContentAlignment.MiddleRight;
     this.lblUberCancel.Alignment = ToolStripItemAlignment.Right;
     this.lblUberCancel.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.lblUberCancel.Name = "lblUberCancel";
     this.lblUberCancel.Size = new Size(0x10a, 0x13);
     this.lblUberCancel.Text = "  Press Ctrl+Shift+F5 to cancel all threads ";
     this.lblUberCancel.TextAlign = ContentAlignment.MiddleRight;
     this.lblUberCancel.Visible = false;
     this.lblElapsed.Alignment = ToolStripItemAlignment.Right;
     this.lblElapsed.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.lblElapsed.Name = "lblElapsed";
     this.lblElapsed.Size = new Size(0x11, 0x13);
     this.lblElapsed.Text = "  ";
     this.lblElapsed.TextAlign = ContentAlignment.MiddleRight;
     this.lblOptimize.BorderSides = ToolStripStatusLabelBorderSides.All;
     this.lblOptimize.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.lblOptimize.ImageScaling = ToolStripItemImageScaling.None;
     this.lblOptimize.ImageTransparentColor = Color.White;
     this.lblOptimize.Margin = new Padding(0, 2, 0, 0);
     this.lblOptimize.Name = "lblOptimize";
     this.lblOptimize.Padding = new Padding(2, 0, 0, 0);
     this.lblOptimize.Size = new Size(0x4e, 0x17);
     this.lblOptimize.Text = "/optimize+";
     this.lblOptimize.MouseHover += new EventHandler(this.lblOptimize_MouseHover);
     this.lblOptimize.Paint += new PaintEventHandler(this.lblOptimize_Paint);
     this.lblOptimize.MouseEnter += new EventHandler(this.lblOptimize_MouseEnter);
     this.lblOptimize.MouseLeave += new EventHandler(this.lblOptimize_MouseLeave);
     this.lblOptimize.MouseDown += new MouseEventHandler(this.lblOptimize_MouseDown);
     this.lblOptimize.Click += new EventHandler(this.lblOptimize_Click);
     this.tsOutput.GripStyle = ToolStripGripStyle.Hidden;
     this.tsOutput.Items.AddRange(new ToolStripItem[] { this.btnArrange, this.btnResults, this.btnLambda, this.btnSql, this.btnIL, this.btnActivateAutocompletion, this.btnAnalyze, this.btnExport, this.btnFormat });
     this.tsOutput.Location = new Point(0, 0);
     this.tsOutput.Name = "tsOutput";
     this.tsOutput.Padding = new Padding(0, 0, 1, 2);
     this.tsOutput.RenderMode = ToolStripRenderMode.System;
     this.tsOutput.Size = new Size(0x2cb, 0x1a);
     this.tsOutput.TabIndex = 0;
     this.tsOutput.Text = "toolStrip1";
     this.tsOutput.MouseEnter += new EventHandler(this.tsOutput_MouseEnter);
     this.btnArrange.DisplayStyle = ToolStripItemDisplayStyle.Image;
     this.btnArrange.DropDownItems.AddRange(new ToolStripItem[] { this.miHideResults, this.miUndock, this.miArrangeVertical, this.toolStripMenuItem3, this.miScrollStart, this.miScrollEnd, this.miAutoScroll, this.toolStripMenuItem4, this.miKeyboardShortcuts });
     this.btnArrange.Image = Resources.DropArrow;
     this.btnArrange.ImageScaling = ToolStripItemImageScaling.None;
     this.btnArrange.Margin = new Padding(0, 1, 3, 2);
     this.btnArrange.Name = "btnArrange";
     this.btnArrange.Padding = new Padding(0, 3, 0, 2);
     this.btnArrange.ShowDropDownArrow = false;
     this.btnArrange.Size = new Size(0x12, 0x15);
     this.btnArrange.DropDownOpening += new EventHandler(this.btnArrange_DropDownOpening);
     this.miHideResults.Name = "miHideResults";
     this.miHideResults.ShortcutKeyDisplayString = "Ctrl+R";
     this.miHideResults.Size = new Size(0x142, 0x18);
     this.miHideResults.Text = "Hide Results Panel";
     this.miHideResults.Click += new EventHandler(this.miHideResults_Click);
     this.miUndock.Name = "miUndock";
     this.miUndock.ShortcutKeyDisplayString = "F8";
     this.miUndock.Size = new Size(0x142, 0x18);
     this.miUndock.Text = "Undock Panel into Second Monitor";
     this.miUndock.Click += new EventHandler(this.miUndock_Click);
     this.miArrangeVertical.Name = "miArrangeVertical";
     this.miArrangeVertical.ShortcutKeyDisplayString = "Ctrl+F8";
     this.miArrangeVertical.Size = new Size(0x142, 0x18);
     this.miArrangeVertical.Text = "Arrange Panel Vertically";
     this.miArrangeVertical.Click += new EventHandler(this.miArrangeVertical_Click);
     this.toolStripMenuItem3.Name = "toolStripMenuItem3";
     this.toolStripMenuItem3.Size = new Size(0x13f, 6);
     this.miScrollStart.Name = "miScrollStart";
     this.miScrollStart.ShortcutKeyDisplayString = "Alt+Home";
     this.miScrollStart.Size = new Size(0x142, 0x18);
     this.miScrollStart.Text = "Scroll to Start";
     this.miScrollStart.Click += new EventHandler(this.miScrollStart_Click);
     this.miScrollEnd.Name = "miScrollEnd";
     this.miScrollEnd.ShortcutKeyDisplayString = "Alt+End";
     this.miScrollEnd.Size = new Size(0x142, 0x18);
     this.miScrollEnd.Text = "Scroll to End";
     this.miScrollEnd.Click += new EventHandler(this.miScrollEnd_Click);
     this.miAutoScroll.Name = "miAutoScroll";
     this.miAutoScroll.ShortcutKeyDisplayString = "Ctrl+Shift+E";
     this.miAutoScroll.Size = new Size(0x142, 0x18);
     this.miAutoScroll.Text = "Auto-Scroll Results to End";
     this.miAutoScroll.Click += new EventHandler(this.miAutoScroll_Click);
     this.toolStripMenuItem4.Name = "toolStripMenuItem4";
     this.toolStripMenuItem4.Size = new Size(0x13f, 6);
     this.miKeyboardShortcuts.Name = "miKeyboardShortcuts";
     this.miKeyboardShortcuts.Size = new Size(0x142, 0x18);
     this.miKeyboardShortcuts.Text = "See more keyboard shortcuts...";
     this.miKeyboardShortcuts.Click += new EventHandler(this.miKeyboardShortcuts_Click);
     this.btnResults.Checked = true;
     this.btnResults.CheckState = CheckState.Checked;
     this.btnResults.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnResults.Image = (Image) manager.GetObject("btnResults.Image");
     this.btnResults.ImageTransparentColor = Color.Magenta;
     this.btnResults.Margin = new Padding(0, 0, 0, 1);
     this.btnResults.Name = "btnResults";
     this.btnResults.Size = new Size(0x38, 0x17);
     this.btnResults.Text = "&Results";
     this.btnResults.Click += new EventHandler(this.btnResults_Click);
     this.btnLambda.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnLambda.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.btnLambda.Image = (Image) manager.GetObject("btnLambda.Image");
     this.btnLambda.ImageTransparentColor = Color.Magenta;
     this.btnLambda.Margin = new Padding(0, 0, 0, 1);
     this.btnLambda.Name = "btnLambda";
     this.btnLambda.Size = new Size(0x1b, 0x17);
     this.btnLambda.Text = " λ ";
     this.btnLambda.Click += new EventHandler(this.btnLambda_Click);
     this.btnSql.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnSql.Image = (Image) manager.GetObject("btnSql.Image");
     this.btnSql.ImageTransparentColor = Color.Magenta;
     this.btnSql.Margin = new Padding(0, 0, 0, 1);
     this.btnSql.Name = "btnSql";
     this.btnSql.Size = new Size(0x26, 0x17);
     this.btnSql.Text = "&SQL";
     this.btnSql.Click += new EventHandler(this.btnSql_Click);
     this.btnIL.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnIL.Image = (Image) manager.GetObject("btnIL.Image");
     this.btnIL.ImageTransparentColor = Color.Magenta;
     this.btnIL.Margin = new Padding(0, 0, 0, 1);
     this.btnIL.Name = "btnIL";
     this.btnIL.Size = new Size(0x20, 0x17);
     this.btnIL.Text = " &IL ";
     this.btnIL.Click += new EventHandler(this.btnIL_Click);
     this.btnActivateAutocompletion.Alignment = ToolStripItemAlignment.Right;
     this.btnActivateAutocompletion.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnActivateAutocompletion.ForeColor = Color.Blue;
     this.btnActivateAutocompletion.Image = (Image) manager.GetObject("btnActivateAutocompletion.Image");
     this.btnActivateAutocompletion.ImageTransparentColor = Color.Magenta;
     this.btnActivateAutocompletion.Margin = new Padding(5, 0, 0, 0);
     this.btnActivateAutocompletion.Name = "btnActivateAutocompletion";
     this.btnActivateAutocompletion.Size = new Size(0xa4, 0x18);
     this.btnActivateAutocompletion.Text = "Activate Autocompletion";
     this.btnActivateAutocompletion.Click += new EventHandler(this.btnActivateAutocompletion_Click);
     this.btnAnalyze.Alignment = ToolStripItemAlignment.Right;
     this.btnAnalyze.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnAnalyze.DropDownItems.AddRange(new ToolStripItem[] { this.miOpenSQLQueryNewTab, this.miOpenInSSMS });
     this.btnAnalyze.Image = (Image) manager.GetObject("btnAnalyze.Image");
     this.btnAnalyze.ImageTransparentColor = Color.Magenta;
     this.btnAnalyze.Margin = new Padding(2, 0, 0, 0);
     this.btnAnalyze.Name = "btnAnalyze";
     this.btnAnalyze.Size = new Size(0x62, 0x18);
     this.btnAnalyze.Text = "A&nalyze SQL";
     this.miOpenSQLQueryNewTab.Image = Resources.New;
     this.miOpenSQLQueryNewTab.Name = "miOpenSQLQueryNewTab";
     this.miOpenSQLQueryNewTab.Size = new Size(0x11d, 0x18);
     this.miOpenSQLQueryNewTab.Text = "Open as SQL Query in New Tab";
     this.miOpenSQLQueryNewTab.Click += new EventHandler(this.miOpenSQLQueryNewTab_Click);
     this.miOpenInSSMS.Image = Resources.SSMS;
     this.miOpenInSSMS.Name = "miOpenInSSMS";
     this.miOpenInSSMS.Size = new Size(0x11d, 0x18);
     this.miOpenInSSMS.Text = "Open in SQL Management Studio";
     this.miOpenInSSMS.Click += new EventHandler(this.miOpenInSSMS_Click);
     this.btnExport.Alignment = ToolStripItemAlignment.Right;
     this.btnExport.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnExport.DropDownItems.AddRange(new ToolStripItem[] { this.btnExportExcelNoFormat, this.btnExportExcel, this.toolStripSeparator1, this.btnExportWordNoFormat, this.btnExportWord, this.toolStripMenuItem1, this.btnExportHtml });
     this.btnExport.ImageTransparentColor = Color.Magenta;
     this.btnExport.Margin = new Padding(2, 0, 0, 0);
     this.btnExport.Name = "btnExport";
     this.btnExport.Size = new Size(0x3d, 0x18);
     this.btnExport.Text = "Ex&port";
     this.btnExportExcelNoFormat.Image = Resources.Excel;
     this.btnExportExcelNoFormat.Name = "btnExportExcelNoFormat";
     this.btnExportExcelNoFormat.Size = new Size(0x115, 0x18);
     this.btnExportExcelNoFormat.Text = "Export to Excel";
     this.btnExportExcelNoFormat.Click += new EventHandler(this.btnExportExcelNoFormat_Click);
     this.btnExportExcel.Image = Resources.Excel;
     this.btnExportExcel.Name = "btnExportExcel";
     this.btnExportExcel.Size = new Size(0x115, 0x18);
     this.btnExportExcel.Text = "Export to Excel With Formatting";
     this.btnExportExcel.Click += new EventHandler(this.btnExportExcel_Click);
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new Size(0x112, 6);
     this.btnExportWordNoFormat.Image = Resources.Word;
     this.btnExportWordNoFormat.Name = "btnExportWordNoFormat";
     this.btnExportWordNoFormat.Size = new Size(0x115, 0x18);
     this.btnExportWordNoFormat.Text = "Export to Word";
     this.btnExportWordNoFormat.Click += new EventHandler(this.btnExportWordNoFormat_Click);
     this.btnExportWord.Image = Resources.Word;
     this.btnExportWord.Name = "btnExportWord";
     this.btnExportWord.Size = new Size(0x115, 0x18);
     this.btnExportWord.Text = "Export to Word With Formatting";
     this.btnExportWord.Click += new EventHandler(this.btnExportWord_Click);
     this.toolStripMenuItem1.Name = "toolStripMenuItem1";
     this.toolStripMenuItem1.Size = new Size(0x112, 6);
     this.btnExportHtml.Name = "btnExportHtml";
     this.btnExportHtml.Size = new Size(0x115, 0x18);
     this.btnExportHtml.Text = "Export to HTML";
     this.btnExportHtml.Click += new EventHandler(this.btnExportHtml_Click);
     this.btnFormat.Alignment = ToolStripItemAlignment.Right;
     this.btnFormat.DisplayStyle = ToolStripItemDisplayStyle.Text;
     this.btnFormat.DropDownItems.AddRange(new ToolStripItem[] { this.btn1NestingLevel, this.btn2NestingLevels, this.btn3NestingLevels, this.btnAllNestingLevels, this.toolStripMenuItem2, this.btnResultFormattingPreferences });
     this.btnFormat.ImageTransparentColor = Color.Magenta;
     this.btnFormat.Margin = new Padding(2, 0, 0, 0);
     this.btnFormat.Name = "btnFormat";
     this.btnFormat.Size = new Size(0x42, 0x18);
     this.btnFormat.Text = "Format";
     this.btn1NestingLevel.Name = "btn1NestingLevel";
     this.btn1NestingLevel.ShortcutKeyDisplayString = "Alt+1";
     this.btn1NestingLevel.Size = new Size(0x126, 0x18);
     this.btn1NestingLevel.Text = "Collapse to 1 Nesting Level";
     this.btn1NestingLevel.Click += new EventHandler(this.btn1NestingLevel_Click);
     this.btn2NestingLevels.Name = "btn2NestingLevels";
     this.btn2NestingLevels.ShortcutKeyDisplayString = "Alt+2";
     this.btn2NestingLevels.Size = new Size(0x126, 0x18);
     this.btn2NestingLevels.Text = "Collapse to 2 Nesting Levels";
     this.btn2NestingLevels.Click += new EventHandler(this.btn2NestingLevels_Click);
     this.btn3NestingLevels.Name = "btn3NestingLevels";
     this.btn3NestingLevels.ShortcutKeyDisplayString = "Alt+3";
     this.btn3NestingLevels.Size = new Size(0x126, 0x18);
     this.btn3NestingLevels.Text = "Collapse to 3 Nesting Levels";
     this.btn3NestingLevels.Click += new EventHandler(this.btn3NestingLevels_Click);
     this.btnAllNestingLevels.Name = "btnAllNestingLevels";
     this.btnAllNestingLevels.ShortcutKeyDisplayString = "Alt+0";
     this.btnAllNestingLevels.Size = new Size(0x126, 0x18);
     this.btnAllNestingLevels.Text = "Show All Nesting Levels";
     this.btnAllNestingLevels.Click += new EventHandler(this.btnAllNestingLevels_Click);
     this.toolStripMenuItem2.Name = "toolStripMenuItem2";
     this.toolStripMenuItem2.Size = new Size(0x123, 6);
     this.btnResultFormattingPreferences.Name = "btnResultFormattingPreferences";
     this.btnResultFormattingPreferences.Size = new Size(0x126, 0x18);
     this.btnResultFormattingPreferences.Text = "Result Formatting Preferences...";
     this.btnResultFormattingPreferences.Click += new EventHandler(this.btnResultFormattingPreferences_Click);
     this.lblDb.Anchor = AnchorStyles.Left;
     this.lblDb.AutoSize = true;
     this.lblDb.Location = new Point(0x151, 6);
     this.lblDb.Margin = new Padding(0);
     this.lblDb.Name = "lblDb";
     this.lblDb.Size = new Size(60, 15);
     this.lblDb.TabIndex = 4;
     this.lblDb.Text = "&Database";
     this.lblDb.TextAlign = ContentAlignment.MiddleLeft;
     this.cboLanguage.Anchor = AnchorStyles.Left;
     this.cboLanguage.DropDownStyle = ComboBoxStyle.DropDownList;
     this.cboLanguage.FormattingEnabled = true;
     this.cboLanguage.Items.AddRange(new object[] { "C# Expression", "C# Statement(s)", "C# Program", "VB Expression", "VB Statement(s)", "VB Program", "SQL", "ESQL", "F# Expression", "F# Program" });
     this.cboLanguage.Location = new Point(0xc6, 3);
     this.cboLanguage.Margin = new Padding(2, 2, 12, 2);
     this.cboLanguage.Name = "cboLanguage";
     this.cboLanguage.Size = new Size(0x69, 0x15);
     this.cboLanguage.TabIndex = 3;
     this.cboLanguage.TabStop = false;
     this.cboLanguage.SelectionChangeCommitted += new EventHandler(this.cboLanguage_SelectionChangeCommitted);
     this.cboLanguage.Leave += new EventHandler(this.cboType_SelectedIndexChanged);
     this.cboLanguage.Enter += new EventHandler(this.cboType_Enter);
     this.cboLanguage.DropDownClosed += new EventHandler(this.cboType_DropDownClosed);
     this.cboDb.Anchor = AnchorStyles.Right | AnchorStyles.Left;
     this.cboDb.DropDownStyle = ComboBoxStyle.DropDownList;
     this.cboDb.FormattingEnabled = true;
     this.cboDb.Location = new Point(0x18f, 3);
     this.cboDb.Margin = new Padding(2);
     this.cboDb.Name = "cboDb";
     this.cboDb.Size = new Size(0xbb, 0x15);
     this.cboDb.TabIndex = 5;
     this.cboDb.TabStop = false;
     this.cboDb.Leave += new EventHandler(this.cboDb_SelectedIndexChanged);
     this.cboDb.Enter += new EventHandler(this.cboDb_Enter);
     this.cboDb.DropDownClosed += new EventHandler(this.cboDb_DropDownClosed);
     this.cboDb.DropDown += new EventHandler(this.cboDb_DropDown);
     this.lblType.Anchor = AnchorStyles.Left;
     this.lblType.AutoSize = true;
     this.lblType.Location = new Point(0x7f, 6);
     this.lblType.Margin = new Padding(2, 0, 0, 0);
     this.lblType.Name = "lblType";
     this.lblType.Padding = new Padding(6, 0, 0, 0);
     this.lblType.Size = new Size(0x45, 15);
     this.lblType.TabIndex = 2;
     this.lblType.Text = "&Language";
     this.lblType.TextAlign = ContentAlignment.MiddleLeft;
     this.panTopControls.AutoSize = true;
     this.panTopControls.AutoSizeMode = AutoSizeMode.GrowAndShrink;
     this.panTopControls.ColumnCount = 10;
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
     this.panTopControls.ColumnStyles.Add(new ColumnStyle());
     this.panTopControls.Controls.Add(this.btnExecute, 0, 0);
     this.panTopControls.Controls.Add(this.btnCancel, 1, 0);
     this.panTopControls.Controls.Add(this.lblDb, 7, 0);
     this.panTopControls.Controls.Add(this.lblType, 4, 0);
     this.panTopControls.Controls.Add(this.cboLanguage, 5, 0);
     this.panTopControls.Controls.Add(this.llDbUseCurrent, 9, 0);
     this.panTopControls.Controls.Add(this.cboDb, 8, 0);
     this.panTopControls.Controls.Add(this.lblSyncDb, 6, 0);
     this.panTopControls.Controls.Add(this.btnText, 2, 0);
     this.panTopControls.Controls.Add(this.btnGrids, 3, 0);
     this.panTopControls.Dock = DockStyle.Top;
     this.panTopControls.Location = new Point(0, 0);
     this.panTopControls.Margin = new Padding(2);
     this.panTopControls.Name = "panTopControls";
     this.panTopControls.Padding = new Padding(0, 0, 15, 1);
     this.panTopControls.RowCount = 1;
     this.panTopControls.RowStyles.Add(new RowStyle());
     this.panTopControls.Size = new Size(0x2a3, 0x1d);
     this.panTopControls.TabIndex = 8;
     this.btnExecute.Image = Resources.Execute;
     this.btnExecute.Location = new Point(0, 2);
     this.btnExecute.Margin = new Padding(0, 2, 1, 2);
     this.btnExecute.Name = "btnExecute";
     this.btnExecute.Size = new Size(30, 0x17);
     this.btnExecute.TabIndex = 0;
     this.btnExecute.TabStop = false;
     this.toolTip.SetToolTip(this.btnExecute, "Execute (F5)");
     this.btnExecute.UseVisualStyleBackColor = true;
     this.btnExecute.Click += new EventHandler(this.btnExecute_Click);
     this.btnCancel.Enabled = false;
     this.btnCancel.Image = Resources.Cancel;
     this.btnCancel.Location = new Point(0x21, 2);
     this.btnCancel.Margin = new Padding(2);
     this.btnCancel.Name = "btnCancel";
     this.btnCancel.Size = new Size(30, 0x17);
     this.btnCancel.TabIndex = 1;
     this.btnCancel.TabStop = false;
     this.toolTip.SetToolTip(this.btnCancel, "Cancel (Shift+F5)");
     this.btnCancel.UseVisualStyleBackColor = true;
     this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
     this.llDbUseCurrent.Anchor = AnchorStyles.Left;
     this.llDbUseCurrent.AutoSize = true;
     this.llDbUseCurrent.Cursor = Cursors.Hand;
     this.llDbUseCurrent.ForeColor = Color.Blue;
     this.llDbUseCurrent.Location = new Point(590, 6);
     this.llDbUseCurrent.Margin = new Padding(2, 0, 0, 0);
     this.llDbUseCurrent.Name = "llDbUseCurrent";
     this.llDbUseCurrent.Size = new Size(70, 15);
     this.llDbUseCurrent.TabIndex = 6;
     this.llDbUseCurrent.TabStop = true;
     this.llDbUseCurrent.Text = "Use current";
     this.llDbUseCurrent.TextAlign = ContentAlignment.MiddleLeft;
     this.llDbUseCurrent.LinkClicked += new EventHandler(this.llDbUseCurrent_LinkClicked);
     this.lblSyncDb.Anchor = AnchorStyles.Left;
     this.lblSyncDb.AutoSize = true;
     this.lblSyncDb.Cursor = Cursors.Hand;
     this.lblSyncDb.Font = new Font("Wingdings", 10.2f, FontStyle.Regular, GraphicsUnit.Point, 2);
     this.lblSyncDb.Location = new Point(0x13b, 6);
     this.lblSyncDb.Margin = new Padding(0, 2, 0, 0);
     this.lblSyncDb.Name = "lblSyncDb";
     this.lblSyncDb.Size = new Size(0x16, 0x11);
     this.lblSyncDb.TabIndex = 7;
     this.lblSyncDb.Text = "\x00ef";
     this.lblSyncDb.Click += new EventHandler(this.lblSyncDb_Click);
     this.btnText.Checked = true;
     this.btnText.Image = Resources.TextResults;
     this.btnText.Location = new Point(0x4d, 3);
     this.btnText.Margin = new Padding(12, 3, 0, 2);
     this.btnText.Name = "btnText";
     this.btnText.NoImageScale = false;
     this.btnText.Size = new Size(0x17, 0x17);
     this.btnText.TabIndex = 8;
     this.btnText.TabStop = false;
     this.toolTip.SetToolTip(this.btnText, "Results to Rich Text (Ctrl+Shift+T)");
     this.btnText.ToolTipText = "";
     this.btnText.Click += new EventHandler(this.btnText_Click);
     this.btnGrids.Checked = false;
     this.btnGrids.Image = Resources.GridResults;
     this.btnGrids.Location = new Point(100, 3);
     this.btnGrids.Margin = new Padding(0, 3, 2, 2);
     this.btnGrids.Name = "btnGrids";
     this.btnGrids.NoImageScale = false;
     this.btnGrids.Size = new Size(0x17, 0x17);
     this.btnGrids.TabIndex = 9;
     this.btnGrids.TabStop = false;
     this.toolTip.SetToolTip(this.btnGrids, "Results to Data Grids (Ctrl+Shift+G)");
     this.btnGrids.ToolTipText = "";
     this.btnGrids.Click += new EventHandler(this.btnGrids_Click);
     this.panTop.AutoSize = true;
     this.panTop.Controls.Add(this.panTopControls);
     this.panTop.Controls.Add(this.panCloseButton);
     this.panTop.Dock = DockStyle.Top;
     this.panTop.Location = new Point(0, 0);
     this.panTop.Name = "panTop";
     this.panTop.Size = new Size(0x2cf, 0x1d);
     this.panTop.TabIndex = 4;
     this.panCloseButton.Controls.Add(this.btnPin);
     this.panCloseButton.Controls.Add(this.btnClose);
     this.panCloseButton.Dock = DockStyle.Right;
     this.panCloseButton.Location = new Point(0x2a3, 0);
     this.panCloseButton.Margin = new Padding(2);
     this.panCloseButton.Name = "panCloseButton";
     this.panCloseButton.Padding = new Padding(0, 3, 2, 4);
     this.panCloseButton.Size = new Size(0x2c, 0x1d);
     this.panCloseButton.TabIndex = 9;
     this.btnPin.Checked = false;
     this.btnPin.Dock = DockStyle.Left;
     this.btnPin.Glyph = ButtonGlyph.Pin;
     this.btnPin.Location = new Point(0, 3);
     this.btnPin.Margin = new Padding(2);
     this.btnPin.Name = "btnPin";
     this.btnPin.NoImageScale = false;
     this.btnPin.Size = new Size(20, 0x16);
     this.btnPin.TabIndex = 1;
     this.toolTip.SetToolTip(this.btnPin, "Keep query open");
     this.btnPin.ToolTipText = "";
     this.btnPin.Click += new EventHandler(this.btnPin_Click);
     this.btnClose.Checked = false;
     this.btnClose.Dock = DockStyle.Right;
     this.btnClose.Location = new Point(0x16, 3);
     this.btnClose.Margin = new Padding(2);
     this.btnClose.Name = "btnClose";
     this.btnClose.NoImageScale = false;
     this.btnClose.Size = new Size(20, 0x16);
     this.btnClose.TabIndex = 0;
     this.toolTip.SetToolTip(this.btnClose, "Close query (Ctrl+F4)");
     this.btnClose.ToolTipText = "";
     this.btnClose.Click += new EventHandler(this.btnClose_Click);
     this.panMain.Controls.Add(this.splitContainer);
     this.panMain.Dock = DockStyle.Fill;
     this.panMain.Location = new Point(0, 0x1d);
     this.panMain.Name = "panMain";
     this.panMain.Size = new Size(0x2cf, 0x192);
     this.panMain.TabIndex = 3;
     base.AutoScaleDimensions = new SizeF(6f, 13f);
     base.AutoScaleMode = AutoScaleMode.Font;
     this.BackColor = Color.Transparent;
     base.Controls.Add(this.panMain);
     base.Controls.Add(this.panTop);
     base.Name = "QueryControl";
     base.Size = new Size(0x2cf, 0x1af);
     this.splitContainer.Panel1.ResumeLayout(false);
     this.splitContainer.Panel2.ResumeLayout(false);
     this.splitContainer.ResumeLayout(false);
     this.panEditor.ResumeLayout(false);
     this.panError.ResumeLayout(false);
     this.panError.PerformLayout();
     this.panBottom.ResumeLayout(false);
     this.panBottom.PerformLayout();
     this.panOutput.ResumeLayout(false);
     this.statusStrip.ResumeLayout(false);
     this.statusStrip.PerformLayout();
     this.tsOutput.ResumeLayout(false);
     this.tsOutput.PerformLayout();
     this.panTopControls.ResumeLayout(false);
     this.panTopControls.PerformLayout();
     this.panTop.ResumeLayout(false);
     this.panTop.PerformLayout();
     this.panCloseButton.ResumeLayout(false);
     this.panMain.ResumeLayout(false);
     base.ResumeLayout(false);
     base.PerformLayout();
 }
Esempio n. 40
0
 private void InitializeComponents(ImageList imageList)
 {
     this.toolStripLabelFilter = new System.Windows.Forms.ToolStripLabel();
     this.toolStripTextBoxFilter = new System.Windows.Forms.ToolStripSpringTextBox();
     this.clearFilterButton = new System.Windows.Forms.ToolStripButton();
     this.toolStripDropDownOptions = new System.Windows.Forms.ToolStripDropDownButton();
     this.toolStripItemMatchCase = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripItemRegEx = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripItemNegate = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripFilters = new PluginCore.Controls.ToolStripEx();
     this.toolStripFilters.SuspendLayout();
     //
     // toolStripTextBoxFilter
     //
     this.toolStripTextBoxFilter.Name = "toolStripTextBoxFilter";
     this.toolStripTextBoxFilter.Size = new System.Drawing.Size(100, 25);
     this.toolStripTextBoxFilter.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
     this.toolStripTextBoxFilter.Enabled = false;
     this.toolStripTextBoxFilter.TextChanged += new System.EventHandler(this.ToolStripTextFieldFilter_Changed);
     //
     // toolStripLabelFilter
     //
     this.toolStripLabelFilter.Margin = new System.Windows.Forms.Padding(2, 1, 0, 1);
     this.toolStripLabelFilter.Name = "toolStripLabelFilter";
     this.toolStripLabelFilter.Size = new System.Drawing.Size(36, 22);
     this.toolStripLabelFilter.Text = "Filter:";
     //
     // clearFilterButton
     //
     this.clearFilterButton.Enabled = false;
     this.clearFilterButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.clearFilterButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.clearFilterButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1);
     this.clearFilterButton.Name = "clearFilterButton";
     this.clearFilterButton.Size = new System.Drawing.Size(23, 26);
     this.clearFilterButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
     this.clearFilterButton.Image = PluginBase.MainForm.FindImage("153");
     this.clearFilterButton.Click += new System.EventHandler(this.ClearFilterButton_Click);
     //
     // toolStripItemMatchCase
     //
     this.toolStripItemMatchCase.Name = "toolStripItemMatchCase";
     this.toolStripItemMatchCase.CheckOnClick = true;
     this.toolStripItemMatchCase.Text = "Match Case";
     this.toolStripItemNegate.Click += FilterOption_Click;
     //
     // toolStripItemRegEx
     //
     this.toolStripItemRegEx.Name = "toolStripItemRegEx";
     this.toolStripItemRegEx.CheckOnClick = true;
     this.toolStripItemRegEx.Text = "Regular Expression";
     this.toolStripItemNegate.Click += FilterOption_Click;
     //
     // toolStripItemNegate
     //
     this.toolStripItemNegate.Name = "toolStripItemNegate";
     this.toolStripItemNegate.CheckOnClick = true;
     this.toolStripItemNegate.Text = "Match Opposite";
     this.toolStripItemNegate.Click += FilterOption_Click;
     //
     // toolStripDropDownOptions
     //
     this.toolStripDropDownOptions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.toolStripDropDownOptions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.toolStripItemMatchCase,
     this.toolStripItemRegEx,
     this.toolStripItemNegate});
     this.toolStripDropDownOptions.Name = "toolStripDropDownOptions";
     this.toolStripDropDownOptions.Text = "Options";
     //
     // toolStripFilters
     //
     this.toolStripFilters.ImageScalingSize = ScaleHelper.Scale(new System.Drawing.Size(16, 16));
     this.toolStripFilters.CanOverflow = false;
     this.toolStripFilters.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
     this.toolStripFilters.Padding = new System.Windows.Forms.Padding(1, 1, 2, 2);
     this.toolStripFilters.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.toolStripFilters.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.toolStripLabelFilter,
     this.toolStripTextBoxFilter,
     this.clearFilterButton,
     this.toolStripDropDownOptions});
     this.toolStripFilters.Name = "toolStripFilters";
     this.toolStripFilters.Location = new System.Drawing.Point(1, 0);
     this.toolStripFilters.Size = new System.Drawing.Size(710, 25);
     this.toolStripFilters.TabIndex = 0;
     this.toolStripFilters.Text = "toolStripFilters";
     // lv
     this.lv = new ListViewEx();
     this.lv.ShowItemToolTips = true;
     this.imageColumnHeader = new ColumnHeader();
     this.imageColumnHeader.Text = string.Empty;
     this.imageColumnHeader.Width = 20;
     this.frameColumnHeader = new ColumnHeader();
     this.frameColumnHeader.Text = string.Empty;
     this.lv.Columns.AddRange(new ColumnHeader[] {
     this.imageColumnHeader,
     this.frameColumnHeader});
     this.lv.FullRowSelect = true;
     this.lv.BorderStyle = BorderStyle.None;
     this.lv.Dock = System.Windows.Forms.DockStyle.Fill;
     foreach (ColumnHeader column in lv.Columns)
     {
         column.Width = ScaleHelper.Scale(column.Width);
     }
     lv.SmallImageList = imageList;
     currentImageIndex = imageList.Images.IndexOfKey("StartContinue");
     lv.View = System.Windows.Forms.View.Details;
     lv.MouseDoubleClick += new MouseEventHandler(Lv_MouseDoubleClick);
     lv.KeyDown += new KeyEventHandler(Lv_KeyDown);
     lv.SizeChanged += new EventHandler(Lv_SizeChanged);
     this.Controls.Add(lv);
     this.Controls.Add(toolStripFilters);
     this.toolStripFilters.ResumeLayout(false);
     this.toolStripFilters.PerformLayout();
 }
Esempio n. 41
0
 private void InitializeComponent() {
     components = new Container();
     toolStrip = new ToolStripEx();
     contextMenu = new ContextMenuStripEx(components, true);
     menuCustomize = new ToolStripMenuItem(ResBBOption[9]);
     menuLockItem = new ToolStripMenuItem(ResBBOption[10]);
     menuLockToolbar = new ToolStripMenuItem(QTUtility.ResMain[0x20]);
     toolStrip.SuspendLayout();
     contextMenu.SuspendLayout();
     SuspendLayout();
     toolStrip.Dock = DockStyle.Fill;
     toolStrip.GripStyle = ToolStripGripStyle.Hidden;
     toolStrip.ImeMode = ImeMode.Disable;
     toolStrip.Renderer = new ToolbarRenderer();
     toolStrip.BackColor = Color.Transparent;
     toolStrip.ItemClicked += toolStrip_ItemClicked;
     toolStrip.GotFocus += toolStrip_GotFocus;
     toolStrip.MouseDoubleClick += toolStrip_MouseDoubleClick;
     toolStrip.MouseActivated += toolStrip_MouseActivated;
     toolStrip.PreviewKeyDown += toolStrip_PreviewKeyDown;
     menuLockItem.Checked = LockDropDownItems;
     contextMenu.Items.Add(menuCustomize);
     contextMenu.Items.Add(menuLockItem);
     contextMenu.Items.Add(menuLockToolbar);
     contextMenu.ShowImageMargin = false;
     contextMenu.Opening += contextMenu_Opening;
     contextMenu.ItemClicked += contextMenu_ItemClicked;
     Controls.Add(toolStrip);
     Height = BarHeight;
     MinSize = new Size(20, BarHeight);
     ContextMenuStrip = contextMenu;
     toolStrip.ResumeLayout(false);
     contextMenu.ResumeLayout(false);
     ResumeLayout();
 }
Esempio n. 42
0
        private void InitializeComponent()
        {
            SuspendLayout();

            AllowDrop           = true;
            AutoScaleDimensions = new SizeF(96F, 96F);
            AutoScaleMode       = AutoScaleMode.Dpi;
            AutoSize            = true;
            AutoSizeMode        = AutoSizeMode.GrowAndShrink;
            BackColor           = SystemColors.ActiveBorder;
            ClientSize          = new Size(284, 261);
            FormBorderStyle     = FormBorderStyle.None;
            ShowInTaskbar       = false;
            StartPosition       = FormStartPosition.Manual;
            Text    = "ShareX - Actions toolbar";
            TopMost = Program.Settings.ActionsToolbarStayTopMost;

            Shown           += ActionsToolbarForm_Shown;
            LocationChanged += ActionsToolbarForm_LocationChanged;
            DragEnter       += ActionsToolbarForm_DragEnter;
            DragDrop        += ActionsToolbarForm_DragDrop;

            tsMain = new ToolStripEx()
            {
                AutoSize         = true,
                CanOverflow      = false,
                ClickThrough     = true,
                Dock             = DockStyle.None,
                GripStyle        = ToolStripGripStyle.Hidden,
                Location         = new Point(1, 1),
                Margin           = new Padding(1),
                MinimumSize      = new Size(10, 30),
                Padding          = new Padding(0, 1, 0, 0),
                Renderer         = new ToolStripRoundedEdgeRenderer(),
                TabIndex         = 0,
                ShowItemToolTips = false
            };

            tsMain.MouseLeave += tsMain_MouseLeave;

            Controls.Add(tsMain);

            components = new Container();

            ttMain = new ToolTip(components)
            {
                AutoPopDelay = 15000,
                InitialDelay = 300,
                ReshowDelay  = 100,
                ShowAlways   = true
            };

            cmsTitle = new ContextMenuStrip(components);

            ToolStripMenuItem tsmiClose = new ToolStripMenuItem(Resources.ActionsToolbar_Close);

            tsmiClose.Click += TsmiClose_Click;
            cmsTitle.Items.Add(tsmiClose);

            cmsTitle.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem tsmiLock = new ToolStripMenuItem(Resources.ActionsToolbar__LockPosition);

            tsmiLock.CheckOnClick = true;
            tsmiLock.Checked      = Program.Settings.ActionsToolbarLockPosition;
            tsmiLock.Click       += TsmiLock_Click;
            cmsTitle.Items.Add(tsmiLock);

            ToolStripMenuItem tsmiTopMost = new ToolStripMenuItem(Resources.ActionsToolbar_StayTopMost);

            tsmiTopMost.CheckOnClick = true;
            tsmiTopMost.Checked      = Program.Settings.ActionsToolbarStayTopMost;
            tsmiTopMost.Click       += TsmiTopMost_Click;
            cmsTitle.Items.Add(tsmiTopMost);

            ToolStripMenuItem tsmiRunAtStartup = new ToolStripMenuItem(Resources.ActionsToolbar_OpenAtShareXStartup);

            tsmiRunAtStartup.CheckOnClick = true;
            tsmiRunAtStartup.Checked      = Program.Settings.ActionsToolbarRunAtStartup;
            tsmiRunAtStartup.Click       += TsmiRunAtStartup_Click;
            cmsTitle.Items.Add(tsmiRunAtStartup);

            cmsTitle.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem tsmiEdit = new ToolStripMenuItem(Resources.ActionsToolbar_Edit);

            tsmiEdit.Click += TsmiEdit_Click;
            cmsTitle.Items.Add(tsmiEdit);

            UpdateToolbar(Program.Settings.ActionsToolbarList);

            ResumeLayout(false);
            PerformLayout();

            UpdatePosition();
        }
Esempio n. 43
0
        private void CreateToolbar()
        {
            menuForm = new Form()
            {
                AutoScaleDimensions = new SizeF(6F, 13F),
                AutoScaleMode       = AutoScaleMode.Font,
                AutoSize            = true,
                AutoSizeMode        = AutoSizeMode.GrowAndShrink,
                ClientSize          = new Size(759, 509),
                FormBorderStyle     = FormBorderStyle.None,
                Location            = new Point(200, 200),
                ShowInTaskbar       = false,
                StartPosition       = FormStartPosition.Manual,
                Text    = "ShareX - Region capture menu",
                TopMost = true
            };

            menuForm.Shown           += MenuForm_Shown;
            menuForm.KeyDown         += MenuForm_KeyDown;
            menuForm.KeyUp           += MenuForm_KeyUp;
            menuForm.LocationChanged += MenuForm_LocationChanged;

            menuForm.SuspendLayout();

            tsMain = new ToolStripEx()
            {
                AutoSize         = true,
                CanOverflow      = false,
                ClickThrough     = true,
                Dock             = DockStyle.None,
                GripStyle        = ToolStripGripStyle.Hidden,
                Location         = new Point(0, 0),
                MinimumSize      = new Size(10, 30),
                Padding          = new Padding(0, 1, 0, 0),
                Renderer         = new CustomToolStripProfessionalRenderer(),
                TabIndex         = 0,
                ShowItemToolTips = false
            };

            tsMain.MouseLeave += TsMain_MouseLeave;

            tsMain.SuspendLayout();

            // https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
            using (Graphics g = menuForm.CreateGraphics())
            {
                double scale    = Math.Max(g.DpiX, g.DpiY) / 96.0;
                double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
                if (newScale > 1)
                {
                    int newWidth  = (int)(tsMain.ImageScalingSize.Width * newScale);
                    int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
                    tsMain.ImageScalingSize = new Size(newWidth, newHeight);
                }
            }

            menuForm.Controls.Add(tsMain);

            tslDragLeft = new ToolStripLabel()
            {
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image        = Resources.ui_radio_button_uncheck,
                Margin       = new Padding(2, 0, 2, 0),
                Padding      = new Padding(2)
            };

            tsMain.Items.Add(tslDragLeft);

            if (form.IsEditorMode)
            {
                #region Editor mode

                ToolStripButton tsbCompleteEdit = new ToolStripButton();

                if (form.Mode == RegionCaptureMode.Editor)
                {
                    tsbCompleteEdit.Text = Resources.ShapeManager_CreateToolbar_RunAfterCaptureTasks;
                }
                else
                {
                    tsbCompleteEdit.Text = Resources.ShapeManager_CreateToolbar_ApplyChangesContinueTaskEnter;
                }

                tsbCompleteEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCompleteEdit.Image        = Resources.tick;
                tsbCompleteEdit.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateRunAfterCaptureTasks);
                tsMain.Items.Add(tsbCompleteEdit);

                if (form.Mode == RegionCaptureMode.TaskEditor)
                {
                    ToolStripButton tsbClose = new ToolStripButton(Resources.ShapeManager_CreateToolbar_ContinueTaskSpaceOrRightClick);
                    tsbClose.DisplayStyle = ToolStripItemDisplayStyle.Image;
                    tsbClose.Image        = Resources.control;
                    tsbClose.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateContinueTask);
                    tsMain.Items.Add(tsbClose);

                    ToolStripButton tsbCloseCancel = new ToolStripButton(Resources.ShapeManager_CreateToolbar_CancelTaskEsc);
                    tsbCloseCancel.DisplayStyle = ToolStripItemDisplayStyle.Image;
                    tsbCloseCancel.Image        = Resources.cross;
                    tsbCloseCancel.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateCancelTask);
                    tsMain.Items.Add(tsbCloseCancel);
                }

                if (form.Mode == RegionCaptureMode.TaskEditor)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }

                ToolStripButton tsbSaveImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_SaveImage);
                tsbSaveImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImage.Enabled      = File.Exists(form.ImageFilePath);
                tsbSaveImage.Image        = Resources.disk_black;
                tsbSaveImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateSaveImage);
                tsMain.Items.Add(tsbSaveImage);

                ToolStripButton tsbSaveImageAs = new ToolStripButton(Resources.ShapeManager_CreateToolbar_SaveImageAs);
                tsbSaveImageAs.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImageAs.Image        = Resources.disks_black;
                tsbSaveImageAs.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateSaveImageAs);
                tsMain.Items.Add(tsbSaveImageAs);

                ToolStripButton tsbCopyImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_CopyImageToClipboard);
                tsbCopyImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCopyImage.Image        = Resources.clipboard;
                tsbCopyImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateCopyImage);
                tsMain.Items.Add(tsbCopyImage);

                ToolStripButton tsbUploadImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_UploadImage);
                tsbUploadImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbUploadImage.Image        = Resources.drive_globe;
                tsbUploadImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateUploadImage);
                tsMain.Items.Add(tsbUploadImage);

                ToolStripButton tsbPrintImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_PrintImage);
                tsbPrintImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbPrintImage.Image        = Resources.printer;
                tsbPrintImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotatePrintImage);
                tsMain.Items.Add(tsbPrintImage);

                tsMain.Items.Add(new ToolStripSeparator());

                #endregion Editor mode
            }

            #region Tools

            foreach (ShapeType shapeType in Helpers.GetEnums <ShapeType>())
            {
                if (form.IsEditorMode)
                {
                    if (IsShapeTypeRegion(shapeType))
                    {
                        continue;
                    }
                }
                else if (shapeType == ShapeType.DrawingRectangle)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }
                else if (shapeType == ShapeType.DrawingCrop)
                {
                    continue;
                }

                ToolStripButton tsbShapeType = new ToolStripButton(shapeType.GetLocalizedDescription());
                tsbShapeType.DisplayStyle = ToolStripItemDisplayStyle.Image;

                Image img = null;

                switch (shapeType)
                {
                case ShapeType.RegionRectangle:
                    img = Resources.layer_shape_region;
                    break;

                case ShapeType.RegionEllipse:
                    img = Resources.layer_shape_ellipse_region;
                    break;

                case ShapeType.RegionFreehand:
                    img = Resources.layer_shape_polygon;
                    break;

                case ShapeType.DrawingRectangle:
                    img = Resources.layer_shape;
                    break;

                case ShapeType.DrawingEllipse:
                    img = Resources.layer_shape_ellipse;
                    break;

                case ShapeType.DrawingFreehand:
                    img = Resources.pencil;
                    break;

                case ShapeType.DrawingLine:
                    img = Resources.layer_shape_line;
                    break;

                case ShapeType.DrawingArrow:
                    img = Resources.layer_shape_arrow;
                    break;

                case ShapeType.DrawingTextOutline:
                    img = Resources.edit_outline;
                    break;

                case ShapeType.DrawingTextBackground:
                    img = Resources.edit_shade;
                    break;

                case ShapeType.DrawingSpeechBalloon:
                    img = Resources.balloon_box_left;
                    break;

                case ShapeType.DrawingStep:
                    img = Resources.counter_reset;
                    break;

                case ShapeType.DrawingImage:
                    img = Resources.folder_open_image;
                    break;

                case ShapeType.DrawingImageScreen:
                    img = Resources.monitor_image;
                    break;

                case ShapeType.DrawingCursor:
                    img = Resources.cursor;
                    break;

                case ShapeType.EffectBlur:
                    img = Resources.layer_shade;
                    break;

                case ShapeType.EffectPixelate:
                    img = Resources.grid;
                    break;

                case ShapeType.EffectHighlight:
                    img = Resources.highlighter_text;
                    break;

                case ShapeType.DrawingCrop:
                    img = Resources.image_crop;
                    break;
                }

                tsbShapeType.Image   = img;
                tsbShapeType.Checked = shapeType == CurrentShapeType;
                tsbShapeType.Tag     = shapeType;

                tsbShapeType.MouseDown += (sender, e) =>
                {
                    tsbShapeType.RadioCheck();
                    CurrentShapeType = shapeType;
                };

                tsMain.Items.Add(tsbShapeType);
            }

            #endregion Tools

            #region Shape options

            tsMain.Items.Add(new ToolStripSeparator());

            tsbBorderColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Border_color___);
            tsbBorderColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbBorderColor.Click       += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color borderColor;

                if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    borderColor = AnnotationOptions.TextBorderColor;
                }
                else if (shapeType == ShapeType.DrawingTextOutline)
                {
                    borderColor = AnnotationOptions.TextOutlineBorderColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    borderColor = AnnotationOptions.StepBorderColor;
                }
                else
                {
                    borderColor = AnnotationOptions.BorderColor;
                }

                if (ColorPickerForm.PickColor(borderColor, out Color newColor))
                {
                    if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                    {
                        AnnotationOptions.TextBorderColor = newColor;
                    }
                    else if (shapeType == ShapeType.DrawingTextOutline)
                    {
                        AnnotationOptions.TextOutlineBorderColor = newColor;
                    }
                    else if (shapeType == ShapeType.DrawingStep)
                    {
                        AnnotationOptions.StepBorderColor = newColor;
                    }
                    else
                    {
                        AnnotationOptions.BorderColor = newColor;
                    }

                    UpdateMenu();
                    UpdateCurrentShape();
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbBorderColor);

            tsbFillColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Fill_color___);
            tsbFillColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbFillColor.Click       += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color fillColor;

                if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    fillColor = AnnotationOptions.TextFillColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    fillColor = AnnotationOptions.StepFillColor;
                }
                else
                {
                    fillColor = AnnotationOptions.FillColor;
                }

                if (ColorPickerForm.PickColor(fillColor, out Color newColor))
                {
                    if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                    {
                        AnnotationOptions.TextFillColor = newColor;
                    }
                    else if (shapeType == ShapeType.DrawingStep)
                    {
                        AnnotationOptions.StepFillColor = newColor;
                    }
                    else
                    {
                        AnnotationOptions.FillColor = newColor;
                    }

                    UpdateMenu();
                    UpdateCurrentShape();
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbFillColor);

            tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
            tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbHighlightColor.Click       += (sender, e) =>
            {
                PauseForm();

                if (ColorPickerForm.PickColor(AnnotationOptions.HighlightColor, out Color newColor))
                {
                    AnnotationOptions.HighlightColor = newColor;
                    UpdateMenu();
                    UpdateCurrentShape();
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbHighlightColor);

            tsddbShapeOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateToolbar_ShapeOptions);
            tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbShapeOptions.Image        = Resources.layer__pencil;
            tsMain.Items.Add(tsddbShapeOptions);

            tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
            tslnudBorderSize.Content.Minimum      = 0;
            tslnudBorderSize.Content.Maximum      = 20;
            tslnudBorderSize.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                int borderSize = (int)tslnudBorderSize.Content.Value;

                if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    AnnotationOptions.TextBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingTextOutline)
                {
                    AnnotationOptions.TextOutlineBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    AnnotationOptions.StepBorderSize = borderSize;
                }
                else
                {
                    AnnotationOptions.BorderSize = borderSize;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);

            tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
            tslnudCornerRadius.Content.Minimum      = 0;
            tslnudCornerRadius.Content.Maximum      = 150;
            tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                if (shapeType == ShapeType.RegionRectangle)
                {
                    AnnotationOptions.RegionCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }
                else if (shapeType == ShapeType.DrawingRectangle || shapeType == ShapeType.DrawingTextBackground)
                {
                    AnnotationOptions.DrawingCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudCornerRadius);

            tslnudBlurRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Blur_radius_);
            tslnudBlurRadius.Content.Minimum      = 3;
            tslnudBlurRadius.Content.Maximum      = 199;
            tslnudBlurRadius.Content.Increment    = 2;
            tslnudBlurRadius.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.BlurRadius = (int)tslnudBlurRadius.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBlurRadius);

            tslnudPixelateSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Pixel_size_);
            tslnudPixelateSize.Content.Minimum      = 2;
            tslnudPixelateSize.Content.Maximum      = 10000;
            tslnudPixelateSize.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.PixelateSize = (int)tslnudPixelateSize.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);

            tslnudCenterPoints = new ToolStripLabeledNumericUpDown("Center points:");
            tslnudCenterPoints.Content.Minimum      = 0;
            tslnudCenterPoints.Content.Maximum      = LineDrawingShape.MaximumCenterPointCount;
            tslnudCenterPoints.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.LineCenterPointCount = (int)tslnudCenterPoints.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudCenterPoints);

            tsmiArrowHeadsBothSide = new ToolStripMenuItem("Arrow heads in both side");
            tsmiArrowHeadsBothSide.CheckOnClick = true;
            tsmiArrowHeadsBothSide.Click       += (sender, e) =>
            {
                AnnotationOptions.ArrowHeadsBothSide = tsmiArrowHeadsBothSide.Checked;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiArrowHeadsBothSide);

            tsmiShadow              = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_DropShadow);
            tsmiShadow.Checked      = true;
            tsmiShadow.CheckOnClick = true;
            tsmiShadow.Click       += (sender, e) =>
            {
                AnnotationOptions.Shadow = tsmiShadow.Checked;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiShadow);

            // In dropdown menu if only last item is visible then menu opens at 0, 0 position on first open, so need to add dummy item to solve this weird bug...
            tsddbShapeOptions.DropDownItems.Add(new ToolStripSeparator()
            {
                Visible = false
            });

            #endregion Shape options

            #region Edit

            ToolStripDropDownButton tsddbEdit = new ToolStripDropDownButton(Resources.ShapeManager_CreateToolbar_Edit);
            tsddbEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbEdit.Image        = Resources.wrench_screwdriver;
            tsMain.Items.Add(tsddbEdit);

            tsmiUndo       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Undo);
            tsmiUndo.Image = Resources.arrow_circle_225_left;
            tsmiUndo.ShortcutKeyDisplayString = "Ctrl+Z";
            tsmiUndo.MouseDown += (sender, e) => UndoShape();
            tsddbEdit.DropDownItems.Add(tsmiUndo);

            tsddbEdit.DropDownItems.Add(new ToolStripSeparator());

            tsmiDelete       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Delete);
            tsmiDelete.Image = Resources.layer__minus;
            tsmiDelete.ShortcutKeyDisplayString = "Del";
            tsmiDelete.MouseDown += (sender, e) => DeleteCurrentShape();
            tsddbEdit.DropDownItems.Add(tsmiDelete);

            tsmiDeleteAll       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_DeleteAll);
            tsmiDeleteAll.Image = Resources.eraser;
            tsmiDeleteAll.ShortcutKeyDisplayString = "Shift+Del";
            tsmiDeleteAll.MouseDown += (sender, e) => DeleteAllShapes();
            tsddbEdit.DropDownItems.Add(tsmiDeleteAll);

            tsddbEdit.DropDownItems.Add(new ToolStripSeparator());

            tsmiMoveTop       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_BringToFront);
            tsmiMoveTop.Image = Resources.layers_stack_arrange;
            tsmiMoveTop.ShortcutKeyDisplayString = "Home";
            tsmiMoveTop.MouseDown += (sender, e) => MoveCurrentShapeTop();
            tsddbEdit.DropDownItems.Add(tsmiMoveTop);

            tsmiMoveUp       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_BringForward);
            tsmiMoveUp.Image = Resources.layers_arrange;
            tsmiMoveUp.ShortcutKeyDisplayString = "Page up";
            tsmiMoveUp.MouseDown += (sender, e) => MoveCurrentShapeUp();
            tsddbEdit.DropDownItems.Add(tsmiMoveUp);

            tsmiMoveDown       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_SendBackward);
            tsmiMoveDown.Image = Resources.layers_arrange_back;
            tsmiMoveDown.ShortcutKeyDisplayString = "Page down";
            tsmiMoveDown.MouseDown += (sender, e) => MoveCurrentShapeDown();
            tsddbEdit.DropDownItems.Add(tsmiMoveDown);

            tsmiMoveBottom       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_SendToBack);
            tsmiMoveBottom.Image = Resources.layers_stack_arrange_back;
            tsmiMoveBottom.ShortcutKeyDisplayString = "End";
            tsmiMoveBottom.MouseDown += (sender, e) => MoveCurrentShapeBottom();
            tsddbEdit.DropDownItems.Add(tsmiMoveBottom);

            #endregion Edit

            if (!form.IsEditorMode)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                #region Capture

                ToolStripDropDownButton tsddbCapture = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Capture);
                tsddbCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbCapture.Image        = Resources.camera;
                tsMain.Items.Add(tsddbCapture);

                tsmiRegionCapture       = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_CaptureRegions);
                tsmiRegionCapture.Image = Resources.layer;
                tsmiRegionCapture.ShortcutKeyDisplayString = "Enter";
                tsmiRegionCapture.MouseDown += (sender, e) =>
                {
                    form.UpdateRegionPath();
                    form.Close(RegionResult.Region);
                };
                tsddbCapture.DropDownItems.Add(tsmiRegionCapture);

                if (RegionCaptureForm.LastRegionFillPath != null)
                {
                    ToolStripMenuItem tsmiLastRegionCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_LastRegion);
                    tsmiLastRegionCapture.Image      = Resources.layers;
                    tsmiLastRegionCapture.MouseDown += (sender, e) => form.Close(RegionResult.LastRegion);
                    tsddbCapture.DropDownItems.Add(tsmiLastRegionCapture);
                }

                ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
                tsmiFullscreenCapture.Image = Resources.layer_fullscreen;
                tsmiFullscreenCapture.ShortcutKeyDisplayString = "Space";
                tsmiFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
                tsddbCapture.DropDownItems.Add(tsmiFullscreenCapture);

                ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
                tsmiActiveMonitorCapture.Image = Resources.monitor;
                tsmiActiveMonitorCapture.ShortcutKeyDisplayString = "~";
                tsmiActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
                tsddbCapture.DropDownItems.Add(tsmiActiveMonitorCapture);

                ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
                tsmiMonitorCapture.HideImageMargin();
                tsmiMonitorCapture.Image = Resources.monitor_window;
                tsddbCapture.DropDownItems.Add(tsmiMonitorCapture);

                Screen[] screens = Screen.AllScreens;

                for (int i = 0; i < screens.Length; i++)
                {
                    Screen            screen = screens[i];
                    ToolStripMenuItem tsmi   = new ToolStripMenuItem($"{screen.Bounds.Width}x{screen.Bounds.Height}");
                    tsmi.ShortcutKeyDisplayString = (i + 1).ToString();
                    int index = i;
                    tsmi.MouseDown += (sender, e) =>
                    {
                        form.MonitorIndex = index;
                        form.Close(RegionResult.Monitor);
                    };
                    tsmiMonitorCapture.DropDownItems.Add(tsmi);
                }

                #endregion Capture

                #region Options

                ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
                tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbOptions.Image        = Resources.gear;
                tsMain.Items.Add(tsddbOptions);

                tsmiQuickCrop                          = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
                tsmiQuickCrop.Checked                  = !Config.QuickCrop;
                tsmiQuickCrop.CheckOnClick             = true;
                tsmiQuickCrop.ShortcutKeyDisplayString = "Q";
                tsmiQuickCrop.Click                   += (sender, e) => Config.QuickCrop = !tsmiQuickCrop.Checked;
                tsddbOptions.DropDownItems.Add(tsmiQuickCrop);

                tsmiTips                          = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_tips);
                tsmiTips.Checked                  = Config.ShowHotkeys;
                tsmiTips.CheckOnClick             = true;
                tsmiTips.ShortcutKeyDisplayString = "F1";
                tsmiTips.Click                   += (sender, e) => Config.ShowHotkeys = tsmiTips.Checked;
                tsddbOptions.DropDownItems.Add(tsmiTips);

                ToolStripMenuItem tsmiShowInfo = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_position_and_size_info);
                tsmiShowInfo.Checked      = Config.ShowInfo;
                tsmiShowInfo.CheckOnClick = true;
                tsmiShowInfo.Click       += (sender, e) => Config.ShowInfo = tsmiShowInfo.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowInfo);

                ToolStripMenuItem tsmiShowMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_magnifier);
                tsmiShowMagnifier.Checked      = Config.ShowMagnifier;
                tsmiShowMagnifier.CheckOnClick = true;
                tsmiShowMagnifier.Click       += (sender, e) => Config.ShowMagnifier = tsmiShowMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowMagnifier);

                ToolStripMenuItem tsmiUseSquareMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Square_shape_magnifier);
                tsmiUseSquareMagnifier.Checked      = Config.UseSquareMagnifier;
                tsmiUseSquareMagnifier.CheckOnClick = true;
                tsmiUseSquareMagnifier.Click       += (sender, e) => Config.UseSquareMagnifier = tsmiUseSquareMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiUseSquareMagnifier);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelCount = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_count_);
                tslnudMagnifierPixelCount.Content.Minimum      = RegionCaptureOptions.MagnifierPixelCountMinimum;
                tslnudMagnifierPixelCount.Content.Maximum      = RegionCaptureOptions.MagnifierPixelCountMaximum;
                tslnudMagnifierPixelCount.Content.Increment    = 2;
                tslnudMagnifierPixelCount.Content.Value        = Config.MagnifierPixelCount;
                tslnudMagnifierPixelCount.Content.ValueChanged = (sender, e) => Config.MagnifierPixelCount = (int)tslnudMagnifierPixelCount.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelCount);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_size_);
                tslnudMagnifierPixelSize.Content.Minimum      = RegionCaptureOptions.MagnifierPixelSizeMinimum;
                tslnudMagnifierPixelSize.Content.Maximum      = RegionCaptureOptions.MagnifierPixelSizeMaximum;
                tslnudMagnifierPixelSize.Content.Value        = Config.MagnifierPixelSize;
                tslnudMagnifierPixelSize.Content.ValueChanged = (sender, e) => Config.MagnifierPixelSize = (int)tslnudMagnifierPixelSize.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelSize);

                ToolStripMenuItem tsmiShowCrosshair = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_screen_wide_crosshair);
                tsmiShowCrosshair.Checked      = Config.ShowCrosshair;
                tsmiShowCrosshair.CheckOnClick = true;
                tsmiShowCrosshair.Click       += (sender, e) => Config.ShowCrosshair = tsmiShowCrosshair.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowCrosshair);

                ToolStripMenuItem tsmiEnableAnimations = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_EnableAnimations);
                tsmiEnableAnimations.Checked      = Config.EnableAnimations;
                tsmiEnableAnimations.CheckOnClick = true;
                tsmiEnableAnimations.Click       += (sender, e) => Config.EnableAnimations = tsmiEnableAnimations.Checked;
                tsddbOptions.DropDownItems.Add(tsmiEnableAnimations);

                ToolStripMenuItem tsmiFixedSize = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fixed_size_region_mode);
                tsmiFixedSize.Checked      = Config.IsFixedSize;
                tsmiFixedSize.CheckOnClick = true;
                tsmiFixedSize.Click       += (sender, e) => Config.IsFixedSize = tsmiFixedSize.Checked;
                tsddbOptions.DropDownItems.Add(tsmiFixedSize);

                ToolStripDoubleLabeledNumericUpDown tslnudFixedSize = new ToolStripDoubleLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Width_,
                                                                                                              Resources.ShapeManager_CreateContextMenu_Height_);
                tslnudFixedSize.Content.Minimum      = 10;
                tslnudFixedSize.Content.Maximum      = 10000;
                tslnudFixedSize.Content.Increment    = 10;
                tslnudFixedSize.Content.Value        = Config.FixedSize.Width;
                tslnudFixedSize.Content.Value2       = Config.FixedSize.Height;
                tslnudFixedSize.Content.ValueChanged = (sender, e) => Config.FixedSize = new Size((int)tslnudFixedSize.Content.Value, (int)tslnudFixedSize.Content.Value2);
                tsddbOptions.DropDownItems.Add(tslnudFixedSize);

                ToolStripMenuItem tsmiShowFPS = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_FPS);
                tsmiShowFPS.Checked      = Config.ShowFPS;
                tsmiShowFPS.CheckOnClick = true;
                tsmiShowFPS.Click       += (sender, e) => Config.ShowFPS = tsmiShowFPS.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowFPS);

                ToolStripMenuItem tsmiRememberMenuState = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_RememberMenuState);
                tsmiRememberMenuState.Checked      = Config.RememberMenuState;
                tsmiRememberMenuState.CheckOnClick = true;
                tsmiRememberMenuState.Click       += (sender, e) => Config.RememberMenuState = tsmiRememberMenuState.Checked;
                tsddbOptions.DropDownItems.Add(tsmiRememberMenuState);

                #endregion Options
            }

            ToolStripLabel tslDragRight = new ToolStripLabel()
            {
                Alignment    = ToolStripItemAlignment.Right,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image        = Resources.ui_radio_button_uncheck,
                Margin       = new Padding(0, 0, 2, 0),
                Padding      = new Padding(2)
            };

            tsMain.Items.Add(tslDragRight);

            tslDragLeft.MouseDown   += TslDrag_MouseDown;
            tslDragRight.MouseDown  += TslDrag_MouseDown;
            tslDragLeft.MouseEnter  += TslDrag_MouseEnter;
            tslDragRight.MouseEnter += TslDrag_MouseEnter;
            tslDragLeft.MouseLeave  += TslDrag_MouseLeave;
            tslDragRight.MouseLeave += TslDrag_MouseLeave;

            foreach (ToolStripItem tsi in tsMain.Items.OfType <ToolStripItem>())
            {
                if (!string.IsNullOrEmpty(tsi.Text))
                {
                    tsi.MouseEnter += (sender, e) =>
                    {
                        Point pos = CaptureHelpers.ScreenToClient(menuForm.PointToScreen(tsi.Bounds.Location));
                        pos.Y += tsi.Height + 8;

                        MenuTextAnimation.Text     = tsi.Text;
                        MenuTextAnimation.Position = pos;
                        MenuTextAnimation.Start();
                    };

                    tsi.MouseLeave += TsMain_MouseLeave;
                }
            }

            tsMain.ResumeLayout(false);
            tsMain.PerformLayout();
            menuForm.ResumeLayout(false);

            menuForm.Show(form);

            UpdateMenu();

            CurrentShapeChanged     += shape => UpdateMenu();
            CurrentShapeTypeChanged += shapeType => UpdateMenu();
            ShapeCreated            += shape => UpdateMenu();

            ConfigureMenuState();

            form.Activate();
        }
Esempio n. 44
0
 private void InitializeNavBtns(bool fSync) {
     toolStrip = new ToolStripEx();
     buttonBack = new ToolStripButton();
     buttonForward = new ToolStripButton();
     toolStrip.SuspendLayout();
     if(!QTUtility.ImageListGlobal.Images.ContainsKey("navBack")) {
         QTUtility.ImageListGlobal.Images.Add("navBack", Resources_Image.imgNavBack);
     }
     if(!QTUtility.ImageListGlobal.Images.ContainsKey("navFrwd")) {
         QTUtility.ImageListGlobal.Images.Add("navFrwd", Resources_Image.imgNavFwd);
     }
     toolStrip.Dock = QTUtility.CheckConfig(Settings.NavButtonsOnRight) ? DockStyle.Right : DockStyle.Left;
     toolStrip.AutoSize = false;
     toolStrip.CanOverflow = false;
     toolStrip.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
     toolStrip.GripStyle = ToolStripGripStyle.Hidden;
     toolStrip.Items.AddRange(new ToolStripItem[] { buttonBack, buttonForward, buttonNavHistoryMenu });
     toolStrip.Renderer = new ToolbarRenderer();
     toolStrip.Width = 0x3f;
     toolStrip.TabStop = false;
     toolStrip.BackColor = Color.Transparent;
     buttonBack.AutoSize = false;
     buttonBack.DisplayStyle = ToolStripItemDisplayStyle.Image;
     buttonBack.Enabled = fSync ? ((navBtnsFlag & 1) != 0) : false;
     buttonBack.Image = QTUtility.ImageListGlobal.Images["navBack"];
     buttonBack.Size = new Size(0x15, 0x15);
     buttonBack.Click += NavigationButtons_Click;
     buttonForward.AutoSize = false;
     buttonForward.DisplayStyle = ToolStripItemDisplayStyle.Image;
     buttonForward.Enabled = fSync ? ((navBtnsFlag & 2) != 0) : false;
     buttonForward.Image = QTUtility.ImageListGlobal.Images["navFrwd"];
     buttonForward.Size = new Size(0x15, 0x15);
     buttonForward.Click += NavigationButtons_Click;
 }