protected ToolStripDropDownItem(string text, Image image, params ToolStripItem[] dropDownItems) : this(text, image, (EventHandler)null) { if (dropDownItems != null) { DropDownItems.AddRange(dropDownItems); } }
public void Populate() { if (_initialized) { return; } _initialized = true; DropDown.SuspendLayout(); DropDownItems.AddRange(new ToolStripItem[] { new ToolStripControlHost(new ThemeSelector(_dialog)), new ToolStripControlHost(new FontSelector(_dialog)), new ToolStripControlHost(new IndentSelector(_dialog)), new ToolStripControlHost(new ResizeToMatchCodeSamplesOption(_dialog)), new ToolStripSeparator(), new ToolStripControlHost(new FullyQualifiedTypeNamesOption(_dialog)), new ToolStripControlHost(new ExplicitTypeNamesOption(_dialog)), new ToolStripControlHost(new ExplicitGenericParamsOption(_dialog)), new ToolStripControlHost(new DeclareOutParamsInlineOption(_dialog)), new ToolStripControlHost(new ImplicitArrayTypeNamesOption(_dialog)), new ToolStripControlHost(new LambdaParameterTypeNamesOption(_dialog)), new ToolStripControlHost(new QuotedLambdaCommentsOption(_dialog)) }); DropDown.ResumeLayout(); }
public RibbonButtonList(IEnumerable <RibbonButton> buttons, IEnumerable <RibbonItem> dropDownItems) : this() { if (buttons != null) { List <RibbonButton> items = new List <RibbonButton>(buttons); Buttons.AddRange(items.ToArray()); //add the handlers foreach (RibbonItem item in buttons) { item.Click += item_Click; } } if (dropDownItems != null) { DropDownItems.AddRange(dropDownItems); //add the handlers foreach (RibbonItem item in dropDownItems) { item.Click += item_Click; } } }
public FilterDatesToolStripDropDownButton() { toolStripMenuItemShowAll = new ToolStripMenuItem { Checked = true, Text = Messages.FILTER_SHOW_ALL }; toolStripMenuItemLast24Hours = new ToolStripMenuItem { Text = Messages.DATE_FILTER_LAST_24_HOURS }; toolStripMenuItemLast3Days = new ToolStripMenuItem { Text = Messages.DATE_FILTER_LAST_3_DAYS }; toolStripMenuItemLast7Days = new ToolStripMenuItem { Text = Messages.DATE_FILTER_LAST_7_DAYS }; toolStripMenuItemLast30Days = new ToolStripMenuItem { Text = Messages.DATE_FILTER_LAST_30_DAYS }; toolStripMenuItemCustomDate = new ToolStripMenuItem { Text = Messages.DATE_FILTER_CUSTOM }; DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItemLast24Hours, toolStripMenuItemLast3Days, toolStripMenuItemLast7Days, toolStripMenuItemLast30Days, toolStripMenuItemCustomDate, new ToolStripSeparator(), toolStripMenuItemShowAll }); dateFilterDialog = new DateFilterDialog(); }
void CreateDropDownItems() { ToolStripItem[] itemsToAdd = null; DropDownItems.Clear(); foreach (object item in subItems) { if (item is ToolStripItem) { DropDownItems.Add((ToolStripItem)item); if (item is IStatusUpdate) { ((IStatusUpdate)item).UpdateStatus(); ((IStatusUpdate)item).UpdateText(); } } else { ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item; itemsToAdd = submenuBuilder.BuildSubmenu(codon, caller); if (itemsToAdd != null) { DropDownItems.AddRange(itemsToAdd); } } } }
public static DropDownItems GetDropDownItems(List <string> pList = null) { var oRtn = new DropDownItems { DropDownBase.GetEmptyItem(DropDownBase.EmptyItem.Select_String) }; if (pList != null) { oRtn.AddRange(pList.Select((t, i) => new DropDownItem((i + 1).ToString(), t))); } return(oRtn); }
private void PopulateMenuSync(ToolStripItem[] items) { DropDownItems.AddRange(items); var menuItems = AllMenuItems.Except(new[] { _dummyItem }).ToArray(); if (!menuItems.Any()) { DropDownItems.Add(_noDiscItem); } // We need to always keep at least 1 menu item in the dropdown list // to prevent the list from being positioned in the upper-left corner // of the screen. DropDownItems.Remove(_dummyItem); }
public FilterStatusToolStripDropDownButton() { toolStripMenuItemComplete = new ToolStripMenuItem { Text = Messages.STATUS_FILTER_COMPLETE, Checked = true, CheckOnClick = true }; toolStripMenuItemInProgress = new ToolStripMenuItem { Text = Messages.STATUS_FILTER_IN_PROGRESS, Checked = true, CheckOnClick = true }; toolStripMenuItemError = new ToolStripMenuItem { Text = Messages.STATUS_FILTER_ERROR, Checked = true, CheckOnClick = true }; toolStripMenuItemCancelled = new ToolStripMenuItem { Text = Messages.STATUS_FILTER_CANCEL, Checked = true, CheckOnClick = true }; toolStripMenuItemAll = new ToolStripMenuItem { Text = Messages.FILTER_SHOW_ALL, Enabled = false }; DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItemComplete, toolStripMenuItemInProgress, toolStripMenuItemError, toolStripMenuItemCancelled, new ToolStripSeparator(), toolStripMenuItemAll }); toolStripMenuItemComplete.CheckedChanged += Item_CheckedChanged; toolStripMenuItemInProgress.CheckedChanged += Item_CheckedChanged; toolStripMenuItemError.CheckedChanged += Item_CheckedChanged; toolStripMenuItemCancelled.CheckedChanged += Item_CheckedChanged; }
void CreateDropDownItems() { DropDownItems.Clear(); foreach (object item in subItems) { if (item is ToolStripItem) { DropDownItems.Add((ToolStripItem)item); if (item is IStatusUpdate) { ((IStatusUpdate)item).UpdateStatus(); ((IStatusUpdate)item).UpdateText(); } } else { IMenuItemBuilder submenuBuilder = (IMenuItemBuilder)item; DropDownItems.AddRange(submenuBuilder.BuildItems(codon, caller).Cast <ToolStripItem>().ToArray()); } } }
void SetupDropdown() { TileSourceFactory factory = new TileSourceFactory(); mnuOpenStreetMap = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.OpenStreetMap), LinkLabelType.OSM); mnuOpenHistoricMap = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.OpenHistoricMap), LinkLabelType.OSM); mnuBingMapAerial = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.BingAerial), LinkLabelType.BING); mnuBingMapRoads = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.BingRoads), LinkLabelType.BING); mnuBingMapHybrid = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.BingHybrid), LinkLabelType.BING); mnuNLS1843_1882 = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.NLS_1843_1882_OS_6in), LinkLabelType.NLS); mnuNLS1885_1900 = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.NLS_1885_1900_OS_1in), LinkLabelType.NLS); mnuNLS1921_1930 = new MapToolStripMenuItem(factory.CreateTileSource(TileSourceFactory.TileType.NLS_1921_1930_OS_6in), LinkLabelType.NLS); mnuOpenStreetMap.SetupMapToolStripMenuItem("mnuOpenStreetMap", "Open Street Map", new EventHandler(_Click)); mnuOpenHistoricMap.SetupMapToolStripMenuItem("mnuOpenHistoricMap", "Open Historical Map 1920-1940 UK", new EventHandler(_Click)); mnuBingMapAerial.SetupMapToolStripMenuItem("mnuBingMapAerial", "Aerial Bing Map", new EventHandler(_Click)); mnuBingMapRoads.SetupMapToolStripMenuItem("mnuBingMapRoads", "Roads Bing Map", new EventHandler(_Click)); mnuBingMapHybrid.SetupMapToolStripMenuItem("mnuBingMapHybrid", "Hybrid Bing Map", new EventHandler(_Click)); mnuNLS1843_1882.SetupMapToolStripMenuItem("mnuNLS1843_1882", "NLS 1843-1882 OS 6in UK Map", new EventHandler(_Click)); mnuNLS1885_1900.SetupMapToolStripMenuItem("mnuNLS1885_1900", "NLS 1885-1900 OS 1in UK Map", new EventHandler(_Click)); mnuNLS1921_1930.SetupMapToolStripMenuItem("mnuNLS1921_1930", "NLS 1921-1930 OS 6in Scotland Map", new EventHandler(_Click)); // Setup map selector menu DisplayStyle = ToolStripItemDisplayStyle.Text; DropDownItems.AddRange(new ToolStripItem[] { mnuOpenStreetMap, mnuOpenHistoricMap, mnuBingMapAerial, mnuBingMapRoads, mnuBingMapHybrid, mnuNLS1843_1882, mnuNLS1885_1900, mnuNLS1921_1930 }); ImageTransparentColor = Color.Magenta; Name = "mnuMapStyle"; Size = new Size(71, 22); Text = "Map style"; }
void CreateDropDownItems() { // let's assume that if a menuBuilder exists, // as in the Search Results panel or the Class // Browser toolbar, it will handle this step. if (menuBuilder != null) { return; } // also, let's prevent a null exception // in the event that there are no subitems if (subItems == null || subItems.Count == 0) { return; } DropDownItems.Clear(); foreach (object item in subItems) { if (item is ToolStripItem) { DropDownItems.Add((ToolStripItem)item); if (item is IStatusUpdate) { ((IStatusUpdate)item).UpdateStatus(); ((IStatusUpdate)item).UpdateText(); } } else { ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item; DropDownItems.AddRange(submenuBuilder.BuildSubmenu(codon, caller)); } } }
private void Reset() { DropDownItems.Clear(); DropDownItems.AddRange(_model.Select(a => new HostsArchiveToolStripMenuItem(a)).ToArray()); }
public void Create(HintSupport form, Func <HintSelections> hints, bool causeShowHints) { this.form = form; this.funcHints = hints; this.causeShowHints = causeShowHints; forcedMovesToolStripMenuItem = new ToolStripMenuItem(); forcedMovesToolStripMenuItem.Text = "Forced Moves"; forcedMovesToolStripMenuItem.Click += forcedMovesToolStripMenuItem_Click; forcedMovesToolStripMenuItem.ToolTipText = "Only way to meet a requirement"; immediateDiscardablesToolStripMenuItem = new ToolStripMenuItem(); immediateDiscardablesToolStripMenuItem.Text = "Immediate Discardables"; immediateDiscardablesToolStripMenuItem.Click += immediateDiscardablesToolStripMenuItem_Click; immediateDiscardablesToolStripMenuItem.ToolTipText = "Directly prevents a requirement being met when selected"; eventualDiscardablesToolStripMenuItem = new ToolStripMenuItem(); eventualDiscardablesToolStripMenuItem.Text = "Eventual Discardables"; eventualDiscardablesToolStripMenuItem.Click += eventualDiscardablesToolStripMenuItem_Click; eventualDiscardablesToolStripMenuItem.ToolTipText = "Indirectly prevents a requirement being met when selected"; selectablesToolStripMenuItem = new ToolStripMenuItem(); selectablesToolStripMenuItem.Text = "Selectables"; selectablesToolStripMenuItem.Click += selectablesToolStripMenuItem_Click; selectablesToolStripMenuItem.ToolTipText = "Prevents a requirement being met when not selected"; eventualSolutionsToolStripMenuItem = new ToolStripMenuItem(); eventualSolutionsToolStripMenuItem.Text = "Eventual Solutions"; eventualSolutionsToolStripMenuItem.Click += eventualSolutionsToolStripMenuItem_Click; eventualSolutionsToolStripMenuItem.ToolTipText = "Leads to a solution when selected (so should be selected assuming a single solution exists)"; ToolStripSeparator divider = new ToolStripSeparator(); noneToolStripMenuItem = new ToolStripMenuItem(); noneToolStripMenuItem.Text = "None"; noneToolStripMenuItem.Click += noneToolStripMenuItem_Click; easyToolStripMenuItem = new ToolStripMenuItem(); easyToolStripMenuItem.Text = "Easy"; easyToolStripMenuItem.Click += easyToolStripMenuItem_Click; mediumToolStripMenuItem = new ToolStripMenuItem(); mediumToolStripMenuItem.Text = "Medium"; mediumToolStripMenuItem.Click += mediumToolStripMenuItem_Click; hardToolStripMenuItem = new ToolStripMenuItem(); hardToolStripMenuItem.Text = "Hard"; hardToolStripMenuItem.Click += hardToolStripMenuItem_Click; extremeToolStripMenuItem = new ToolStripMenuItem(); extremeToolStripMenuItem.Text = "Extreme"; extremeToolStripMenuItem.Click += extremeToolStripMenuItem_Click; diabolicalToolStripMenuItem = new ToolStripMenuItem(); diabolicalToolStripMenuItem.Text = "Diabolical"; diabolicalToolStripMenuItem.Click += diabolicalToolStripMenuItem_Click; DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { forcedMovesToolStripMenuItem, immediateDiscardablesToolStripMenuItem, eventualDiscardablesToolStripMenuItem, selectablesToolStripMenuItem, eventualSolutionsToolStripMenuItem, divider, noneToolStripMenuItem, easyToolStripMenuItem, mediumToolStripMenuItem, hardToolStripMenuItem, extremeToolStripMenuItem, diabolicalToolStripMenuItem }); }
private void Initialize() { _mMenFileNewConnection = new ToolStripMenuItem(); _mMenFileNewFolder = new ToolStripMenuItem(); _mMenFileSep1 = new ToolStripSeparator(); _mMenFileNew = new ToolStripMenuItem(); _mMenFileLoad = new ToolStripMenuItem(); _mMenFileSave = new ToolStripMenuItem(); _mMenFileSaveAs = new ToolStripMenuItem(); _mMenFileSep2 = new ToolStripSeparator(); _mMenFileDelete = new ToolStripMenuItem(); _mMenFileRename = new ToolStripMenuItem(); _mMenFileDuplicate = new ToolStripMenuItem(); _mMenFileSep4 = new ToolStripSeparator(); _mMenReconnectAll = new ToolStripMenuItem(); _mMenFileSep3 = new ToolStripSeparator(); _mMenFileImport = new ToolStripMenuItem(); _mMenFileImportFromFile = new ToolStripMenuItem(); _mMenFileImportFromActiveDirectory = new ToolStripMenuItem(); _mMenFileImportFromPortScan = new ToolStripMenuItem(); _mMenFileExport = new ToolStripMenuItem(); _mMenFileSep5 = new ToolStripSeparator(); _mMenFileExit = new ToolStripMenuItem(); // // mMenFile // DropDownItems.AddRange(new ToolStripItem[] { _mMenFileNewConnection, _mMenFileNewFolder, _mMenFileSep1, _mMenFileNew, _mMenFileLoad, _mMenFileSave, _mMenFileSaveAs, _mMenFileSep2, _mMenFileDelete, _mMenFileRename, _mMenFileDuplicate, _mMenFileSep4, _mMenReconnectAll, _mMenFileSep3, _mMenFileImport, _mMenFileExport, _mMenFileSep5, _mMenFileExit }); Name = "mMenFile"; Size = new System.Drawing.Size(37, 20); Text = Language.strMenuFile; //DropDownOpening += mMenFile_DropDownOpening; DropDownClosed += OnDropDownClosed; // // mMenFileNewConnection // _mMenFileNewConnection.Image = Resources.Connection_Add; _mMenFileNewConnection.Name = "mMenFileNewConnection"; _mMenFileNewConnection.ShortcutKeys = Keys.Control | Keys.N; _mMenFileNewConnection.Size = new System.Drawing.Size(281, 22); _mMenFileNewConnection.Text = Language.strNewConnection; _mMenFileNewConnection.Click += mMenFileNewConnection_Click; // // mMenFileNewFolder // _mMenFileNewFolder.Image = Resources.Folder_Add; _mMenFileNewFolder.Name = "mMenFileNewFolder"; _mMenFileNewFolder.ShortcutKeys = (Keys.Control | Keys.Shift) | Keys.N; _mMenFileNewFolder.Size = new System.Drawing.Size(281, 22); _mMenFileNewFolder.Text = Language.strNewFolder; _mMenFileNewFolder.Click += mMenFileNewFolder_Click; // // mMenFileSep1 // _mMenFileSep1.Name = "mMenFileSep1"; _mMenFileSep1.Size = new System.Drawing.Size(278, 6); // // mMenFileNew // _mMenFileNew.Image = Resources.Connections_New; _mMenFileNew.Name = "mMenFileNew"; _mMenFileNew.Size = new System.Drawing.Size(281, 22); _mMenFileNew.Text = Language.strMenuNewConnectionFile; _mMenFileNew.Click += mMenFileNew_Click; // // mMenFileLoad // _mMenFileLoad.Image = Resources.Connections_Load; _mMenFileLoad.Name = "mMenFileLoad"; _mMenFileLoad.ShortcutKeys = Keys.Control | Keys.O; _mMenFileLoad.Size = new System.Drawing.Size(281, 22); _mMenFileLoad.Text = Language.strMenuOpenConnectionFile; _mMenFileLoad.Click += mMenFileLoad_Click; // // mMenFileSave // _mMenFileSave.Image = Resources.Connections_Save; _mMenFileSave.Name = "mMenFileSave"; _mMenFileSave.ShortcutKeys = Keys.Control | Keys.S; _mMenFileSave.Size = new System.Drawing.Size(281, 22); _mMenFileSave.Text = Language.strMenuSaveConnectionFile; _mMenFileSave.Click += mMenFileSave_Click; // // mMenFileSaveAs // _mMenFileSaveAs.Image = Resources.Connections_SaveAs; _mMenFileSaveAs.Name = "mMenFileSaveAs"; _mMenFileSaveAs.ShortcutKeys = (Keys.Control | Keys.Shift) | Keys.S; _mMenFileSaveAs.Size = new System.Drawing.Size(281, 22); _mMenFileSaveAs.Text = Language.strMenuSaveConnectionFileAs; _mMenFileSaveAs.Click += mMenFileSaveAs_Click; // // mMenFileSep2 // _mMenFileSep2.Name = "mMenFileSep2"; _mMenFileSep2.Size = new System.Drawing.Size(278, 6); // // mMenFileDelete // _mMenFileDelete.Image = Resources.Delete; _mMenFileDelete.Name = "mMenFileDelete"; _mMenFileDelete.Size = new System.Drawing.Size(281, 22); _mMenFileDelete.Text = Language.strDelete; _mMenFileDelete.Click += mMenFileDelete_Click; // // mMenFileRename // _mMenFileRename.Image = Resources.Rename; _mMenFileRename.Name = "mMenFileRename"; _mMenFileRename.Size = new System.Drawing.Size(281, 22); _mMenFileRename.Text = Language.strRename; _mMenFileRename.Click += mMenFileRename_Click; // // mMenFileDuplicate // _mMenFileDuplicate.Image = Resources.page_copy; _mMenFileDuplicate.Name = "mMenFileDuplicate"; _mMenFileDuplicate.Size = new System.Drawing.Size(281, 22); _mMenFileDuplicate.Text = Language.strDuplicate; _mMenFileDuplicate.Click += mMenFileDuplicate_Click; // // mMenFileSep4 // _mMenFileSep4.Name = "mMenFileSep4"; _mMenFileSep4.Size = new System.Drawing.Size(278, 6); // // mMenReconnectAll // _mMenReconnectAll.Image = Resources.Refresh; _mMenReconnectAll.Name = "mMenReconnectAll"; _mMenReconnectAll.Size = new System.Drawing.Size(281, 22); _mMenReconnectAll.Text = Language.strReconnectAllConnections; _mMenReconnectAll.Click += mMenReconnectAll_Click; // // mMenFileSep3 // _mMenFileSep3.Name = "mMenFileSep3"; _mMenFileSep3.Size = new System.Drawing.Size(278, 6); // // mMenFileImport // _mMenFileImport.DropDownItems.AddRange(new ToolStripItem[] { _mMenFileImportFromFile, _mMenFileImportFromActiveDirectory, _mMenFileImportFromPortScan }); _mMenFileImport.Name = "mMenFileImport"; _mMenFileImport.Size = new System.Drawing.Size(281, 22); _mMenFileImport.Text = Language.strImportMenuItem; // // mMenFileImportFromFile // _mMenFileImportFromFile.Name = "mMenFileImportFromFile"; _mMenFileImportFromFile.Size = new System.Drawing.Size(235, 22); _mMenFileImportFromFile.Text = Language.strImportFromFileMenuItem; _mMenFileImportFromFile.Click += mMenFileImportFromFile_Click; // // mMenFileImportFromActiveDirectory // _mMenFileImportFromActiveDirectory.Name = "mMenFileImportFromActiveDirectory"; _mMenFileImportFromActiveDirectory.Size = new System.Drawing.Size(235, 22); _mMenFileImportFromActiveDirectory.Text = Language.strImportAD; _mMenFileImportFromActiveDirectory.Click += mMenFileImportFromActiveDirectory_Click; // // mMenFileImportFromPortScan // _mMenFileImportFromPortScan.Name = "mMenFileImportFromPortScan"; _mMenFileImportFromPortScan.Size = new System.Drawing.Size(235, 22); _mMenFileImportFromPortScan.Text = Language.strImportPortScan; _mMenFileImportFromPortScan.Click += mMenFileImportFromPortScan_Click; // // mMenFileExport // _mMenFileExport.Name = "mMenFileExport"; _mMenFileExport.Size = new System.Drawing.Size(281, 22); _mMenFileExport.Text = Language.strExportToFileMenuItem; _mMenFileExport.Click += mMenFileExport_Click; // // mMenFileSep5 // _mMenFileSep5.Name = "mMenFileSep5"; _mMenFileSep5.Size = new System.Drawing.Size(278, 6); // // mMenFileExit // _mMenFileExit.Image = Resources.Quit; _mMenFileExit.Name = "mMenFileExit"; _mMenFileExit.ShortcutKeys = Keys.Alt | Keys.F4; _mMenFileExit.Size = new System.Drawing.Size(281, 22); _mMenFileExit.Text = Language.strMenuExit; _mMenFileExit.Click += mMenFileExit_Click; }
private void Initialize() { _mMenViewAddConnectionPanel = new ToolStripMenuItem(); _mMenViewConnectionPanels = new ToolStripMenuItem(); _mMenViewSep1 = new ToolStripSeparator(); _mMenViewConnections = new ToolStripMenuItem(); _mMenViewConfig = new ToolStripMenuItem(); _mMenViewErrorsAndInfos = new ToolStripMenuItem(); _mMenViewScreenshotManager = new ToolStripMenuItem(); _mMenViewJumpTo = new ToolStripMenuItem(); _mMenViewJumpToConnectionsConfig = new ToolStripMenuItem(); _mMenViewJumpToErrorsInfos = new ToolStripMenuItem(); _mMenViewResetLayout = new ToolStripMenuItem(); _mMenViewLockToolbars = new ToolStripMenuItem(); _mMenViewSep2 = new ToolStripSeparator(); _mMenViewQuickConnectToolbar = new ToolStripMenuItem(); _mMenViewExtAppsToolbar = new ToolStripMenuItem(); _mMenViewMultiSshToolbar = new ToolStripMenuItem(); _mMenViewSep3 = new ToolStripSeparator(); _mMenViewFullscreen = new ToolStripMenuItem(); _toolStripSeparator1 = new ToolStripSeparator(); // // mMenView // DropDownItems.AddRange(new ToolStripItem[] { _mMenViewAddConnectionPanel, _mMenViewConnectionPanels, _mMenViewSep1, _mMenViewConnections, _mMenViewConfig, _mMenViewErrorsAndInfos, _mMenViewScreenshotManager, _toolStripSeparator1, _mMenViewJumpTo, _mMenViewResetLayout, _mMenViewLockToolbars, _mMenViewSep2, _mMenViewQuickConnectToolbar, _mMenViewExtAppsToolbar, _mMenViewMultiSshToolbar, _mMenViewSep3, _mMenViewFullscreen }); Name = "mMenView"; Size = new System.Drawing.Size(44, 20); Text = Language.strMenuView; //DropDownOpening += mMenView_DropDownOpening; // // mMenViewAddConnectionPanel // _mMenViewAddConnectionPanel.Image = Resources.Panel_Add; _mMenViewAddConnectionPanel.Name = "mMenViewAddConnectionPanel"; _mMenViewAddConnectionPanel.Size = new System.Drawing.Size(228, 22); _mMenViewAddConnectionPanel.Text = Language.strMenuAddConnectionPanel; _mMenViewAddConnectionPanel.Click += mMenViewAddConnectionPanel_Click; // // mMenViewConnectionPanels // _mMenViewConnectionPanels.Image = Resources.Panels; _mMenViewConnectionPanels.Name = "mMenViewConnectionPanels"; _mMenViewConnectionPanels.Size = new System.Drawing.Size(228, 22); _mMenViewConnectionPanels.Text = Language.strMenuConnectionPanels; // // mMenViewSep1 // _mMenViewSep1.Name = "mMenViewSep1"; _mMenViewSep1.Size = new System.Drawing.Size(225, 6); // // mMenViewConnections // _mMenViewConnections.Checked = true; _mMenViewConnections.CheckState = CheckState.Checked; _mMenViewConnections.Image = Resources.Root; _mMenViewConnections.Name = "mMenViewConnections"; _mMenViewConnections.Size = new System.Drawing.Size(228, 22); _mMenViewConnections.Text = Language.strMenuConnections; _mMenViewConnections.Click += mMenViewConnections_Click; // // mMenViewConfig // _mMenViewConfig.Checked = true; _mMenViewConfig.CheckState = CheckState.Checked; _mMenViewConfig.Image = Resources.cog; _mMenViewConfig.Name = "mMenViewConfig"; _mMenViewConfig.Size = new System.Drawing.Size(228, 22); _mMenViewConfig.Text = Language.strMenuConfig; _mMenViewConfig.Click += mMenViewConfig_Click; // // mMenViewErrorsAndInfos // _mMenViewErrorsAndInfos.Checked = true; _mMenViewErrorsAndInfos.CheckState = CheckState.Checked; _mMenViewErrorsAndInfos.Image = Resources.ErrorsAndInfos; _mMenViewErrorsAndInfos.Name = "mMenViewErrorsAndInfos"; _mMenViewErrorsAndInfos.Size = new System.Drawing.Size(228, 22); _mMenViewErrorsAndInfos.Text = Language.strMenuNotifications; _mMenViewErrorsAndInfos.Click += mMenViewErrorsAndInfos_Click; // // mMenViewScreenshotManager // _mMenViewScreenshotManager.Image = Resources.Screenshot; _mMenViewScreenshotManager.Name = "mMenViewScreenshotManager"; _mMenViewScreenshotManager.Size = new System.Drawing.Size(228, 22); _mMenViewScreenshotManager.Text = Language.strScreenshots; _mMenViewScreenshotManager.Click += mMenViewScreenshotManager_Click; // // ToolStripSeparator1 // _toolStripSeparator1.Name = "ToolStripSeparator1"; _toolStripSeparator1.Size = new System.Drawing.Size(225, 6); // // mMenViewJumpTo // _mMenViewJumpTo.DropDownItems.AddRange(new ToolStripItem[] { _mMenViewJumpToConnectionsConfig, _mMenViewJumpToErrorsInfos }); _mMenViewJumpTo.Image = Resources.JumpTo; _mMenViewJumpTo.Name = "mMenViewJumpTo"; _mMenViewJumpTo.Size = new System.Drawing.Size(228, 22); _mMenViewJumpTo.Text = Language.strMenuJumpTo; // // mMenViewJumpToConnectionsConfig // _mMenViewJumpToConnectionsConfig.Image = Resources.Root; _mMenViewJumpToConnectionsConfig.Name = "mMenViewJumpToConnectionsConfig"; _mMenViewJumpToConnectionsConfig.ShortcutKeys = ((Keys)(((Keys.Control | Keys.Alt) | Keys.C))); _mMenViewJumpToConnectionsConfig.Size = new System.Drawing.Size(258, 22); _mMenViewJumpToConnectionsConfig.Text = Language.strMenuConnectionsAndConfig; _mMenViewJumpToConnectionsConfig.Click += mMenViewJumpToConnectionsConfig_Click; // // mMenViewJumpToErrorsInfos // _mMenViewJumpToErrorsInfos.Image = Resources.InformationSmall; _mMenViewJumpToErrorsInfos.Name = "mMenViewJumpToErrorsInfos"; _mMenViewJumpToErrorsInfos.ShortcutKeys = ((Keys)(((Keys.Control | Keys.Alt) | Keys.E))); _mMenViewJumpToErrorsInfos.Size = new System.Drawing.Size(258, 22); _mMenViewJumpToErrorsInfos.Text = Language.strMenuNotifications; _mMenViewJumpToErrorsInfos.Click += mMenViewJumpToErrorsInfos_Click; // // mMenViewResetLayout // _mMenViewResetLayout.Image = Resources.application_side_tree; _mMenViewResetLayout.Name = "mMenViewResetLayout"; _mMenViewResetLayout.Size = new System.Drawing.Size(228, 22); _mMenViewResetLayout.Text = Language.strMenuResetLayout; _mMenViewResetLayout.Click += mMenViewResetLayout_Click; // // mMenViewLockToolbars // _mMenViewLockToolbars.Image = Resources.application_side_tree; _mMenViewLockToolbars.Name = "mMenViewLockToolbars"; _mMenViewLockToolbars.Size = new System.Drawing.Size(228, 22); _mMenViewLockToolbars.Text = Language.strMenuLockToolbars; _mMenViewLockToolbars.Click += mMenViewLockToolbars_Click; // // mMenViewSep2 // _mMenViewSep2.Name = "mMenViewSep2"; _mMenViewSep2.Size = new System.Drawing.Size(225, 6); // // mMenViewQuickConnectToolbar // _mMenViewQuickConnectToolbar.Image = Resources.Play_Quick; _mMenViewQuickConnectToolbar.Name = "mMenViewQuickConnectToolbar"; _mMenViewQuickConnectToolbar.Size = new System.Drawing.Size(228, 22); _mMenViewQuickConnectToolbar.Text = Language.strMenuQuickConnectToolbar; _mMenViewQuickConnectToolbar.Click += mMenViewQuickConnectToolbar_Click; // // mMenViewExtAppsToolbar // _mMenViewExtAppsToolbar.Image = Resources.ExtApp; _mMenViewExtAppsToolbar.Name = "mMenViewExtAppsToolbar"; _mMenViewExtAppsToolbar.Size = new System.Drawing.Size(228, 22); _mMenViewExtAppsToolbar.Text = Language.strMenuExternalToolsToolbar; _mMenViewExtAppsToolbar.Click += mMenViewExtAppsToolbar_Click; // // mMenViewMultiSSHToolbar // _mMenViewMultiSshToolbar.Image = Resources.Panels; _mMenViewMultiSshToolbar.Name = "mMenViewMultiSSHToolbar"; _mMenViewMultiSshToolbar.Size = new System.Drawing.Size(279, 26); _mMenViewMultiSshToolbar.Text = Language.strMenuMultiSshToolbar; _mMenViewMultiSshToolbar.Click += mMenViewMultiSSHToolbar_Click; // // mMenViewSep3 // _mMenViewSep3.Name = "mMenViewSep3"; _mMenViewSep3.Size = new System.Drawing.Size(225, 6); // // mMenViewFullscreen // _mMenViewFullscreen.Image = Resources.arrow_out; _mMenViewFullscreen.Name = "mMenViewFullscreen"; _mMenViewFullscreen.ShortcutKeys = Keys.F11; _mMenViewFullscreen.Size = new System.Drawing.Size(228, 22); _mMenViewFullscreen.Text = Language.strMenuFullScreen; _mMenViewFullscreen.Checked = Settings.Default.MainFormKiosk; _mMenViewFullscreen.Click += mMenViewFullscreen_Click; }
public FilterSeveritiesToolStripDropDownButton() { toolStripMenuItem0 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_0, Checked = true, CheckOnClick = true, }; toolStripMenuItem1 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_1, Checked = true, CheckOnClick = true, Image = Properties.Resources._000_PiiYes_h32bit_16 }; toolStripMenuItem2 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_2, Checked = true, CheckOnClick = true, Image = Properties.Resources._000_PiiMaybe_h32bit_16 }; toolStripMenuItem3 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_3, Checked = true, CheckOnClick = true, Image = Properties.Resources._000_PiiCustomised_h32bit_16 }; toolStripMenuItem4 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_4, Checked = true, CheckOnClick = true, Image = Properties.Resources._000_PiiNo_h32bit_16 }; toolStripMenuItem5 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_5, Checked = true, CheckOnClick = true, Image = Properties.Resources._000_Severity5_h32bit_16 }; toolStripMenuItemAll = new ToolStripMenuItem { Text = Messages.FILTER_SHOW_ALL, Enabled = false }; DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem1, toolStripMenuItem2, toolStripMenuItem3, toolStripMenuItem4, toolStripMenuItem5, toolStripMenuItem0, new ToolStripSeparator(), toolStripMenuItemAll }); toolStripMenuItem0.CheckedChanged += Item_CheckedChanged; toolStripMenuItem1.CheckedChanged += Item_CheckedChanged; toolStripMenuItem2.CheckedChanged += Item_CheckedChanged; toolStripMenuItem3.CheckedChanged += Item_CheckedChanged; toolStripMenuItem4.CheckedChanged += Item_CheckedChanged; toolStripMenuItem5.CheckedChanged += Item_CheckedChanged; }
public FilterSeveritiesToolStripDropDownButton() { toolStripMenuItem0 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_0, Checked = true, CheckOnClick = true, Image = Properties.Resources.alert6_16, ToolTipText = Messages.SEVERITY_FILTER_0_DETAIL }; toolStripMenuItem1 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_1, Checked = true, CheckOnClick = true, Image = Properties.Resources.alert1_16, ToolTipText = Messages.SEVERITY_FILTER_1_DETAIL }; toolStripMenuItem2 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_2, Checked = true, CheckOnClick = true, Image = Properties.Resources.alert2_16, ToolTipText = Messages.SEVERITY_FILTER_2_DETAIL }; toolStripMenuItem3 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_3, Checked = true, CheckOnClick = true, Image = Properties.Resources.alert3_16, ToolTipText = Messages.SEVERITY_FILTER_3_DETAIL }; toolStripMenuItem4 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_4, Checked = true, CheckOnClick = true, Image = Properties.Resources.alert4_16, ToolTipText = Messages.SEVERITY_FILTER_4_DETAIL }; toolStripMenuItem5 = new ToolStripMenuItem { Text = Messages.SEVERITY_FILTER_5, Checked = true, CheckOnClick = true, Image = Properties.Resources.alert5_16, ToolTipText = Messages.SEVERITY_FILTER_5_DETAIL }; toolStripMenuItemAll = new ToolStripMenuItem { Text = Messages.FILTER_SHOW_ALL, Enabled = false }; DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem1, toolStripMenuItem2, toolStripMenuItem3, toolStripMenuItem4, toolStripMenuItem5, toolStripMenuItem0, new ToolStripSeparator(), toolStripMenuItemAll }); toolStripMenuItem0.CheckedChanged += Item_CheckedChanged; toolStripMenuItem1.CheckedChanged += Item_CheckedChanged; toolStripMenuItem2.CheckedChanged += Item_CheckedChanged; toolStripMenuItem3.CheckedChanged += Item_CheckedChanged; toolStripMenuItem4.CheckedChanged += Item_CheckedChanged; toolStripMenuItem5.CheckedChanged += Item_CheckedChanged; }
protected override void OnDropDownShow(EventArgs e) { DropDownItems.Clear(); DropDownItems.AddRange(m_itemList); base.OnDropDownShow(e); }
private void Initialize() { _mMenToolsSshTransfer = new ToolStripMenuItem(); _mMenToolsUvncsc = new ToolStripMenuItem(); _mMenToolsExternalApps = new ToolStripMenuItem(); _mMenToolsPortScan = new ToolStripMenuItem(); _mMenToolsSep1 = new ToolStripSeparator(); _mMenToolsComponentsCheck = new ToolStripMenuItem(); _mMenToolsOptions = new ToolStripMenuItem(); _mMenViewScreenshotManager = new ToolStripMenuItem(); // // mMenTools // DropDownItems.AddRange(new ToolStripItem[] { _mMenToolsSshTransfer, _mMenToolsUvncsc, _mMenToolsExternalApps, _mMenToolsPortScan, _mMenViewScreenshotManager, _mMenToolsSep1, _mMenToolsComponentsCheck, _mMenToolsOptions }); Name = "mMenTools"; Size = new System.Drawing.Size(48, 20); Text = Language.strMenuTools; // // mMenToolsSSHTransfer // _mMenToolsSshTransfer.Image = Resources.SSHTransfer; _mMenToolsSshTransfer.Name = "mMenToolsSSHTransfer"; _mMenToolsSshTransfer.Size = new System.Drawing.Size(184, 22); _mMenToolsSshTransfer.Text = Language.strMenuSSHFileTransfer; _mMenToolsSshTransfer.Click += mMenToolsSSHTransfer_Click; // // mMenToolsUVNCSC // _mMenToolsUvncsc.Image = Resources.UVNC_SC; _mMenToolsUvncsc.Name = "mMenToolsUVNCSC"; _mMenToolsUvncsc.Size = new System.Drawing.Size(184, 22); _mMenToolsUvncsc.Text = Language.strUltraVNCSingleClick; _mMenToolsUvncsc.Visible = false; _mMenToolsUvncsc.Click += mMenToolsUVNCSC_Click; // // mMenToolsExternalApps // _mMenToolsExternalApps.Image = Resources.ExtApp; _mMenToolsExternalApps.Name = "mMenToolsExternalApps"; _mMenToolsExternalApps.Size = new System.Drawing.Size(184, 22); _mMenToolsExternalApps.Text = Language.strMenuExternalTools; _mMenToolsExternalApps.Click += mMenToolsExternalApps_Click; // // mMenToolsPortScan // _mMenToolsPortScan.Image = Resources.PortScan; _mMenToolsPortScan.Name = "mMenToolsPortScan"; _mMenToolsPortScan.Size = new System.Drawing.Size(184, 22); _mMenToolsPortScan.Text = Language.strMenuPortScan; _mMenToolsPortScan.Click += mMenToolsPortScan_Click; // // mMenViewScreenshotManager // _mMenViewScreenshotManager.Image = Resources.Screenshot; _mMenViewScreenshotManager.Name = "mMenViewScreenshotManager"; _mMenViewScreenshotManager.Size = new System.Drawing.Size(228, 22); _mMenViewScreenshotManager.Text = Language.strScreenshots; _mMenViewScreenshotManager.Click += mMenViewScreenshotManager_Click; // // mMenToolsSep1 // _mMenToolsSep1.Name = "mMenToolsSep1"; _mMenToolsSep1.Size = new System.Drawing.Size(181, 6); // // mMenToolsComponentsCheck // _mMenToolsComponentsCheck.Image = Resources.cog_error; _mMenToolsComponentsCheck.Name = "mMenToolsComponentsCheck"; _mMenToolsComponentsCheck.Size = new System.Drawing.Size(184, 22); _mMenToolsComponentsCheck.Text = Language.strComponentsCheck; _mMenToolsComponentsCheck.Click += mMenToolsComponentsCheck_Click; // // mMenToolsOptions // _mMenToolsOptions.Image = Resources.Options; _mMenToolsOptions.Name = "mMenToolsOptions"; _mMenToolsOptions.Size = new System.Drawing.Size(184, 22); _mMenToolsOptions.Text = Language.strMenuOptions; _mMenToolsOptions.Click += mMenToolsOptions_Click; }
public void BuildFilterList() { Program.AssertOnEventThread(); if (inFilterListUpdate) { // queue up an update after the current one has finished, // in case the update has missed the relevant change retryFilterListUpdate = true; return; } inFilterListUpdate = true; try { DropDownItems.Clear(); DeregisterEvents(); RegisterEvents(); foreach (IXenConnection c in ConnectionsManager.XenConnectionsCopy) { Pool p = Helpers.GetPool(c); if (p == null)// Stand alone host { foreach (Host h in c.Cache.Hosts) { var item = GenerateFilterItem(h, h.uuid); item.Checked = HostCheckStates.ContainsKey(h.uuid); DropDownItems.Add(item); break; } } else { DropDownItems.Add(GeneratePoolFilterItem(p)); } } if (DropDownItems.Count > 0) { toolStripMenuItemAll = new ToolStripMenuItem { Text = Messages.FILTER_SHOW_ALL, Enabled = FilterIsOn }; DropDownItems.AddRange(new ToolStripItem[] { new ToolStripSeparator(), toolStripMenuItemAll }); } Enabled = DropDownItems.Count > 0; } finally { inFilterListUpdate = false; if (retryFilterListUpdate) { // there was a request to update while we were building, // rebuild in case we missed something retryFilterListUpdate = false; BuildFilterList(); } } }
private void Initialize() { _mMenInfoHelp = new ToolStripMenuItem(); _mMenInfoSep1 = new ToolStripSeparator(); _mMenInfoWebsite = new ToolStripMenuItem(); _mMenInfoDonate = new ToolStripMenuItem(); _mMenInfoForum = new ToolStripMenuItem(); _mMenInfoBugReport = new ToolStripMenuItem(); _toolStripSeparator2 = new ToolStripSeparator(); _mMenInfoSep2 = new ToolStripSeparator(); _mMenToolsUpdate = new ToolStripMenuItem(); _mMenInfoAbout = new ToolStripMenuItem(); // // mMenInfo // DropDownItems.AddRange(new ToolStripItem[] { _mMenInfoHelp, _mMenInfoSep1, _mMenInfoWebsite, _mMenInfoDonate, _mMenInfoForum, _mMenInfoBugReport, _toolStripSeparator2, _mMenToolsUpdate, _mMenInfoSep2, _mMenInfoAbout }); Name = "mMenInfo"; Size = new System.Drawing.Size(44, 20); Text = Language.strMenuHelp; TextDirection = ToolStripTextDirection.Horizontal; // // mMenInfoHelp // _mMenInfoHelp.Image = Resources.Help; _mMenInfoHelp.Name = "mMenInfoHelp"; _mMenInfoHelp.ShortcutKeys = Keys.F1; _mMenInfoHelp.Size = new System.Drawing.Size(190, 22); _mMenInfoHelp.Text = Language.strMenuHelpContents; _mMenInfoHelp.Click += mMenInfoHelp_Click; // // mMenInfoSep1 // _mMenInfoSep1.Name = "mMenInfoSep1"; _mMenInfoSep1.Size = new System.Drawing.Size(187, 6); // // mMenInfoWebsite // _mMenInfoWebsite.Image = Resources.Website; _mMenInfoWebsite.Name = "mMenInfoWebsite"; _mMenInfoWebsite.Size = new System.Drawing.Size(190, 22); _mMenInfoWebsite.Text = Language.strMenuWebsite; _mMenInfoWebsite.Click += mMenInfoWebsite_Click; // // mMenInfoDonate // _mMenInfoDonate.Image = Resources.Donate; _mMenInfoDonate.Name = "mMenInfoDonate"; _mMenInfoDonate.Size = new System.Drawing.Size(190, 22); _mMenInfoDonate.Text = Language.strMenuDonate; _mMenInfoDonate.Click += mMenInfoDonate_Click; // // mMenInfoForum // _mMenInfoForum.Image = Resources.user_comment; _mMenInfoForum.Name = "mMenInfoForum"; _mMenInfoForum.Size = new System.Drawing.Size(190, 22); _mMenInfoForum.Text = Language.strMenuSupportForum; _mMenInfoForum.Click += mMenInfoForum_Click; // // mMenInfoBugReport // _mMenInfoBugReport.Image = Resources.Bug; _mMenInfoBugReport.Name = "mMenInfoBugReport"; _mMenInfoBugReport.Size = new System.Drawing.Size(190, 22); _mMenInfoBugReport.Text = Language.strMenuReportBug; _mMenInfoBugReport.Click += mMenInfoBugReport_Click; // // ToolStripSeparator2 // _toolStripSeparator2.Name = "ToolStripSeparator2"; _toolStripSeparator2.Size = new System.Drawing.Size(187, 6); // // mMenToolsUpdate // _mMenToolsUpdate.Image = Resources.Update; _mMenToolsUpdate.Name = "mMenToolsUpdate"; _mMenToolsUpdate.Size = new System.Drawing.Size(190, 22); _mMenToolsUpdate.Text = Language.strMenuCheckForUpdates; _mMenToolsUpdate.Click += mMenToolsUpdate_Click; // // mMenInfoSep2 // _mMenInfoSep2.Name = "mMenInfoSep2"; _mMenInfoSep2.Size = new System.Drawing.Size(187, 6); // // mMenInfoAbout // _mMenInfoAbout.Image = Resources.mRemoteNG; _mMenInfoAbout.Name = "mMenInfoAbout"; _mMenInfoAbout.Size = new System.Drawing.Size(190, 22); _mMenInfoAbout.Text = Language.strMenuAbout; _mMenInfoAbout.Click += mMenInfoAbout_Click; }