private void InitialDataBaseMenuStrip() { DataBaseList1.DropDownItems.Clear(); string[] arr = LoadItems("List", "Count"); int length = arr.Length; //toolStripMenuItem3.Visible = length > 1; //DataBaseList1.Visible = length > 1; DataBaseMenuItem = new RadioMenuItem[length]; for (int i = 0; i < length; i++) { if (Directory.Exists(arr[i])) { DataBaseMenuItem[i] = new RadioMenuItem(); DataBaseMenuItem[i].Text = Path.GetFileNameWithoutExtension(arr[i]); DataBaseMenuItem[i].Tag = arr[i]; DataBaseMenuItem[i].Click += new System.EventHandler(ToolStripMenuItem_Click); DataBaseList1.DropDownItems.Add(DataBaseMenuItem[i]); } } }
private Menu CreateMenu(int depth, bool tearoff) { if (depth < 1) { return(null); } Menu menu = new Menu(); GLib.SList group = new GLib.SList(IntPtr.Zero); if (tearoff) { TearoffMenuItem menuitem = new TearoffMenuItem(); menu.Append(menuitem); } for (int i = 0, j = 1; i < 5; i++, j++) { RadioMenuItem menuitem = new RadioMenuItem(group, String.Format("item {0} - {1}", depth, j)); group = menuitem.Group; menu.Append(menuitem); if (i == 3) { menuitem.Sensitive = false; } menuitem.Submenu = CreateMenu((depth - 1), true); } return(menu); }
void FillEncodings() { selectOption = -1; RadioMenuItem defaultActivated = null; Gtk.Menu menu = new Menu(); // Don't show the auto-detection option when saving if (Action != Gtk.FileChooserAction.Save) { RadioMenuItem autodetect = new RadioMenuItem(GettextCatalog.GetString("Auto Detected")); autodetect.Group = new GLib.SList(typeof(object)); menu.Append(autodetect); menu.Append(new Gtk.SeparatorMenuItem()); autodetect.Active = true; defaultActivated = autodetect; firstEncIndex = 2; } else { firstEncIndex = 0; } foreach (var codePage in SelectedEncodings.ConversionEncodings) { var enc = Encoding.GetEncoding(codePage); RadioMenuItem mitem = new RadioMenuItem(enc.EncodingName + " (" + enc.WebName + ")"); menu.Append(mitem); if (defaultActivated == null) { defaultActivated = mitem; defaultActivated.Group = new GLib.SList(typeof(object)); } else { mitem.Group = defaultActivated.Group; } mitem.Active = false; } if (defaultActivated != null) { defaultActivated.Active = true; } menu.Append(new Gtk.SeparatorMenuItem()); MenuItem select = new MenuItem(GettextCatalog.GetString("Add or _Remove...")); menu.Append(select); menu.ShowAll(); encodingMenu.Menu = menu; encodingMenu.SetHistory(0); selectOption = firstEncIndex + SelectedEncodings.ConversionEncodings.Length + 1; }
private void OnTimingsCurrentFrameRateToggled(object o, EventArgs args) { RadioMenuItem menuItem = o as RadioMenuItem; if (menuItem.Active && Base.IsDocumentLoaded) { float frameRate = GetFrameRateMenuItemValue(menuItem); Base.CommandManager.Execute(new ChangeVideoFrameRateCommand(frameRate)); } }
private void IsCheckedChanged(DependencyObject o, DependencyProperty p) { RadioMenuItem radioItem = o as RadioMenuItem; TextBlock stateText; if (itemStates.TryGetValue((string)radioItem.Header, out stateText)) { UpdateTextState(radioItem, stateText); } }
private void IsCheckedChanged(object o, EventArgs e) { RadioMenuItem radioItem = o as RadioMenuItem; TextBlock stateText; if (itemStates.TryGetValue((string)radioItem.Header, out stateText)) { UpdateTextState(radioItem, stateText); } }
public static RadioMenuItem AddToolStripItem(ContextMenu contextMenu, string text, object tag, EventHandler <EventArgs> clickHandler) { var tsItem = new RadioMenuItem(); tsItem.Text = text; tsItem.Tag = tag; tsItem.Click += clickHandler; contextMenu.Items.Add(tsItem); return(tsItem); }
private static EventHandler BuildSortChangedHandler(Source source, SourceSortType sort_type) { return(delegate(object sender, EventArgs args) { RadioMenuItem item = sender as RadioMenuItem; if (item != null && item.Active) { source.SortChildSources(sort_type); } }); }
void LogEvents(RadioMenuItem item) { if (item == null) { return; } item.CheckedChanged += delegate { Log.Write(item, "CheckedChanged, Item: {0}, Checked: {1}", item.Text, item.Checked); }; }
/* Note: this method makes the assumption that the OnTimingsCurrentFrameRateToggled event handler is connected to the * menu item, as it is disconnected and then connected again after changing the active menu item. */ public void UpdateActiveCurrentFrameRateMenuItem() { Menu menu = Base.GetWidget(WidgetNames.TimingsCurrentFrameRateMenu) as Menu; float currentFrameRate = Base.Document.Subtitles.Properties.CurrentFrameRate; RadioMenuItem item = GetFrameRateMenuItem(menu, currentFrameRate); if (item == null) { item = AddFrameRateMenuItem(menu, currentFrameRate, null, null, OnTimingsCurrentFrameRateToggled); } SetCheckMenuItemActivity(item, true, OnTimingsCurrentFrameRateToggled); }
private void SetFormatterMenu(string key) { RadioMenuItem item = null; foreach (RadioMenuItemInfo ri in formatterInfo) { if (ri.key == key) { item = ri.menuItem; break; } } if (item != null) { item.Active = true; } }
private void OnCountrySelect(object o, EventArgs args) { RadioMenuItem mi = (RadioMenuItem)o; if (!mi.Active) { return; } strCountry = mi.Name; string strPath = Path.Combine(strDataDir, "country"); StreamWriter sw = new StreamWriter(strPath); sw.Write(strCountry); sw.Close(); }
private IEnumerable <MenuItem> GetVerticalHorizontalRadioMenuItems() { var horizontal = new RadioMenuItem //Horizontal { Text = ResourceManager.LocalizationResource.MenuHorizontal, Tag = "Horizontal", Command = /* ToDo: Add SetOrientation(Horizontal) command */ null, Checked = true }; var vertical = new RadioMenuItem(horizontal) //Vertical { Text = ResourceManager.LocalizationResource.MenuVertical, Tag = "Vertical", Command = /* ToDo: Add SetOrientation(Vertical) command */ null }; return(new[] { horizontal, vertical }); }
void FillMenu() { editItem = new MenuItem(Catalog.GetString("Edit properties")); sortItem = new MenuItem(Catalog.GetString("Sort Method")); sortMenu = new Menu(); sortByName = new RadioMenuItem(Catalog.GetString("Sort by name")); sortByStart = new RadioMenuItem(Catalog.GetString("Sort by start time")); sortByStop = new RadioMenuItem(Catalog.GetString("Sort by stop time")); sortByDuration = new RadioMenuItem(Catalog.GetString("Sort by duration")); sortByName.Group = new GLib.SList(IntPtr.Zero); sortByName.Active = false; sortByStart.Group = sortByName.Group; sortByStart.Active = false; sortByStop.Group = sortByName.Group; sortByStop.Active = false; sortByDuration.Group = sortByName.Group; sortByDuration.Active = false; addToPlaylistMenuItem = new MenuItem(); exportToVideoFileItem = new MenuItem(); Add(editItem); Add(sortItem); sortItem.Submenu = sortMenu; sortMenu.Add(sortByName); sortMenu.Add(sortByStart); sortMenu.Add(sortByStop); sortMenu.Add(sortByDuration); Add(addToPlaylistMenuItem); Add(exportToVideoFileItem); sortByName.Activated += OnSortActivated; sortByStart.Activated += OnSortActivated; sortByStop.Activated += OnSortActivated; sortByDuration.Activated += OnSortActivated; editItem.Activated += (s, e) => EditProperties(eventType); exportToVideoFileItem.Activated += HandleExportEvents; sortByName.Active = true; ShowAll(); }
static Menu Create_Menu(int depth, bool tearoff) { if (depth < 1) { return(null); } Menu menu = new Menu(); MenuItem menuitem = null; string label = null; GLib.SList group = new GLib.SList(IntPtr.Zero); if (tearoff) { menuitem = new TearoffMenuItem(); menu.Append(menuitem); menuitem.Show(); } for (int i = 0, j = 1; i < 5; i++, j++) { label = String.Format("item {0} - {1}", depth, j); menuitem = new RadioMenuItem(group, label); group = ((RadioMenuItem)menuitem).Group; menuitem = new MenuItem(label); menu.Append(menuitem); if (i == 3) { menuitem.Sensitive = false; } Menu child = Create_Menu((depth - 1), true); if (child != null) { menuitem.Submenu = child; } } return(menu); }
private void OnFormatterChanged(object sender, EventArgs e) { RadioMenuItem item = (RadioMenuItem)sender; string key = null; foreach (RadioMenuItemInfo ri in formatterInfo) { if (object.ReferenceEquals(ri.menuItem, sender)) { key = ri.key; break; } } if (key != null) { SetFormatterView(key); SetNewFormatter(key); } }
private void AddPackagesToMenu(SortedDictionary <Idstring, PackageHeader> pckIds) { RadioMenuItem prevItem = new RadioMenuItem { Text = this.show_all_radio }; prevItem.CheckedChanged += this.OnPackageChanged; this.pckList.Items.Add(prevItem); foreach (KeyValuePair <Idstring, PackageHeader> ids in pckIds) { RadioMenuItem item = new RadioMenuItem(prevItem) { Tag = ids.Key, Text = ids.Key.ToString(), }; item.CheckedChanged += this.OnPackageChanged; this.pckList.Items.Add(item); prevItem = item; } }
public void UpdateActiveInputFrameRateMenuItem(bool toggleHandlers) { Menu menu = Base.GetWidget(WidgetNames.TimingsInputFrameRateMenu) as Menu; float inputFrameRate = Base.Document.Subtitles.Properties.OriginalFrameRate; RadioMenuItem item = GetFrameRateMenuItem(menu, inputFrameRate); if (item == null) { item = AddFrameRateMenuItem(menu, inputFrameRate, null, null, OnTimingsInputFrameRateToggled); } if (toggleHandlers) { SetCheckMenuItemActivity(item, true, OnTimingsInputFrameRateToggled); } else { SetCheckMenuItemActivity(item, true); } }
public RadioMenuFlyoutItemPage() { this.InitializeComponent(); itemStates = new Dictionary <string, TextBlock>(); //if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.MenuFlyoutItem", "Icon")) { IconMenuFlyoutItem.Icon = new SymbolIcon(Symbol.Calendar); IconRadioMenuFlyoutItem.Icon = new SymbolIcon(Symbol.Calculator); } /*if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Grid", "ColumnSpacing")) * { * ItemNames.Spacing = 4; * ItemStates.Spacing = 4; * }*/ // register all RadioMenuFlyoutItems foreach (object item in ButtonMenuFlyout.Items) { if (item is RadioMenuItem) { RadioMenuItem radioItem = item as RadioMenuItem; DependencyPropertyDescriptor.FromProperty(RadioMenuItem.IsCheckedProperty, typeof(RadioMenuItem)).AddValueChanged(radioItem, IsCheckedChanged); TextBlock nameText = new TextBlock(); nameText.Text = (string)radioItem.Header; ItemNames.Children.Add(nameText); TextBlock stateText = new TextBlock(); AutomationProperties.SetName(stateText, (string)radioItem.Header + "State"); UpdateTextState(radioItem, stateText); ItemStates.Children.Add(stateText); itemStates.Add((string)radioItem.Header, stateText); } } }
private void PopulateContextMenus() { miGensInfCommon = UIHelper.AddToolStripItem(MenuGensCommon, "Inf", -1, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "1", 1, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "2", 2, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "3", 3, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "4", 4, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "5", 5, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "6", 6, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "7", 7, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "8", 8, miGensX_Click); UIHelper.AddToolStripItem(MenuGensCommon, "9", 9, miGensX_Click); miGensInfAncestors = UIHelper.AddToolStripItem(MenuGensAncestors, "Inf", -1, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "1", 1, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "2", 2, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "3", 3, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "4", 4, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "5", 5, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "6", 6, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "7", 7, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "8", 8, miGensXAncestors_Click); UIHelper.AddToolStripItem(MenuGensAncestors, "9", 9, miGensXAncestors_Click); miGensInfDescendants = UIHelper.AddToolStripItem(MenuGensDescendants, "Inf", -1, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "1", 1, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "2", 2, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "3", 3, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "4", 4, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "5", 5, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "6", 6, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "7", 7, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "8", 8, miGensXDescendants_Click); UIHelper.AddToolStripItem(MenuGensDescendants, "9", 9, miGensXDescendants_Click); for (var bs = GfxBorderStyle.None; bs <= GfxBorderStyle.CrossCorners; bs++) { UIHelper.AddToolStripItem(MenuBorders, bs.ToString(), (int)bs, miBorderX_Click); } }
private static void CreateEntriesFromFactory(MenuItem menu, TreeStore store, EventHandler handler, TypeFactory factory, IList menuEntries) { GLib.SList group = new GLib.SList(IntPtr.Zero); Menu submenu = new Menu(); foreach (DictionaryEntry de in factory) { TypeFactoryEntry entry = (TypeFactoryEntry)de.Value; if (store != null) { store.AppendValues(false, entry.Description, entry.Key); } RadioMenuItem item = new RadioMenuItem(group, entry.Description); item.Activated += handler; group = item.Group; submenu.Append(item); menuEntries.Add(new RadioMenuItemInfo(item, entry.Key)); } menu.Submenu = submenu; menu.ShowAll(); }
//Adds a menu item sorting by frame rate private RadioMenuItem AddFrameRateMenuItem(Menu menu, float frameRate, string title, string tag, EventHandler onToggled) { int position = 0; RadioMenuItem group = null; foreach (RadioMenuItem item in menu.Children) { float itemFrameRate = GetFrameRateMenuItemValue(item); if (Math.Abs(itemFrameRate - frameRate) <= float.Epsilon) { return(null); //Already exists, not adding } //Find the group if (group == null) { group = (item.Group.Length > 0 ? item.Group[0] : item); //We get the group from the first time. If there's no group, it becomes the group. } if (itemFrameRate > frameRate) { break; } position++; } string label = frameRate.ToString("G", CultureInfo.InvariantCulture) + (title != null ? " " + title : "") + (tag != null ? " (" + tag + ")" : ""); RadioMenuItem newItem = new RadioMenuItem(group, label); newItem.Toggled += onToggled; menu.Insert(newItem, position); menu.ShowAll(); return(newItem); }
private Menu BuildSortMenu(Source source) { Menu menu = new Menu(); GLib.SList group = null; foreach (SourceSortType sort_type in source.ChildSortTypes) { RadioMenuItem item = new RadioMenuItem(group, sort_type.Label); group = item.Group; item.Active = (sort_type == source.ActiveChildSort); item.Toggled += BuildSortChangedHandler(source, sort_type); menu.Append(item); } menu.Append(new SeparatorMenuItem()); CheckMenuItem sort_types_item = new CheckMenuItem(Catalog.GetString("Separate by Type")); sort_types_item.Active = source.SeparateChildrenByType; sort_types_item.Toggled += OnSeparateTypesChanged; menu.Append(sort_types_item); return(menu); }
public void OnUserTreeViewButtonPressed(object obj, ButtonPressEventArgs args) { switch (args.Event.Button) { case 1: // first mouse button break; case 2: // second mouse button break; case 3: // third mouse button { TreePath tPath = null; TreeViewColumn tColumn = null; if (UserTreeView.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out tPath, out tColumn) == true) { TreeSelection tSelect = UserTreeView.Selection; if (tSelect.CountSelectedRows() > 0) { Menu rightsMenu = new Menu(); RadioMenuItem adminItem = new RadioMenuItem(Util.GS("Full Control")); rightsMenu.Append(adminItem); RadioMenuItem rwItem = new RadioMenuItem(adminItem.Group, Util.GS("Read/Write")); rightsMenu.Append(rwItem); RadioMenuItem roItem = new RadioMenuItem(adminItem.Group, Util.GS("Read Only")); rightsMenu.Append(roItem); if (ifolder.CurrentUserRights != "Admin" || SelectionHasOwnerOrCurrent()) { adminItem.Sensitive = false; rwItem.Sensitive = false; roItem.Sensitive = false; } // Get the Value of the actual user selected TreeIter iter; if (UserTreeStore.GetIter(out iter, tPath)) { iFolderUser user = (iFolderUser) UserTreeStore.GetValue(iter, 0); if (user.Rights == "ReadWrite") { rwItem.Active = true; } else if (user.Rights == "Admin") { adminItem.Active = true; } else { roItem.Active = true; } } adminItem.Activated += new EventHandler( OnAdminRightsMenu); rwItem.Activated += new EventHandler( OnRWRightsMenu); roItem.Activated += new EventHandler( OnRORightsMenu); rightsMenu.ShowAll(); rightsMenu.Popup(null, null, null, 3, Gtk.Global.CurrentEventTime); } } break; } } }
private void InitializeComponent() { SuspendLayout(); tbImageSave = new ButtonToolItem(); tbImageSave.Click += tbImageSave_Click; tbGens = new ButtonToolItem(); //tbGens.DropDown = MenuGens; tbGens.Text = "tbGens"; tbGens.Click += (sender, e) => MenuGens.Show(this); tbModes = new ButtonToolItem(); //tbModes.DropDown = MenuModes; tbModes.Click += (sender, e) => MenuModes.Show(this); tbFilter = new ButtonToolItem(); tbFilter.Click += ToolBar1_ButtonClick; tbPrev = new ButtonToolItem(); tbPrev.Enabled = false; tbPrev.Click += ToolBar1_ButtonClick; tbNext = new ButtonToolItem(); tbNext.Enabled = false; tbNext.Click += ToolBar1_ButtonClick; tbDocPreview = new ButtonToolItem(); tbDocPreview.Click += tbDocPreview_Click; tbDocPrint = new ButtonToolItem(); tbDocPrint.Click += tbDocPrint_Click; tbOptions = new ButtonToolItem(); tbOptions.Click += tbOptions_Click; ToolBar1 = new ToolBar(); ToolBar1.TextAlign = ToolBarTextAlign.Right; ToolBar1.Items.AddRange(new ToolItem[] { tbImageSave, new SeparatorToolItem(), tbGens, new SeparatorToolItem(), tbModes, new SeparatorToolItem(), tbFilter, tbPrev, tbNext, new SeparatorToolItem(), tbDocPreview, tbDocPrint, new SeparatorToolItem(), tbOptions }); miGensInf = new RadioMenuItem(); miGensInf.Checked = true; miGensInf.Text = "Inf"; miGensInf.Click += miGens9_Click; miGens1 = new RadioMenuItem(); miGens1.Text = "1"; miGens1.Click += miGens9_Click; miGens2 = new RadioMenuItem(); miGens2.Text = "2"; miGens2.Click += miGens9_Click; miGens3 = new RadioMenuItem(); miGens3.Text = "3"; miGens3.Click += miGens9_Click; miGens4 = new RadioMenuItem(); miGens4.Text = "4"; miGens4.Click += miGens9_Click; miGens5 = new RadioMenuItem(); miGens5.Text = "5"; miGens5.Click += miGens9_Click; miGens6 = new RadioMenuItem(); miGens6.Text = "6"; miGens6.Click += miGens9_Click; miGens7 = new RadioMenuItem(); miGens7.Text = "7"; miGens7.Click += miGens9_Click; miGens8 = new RadioMenuItem(); miGens8.Text = "8"; miGens8.Click += miGens9_Click; miGens9 = new RadioMenuItem(); miGens9.Text = "9"; miGens9.Click += miGens9_Click; MenuGens = new ContextMenu(); MenuGens.Items.AddRange(new MenuItem[] { miGensInf, miGens1, miGens2, miGens3, miGens4, miGens5, miGens6, miGens7, miGens8, miGens9 }); miModeBoth = new RadioMenuItem(); miModeBoth.Text = "miModeBoth"; miModeBoth.Click += miModeItem_Click; miModeAncestors = new RadioMenuItem(); miModeAncestors.Text = "miModeAncestors"; miModeAncestors.Click += miModeItem_Click; miModeDescendants = new RadioMenuItem(); miModeDescendants.Text = "miModeDescendants"; miModeDescendants.Click += miModeItem_Click; miTraceSelected = new CheckMenuItem(); miTraceSelected.Text = "miTraceSelected"; miTraceSelected.Click += miTraceSelected_Click; miTraceKinships = new CheckMenuItem(); miTraceKinships.Text = "miTraceKinships"; miTraceKinships.Click += miTraceKinships_Click; miCertaintyIndex = new CheckMenuItem(); miCertaintyIndex.Text = "miCertaintyIndex"; miCertaintyIndex.Click += miCertaintyIndex_Click; miFillColor = new ButtonMenuItem(); miFillColor.Text = "miFillColor"; miFillColor.Click += miFillColor_Click; miFillImage = new ButtonMenuItem(); miFillImage.Text = "miFillImage"; miFillImage.Click += miFillImage_Click; MenuModes = new ContextMenu(); MenuModes.Items.AddRange(new MenuItem[] { miModeBoth, miModeAncestors, miModeDescendants, new SeparatorMenuItem(), miTraceSelected, miTraceKinships, miCertaintyIndex, new SeparatorMenuItem(), miFillColor, miFillImage, new SeparatorMenuItem() }); miEdit = new ButtonMenuItem(); miEdit.Text = "miEdit"; miEdit.Click += miEdit_Click; miFatherAdd = new ButtonMenuItem(); miFatherAdd.Text = "miFatherAdd"; miFatherAdd.Click += miFatherAdd_Click; miMotherAdd = new ButtonMenuItem(); miMotherAdd.Text = "miMotherAdd"; miMotherAdd.Click += miMotherAdd_Click; miFamilyAdd = new ButtonMenuItem(); miFamilyAdd.Text = "miFamilyAdd"; miFamilyAdd.Click += miFamilyAdd_Click; miSpouseAdd = new ButtonMenuItem(); miSpouseAdd.Text = "miSpouseAdd"; miSpouseAdd.Click += miSpouseAdd_Click; miSonAdd = new ButtonMenuItem(); miSonAdd.Text = "miSonAdd"; miSonAdd.Click += miSonAdd_Click; miDaughterAdd = new ButtonMenuItem(); miDaughterAdd.Text = "miDaughterAdd"; miDaughterAdd.Click += miDaughterAdd_Click; miDelete = new ButtonMenuItem(); miDelete.Text = "miDelete"; miDelete.Click += miDelete_Click; miRebuildTree = new ButtonMenuItem(); miRebuildTree.Text = "miRebuildTree"; miRebuildTree.Click += miRebuildTree_Click; miRebuildKinships = new ButtonMenuItem(); miRebuildKinships.Text = "miRebuildKinships"; miRebuildKinships.Click += miRebuildKinships_Click; miSelectColor = new ButtonMenuItem(); miSelectColor.Text = "miSelectColor"; miSelectColor.Click += miSelectColor_Click; miGoToRecord = new ButtonMenuItem(); miGoToRecord.Text = "miGoToRecord"; miGoToRecord.Click += miGoToRecord_Click; MenuPerson = new ContextMenu(); MenuPerson.Items.AddRange(new MenuItem[] { miEdit, new SeparatorMenuItem(), miFatherAdd, miMotherAdd, miFamilyAdd, miSpouseAdd, miSonAdd, miDaughterAdd, new SeparatorMenuItem(), miDelete, new SeparatorMenuItem(), miGoToRecord, new SeparatorMenuItem(), miRebuildTree, miRebuildKinships, new SeparatorMenuItem(), miSelectColor }); MenuPerson.Opening += MenuPerson_Opening; ShowInTaskbar = true; Title = "TreeChartWin"; ToolBar = ToolBar1; KeyDown += TreeChartWin_KeyDown; UIHelper.SetPredefProperties(this, 820, 450, true, true); ResumeLayout(); }
private void CreateMenu() { // OPEN _context.Debug(() => "Creating Menu."); var open = new Command { MenuText = "&Open", ToolBarText = "Open", Shortcut = Application.Instance.CommonModifier | Keys.O }; open.Executed += OpenOnExecuted; // QUIT var quit = new Command { MenuText = "&Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q }; quit.Executed += (sender, e) => Application.Instance.Quit(); if (Platform.Supports <MenuBar>()) { var fileMenu = new ButtonMenuItem { Text = "&File", Items = { open } }; var connectionMenu = new ButtonMenuItem { Text = "&Connections", Items = { } }; var typeMenu = new ButtonMenuItem { Text = "&Types", Items = { } }; if (Platform.Supports <CheckMenuItem>()) { var types = new[] { "bool", "byte", "short", "int", "long", "single", "double", "decimal", "datetime", "guid" }; foreach (var type in types) { typeMenu.Items.Add(new CheckMenuItem { Text = type, Checked = _cfg.Input().Types.Any(t => t.Type.StartsWith(type)) }); } typeMenu.Items.Add(new CheckMenuItem { Text = "string", Checked = true, Enabled = false }); } if (Platform.Supports <RadioMenuItem>()) { var controller = new RadioMenuItem { Text = "output", Checked = true }; connectionMenu.Items.Add(new RadioMenuItem(controller) { Text = "output", Checked = true }); connectionMenu.Items.AddSeparator(); foreach (var c in _cfg.Connections.Where(c => !c.Name.In("input", "output"))) { connectionMenu.Items.Add(new RadioMenuItem(controller) { Text = c.Name, Checked = false }); } } Menu = new MenuBar { Items = { fileMenu, connectionMenu, typeMenu }, QuitItem = quit }; } }
ContextMenu CreateMenu() { if (_menu != null) { return(_menu); } _menu = new ContextMenu(); _menu.Opening += (sender, e) => Log.Write(sender, "Opening"); _menu.Closed += (sender, e) => Log.Write(sender, "Closed"); _menu.Closing += (sender, e) => Log.Write(sender, "Closing"); _menu.Items.Add(new ButtonMenuItem { Text = "Item 1" }); _menu.Items.Add(new ButtonMenuItem { Text = "Item 2", Shortcut = Keys.Control | Keys.I }); _menu.Items.Add(new ButtonMenuItem { Text = "Item 3", Shortcut = Keys.Shift | Keys.I }); _menu.Items.Add(new ButtonMenuItem { Text = "Item 4", Shortcut = Keys.Alt | Keys.I }); _menu.Items.Add(new ButtonMenuItem { Text = "Disabled Item", Enabled = false }); var subMenu = _menu.Items.GetSubmenu("Sub Menu"); subMenu.Items.Add(new ButtonMenuItem { Text = "Item 5", Shortcut = Keys.Application | Keys.I }); subMenu.Items.Add(new ButtonMenuItem { Text = "Item 6", Shortcut = Keys.I }); subMenu.Items.Add(new ButtonMenuItem { Text = "Disabled Item 2", Enabled = false }); var dynamicSubMenu = new SubMenuItem { Text = "Dynamic Sub Menu" }; dynamicSubMenu.Opening += (sender, e) => { Log.Write(dynamicSubMenu, "Opening"); dynamicSubMenu.Items.Add(new ButtonMenuItem { Text = "Dynamic Item 1" }); dynamicSubMenu.Items.Add(new ButtonMenuItem { Text = "Dynamic Item 2" }); dynamicSubMenu.Items.Add(new ButtonMenuItem { Text = "Dynamic Item 3", Enabled = false }); LogEvents(dynamicSubMenu); }; dynamicSubMenu.Closing += (sender, e) => { Log.Write(dynamicSubMenu, "Closing"); }; dynamicSubMenu.Closed += (sender, e) => { Log.Write(dynamicSubMenu, "Closed"); dynamicSubMenu.Items.Clear(); }; _menu.Items.Add(dynamicSubMenu); _menu.Items.AddSeparator(); RadioMenuItem radioController; _menu.Items.Add(radioController = new RadioMenuItem { Text = "Radio 1" }); _menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 2", Checked = true }); _menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 3", Shortcut = Keys.R }); _menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 4" }); _menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 5 Disabled", Enabled = false }); _menu.Items.AddSeparator(); _menu.Items.Add(new CheckMenuItem { Text = "Check 1" }); _menu.Items.Add(new CheckMenuItem { Text = "Check 2", Shortcut = Keys.Control | Keys.Alt | Keys.G, Checked = true }); _menu.Items.Add(new CheckMenuItem { Text = "Check 3", Shortcut = Keys.Control | Keys.Shift | Keys.G }); _menu.Items.Add(new CheckMenuItem { Text = "Check 4", Shortcut = Keys.Control | Keys.Application | Keys.G }); _menu.Items.Add(new CheckMenuItem { Text = "Check 5", Shortcut = Keys.Shift | Keys.Alt | Keys.G }); _menu.Items.Add(new CheckMenuItem { Text = "Check 6", Shortcut = Keys.Shift | Keys.Application | Keys.G }); _menu.Items.Add(new CheckMenuItem { Text = "Check 7", Shortcut = Keys.Alt | Keys.Application | Keys.G }); _menu.Items.Add(new CheckMenuItem { Text = "Disabled Check", Checked = true, Enabled = false }); _menu.Items.AddSeparator(); var hiddenItem = new ButtonMenuItem { Text = "This button should not be visible!", Visible = false }; var toggleHiddenItem = new ButtonMenuItem { Text = "Toggle Hidden Item" }; toggleHiddenItem.Click += (sender, e) => hiddenItem.Visible = !hiddenItem.Visible; _menu.Items.Add(hiddenItem); _menu.Items.Add(toggleHiddenItem); LogEvents(_menu); return(_menu); }
private void UpdateTextState(RadioMenuItem item, TextBlock textBlock) { textBlock.Text = item.IsChecked ? "Checked" : "Unchecked"; }
ContextMenu CreateMenu() { if (menu != null) { return(menu); } menu = new ContextMenu(); menu.Opening += (sender, e) => Log.Write(sender, "Opening"); menu.Closed += (sender, e) => Log.Write(sender, "Closed"); menu.Items.Add(new ButtonMenuItem { Text = "Item 1" }); menu.Items.Add(new ButtonMenuItem { Text = "Item 2", Shortcut = Keys.Control | Keys.I }); menu.Items.Add(new ButtonMenuItem { Text = "Item 3", Shortcut = Keys.Shift | Keys.I }); menu.Items.Add(new ButtonMenuItem { Text = "Item 4", Shortcut = Keys.Alt | Keys.I }); var subMenu = menu.Items.GetSubmenu("Sub Menu"); subMenu.Items.Add(new ButtonMenuItem { Text = "Item 5", Shortcut = Keys.Application | Keys.I }); subMenu.Items.Add(new ButtonMenuItem { Text = "Item 6", Shortcut = Keys.I }); menu.Items.AddSeparator(); RadioMenuItem radioController; menu.Items.Add(radioController = new RadioMenuItem { Text = "Radio 1" }); menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 2", Checked = true }); menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 3", Shortcut = Keys.R }); menu.Items.Add(new RadioMenuItem(radioController) { Text = "Radio 4" }); menu.Items.AddSeparator(); menu.Items.Add(new CheckMenuItem { Text = "Check 1" }); menu.Items.Add(new CheckMenuItem { Text = "Check 2", Shortcut = Keys.Control | Keys.Alt | Keys.G, Checked = true }); menu.Items.Add(new CheckMenuItem { Text = "Check 3", Shortcut = Keys.Control | Keys.Shift | Keys.G }); menu.Items.Add(new CheckMenuItem { Text = "Check 4", Shortcut = Keys.Control | Keys.Application | Keys.G }); menu.Items.Add(new CheckMenuItem { Text = "Check 5", Shortcut = Keys.Shift | Keys.Alt | Keys.G }); menu.Items.Add(new CheckMenuItem { Text = "Check 6", Shortcut = Keys.Shift | Keys.Application | Keys.G }); menu.Items.Add(new CheckMenuItem { Text = "Check 7", Shortcut = Keys.Alt | Keys.Application | Keys.G }); LogEvents(menu); return(menu); }
void CreateMenuToolBar() { var about = new Commands.About(); var quit = new Commands.Quit(); if (Platform.Supports <MenuBar>()) { var fileCommand = new Command { MenuText = "File Command", Shortcut = Application.Instance.CommonModifier | Keys.F }; fileCommand.Executed += (sender, e) => Log.Write(sender, "Executed"); var editCommand = new Command { MenuText = "Edit Command", Shortcut = Keys.Shift | Keys.E }; editCommand.Executed += (sender, e) => Log.Write(sender, "Executed"); var viewCommand = new Command { MenuText = "View Command", Shortcut = Keys.Control | Keys.V }; viewCommand.Executed += (sender, e) => Log.Write(sender, "Executed"); var windowCommand = new Command { MenuText = "Window Command" }; windowCommand.Executed += (sender, e) => Log.Write(sender, "Executed"); var file = new ButtonMenuItem { Text = "&File", Items = { fileCommand } }; var edit = new ButtonMenuItem { Text = "&Edit", Items = { editCommand } }; var view = new ButtonMenuItem { Text = "&View", Items = { viewCommand } }; var window = new ButtonMenuItem { Text = "&Window", Order = 1000, Items = { windowCommand } }; if (Platform.Supports <CheckMenuItem>()) { edit.Items.AddSeparator(); var checkMenuItem1 = new CheckMenuItem { Text = "Check Menu Item", Shortcut = Keys.Shift | Keys.K }; checkMenuItem1.Click += (sender, e) => Log.Write(checkMenuItem1, "Click, {0}, Checked: {1}", checkMenuItem1.Text, checkMenuItem1.Checked); checkMenuItem1.CheckedChanged += (sender, e) => Log.Write(checkMenuItem1, "CheckedChanged, {0}: {1}", checkMenuItem1.Text, checkMenuItem1.Checked); edit.Items.Add(checkMenuItem1); var checkMenuItem2 = new CheckMenuItem { Text = "Initially Checked Menu Item", Checked = true }; checkMenuItem2.Click += (sender, e) => Log.Write(checkMenuItem2, "Click, {0}, Checked: {1}", checkMenuItem2.Text, checkMenuItem2.Checked); checkMenuItem2.CheckedChanged += (sender, e) => Log.Write(checkMenuItem2, "CheckedChanged, {0}: {1}", checkMenuItem2.Text, checkMenuItem2.Checked); edit.Items.Add(checkMenuItem2); } if (Platform.Supports <RadioMenuItem>()) { edit.Items.AddSeparator(); RadioMenuItem controller = null; for (int i = 0; i < 5; i++) { var radio = new RadioMenuItem(controller) { Text = "Radio Menu Item " + (i + 1) }; radio.Click += (sender, e) => Log.Write(radio, "Click, {0}, Checked: {1}", radio.Text, radio.Checked); radio.CheckedChanged += (sender, e) => Log.Write(radio, "CheckedChanged, {0}: {1}", radio.Text, radio.Checked); edit.Items.Add(radio); if (controller == null) { radio.Checked = true; // check the first item initially controller = radio; } } } Menu = new MenuBar { Items = { // custom top-level menu items file, edit, view, window }, ApplicationItems = { // custom menu items for the application menu (Application on OS X, File on others) new Command { MenuText = "Application command" }, new ButtonMenuItem { Text = "Application menu item" } }, HelpItems = { new Command { MenuText = "Help Command" } }, QuitItem = quit, AboutItem = about }; } if (Platform.Supports <ToolBar>()) { // create and set the toolbar ToolBar = new ToolBar(); ToolBar.Items.Add(about); if (Platform.Supports <CheckToolItem>()) { ToolBar.Items.Add(new SeparatorToolItem { Type = SeparatorToolItemType.Divider }); ToolBar.Items.Add(new CheckToolItem { Text = "Check", Image = TestIcons.TestImage }); } if (Platform.Supports <RadioToolItem>()) { ToolBar.Items.Add(new SeparatorToolItem { Type = SeparatorToolItemType.FlexibleSpace }); ToolBar.Items.Add(new RadioToolItem { Text = "Radio1", Image = TestIcons.TestIcon, Checked = true }); ToolBar.Items.Add(new RadioToolItem { Text = "Radio2", Image = TestIcons.TestImage }); } ; } }
/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("", 0); this.listView1 = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStrip1 = new System.Windows.Forms.ClassicContextMenuStrip(); this.ts_OpenFile = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.OpenWithNotePad = new System.Windows.Forms.ToolStripMenuItem(); this.cms_ExplorerFile = new System.Windows.Forms.ToolStripMenuItem(); this.saveAs1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); this.复制ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cms_DeleteFile = new System.Windows.Forms.ToolStripMenuItem(); this.cms_ReNameFile = new System.Windows.Forms.ToolStripMenuItem(); this.imageList1 = new System.Windows.Forms.ImageList(); this.toolTip1 = new System.Windows.Forms.ToolTip(); this.contextMenuStrip2 = new System.Windows.Forms.ClassicContextMenuStrip(); this.查看VToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.largeIcon1 = new System.Windows.Forms.RadioMenuItem(); this.smallIcon1 = new System.Windows.Forms.RadioMenuItem(); this.list1 = new System.Windows.Forms.RadioMenuItem(); this.tile1 = new System.Windows.Forms.RadioMenuItem(); this.details1 = new System.Windows.Forms.RadioMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.添加附件AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openCurrentDir = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.cms_Refresh = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.cms_SelectAll = new System.Windows.Forms.ToolStripMenuItem(); this.fileSystemWatcher1 = new System.IO.FileSystemWatcher(); this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit(); this.SuspendLayout(); // // listView1 // this.listView1.AllowDrop = true; this.listView1.BackColor = System.Drawing.Color.White; this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5}); this.listView1.ContextMenuStrip = this.contextMenuStrip1; this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; this.listView1.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.listView1.FullRowSelect = true; this.listView1.HideSelection = false; this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4, listViewItem5, listViewItem6, listViewItem7}); this.listView1.Location = new System.Drawing.Point(0, 0); this.listView1.Name = "listView1"; this.listView1.ShowGroups = false; this.listView1.ShowItemToolTips = true; this.listView1.Size = new System.Drawing.Size(655, 356); this.listView1.Sorting = System.Windows.Forms.SortOrder.Ascending; this.listView1.TabIndex = 4; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; this.listView1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView1_ColumnClick); this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); this.listView1.DoubleClick += new System.EventHandler(this.打开_Click); this.listView1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseUp); // // columnHeader1 // this.columnHeader1.Text = "文件名"; this.columnHeader1.Width = 189; // // columnHeader2 // this.columnHeader2.Text = "修改时间"; this.columnHeader2.Width = 100; // // columnHeader3 // this.columnHeader3.Text = "大小"; this.columnHeader3.Width = 99; // // columnHeader4 // this.columnHeader4.Text = "路径"; this.columnHeader4.Width = 170; // // columnHeader5 // this.columnHeader5.Text = "类型"; this.columnHeader5.Width = 93; // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ts_OpenFile, this.toolStripMenuItem1, this.OpenWithNotePad, this.cms_ExplorerFile, this.saveAs1, this.toolStripMenuItem2, this.复制ToolStripMenuItem, this.cms_DeleteFile, this.cms_ReNameFile}); this.contextMenuStrip1.Name = "contextMenuStrip_ListView"; this.contextMenuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; this.contextMenuStrip1.Size = new System.Drawing.Size(189, 170); this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); // // ts_OpenFile // this.ts_OpenFile.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Bold); this.ts_OpenFile.Name = "ts_OpenFile"; this.ts_OpenFile.Size = new System.Drawing.Size(188, 22); this.ts_OpenFile.Text = "打开(&O)"; this.ts_OpenFile.Click += new System.EventHandler(this.打开_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(185, 6); // // OpenWithNotePad // this.OpenWithNotePad.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); this.OpenWithNotePad.Name = "OpenWithNotePad"; this.OpenWithNotePad.Size = new System.Drawing.Size(188, 22); this.OpenWithNotePad.Text = "用记事本打开(&N)"; this.OpenWithNotePad.Click += new System.EventHandler(this.用记事本打开_Click); // // cms_ExplorerFile // this.cms_ExplorerFile.Name = "cms_ExplorerFile"; this.cms_ExplorerFile.Size = new System.Drawing.Size(188, 22); this.cms_ExplorerFile.Text = "用资源管理器打开(&X)"; this.cms_ExplorerFile.Click += new System.EventHandler(this.用资源管理器打开_Click); // // saveAs1 // this.saveAs1.Name = "saveAs1"; this.saveAs1.Size = new System.Drawing.Size(188, 22); this.saveAs1.Text = "另存为(&S)..."; this.saveAs1.Click += new System.EventHandler(this.另存为_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new System.Drawing.Size(185, 6); // // 复制ToolStripMenuItem // this.复制ToolStripMenuItem.Name = "复制ToolStripMenuItem"; this.复制ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.复制ToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.复制ToolStripMenuItem.Text = "复制(&C)"; this.复制ToolStripMenuItem.Click += new System.EventHandler(this.复制文件到剪切板_Click); // // cms_DeleteFile // this.cms_DeleteFile.Name = "cms_DeleteFile"; this.cms_DeleteFile.ShortcutKeyDisplayString = ""; this.cms_DeleteFile.ShortcutKeys = System.Windows.Forms.Keys.Delete; this.cms_DeleteFile.Size = new System.Drawing.Size(188, 22); this.cms_DeleteFile.Text = "删除(&D)"; this.cms_DeleteFile.Click += new System.EventHandler(this.删除_Click); // // cms_ReNameFile // this.cms_ReNameFile.Name = "cms_ReNameFile"; this.cms_ReNameFile.ShortcutKeys = System.Windows.Forms.Keys.F2; this.cms_ReNameFile.Size = new System.Drawing.Size(188, 22); this.cms_ReNameFile.Text = "重命名(&R)"; this.cms_ReNameFile.Click += new System.EventHandler(this.重命名_Click); // // imageList1 // this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; this.imageList1.ImageSize = new System.Drawing.Size(16, 16); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; // // toolTip1 // this.toolTip1.IsBalloon = true; this.toolTip1.ShowAlways = true; // // contextMenuStrip2 // this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.查看VToolStripMenuItem, this.toolStripSeparator2, this.添加附件AToolStripMenuItem, this.openCurrentDir, this.toolStripSeparator4, this.cms_Refresh, this.toolStripSeparator5, this.cms_SelectAll}); this.contextMenuStrip2.Name = "contextMenuStrip_ListView"; this.contextMenuStrip2.Size = new System.Drawing.Size(177, 132); // // 查看VToolStripMenuItem // this.查看VToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.largeIcon1, this.smallIcon1, this.list1, this.tile1, this.details1}); this.查看VToolStripMenuItem.Name = "查看VToolStripMenuItem"; this.查看VToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.查看VToolStripMenuItem.Text = "查看(&V)"; // // largeIcon1 // this.largeIcon1.CheckOnClick = true; this.largeIcon1.GroupIndex = 0; this.largeIcon1.Name = "largeIcon1"; this.largeIcon1.Size = new System.Drawing.Size(141, 22); this.largeIcon1.Text = "大图标(&R)"; this.largeIcon1.Click += new System.EventHandler(this.details1_Click); // // smallIcon1 // this.smallIcon1.CheckOnClick = true; this.smallIcon1.GroupIndex = 0; this.smallIcon1.Name = "smallIcon1"; this.smallIcon1.Size = new System.Drawing.Size(141, 22); this.smallIcon1.Text = "小图标(&N)"; this.smallIcon1.Click += new System.EventHandler(this.details1_Click); // // list1 // this.list1.CheckOnClick = true; this.list1.GroupIndex = 0; this.list1.Name = "list1"; this.list1.Size = new System.Drawing.Size(141, 22); this.list1.Text = "列表(&T)"; this.list1.Click += new System.EventHandler(this.details1_Click); // // tile1 // this.tile1.CheckOnClick = true; this.tile1.GroupIndex = 0; this.tile1.Name = "tile1"; this.tile1.Size = new System.Drawing.Size(141, 22); this.tile1.Text = "平铺(&S)"; this.tile1.Click += new System.EventHandler(this.details1_Click); // // details1 // this.details1.Checked = true; this.details1.CheckOnClick = true; this.details1.CheckState = System.Windows.Forms.CheckState.Checked; this.details1.GroupIndex = 0; this.details1.Name = "details1"; this.details1.Size = new System.Drawing.Size(141, 22); this.details1.Text = "详细信息(&D)"; this.details1.Click += new System.EventHandler(this.details1_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(173, 6); // // 添加附件AToolStripMenuItem // this.添加附件AToolStripMenuItem.Name = "添加附件AToolStripMenuItem"; this.添加附件AToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.添加附件AToolStripMenuItem.Text = "添加文件(&A)"; this.添加附件AToolStripMenuItem.Click += new System.EventHandler(this.添加_Click); // // openCurrentDir // this.openCurrentDir.Name = "openCurrentDir"; this.openCurrentDir.Size = new System.Drawing.Size(176, 22); this.openCurrentDir.Text = "打开当前文件夹(&C)"; this.openCurrentDir.Click += new System.EventHandler(this.打开当前文件夹_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(173, 6); // // cms_Refresh // this.cms_Refresh.Name = "cms_Refresh"; this.cms_Refresh.ShortcutKeys = System.Windows.Forms.Keys.F5; this.cms_Refresh.Size = new System.Drawing.Size(176, 22); this.cms_Refresh.Text = "刷新(&R)"; this.cms_Refresh.Click += new System.EventHandler(this.刷新_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(173, 6); // // cms_SelectAll // this.cms_SelectAll.Name = "cms_SelectAll"; this.cms_SelectAll.ShortcutKeyDisplayString = "Ctrl+A"; this.cms_SelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.cms_SelectAll.Size = new System.Drawing.Size(176, 22); this.cms_SelectAll.Text = "全选(&L)"; this.cms_SelectAll.TextDirection = System.Windows.Forms.ToolStripTextDirection.Horizontal; this.cms_SelectAll.Click += new System.EventHandler(this.全选_Click); // // fileSystemWatcher1 // this.fileSystemWatcher1.EnableRaisingEvents = true; this.fileSystemWatcher1.SynchronizingObject = this; this.fileSystemWatcher1.Created += new System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created); this.fileSystemWatcher1.Deleted += new System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created); // // FormAttachment // this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(655, 356); this.ControlBox = false; this.Controls.Add(this.listView1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "FormAttachment"; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Form2"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormAttachment_FormClosed); this.Load += new System.EventHandler(this.Form1_Load); this.Shown += new System.EventHandler(this.FormAttachment_Shown); this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit(); this.ResumeLayout(false); }