public void CommonRightClick(object sender, CellRightClickEventArgs e) { //if we aren't doing a multi select if (Tree.SelectedObjects.Count <= 1) { Tree.SelectedObject = e.Model; } RefreshContextMenuStrip(); _menu?.Show(Tree.PointToScreen(e.Location)); }
private void objectListViewMain_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model == null) { return; } EnsureSingleSelection(e.Item); e.MenuStrip = listViewContextMenuStrip; }
private void olvDuplicates_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model is null) { return; } possibleMergedEpisodeRightClickMenu.Items.Clear(); if (olvDuplicates.SelectedObjects.Count == 1) { SettingsCheck mlastSelected = (SettingsCheck)e.Model; if (mlastSelected is MovieCheck mcheck) { MovieConfiguration si = mcheck.Movie; AddRcMenuItem("Force Refresh", (o, args) => mainUi.ForceMovieRefresh(new List <MovieConfiguration> { si }, false)); AddRcMenuItem("Edit Movie", (o, args) => mainUi.EditMovie(si)); possibleMergedEpisodeRightClickMenu.Items.Add(new ToolStripSeparator()); foreach (var f in si.Locations) { AddRcMenuItem("Visit " + f, (o, args) => Helpers.OpenFolder(f)); } } else if (mlastSelected is TvShowCheck tcheck) { ShowConfiguration si = tcheck.Show; AddRcMenuItem("Force Refresh", (o, args) => mainUi.ForceRefresh(new List <ShowConfiguration> { si }, false)); AddRcMenuItem("Edit TV Show", (o, args) => mainUi.EditShow(si)); } possibleMergedEpisodeRightClickMenu.Items.Add(new ToolStripSeparator()); AddRcMenuItem("Fix Issue", (o, args) => Remedy(mlastSelected)); } else { AddRcMenuItem("Fix Issues", (o, args) => { foreach (var selected in olvDuplicates.SelectedObjects.OfType <SettingsCheck>()) { Remedy(selected); } mDoc.SetDirty(); }); } }
/// <summary> /// Sets right click menu when clicking on a list item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void olvCraftList_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model != null) { e.MenuStrip = cmsShip; } else { e.MenuStrip = cmsList; } }
void olvSelected_CellRightClick(object sender, CellRightClickEventArgs e) { var ec = e.Model as ExtractableColumn; if (ec != null && ec.IsOutOfSync()) { var ms = new ContextMenuStrip(); ms.Items.Add(new ToolStripMenuItem("Update With Catalogue Settings", null, (s, x) => ec.UpdateValuesToMatch(ec.CatalogueExtractionInformation))); e.MenuStrip = ms; } }
private void olvAllCars_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model == null) { e.MenuStrip = contextMenuStripGroups; } else { contextMenuStripCar.Tag = (Car)e.Model; e.MenuStrip = contextMenuStripCar; } }
private void mAttachments_CellRightClick(object sender, CellRightClickEventArgs e) { var singleItemSelected = mAttachments.SelectedObjects.Count == 1; var anyItemSelected = mAttachments.SelectedObjects.Count > 0; mViewBinaryCommand.Enabled = singleItemSelected; mRenameBinaryCommand.Enabled = singleItemSelected; mSaveBinaryCommand.Enabled = anyItemSelected; mDeleteBinaryCommand.Enabled = anyItemSelected; mAttachBinaryCommand.Enabled = Entry != null; e.MenuStrip = mAttachmentsContextMenu; }
private void ModListCellRightClick(object sender, CellRightClickEventArgs e) { var mod = e.Model as ModEntry; var graphics = e.ListView.CreateGraphics(); var selectedTag = e.SubItem != null && e.Column == olvcTags ? HitTest(mod?.Tags, graphics, e) : null; var menu = selectedTag == null ? CreateModListContextMenu(mod, e.Item) : CreateModListContextMenu(mod, selectedTag); menu.Show(e.ListView, e.Location); }
private void mainTreeView_CellRightClick(object sender, CellRightClickEventArgs e) { if (mainTreeView.SelectedObjects.Count == 0) { return; } _cmenuItems["Open"].Visible = false; _cmenuItems["OpenAll"].Visible = true; _cmenuItems["Sep.OpenNew"].Visible = true; _cmenuItems["SortName"].Visible = true; _cmenuItems["Sep.DelSort"].Visible = true; e.MenuStrip = _cmenu; }
public static void CreateContextualMenu(object obj, CellRightClickEventArgs args) { CustomizeTreeView.CreateContextualMenu(obj, args); IVariable enclosingVariable = args.Model as IVariable; if (enclosingVariable != null) { if (enclosingVariable.Type is StateMachine) { args.MenuStrip.Items.Add(new ToolStripShowStateMachine(args, enclosingVariable)); } } }
private void mMultipleSelectionFields_CellRightClick(object sender, CellRightClickEventArgs e) { var rowObject = (FieldsListView.RowObject)e.Model; if (rowObject == null || rowObject.IsInsertionRow) { mURLDropDown.Visible = false; mCopyCommand.Enabled = false; mEditFieldCommand.Enabled = false; mProtectFieldCommand.Enabled = false; mPasswordGeneratorCommand.Enabled = false; mDeleteFieldCommand.Enabled = false; mAddNewCommand.Enabled = Entry != null; mProtectFieldCommand.Checked = false; mCopyCommand.Text = String.Format(Properties.Resources.CopyCommand, Properties.Resources.Field); } else { if (mMultipleSelectionFields.IsMultiValuedField(rowObject)) { mURLDropDown.Visible = false; mCopyCommand.Enabled = false; mProtectFieldCommand.Enabled = false; mProtectFieldCommand.Checked = false; mCopyCommand.Text = String.Format(Properties.Resources.CopyCommand, Properties.Resources.Field); } else { var url = e.Item.SubItems.Count == 2 ? e.Item.GetSubItem(1).Url : null; mLastContextMenuUrl = url; mURLDropDown.Visible = url != null; mCopyCommand.Enabled = true; mProtectFieldCommand.Enabled = true; mProtectFieldCommand.Checked = rowObject.Value.IsProtected; mCopyCommand.Text = String.Format(Properties.Resources.CopyCommand, rowObject.DisplayName); } mEditFieldCommand.Enabled = true; mPasswordGeneratorCommand.Enabled = true; mDeleteFieldCommand.Enabled = true; mAddNewCommand.Enabled = true; } e.MenuStrip = mFieldGridContextMenu; mFieldGridContextMenuTarget = mMultipleSelectionFields; }
private void objectListViewMain_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model == null) { return; } if (objectListViewMain.CheckBoxes && !objectListViewMain.IsChecked(e.Model)) { objectListViewMain.UncheckAll(); objectListViewMain.CheckObject(e.Model); } e.MenuStrip = listViewContextMenuStrip; }
internal void fOlvCustomers_CellRightClick(object sender, CellRightClickEventArgs e) { if (!(e.Item is null) && e.ColumnIndex < e.ListView.Columns.Count - 1) { _olvSelectedListItem = e.Item; _olvSelectedSubItemIndex = e.ColumnIndex; if (e.Column.IsEditable) { _canEdit = true; } else { _canEdit = false; } }
private void olv_RightClick(object sender, CellRightClickEventArgs e) { if (e.Item != null) { e.Item.Selected = true; if (e.Model is AtlasObject) { this.removeAtlasEntryToolStripMenuItem.Enabled = true; } else { this.removeAtlasEntryToolStripMenuItem.Enabled = false; } } this.contextMenuStrip1.Show(this.olv, e.Location.X, e.Location.Y); }
private void mainContentsView_CellRightClick(object sender, CellRightClickEventArgs e) { //reset _cmenuItems["OpenAll"].Visible = false; _cmenuItems["Open"].Visible = false; _cmenuItems["Sep.OpenNew"].Visible = false; _cmenuItems["SortName"].Visible = false; _cmenuItems["Sep.DelSort"].Visible = false; switch (mainContentsView.SelectedObjects.Count) { case 0: //selected outside list if (mainTreeView.SelectedObjects.Count == 1) { //processing of the selected directory in MainTreeView _cmenuItems["OpenAll"].Visible = true; _cmenuItems["Sep.OpenNew"].Visible = true; _cmenuItems["SortName"].Visible = true; _cmenuItems["Sep.DelSort"].Visible = true; } break; case 1: var bi = (BookmarkItem)mainContentsView.SelectedObject; if (bi.IsBookmark) { //processing the selected bookmark in MainContentView _cmenuItems["Open"].Visible = true; _cmenuItems["Sep.OpenNew"].Visible = true; } else { if (bi.IsDirectory) { //processing the selected directory in MainContentView _cmenuItems["OpenAll"].Visible = true; _cmenuItems["Sep.OpenNew"].Visible = true; _cmenuItems["SortName"].Visible = true; _cmenuItems["Sep.DelSort"].Visible = true; } } break; } e.MenuStrip = _cmenu; }
private void objectListViewMain_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model == null) { return; } /*if (objectListViewMain.CheckBoxes && !objectListViewMain.IsChecked(e.Model)) * { * objectListViewMain.UncheckAll(); * objectListViewMain.CheckObject(e.Model); * }*/ EnsureSingleSelection(e.Item); e.MenuStrip = listViewContextMenuStrip; }
private void objectListViewTicket_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Model != null) { ContextMenuStrip menuStrip = new ContextMenuStrip(); if (objectListViewTicket.SelectedObjects.Count == 1) { menuStrip.Items.Add("Delete ticket", Properties.Resources.icons8_trash_24, new EventHandler(DeleteTicket_Click)); } if (objectListViewTicket.SelectedObjects.Count > 1) { menuStrip.Items.Add("Delete tickets", Properties.Resources.icons8_trash_24, new EventHandler(DeleteTickets_Click)); } e.MenuStrip = menuStrip; } }
void tree_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.RowIndex == -1) // empty tree, no datasources added yet { this.ContextMenuStrip = this.ctxDataSource; return; } this.syncSymbolAndDataSourceSelectedFromRowIndexClicked(e.RowIndex); if (this.SymbolSelected != null) { if (this.DataSourceSelected == null) { throw new Exception("DATASOURCE_NOT_SELECTED_WHILE_SYMBOL_SELECTED"); } this.ContextMenuStrip = this.ctxSymbol; //string dataSourceName = base.SelectedNode.Parent.Text; //string chartTitlePartial = " - " + symbol + " (" + dataSourceName + ")"; //ChartForm chart = MainModule.Instance.MainForm.findByChartTitlePartialIfOpen(chartTitlePartial); string newExisting = (true) ? "New" : "Existing"; //chart != null this.mniNewChartSymbol.Text = newExisting + " Chart for " + this.SymbolSelected; this.mniBarsAnalyzerSymbol.Text = "Bars Analyzer for " + this.SymbolSelected; this.mniOpenStrategySymbol.Text = "New Strategy for " + this.SymbolSelected; this.mniRemoveSymbol.Text = "Remove [" + this.SymbolSelected + "] from [" + this.DataSourceSelected.Name + "]"; DataSourceSymbolEventArgs subscribersPolled = this.dataSourceRepository.SymbolCanBeDeleted(this.DataSourceSelected, this.SymbolSelected, this); this.mniRemoveSymbol.Enabled = (subscribersPolled.DoNotDeleteItsUsedElsewhere == false); //int imageIndex = getProviderImageIndexForDataSource(this.DataSourceSelected); //if (imageIndex == -1) return; //Image providerIcon = this.tree.SmallImageList.Images[imageIndex]; //if (providerIcon != null) { // this.mniNewChartSymbol.Image = providerIcon; // this.mniOpenStrategySymbol.Image = providerIcon; //} } else { NamedObjectJsonEventArgs <DataSource> subscribersPolled = this.dataSourceRepository.ItemCanBeDeleted(this.DataSourceSelected, this); this.mniDataSourceEdit.Enabled = (subscribersPolled.DoNotDeleteItsUsedElsewhere == false); this.mniDataSourceDelete.Enabled = (subscribersPolled.DoNotDeleteItsUsedElsewhere == false); this.mniDataSourceEdit.Text = "Edit DataSource [" + this.DataSourceSelected.Name + "]"; this.mniDataSourceDelete.Text = "Delete DataSource [" + this.DataSourceSelected.Name + "]"; this.ContextMenuStrip = this.ctxDataSource; } }
private void treeListView1_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.Item != null) { e.Item.Selected = true; this.contextMenuStrip1.Show(this.treeListView1, e.Location.X, e.Location.Y); if (e.Model is MeshTextureObject) { this.removeReferenceToModelPartToolStripMenuItem1.Enabled = true; } else if (e.Model is UnitVariantObject) { this.removeReferenceToModelPartToolStripMenuItem1.Enabled = false; this.removeModelPartToolStripMenuItem.Enabled = true; this.insertModelPartToolStripMenuItem.Enabled = true; } } }
private void olvOrder_CellRightClick(object sender, CellRightClickEventArgs e) { if (e.RowIndex < 0) { olvOrder.ContextMenuStrip = null; } else { Order o = (Order)e.Item.RowObject; if (o.Qty != 0 && o.Qty - o.SumQty > 0) { _ChangeOrderMenu(o); olvOrder.ContextMenuStrip = cmChangeOrder; } else { olvOrder.ContextMenuStrip = null; } } }
private void olvComponents_CellRightClick(object sender, CellRightClickEventArgs e) { var model = (AdvertisedPipelineComponentTypeUnderContext)e.Model; ContextMenuStrip RightClickMenu = new ContextMenuStrip(); if (model != null) { if (!model.IsCompatible()) { RightClickMenu.Items.Add("Component incompatible", null, (s, v) => WideMessageBox.Show(model.ToString(), model.GetReasonIncompatible(), WideMessageBoxTheme.Help)); } } //show it if (RightClickMenu.Items.Count != 0) { RightClickMenu.Show(this, e.Location); } }
private void cellRightClick(object sender, CellRightClickEventArgs e) { if (treeListView.SelectedObject == null) { pcPhraseMenu.Items[1].Visible = false; pcPhraseMenu.Items[2].Visible = false; pcPhraseMenu.Items[3].Visible = false; e.MenuStrip = pcPhraseMenu; } else if (treeListView.SelectedObject is DialogNode) { e.MenuStrip = npcPhraseMenu; } else if (treeListView.SelectedObject is DialogResponse) { pcPhraseMenu.Items[1].Visible = true; pcPhraseMenu.Items[2].Visible = true; pcPhraseMenu.Items[3].Visible = true; e.MenuStrip = pcPhraseMenu; } }
private void targetTreeView_CellRightClick(object sender, CellRightClickEventArgs e) { //TODO: enableDisable context menu options }
internal void fastObjectListView1_CellRightClick(object sender, CellRightClickEventArgs e) { if (!(e.Item is null)) { OlvSelectedItem = e.Item; }
public static void CreateContextualMenu(object obj, CellRightClickEventArgs args) { ContextMenuStrip menuStrip = new ContextMenuStrip(); List <BaseToolStripButton> items = new List <BaseToolStripButton>(); IVariable enclosingVariable = args.Model as IVariable; IValue value = DerefVariable(args.Model); StructureValue structureValue = value as StructureValue; if (structureValue != null) { Structure structureType = (Structure)structureValue.Type; foreach (StructureElement element in structureType.Elements) { if (element.Type is Structure) { IVariable subVariable = null; INamable tmp; if (structureValue.Val.TryGetValue(element.Name, out tmp)) { subVariable = tmp as IVariable; } if (subVariable == null || subVariable.Value == EfsSystem.Instance.EmptyValue || subVariable.Value is DefaultValue) { items.Add(new ToolStripAddStructureMember(args, structureValue, element)); } } } if (enclosingVariable != null) { StructureValue enclosingStructureValue = enclosingVariable.Enclosing as StructureValue; if (enclosingStructureValue != null) { items.Add(new ToolStripRemoveStructureMember(args, enclosingVariable)); } } TreeListView treeListView = (TreeListView)obj; object parent = treeListView.GetParent(args.Model); ListValue enclosingListValue = DerefVariable(parent) as ListValue; if (enclosingListValue != null) { items.Add(new ToolStripRemoveListEntry(args, enclosingListValue, structureValue)); } } ListValue listValue = value as ListValue; if (listValue != null) { if (enclosingVariable != null) { Collection collection = (Collection)enclosingVariable.Type; if (listValue.Val.Count < collection.getMaxSize()) { items.Add(new ToolStripAddValueInList(args, enclosingVariable)); } } } items.Sort((b1, b2) => String.Compare(b1.Text, b2.Text, StringComparison.Ordinal)); foreach (BaseToolStripButton menuItem in items) { menuStrip.Items.Add(menuItem); } args.MenuStrip = menuStrip; }
/// <summary> /// Constructor /// </summary> /// <param name="args"></param> /// <param name="variable"></param> public ToolStripRemoveStructureMember(CellRightClickEventArgs args, IVariable variable) : base(args, "Remove") { Variable = variable; }
/// <summary> /// Constructor /// </summary> /// <param name="args"></param> /// <param name="value"></param> /// <param name="entry"></param> public ToolStripRemoveListEntry(CellRightClickEventArgs args, ListValue value, Value entry) : base(args, "Remove") { Value = value; Entry = entry; }
/// <summary> /// Constructor /// </summary> /// <param name="args"></param> /// <param name="variable"></param> public ToolStripAddValueInList(CellRightClickEventArgs args, IVariable variable) : base(args, "Add entry") { Variable = variable; }
private void treeListView_CellRightClick(object sender, CellRightClickEventArgs e) { e.MenuStrip = this.GetContextMenu(e.Model, e.Column); }
private void lvResults_CellRightClick(object sender, CellRightClickEventArgs e) { e.MenuStrip = contextMenuStrip1; }
private void listViewLibrary_CellRightClick(object sender, CellRightClickEventArgs e) { var selectedItem = GetSelectedLibraryItem(); if (selectedItem == null) return; //check if playlists already contains tablature foreach (var item in librarycontextaddtoplaylist.DropDownItems) { var toolItem = item as ToolStripMenuItem; if (toolItem != null && toolItem.Tag != null) { var associatedPlaylist = toolItem.Tag as TablaturePlaylist; toolItem.Enabled = associatedPlaylist.Find(x => x.FileInfo.FullName.Equals(selectedItem.FileInfo.FullName)) == null; } } librarycontextfavorites.Text = GetSelectedLibraryItem().Favorited ? Resources.RemoveFromFavorites : Resources.AddToFavorites; e.MenuStrip = LibraryMenu; }