protected override void InitializeItem(ToolStripItem item) { base.InitializeItem(item); // Set default blank image to look ok in high dpi if (item.Image == null && item.IsOnDropDown) { item.Image = PluginBase.MainForm.FindImage("559"); } if (item is ToolStripButton) { Double scale = ScaleHelper.GetScale(); if (scale >= 1.5) { item.Padding = new Padding(4, 2, 4, 2); } else if (scale >= 1.2) { item.Padding = new Padding(2, 1, 2, 1); } else if (renderer is ToolStripSystemRenderer && Win32.IsRunningOnWindows()) { item.Padding = new Padding(2, 2, 2, 2); } } else if (item is ToolStripComboBoxEx) { ToolStripComboBoxEx comboBox = item as ToolStripComboBoxEx; comboBox.Margin = new Padding(2, 0, 2, 0); comboBox.FlatCombo.UseTheme = useTheme; } }
public FDMenus(IMainForm mainForm) { // modify the file menu ToolStripMenuItem fileMenu = (ToolStripMenuItem)mainForm.FindMenuItem("FileMenu"); RecentProjects = new RecentProjectsMenu(); fileMenu.DropDownItems.Insert(5, RecentProjects); // modify the view menu ToolStripMenuItem viewMenu = (ToolStripMenuItem)mainForm.FindMenuItem("ViewMenu"); View = new ToolStripMenuItem(TextHelper.GetString("Label.MainMenuItem")); View.Image = Icons.Project.Img; viewMenu.DropDownItems.Add(View); PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowProject", View); // modify the tools menu - add a nice GUI classpath editor ToolStripMenuItem toolsMenu = (ToolStripMenuItem)mainForm.FindMenuItem("ToolsMenu"); GlobalClasspaths = new ToolStripMenuItem(TextHelper.GetString("Label.GlobalClasspaths")); GlobalClasspaths.ShortcutKeys = Keys.F9 | Keys.Control; GlobalClasspaths.Image = Icons.Classpath.Img; toolsMenu.DropDownItems.Insert(toolsMenu.DropDownItems.Count - 4, GlobalClasspaths); PluginBase.MainForm.RegisterShortcutItem("ToolsMenu.GlobalClasspaths", GlobalClasspaths); ProjectMenu = new ProjectMenu(); MenuStrip mainMenu = mainForm.MenuStrip; mainMenu.Items.Insert(5, ProjectMenu); ToolStrip toolBar = mainForm.ToolStrip; toolBar.Items.Add(new ToolStripSeparator()); toolBar.Items.Add(RecentProjects.ToolbarSelector); BuildProject = new ToolStripButton(Icons.Gear.Img); BuildProject.Name = "BuildProject"; BuildProject.ToolTipText = TextHelper.GetStringWithoutMnemonics("Label.BuildProject"); PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.BuildProject", BuildProject); toolBar.Items.Add(BuildProject); TestMovie = new ToolStripButton(Icons.GreenCheck.Img); TestMovie.Name = "TestMovie"; TestMovie.ToolTipText = TextHelper.GetStringWithoutMnemonics("Label.TestMovie"); PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.TestMovie", TestMovie); toolBar.Items.Add(TestMovie); ConfigurationSelector = new ToolStripComboBoxEx(); ConfigurationSelector.Name = "ConfigurationSelector"; ConfigurationSelector.ToolTipText = TextHelper.GetString("ToolTip.SelectConfiguration"); ConfigurationSelector.Items.AddRange(new string[] { TextHelper.GetString("Info.Debug"), TextHelper.GetString("Info.Release") }); ConfigurationSelector.DropDownStyle = ComboBoxStyle.DropDownList; ConfigurationSelector.AutoSize = false; ConfigurationSelector.Enabled = false; ConfigurationSelector.Width = ScaleHelper.Scale(GetThemeWidth("ProjectManager.TargetBuildSelectorWidth", 85)); ConfigurationSelector.Margin = new Padding(1, 0, 0, 0); ConfigurationSelector.FlatStyle = PluginBase.MainForm.Settings.ComboBoxFlatStyle; ConfigurationSelector.Font = PluginBase.Settings.DefaultFont; toolBar.Items.Add(ConfigurationSelector); PluginBase.MainForm.RegisterShortcutItem("ProjectMenu.ConfigurationSelectorToggle", Keys.Control | Keys.F5); PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.ConfigurationSelectorToggle", ConfigurationSelector); TargetBuildSelector = new ToolStripComboBoxEx(); TargetBuildSelector.Name = "TargetBuildSelector"; TargetBuildSelector.ToolTipText = TextHelper.GetString("ToolTip.TargetBuild"); TargetBuildSelector.AutoSize = false; TargetBuildSelector.Width = ScaleHelper.Scale(GetThemeWidth("ProjectManager.ConfigurationSelectorWidth", 120)); TargetBuildSelector.Margin = new Padding(1, 0, 0, 0); TargetBuildSelector.FlatStyle = PluginBase.MainForm.Settings.ComboBoxFlatStyle; TargetBuildSelector.Font = PluginBase.Settings.DefaultFont; toolBar.Items.Add(TargetBuildSelector); PluginBase.MainForm.RegisterShortcutItem("ProjectMenu.TargetBuildSelector", Keys.Control | Keys.F7); PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.TargetBuildSelector", TargetBuildSelector); EnableTargetBuildSelector(false); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.toolStrip = new PluginCore.Controls.ToolStripEx(); this.toggleButton = new System.Windows.Forms.ToolStripButton(); this.topMostButton = new System.Windows.Forms.ToolStripButton(); this.clearFilterButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.viewLabel = new System.Windows.Forms.ToolStripLabel(); this.logComboBox = new System.Windows.Forms.ToolStripComboBoxEx(); this.filterLabel = new System.Windows.Forms.ToolStripLabel(); this.filterComboBox = new System.Windows.Forms.ToolStripSpringComboBox(); this.logTextBox = new System.Windows.Forms.RichTextBox(); this.toolStrip.SuspendLayout(); this.SuspendLayout(); // // toolStrip // this.toolStrip.CanOverflow = false; this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toggleButton, this.topMostButton, this.toolStripSeparator, this.viewLabel, this.logComboBox, this.filterLabel, this.filterComboBox, this.clearFilterButton }); this.toolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; this.toolStrip.Location = new System.Drawing.Point(1, 0); this.toolStrip.Name = "toolStrip"; this.toolStrip.Padding = new System.Windows.Forms.Padding(1, 1, 2, 2); this.toolStrip.Size = new System.Drawing.Size(683, 30); this.toolStrip.TabIndex = 1; // // toggleButton // this.toggleButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toggleButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.toggleButton.Margin = new System.Windows.Forms.Padding(1); this.toggleButton.Name = "toggleButton"; this.toggleButton.Size = new System.Drawing.Size(23, 26); this.toggleButton.Click += new System.EventHandler(this.ToggleButtonClick); // // clearFilterButton // this.clearFilterButton.Enabled = true; 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.Click += new System.EventHandler(this.ClearFilterButtonClick); // // topMostButton // this.topMostButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.topMostButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.topMostButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1); this.topMostButton.Name = "topMostButton"; this.topMostButton.Size = new System.Drawing.Size(23, 26); this.topMostButton.Click += new System.EventHandler(this.TopMostButtonClick); // // toolStripSeparator // this.toolStripSeparator.Name = "toolStripSeparator"; this.toolStripSeparator.Size = new System.Drawing.Size(6, 28); // // viewLabel // this.viewLabel.Margin = new System.Windows.Forms.Padding(2, 1, 0, 1); this.viewLabel.Name = "viewLabel"; this.viewLabel.Size = new System.Drawing.Size(44, 25); this.viewLabel.Text = "View:"; // // logComboBox // this.logComboBox.Enabled = false; this.logComboBox.Items.AddRange(new Object[] { TextHelper.GetString("Label.FlashLog"), TextHelper.GetString("Label.PolicyLog") }); this.logComboBox.Name = "logComboBox"; this.logComboBox.Size = new System.Drawing.Size(120, 28); this.logComboBox.SelectedIndex = 0; this.logComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this.logComboBox.FlatCombo.SelectedIndexChanged += new System.EventHandler(this.LogComboBoxIndexChanged); // // filterLabel // this.filterLabel.Margin = new System.Windows.Forms.Padding(2, 1, 0, 1); this.filterLabel.Name = "filterLabel"; this.filterLabel.Size = new System.Drawing.Size(45, 25); this.filterLabel.Text = "Filter:"; // // filterComboBox // this.filterComboBox.Enabled = true; this.filterComboBox.Name = "filterComboBox"; this.filterComboBox.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); this.filterComboBox.Size = new System.Drawing.Size(50, 28); this.filterComboBox.TextChanged += new System.EventHandler(this.FilterTextBoxTextChanged); // // logTextBox // this.logTextBox.BackColor = System.Drawing.SystemColors.Window; this.logTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.logTextBox.DetectUrls = false; this.logTextBox.Dock = System.Windows.Forms.DockStyle.Fill; this.logTextBox.Font = new System.Drawing.Font("Courier New", 8.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.logTextBox.Location = new System.Drawing.Point(1, 30); this.logTextBox.Name = "logTextBox"; this.logTextBox.ReadOnly = true; this.logTextBox.Size = new System.Drawing.Size(683, 322); this.logTextBox.TabIndex = 0; this.logTextBox.Text = ""; this.logTextBox.WordWrap = false; // // PluginUI // this.Name = "PluginUI"; this.Controls.Add(this.logTextBox); this.Controls.Add(this.toolStrip); this.Size = new System.Drawing.Size(685, 352); this.toolStrip.ResumeLayout(false); this.toolStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
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(); }