/// <summary> /// FilterPopup event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cell_FilterPopup(object sender, ColumnHeaderCellEventArgs e) { if (Columns.Contains(e.Column)) { MenuStrip filterMenu = e.FilterMenu; DataGridViewColumn column = e.Column; System.Drawing.Rectangle rect = GetCellDisplayRectangle(column.Index, -1, true); if (_filteredColumns.Contains(column.Name)) { filterMenu.Show(this, rect.Left, rect.Bottom, false); } else { _filteredColumns.Add(column.Name); if (_filterOrderList.Count() > 0 && _filterOrderList.Last() == column.Name) { filterMenu.Show(this, rect.Left, rect.Bottom, true); } else { filterMenu.Show(this, rect.Left, rect.Bottom, MenuStrip.GetValuesForFilter(this, column.Name)); } } } }
/// <summary> /// Event fired when the user right clicks, to open the context menu /// </summary> private void SnapshotView_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && SnapshotView.FocusedItem.Bounds.Contains(e.Location)) { MenuStrip.Show(Cursor.Position); } }
private void editor2_MouseClick(object sender, MouseEventArgs e) { firstEditorRMouse = false; if (e.Button == MouseButtons.Right) { MenuStrip.Show(Cursor.Position); } }
public dynamic menu(Control parent) { var mnu = new MenuStrip(); parent.Controls.Add(mnu); mnu.Dock = DockStyle.Top; mnu.Show(); return(mnu); }
public override void Initialize() { base.Initialize(); ptree = new PropertyTree(panel); tagStrip = new MenuStrip(panel); var root = tagStrip.AddItem("Add tag"); root.Position(Gwen.Pos.Top, 0, 100); root.Menu.Position(Gwen.Pos.Top, 0, 20); root.Clicked += (sender, arguments) => { var menu = sender as MenuItem; menu.Menu.Show(); }; foreach (var tag in TagsContainer.allTags) { root.Menu.AddItem(tag); } root.Menu.AddDivider(); root.Menu.AddItem("Create new tag").SetAction((Base sender, EventArgs arguments) => Console.WriteLine()); //root.Menu.; tagStrip.Hide(); ptree.ShouldDrawBackground = false; Selection.OnSelectionChange += (sender, args) => { var entity = (sender as Func <object>)() as Entity; if (entity != null) { var comps = entity.GetAllComponents(); ptree.RemoveAll(); var prop = ptree.Add("Transform"); prop.Add("Position:", new Gwen.Control.Property.Vector3(prop), entity.Position).ValueChanged += (o, arg) => { var tmpObj = o as PropertyRow <Vector3>; entity.Position = tmpObj.Value; }; prop.Add("Rotation:", new Gwen.Control.Property.Vector3(prop), entity.Rotation).ValueChanged += (o, arg) => { var tmpObj = o as PropertyRow <Vector3>; entity.Rotation = tmpObj.Value; }; prop.Add("Scale:", new Gwen.Control.Property.Vector3(prop), entity.Scale).ValueChanged += (o, arg) => { var tmpObj = o as PropertyRow <Vector3>; entity.Scale = tmpObj.Value; }; foreach (var component in comps) { prop = ptree.Add(component.GetType().Name); var inspector = new DefaultInspector(); inspector.properties = prop; inspector.getTarget = () => component; inspector.OnInitializeGUI(); } ptree.Show(); ptree.SetBounds(0, 25, 200, 200); ptree.ExpandAll(); tagStrip.Show(); } //else //props=Selection.assets [0].GetType ().GetProperties ().Where (p=>p.CanRead && p.CanWrite); }; }
private void MainRelationView_MouseDown(object sender, MouseEventArgs e) { if (selectedId_renameBox != selectedId_None) { startRename(); } if (e.Button == MouseButtons.Right) { selectedId_menu = get_circleID(e.Location); ChangeMenuVisible(); Point currMouseLocation = e.Location + (Size)FormLocate + (Size)Location; afterMenuMouseLocation = e.Location + (Size)Location; MenuStrip.Show(currMouseLocation); } }
protected void ListView_MouseClick(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Right) { return; } ListViewHitTestInfo hit = ListView.HitTest(e.Location); if (hit.Item == null) { return; } MenuStrip.Show(ListView, e.Location, ToolStripDropDownDirection.BelowRight); }
private void Ruler_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { nameItem.Text = Name; sizeItem.Text = "Size: " + Width.ToString() + "px x " + Height.ToString() + "px"; locationItem.Text = "Location: " + Location.X.ToString() + "px; " + Location.X.ToString() + "px"; try { Screen screen = Screen.AllScreens.First(x => x.Bounds.Contains(Location)); screenItem.Text = "Screen: " + screen.DeviceName.Replace(@"\\.\", "") + (screen.Primary ? " (Primary)" : ""); } catch { screenItem.Text = "Unknown"; } MenuStrip.Show(PointToScreen(e.Location)); } }
public override void Initialize() { base.Initialize(); ptree = new PropertyTree(panel); tagStrip = new MenuStrip(panel); var root = tagStrip.AddItem("Add tag"); root.Position(Gwen.Pos.Top, 0, 100); root.Menu.Position(Gwen.Pos.Top, 0, 20); root.Clicked += (sender, arguments) => { var menu = sender as MenuItem; menu.Menu.Show(); }; foreach (var tag in TagsContainer.allTags) { root.Menu.AddItem(tag); } root.Menu.AddDivider(); root.Menu.AddItem("Create new tag").SetAction((Base sender, EventArgs arguments) => Console.WriteLine()); //root.Menu.; tagStrip.Hide(); ptree.ShouldDrawBackground = false; Selection.OnSelectionChange += (sender, args) => { Console.WriteLine("SelectionChange"); ptree.RemoveAll(); if (sender is Entity entity) { RenderComponents(entity); } //else //props=Selection.assets [0].GetType ().GetProperties ().Where (p=>p.CanRead && p.CanWrite); tagStrip.Show(); ptree.Show(); ptree.SetBounds(0, 25, panel.Width, 200); ptree.ExpandAll(); }; Selection.OnSelectionDirty += (sender, args) => { if (sender is Entity entity) { RenderComponents(entity); } }; }
private void UpdateRightClick() { // 우선 테스트 정도로 작동 대충 되도록 짜봤음 if (_drawState == DrawState.NONE) { if (_nearShapes.Count == 1) { if (Scene.CurrentScene.IsRightMouseUp) { UnselectAll(); Select(_nearShapes[0]); _shapeMenuStrip.Show(Scene.CurrentScene.MousePosition.X, Scene.CurrentScene.MousePosition.Y); } } if (_shapeMenuStrip.IsSelected) { if (_shapeMenuStrip.SelectedItem.Text == "Delete") { DeleteSelected(); } } } }
private void MenuBT_Click(object sender, EventArgs e) { MenuStrip.Show(Cursor.Position); }
public void Show() { _menu.Show(); }
private void BuildMenu(MasterFrom masterForm, int?empType) { MenuStrip mainMenu = masterForm.Controls["menuMain"] as MenuStrip; mainMenu.Items.Clear(); mainMenu.Show(); ToolStripMenuItem item, submenu, stock, company, billing; submenu = new ToolStripMenuItem(); submenu.Text = Constants.HOME; item = new ToolStripMenuItem(); item.Text = Constants.LOG_OUT; item.Click += LogOut_Click; submenu.DropDownItems.Add(item); item = new ToolStripMenuItem(); item.Click += new EventHandler(exitToolStripMenuItem_Click); item.Text = Constants.EXIT; submenu.DropDownItems.Add(item); stock = new ToolStripMenuItem(); stock.Text = Constants.STOCK; item = new ToolStripMenuItem(); item.Text = Constants.NEW_STOCK; item.Click += Item_Click; stock.DropDownItems.Add(item); item = new ToolStripMenuItem(); item.Text = Constants.UPDATE_STOCK; item.Click += Item_Click; stock.DropDownItems.Add(item); item = new ToolStripMenuItem(); item.Text = Constants.DELETE_STOCK; item.Click += Item_Click; stock.DropDownItems.Add(item); company = new ToolStripMenuItem(); company.Text = Constants.COMPANY; item = new ToolStripMenuItem(); item.Text = Constants.ADD_COMPANY; item.Click += Item_Click; company.DropDownItems.Add(item); item = new ToolStripMenuItem(); item.Text = Constants.REMOVE_COMPANY; item.Click += Item_Click; company.DropDownItems.Add(item); item = new ToolStripMenuItem(); item.Text = Constants.VIEW_COMPANIES; item.Click += Item_Click; company.DropDownItems.Add(item); mainMenu.Items.Add(submenu); mainMenu.Items.Add(stock); mainMenu.Items.Add(company); if (empType == (int)Constants.EMPLOYEETYPE.ADMIN || empType == (int)Constants.EMPLOYEETYPE.MANAGER) { item = new ToolStripMenuItem(); item.Text = Constants.REPORTS; item.Click += Item_Click; stock.DropDownItems.Add(item); billing = new ToolStripMenuItem(); billing.Text = Constants.SALES; item = new ToolStripMenuItem(); item.Text = Constants.NEW_BILL; item.Click += Item_Click; billing.DropDownItems.Add(item); item = new ToolStripMenuItem(); item.Text = Constants.VIEW_BILLS; item.Click += Item_Click; billing.DropDownItems.Add(item); mainMenu.Items.Add(billing); } }