private void objectListView1_CellRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
 {
     if (e.Model != null)
     {
         e.MenuStrip = contextMenuStrip1;
     }
 }
Exemple #2
0
 private void CategoriesList_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if (e.ListView.SelectedObjects.Count > 0)
     {
         e.MenuStrip = contextMenuCategories;
     }
 }
Exemple #3
0
        private void OnRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
        {
            if (e.Model == null)
            {
                return;
            }

            var removeItem = new ToolStripMenuItem();

            removeItem.Text   = @"Supprimer";
            removeItem.Tag    = e.RowIndex;
            removeItem.Click += (__, _) => {
                PeakView.RemoveObject(e.Model);
                PeakView.Refresh();
                PeakView.Sort(0);
            };

            var editItem = new ToolStripMenuItem();

            editItem.Text   = @"Modifier";
            editItem.Tag    = e.RowIndex;
            editItem.Click += (__, _) => {
                PeakView.EditSubItem(e.Item, e.ColumnIndex);
                PeakView.Sort(0);
            };

            e.MenuStrip = new ContextMenuStrip();
            e.MenuStrip.Items.Add(removeItem);
            e.MenuStrip.Items.Add(editItem);
        }
Exemple #4
0
        private void olvLookupColumns_CellRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
        {
            var c = e.Model as ColumnInfo;

            if (c == null)
            {
                return;
            }

            e.MenuStrip = new ColumnInfoMenu(new RDMPContextMenuStripArgs(Activator), c);
        }
		void treeListView_CellRightClick(object sender, CellRightClickEventArgs e) {
			if (e.RowIndex == -1) return;
			this.syncFolderStrategySelectedFromRowIndexClicked(e.RowIndex);
			if (this.StrategySelected != null) {
				bool clickable = (this.StrategySelected.ActivatedFromDll == false);
				this.mniStrategyDelete.Enabled = clickable;
				this.mniStrategyEdit.Enabled = clickable;
				//v1 - invisible until deleted
				this.mniStrategyDuplicate.Enabled = clickable;
				this.mniStrategyRename.Enabled = clickable;
				//v2
				this.mniltbStrategyDuplicateTo.Enabled = clickable;
				this.mniltbStrategyRenameTo.Enabled = clickable;
				
				this.ContextMenuStrip = this.ctxStrategy;
				
				List<ToolStripItem> scriptContextsMnis = this.CreateMnisForScriptContexts(this.StrategySelected);
				if (scriptContextsMnis.Count == 0) {
					this.mniStrategyOpenWith.Enabled = false;
				} else {
					this.mniStrategyOpenWith.Enabled = true;
					this.mniStrategyOpenWith.DropDownItems.Clear();
					this.mniStrategyOpenWith.DropDownItems.AddRange(scriptContextsMnis.ToArray());
				}
				
				if (clickable) {
					List<ToolStripItem> strategyFoldersMnis = this.CreateMnisForFolders(this.StrategySelected.StoredInFolderRelName);
					if (strategyFoldersMnis.Count == 0) {
						// can only happen we read Strategies/aaa.json and there is no other folders in Strategies/
						this.mniStrategyMoveToAnotherFolder.Enabled = false;
					} else {
						this.mniStrategyMoveToAnotherFolder.Enabled = true;
						this.mniStrategyMoveToAnotherFolder.DropDownItems.Clear();
						this.mniStrategyMoveToAnotherFolder.DropDownItems.AddRange(strategyFoldersMnis.ToArray());
					}
				} else {
					this.mniStrategyMoveToAnotherFolder.Enabled = false;
				}
			} else {
				bool clickable = this.FolderSelected != null
					&& (this.FolderSelected.ToUpper().EndsWith(".DLL") == false);
				this.mniFolderDelete.Enabled = clickable;
				//v1 - invisible until deleted
				this.mniFolderCreate.Enabled = clickable;
				this.mniFolderRename.Enabled = clickable;
				this.mniFolderCreateStrategy.Enabled = clickable;
				//v2
				this.mniltbFolderRename.Enabled = clickable;
				this.mniltbStrategyCreate.Enabled = clickable;
				this.mniltbFolderCreate.Enabled = clickable;
				
				this.ContextMenuStrip = this.ctxFolder;
			}
		}
        void olvCatalogues_CellRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
        {
            var ci = olvCatalogues.SelectedObject as CatalogueItem;

            if (ci == null)
            {
                return;
            }

            var menu = new CatalogueItemMenu(new RDMPContextMenuStripArgs(Activator), ci);

            menu.Show(Cursor.Position);
        }
Exemple #7
0
 private void tlwAlbums_CellRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
 {
     if (e.Model == null)
     {
         e.MenuStrip = null;
     }
     else
     {
         e.MenuStrip      = mAlbums;
         miHidden.Checked = ((AlbumDto)e.Model).IsHidden;
         miHidden.Tag     = e.Model;
         miToFolder.Tag   = e.Model;
         aerostatToolStripMenuItem.Tag = e.Model;
     }
 }
		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;
			}
		}
Exemple #9
0
 private void registryListView_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     registryMenuStrip.Show(Cursor.Position);
 }
Exemple #10
0
 private void tasksTreeView_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if (e.Model != null)
     {
         e.MenuStrip = contextMenuItem;
         ActiveTarget = (Task)e.Model;
     }
 }
Exemple #11
0
 // fill tree context menu with items valid for row
 private void tree_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     treeMenu.Items.Clear();
       var tag = e.Model as TagItem;
       //for tags
       if (tag != null) {
     if (tag == tagDeleted && tree.SelectedObjects.Count == 1) treeMenu.Items.Add("Purge Deleted", null, purgeTagClick);
     else treeMenu.Items.Add("New Note (F7)", null, btnAdd_ButtonClick);
     if (!tag.System) {
       if (tree.SelectedObjects.Count == 1) treeMenu.Items.Add("Rename (F2)", null, renTagClick);
       treeMenu.Items.Add("Delete (Del)", null, delClick);
       if (tree.SelectedObjects.Count == 1) {
     ToolStripMenuItem lex = (ToolStripMenuItem)treeMenu.Items.Add("Default Lexer");
     foreach (var l in Glob.Lexers) {
       var i = lex.DropDownItems.Add(l, null, lexTagClick);
       if (tag.Lexer == l) ((ToolStripMenuItem)i).Checked = true;
     }
       }
     }
       }
       //for notes
       else {
     var n = e.Model as NoteItem;
     if (n == null) return; // right click on blank space
     if (n.Deleted) {
       treeMenu.Items.Add("Restore", null, restoreClick);
       treeMenu.Items.Add("Purge (Del)", null, delClick);
     }
     else {
       if(tree.RowHeight == -1) treeMenu.Items.Add("New Note (F7)", null, btnAdd_ButtonClick);
       if(n.Pinned) treeMenu.Items.Add("Unpin Note", null, pinClick);
       else treeMenu.Items.Add("Pin Note", null, pinClick);
       treeMenu.Items.Add("Delete (Del)", null, delClick);
     }
       }
 }
Exemple #12
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnCellRightClick(CellRightClickEventArgs args) {
     if (this.CellRightClick != null)
         this.CellRightClick(this, args);
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="args"></param>
 /// <param name="variable"></param>
 public ToolStripShowStateMachine(CellRightClickEventArgs args, IVariable variable)
     : base(args, "Show state machine")
 {
     Variable = variable;
 }
Exemple #14
0
 void processTreeView_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     processMenuStrip.Show(Cursor.Position);
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="args"></param>
 /// <param name="variable"></param>
 public ToolStripAddValueInList(CellRightClickEventArgs args, IVariable variable)
     : base(args, "Add entry")
 {
     Variable = variable;
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="args"></param>
 /// <param name="text"></param>
 protected BaseToolStripButton(CellRightClickEventArgs args, string text)
     : base(text)
 {
     Args = args;
     Width = Text.Length*8;
 }
Exemple #17
0
 private void objectListView1_CellRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
 {
     e.MenuStrip = this.selectMenuStrip(e.Model, e.Column);
 }
Exemple #18
0
 private void olvIP_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if (e.Model != null)
     {
         olvIP.SelectedIndex = e.RowIndex;
         e.MenuStrip = cmsOlvIP;
     }
 }
 private void OrderList_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     // or e.column to get column info
     e.MenuStrip = this.DecideRightClickMenu(e.Model);
 }
Exemple #20
0
 private void olv_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if (null != e.Item)
     {
         LaunchItemBase item = _list.SelectedObject;
         if ((null != item) && ((item is LaunchItemInternal) || (item is LaunchItemDatabase)))
         {
             e.MenuStrip = contextItem;
         }
     }
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="args"></param>
 /// <param name="variable"></param>
 public ToolStripRemoveStructureMember(CellRightClickEventArgs args, IVariable variable)
     : base(args, "Remove")
 {
     Variable = variable;
 }
 private void objEpisode_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if ((e.ColumnIndex == olvDownAll.Index) && (objShows.SelectedIndex == e.RowIndex))
     {
         DownloadEpisodeWithRequest((Episode)objEpisode.SelectedObject);
     }
 }
Exemple #23
0
 private void processTreeView_CellRightClick_1(object sender, CellRightClickEventArgs e)
 {
     if (e.Model != null)
     {
         e.MenuStrip = processMenuStrip;
     }
 }
        private void listView_CellRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
        {
            try
            {
                object selectedObject = e.Model;

                List <ToolStripItem> menuItemList = new List <ToolStripItem>();
                // add this item here to take into account e.Column
                // add other menu items in the override MakeContextMenu
                string aspectName = null;
                if (e.Column != null)
                {
                    aspectName = e.Column.AspectName;

                    /*
                     * if (AppManager.Instance.IsCustomEditProperty(SourceObjectType, aspectName))
                     * {
                     *
                     *  ToolStripMenuItem menuItem = new ToolStripMenuItem();
                     *  menuItem.Text = FrwCRUDRes.List_Edit_Field;
                     *  menuItem.Click += (s, em) =>
                     *  {
                     *      try
                     *      {
                     *          //todo button xak ?
                     *          object rowObject = e.Model;
                     *          bool cancel = false;
                     *          object newValue = AppManager.Instance.EditCustomPropertyValue(rowObject, aspectName, out cancel, this);
                     *          Dm.Instance.InsertOrUpdateObject(rowObject);
                     *          RefreshObject(rowObject);
                     *      }
                     *      catch (Exception ex)
                     *      {
                     *          Log.showError(ex);
                     *      }
                     *  };
                     *  menuItemList.Add(menuItem);
                     *  menuItemList.Add(new ToolStripSeparator());
                     */
                    /* todo
                     * if (AppManager.Instance.IsCustomEditProperty(SourceObjectType, aspectName))
                     * {
                     *  object rowObject = e.Model;
                     *  object v = AttrHelper.GetPropertyValue(rowObject, aspectName);
                     *  if (v != null) {
                     *      menuItem = new ToolStripMenuItem();
                     *      menuItem.Text = FrwCRUDRes.List_View_Field;
                     *      menuItem.Click += (s, em) =>
                     *      {
                     *          try
                     *          {
                     *              Dm.Instance.ResolveRelation(rowObject, aspectName);
                     *              //IList rvs = (IList)AttrHelper.GetPropertyValue(rowObject, aspectName);
                     *              if (rvs != null && rvs.Count > 0)
                     *              {
                     *                  IPropertyProcessor propertyControl = null;
                     *                  if (propertyDialog == null)
                     *                  {
                     *                      propertyControl = (IPropertyProcessor)AppManager.Instance.CreateNewContentInstance(typeof(IPropertyProcessor), rvs[0].GetType(), null);
                     *                      propertyDialog = new SimplePropertyDialog(propertyControl);
                     *                  }
                     *                  else propertyControl = propertyDialog.PropertyWindow;
                     *                  propertyControl.ViewMode = ViewMode.View;
                     *                  propertyControl.SourceObject = rvs[0];
                     *                  propertyControl.ProcessView();
                     *                  DialogResult res = propertyDialog.ShowDialog();
                     *              }
                     *              else
                     *              {
                     *                  MessageBox.Show(FrwCRUDRes.Object_For_View_Not_Found);
                     *              }
                     *          }
                     *          catch (Exception ex)
                     *          {
                     *              Log.showError(ex);
                     *          }
                     *      };
                     *      menuItemList.Add(menuItem);
                     *  }
                     * }
                     */
                    //}
                }
                MakeContextMenu(menuItemList, e.Item, selectedObject, aspectName);


                if (menuItemList != null)
                {
                    this.contextMenu.Items.Clear();
                    this.contextMenu.Items.AddRange(menuItemList.ToArray <ToolStripItem>());
                    e.MenuStrip = this.contextMenu;
                }
            }
            catch (Exception ex)
            {
                Log.ShowError(ex);
            }
        }
Exemple #25
0
 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;
     }
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="args"></param>
 /// <param name="value"></param>
 /// <param name="element"></param>
 public ToolStripAddStructureMember(CellRightClickEventArgs args, StructureValue value,
     StructureElement element)
     : base(args, "Add " + element.Name)
 {
     Value = value;
     Element = element;
 }
Exemple #27
0
 private void dataListEvents_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if (e.Item == null)
         e.MenuStrip = contextMenuStripTriggerNull;
     else
         e.MenuStrip = contextMenuStripTrigger;
 }
 /// <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;
 }
Exemple #29
0
        private void dataListViewDevices_CellRightClick(object sender, CellRightClickEventArgs e)
        {
            if (e.Item == null)
                e.MenuStrip = contextMenuStripDevicesNull;
            else
            {
                ContextMenuStrip contextMenuStripDevicesDynamicCMDs = new ContextMenuStrip();
                contextMenuStripDevicesDynamicCMDs.Items.Clear();

                using (zvsEntities2 db = new zvsEntities2(zvsEntityControl.GetzvsConnectionString))
                {
                    device d = db.devices.FirstOrDefault(o => o.id == ((device)e.Item.RowObject).id);
                    if (d != null)
                    {
                        //Create a new context menu
                        ToolStripMenuItem CMDcontainer = new ToolStripMenuItem();
                        CMDcontainer.Text = d.friendly_name;
                        CMDcontainer.Tag = "dynamic_cmd_menu";

                        foreach (device_type_commands c in d.device_types.device_type_commands)
                        {
                            switch ((Data_Types)c.arg_data_type)
                            {
                                case Data_Types.NONE:
                                    {
                                        ToolStripMenuItem item = new ToolStripMenuItem();
                                        item.Name = string.Empty;
                                        item.Text = c.friendly_name;
                                        item.ToolTipText = c.description;
                                        item.Tag = c;
                                        item.Click += new EventHandler(dynamic_CMD_item_Click);
                                        CMDcontainer.DropDownItems.Add(item);
                                        break;
                                    }
                                case Data_Types.LIST:
                                    {
                                        //ROOT MENU
                                        ToolStripMenuItem item = new ToolStripMenuItem();
                                        item.Name = string.Empty;
                                        item.Text = c.friendly_name;
                                        item.ToolTipText = c.description;

                                        foreach (device_type_command_options option in c.device_type_command_options)
                                        {
                                            ToolStripMenuItem option_item = new ToolStripMenuItem();
                                            option_item.Name = option.option;
                                            option_item.Text = option.option;
                                            option_item.Tag = c;
                                            option_item.Click += new EventHandler(dynamic_CMD_item_Click);
                                            item.DropDownItems.Add(option_item);
                                        }
                                        CMDcontainer.DropDownItems.Add(item);
                                        break;
                                    }
                            }
                        }

                        foreach (device_commands c in d.device_commands)
                        {
                            switch ((Data_Types)c.arg_data_type)
                            {
                                case Data_Types.NONE:
                                    {
                                        ToolStripMenuItem item = new ToolStripMenuItem();
                                        item.Name = string.Empty;
                                        item.Text = c.friendly_name;
                                        item.ToolTipText = c.description;
                                        item.Tag = c;
                                        item.Click += new EventHandler(dynamic_CMD_item_Click);
                                        CMDcontainer.DropDownItems.Add(item);
                                        break;
                                    }
                                case Data_Types.LIST:
                                    {
                                        //ROOT MENU
                                        ToolStripMenuItem item = new ToolStripMenuItem();
                                        item.Name = string.Empty;
                                        item.Text = c.friendly_name;
                                        item.ToolTipText = c.description;

                                        foreach (device_command_options option in c.device_command_options)
                                        {
                                            ToolStripMenuItem option_item = new ToolStripMenuItem();
                                            option_item.Name = option.name;
                                            option_item.Text = option.name;
                                            option_item.Tag = c;
                                            option_item.Click += new EventHandler(dynamic_CMD_item_Click);
                                            item.DropDownItems.Add(option_item);
                                        }
                                        CMDcontainer.DropDownItems.Add(item);
                                        break;
                                    }
                            }
                        }

                        e.MenuStrip = contextMenuStripDevicesDynamicCMDs;
                        if (CMDcontainer.DropDownItems.Count > 0)
                            contextMenuStripDevicesDynamicCMDs.Items.Insert(0, CMDcontainer);

                        ToolStripMenuItem repoll = new ToolStripMenuItem();
                        repoll.Text = "Repoll Device";
                        repoll.Click += new EventHandler(Repoll_Click);
                        repoll.Tag = d;

                        contextMenuStripDevicesDynamicCMDs.Items.Add(repoll);
                        contextMenuStripDevicesDynamicCMDs.Items.Add(new ToolStripSeparator());
                        contextMenuStripDevicesDynamicCMDs.Items.Add(new ToolStripMenuItem("Delete Device", null, new EventHandler(DeleteDevice_Click)));
                        contextMenuStripDevicesDynamicCMDs.Items.Add(new ToolStripMenuItem("Activate Groups", null, new EventHandler(ActivateGroups_Click)));
                        contextMenuStripDevicesDynamicCMDs.Items.Add(new ToolStripMenuItem("Edit Groups", null, new EventHandler(EditGroups_Click)));
                        contextMenuStripDevicesDynamicCMDs.Items.Add(new ToolStripSeparator());
                        contextMenuStripDevicesDynamicCMDs.Items.Add(new ToolStripMenuItem("Properties", null, new EventHandler(deviceProperties_Click)));
                    }
                }
            }
        }
        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.ElementCount < collection.getMaxSize())
                    {
                        items.Add(new ToolStripAddValueInList(args, enclosingVariable));
                    }
                }
            }

            items.Sort(delegate(BaseToolStripButton b1, BaseToolStripButton b2) { return b1.Text.CompareTo(b2.Text); });
            foreach (BaseToolStripButton menuItem in items)
            {
                menuStrip.Items.Add(menuItem);
            }

            args.MenuStrip = menuStrip;
        }
Exemple #31
0
 //scene commands
 private void dataListViewSceneCMDs_CellRightClick(object sender, CellRightClickEventArgs e)
 {
     if (e.Item != null)
         e.MenuStrip = cmsSceneCMD;
 }
        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));
                }
            }
        }
Exemple #33
0
 private void dataListViewScenes_CellRightClick_1(object sender, CellRightClickEventArgs e)
 {
     if (e.Item == null)
         e.MenuStrip = contextMenuStripScenesNull;
     else
         e.MenuStrip = contextMenuStripScenes;
 }
 /// <summary>
 /// The user right clicked on the control
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnRightMouseUp(MouseEventArgs e)
 {
     CellRightClickEventArgs args = new CellRightClickEventArgs();
     this.BuildCellEvent(args, e.Location);
     this.OnCellRightClick(args);
     if (!args.Handled) {
         if (args.MenuStrip != null) {
             args.MenuStrip.Show(this, args.Location);
         }
     }
 }
Exemple #35
0
 /// <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;
 }