private void PopulateMenu() { DropDownItems.Clear(); if (EnableRepeatEffectMenuItem && LastEffect != null) { string repeatFormat = PdnResources.GetString("Effects.RepeatMenuItem.Format"); string menuName = string.Format(repeatFormat, LastEffect.Name); PdnMenuItem pmi = new PdnMenuItem(menuName, LastEffect.Image, RepeatEffectMenuItem_Click) { Name = "RepeatEffect(" + LastEffect.GetType().FullName + ")", ShortcutKeys = Keys.Control | Keys.F }; DropDownItems.Add(pmi); ToolStripSeparator tss = new ToolStripSeparator(); DropDownItems.Add(tss); } AddEffectsToMenu(); Triple <Assembly, Type, Exception>[] errors = Effects.GetLoaderExceptions(); for (int i = 0; i < errors.Length; ++i) { AppWorkspace.ReportEffectLoadError(errors[i]); } MenuPopulated = true; }
private void InitializeComponent() { this.menuToolsAntialiasing = new PdnMenuItem(); this.menuToolsAlphaBlending = new PdnMenuItem(); this.menuToolsSeperator = new ToolStripSeparator(); // // ToolsMenu // this.DropDownItems.AddRange( new ToolStripItem[] { this.menuToolsAntialiasing, this.menuToolsAlphaBlending, this.menuToolsSeperator }); this.Name = "Menu.Tools"; this.Text = PdnResources.GetString("Menu.Tools.Text"); // // menuToolsAntiAliasing // this.menuToolsAntialiasing.Name = "AntiAliasing"; this.menuToolsAntialiasing.Click += new System.EventHandler(MenuToolsAntiAliasing_Click); // // menuToolsAlphaBlending // this.menuToolsAlphaBlending.Name = "AlphaBlending"; this.menuToolsAlphaBlending.Click += new EventHandler(MenuToolsAlphaBlending_Click); }
private void InitializeComponent() { // // sentinel // Sentinel = new PdnMenuItem { Name = null }; // // components // Components = new System.ComponentModel.Container(); // // invalidateTimer // InvalidateTimer = new System.Windows.Forms.Timer(Components) { Enabled = false, Interval = effectRefreshInterval }; InvalidateTimer.Tick += InvalidateTimer_Tick; // // EffectMenuBase // DropDownItems.Add(Sentinel); }
private void AddEffectToMenu(Effect effect, bool withShortcut) { if (!FilterEffects(effect)) { return; } string name = effect.Name; if (effect.IsConfigurable) { string configurableFormat = PdnResources.GetString("Effects.Name.Format.Configurable"); name = string.Format(configurableFormat, name); } PdnMenuItem mi = new PdnMenuItem(name, effect.Image, EffectMenuItem_Click); if (withShortcut) { mi.ShortcutKeys = GetEffectShortcutKeys(effect); } else { mi.ShortcutKeys = Keys.None; } mi.Tag = (object)effect.GetType(); PdnMenuItem addEffectHere = this; if (effect.SubMenuName != null) { PdnMenuItem subMenu = null; // search for this subMenu foreach (ToolStripItem sub in this.DropDownItems) { PdnMenuItem subpmi = sub as PdnMenuItem; if (subpmi != null) { if (subpmi.Text == effect.SubMenuName) { subMenu = subpmi; break; } } } if (subMenu == null) { subMenu = new PdnMenuItem(effect.SubMenuName, null, null); this.DropDownItems.Add(subMenu); } addEffectHere = subMenu; } addEffectHere.DropDownItems.Add(mi); }
protected override void OnDropDownOpening(EventArgs e) { if (!this.toolsListInit) { this.DropDownItems.Clear(); this.DropDownItems.Add(this.menuToolsAntialiasing); this.DropDownItems.Add(this.menuToolsAlphaBlending); this.DropDownItems.Add(this.menuToolsSeperator); foreach (ToolInfo toolInfo in DocumentWorkspace.ToolInfos) { PdnMenuItem mi = new PdnMenuItem(toolInfo.Name, null, this.menuTools_ClickHandler); mi.SetIcon(toolInfo.Image); mi.Tag = toolInfo; this.DropDownItems.Add(mi); } this.toolsListInit = true; } Type currentToolType; if (AppWorkspace.ActiveDocumentWorkspace != null) { currentToolType = AppWorkspace.ActiveDocumentWorkspace.GetToolType(); } else { currentToolType = null; } foreach (ToolStripItem tsi in this.DropDownItems) { PdnMenuItem mi = tsi as PdnMenuItem; if (mi != null) { ToolInfo toolInfo = mi.Tag as ToolInfo; if (toolInfo != null) { if (toolInfo.ToolType == currentToolType) { mi.Checked = true; } else { mi.Checked = false; } } } } this.menuToolsAntialiasing.Checked = AppWorkspace.AppEnvironment.AntiAliasing; this.menuToolsAlphaBlending.Checked = AppWorkspace.AppEnvironment.AlphaBlending; base.OnDropDownOpening(e); }
private void menuTools_ClickHandler(object sender, System.EventArgs e) { if (AppWorkspace.ActiveDocumentWorkspace != null) { PdnMenuItem mi = (PdnMenuItem)sender; ToolInfo toolInfo = (ToolInfo)mi.Tag; AppWorkspace.ActiveDocumentWorkspace.SetToolFromType(toolInfo.ToolType); } }
protected virtual void OnAppWorkspaceChanged() { foreach (ToolStripItem item in base.DropDownItems) { PdnMenuItem item2 = item as PdnMenuItem; if (item2 != null) { item2.AppWorkspace = this.AppWorkspace; } } }
private void EffectMenuItem_Click(object sender, EventArgs e) { if (AppWorkspace.ActiveDocumentWorkspace == null) { return; } PdnMenuItem pmi = (PdnMenuItem)sender; Type effectType = (Type)pmi.Tag; RunEffect(effectType); }
private void InitializeComponent() { this.menuFileNew = new PdnMenuItem(); this.menuFileOpen = new PdnMenuItem(); this.menuFileOpenRecent = new PdnMenuItem(); this.menuFileOpenRecentSentinel = new PdnMenuItem(); this.menuFileAcquire = new PdnMenuItem(); this.menuFileAcquireFromScannerOrCamera = new PdnMenuItem(); this.menuFileClose = new PdnMenuItem(); this.menuFileSeparator1 = new ToolStripSeparator(); this.menuFileSave = new PdnMenuItem(); this.menuFileSaveAs = new PdnMenuItem(); this.menuFileSeparator2 = new ToolStripSeparator(); this.menuFilePrint = new PdnMenuItem(); this.menuFileSeparator3 = new ToolStripSeparator(); this.menuFileExit = new PdnMenuItem(); base.DropDownItems.AddRange(this.GetMenuItemsToAdd()); base.Name = "Menu.File"; this.Text = PdnResources.GetString("Menu.File.Text"); this.menuFileNew.Name = "New"; this.menuFileNew.ShortcutKeys = Keys.Control | Keys.N; this.menuFileNew.Click += new EventHandler(this.OnMenuFileNewClick); this.menuFileOpen.Name = "Open"; this.menuFileOpen.ShortcutKeys = Keys.Control | Keys.O; this.menuFileOpen.Click += new EventHandler(this.OnMenuFileOpenClick); this.menuFileOpenRecent.Name = "OpenRecent"; ToolStripItem[] toolStripItems = new ToolStripItem[] { this.menuFileOpenRecentSentinel }; this.menuFileOpenRecent.DropDownItems.AddRange(toolStripItems); this.menuFileOpenRecent.DropDownOpening += new EventHandler(this.OnMenuFileOpenRecentDropDownOpening); this.menuFileOpenRecentSentinel.Text = "sentinel"; this.menuFileAcquire.Name = "Acquire"; ToolStripItem[] itemArray2 = new ToolStripItem[] { this.menuFileAcquireFromScannerOrCamera }; this.menuFileAcquire.DropDownItems.AddRange(itemArray2); this.menuFileAcquire.DropDownOpening += new EventHandler(this.OnMenuFileAcquireDropDownOpening); this.menuFileAcquireFromScannerOrCamera.Name = "FromScannerOrCamera"; this.menuFileAcquireFromScannerOrCamera.Click += new EventHandler(this.OnMenuFileAcquireFromScannerOrCameraClick); this.menuFileClose.Name = "Close"; this.menuFileClose.Click += new EventHandler(this.OnMenuFileCloseClick); this.menuFileClose.ShortcutKeys = Keys.Control | Keys.W; this.menuFileSave.Name = "Save"; this.menuFileSave.ShortcutKeys = Keys.Control | Keys.S; this.menuFileSave.Click += new EventHandler(this.OnMenuFileSaveClick); this.menuFileSaveAs.Name = "SaveAs"; this.menuFileSaveAs.ShortcutKeys = Keys.Control | Keys.Shift | Keys.S; this.menuFileSaveAs.Click += new EventHandler(this.OnMenuFileSaveAsClick); this.menuFilePrint.Name = "Print"; this.menuFilePrint.ShortcutKeys = Keys.Control | Keys.P; this.menuFilePrint.Click += new EventHandler(this.OnMenuFilePrintClick); this.menuFileExit.Name = "Exit"; this.menuFileExit.Click += new EventHandler(this.OnMenuFileExitClick); }
private void InitializeComponent() { this.menuHelpHelpTopics = new PdnMenuItem(); this.menuHelpSeparator1 = new ToolStripSeparator(); this.menuHelpPdnWebsite = new PdnMenuItem(); this.menuHelpPdnSearch = new PdnMenuItem(); this.menuHelpDonate = new PdnMenuItem(); this.menuHelpForum = new PdnMenuItem(); this.menuHelpTutorials = new PdnMenuItem(); this.menuHelpPlugins = new PdnMenuItem(); this.menuHelpSendFeedback = new PdnMenuItem(); this.menuHelpSeparator2 = new ToolStripSeparator(); this.menuHelpAbout = new PdnMenuItem(); ToolStripItem[] toolStripItems = new ToolStripItem[] { this.menuHelpHelpTopics, this.menuHelpSeparator1, this.menuHelpPdnWebsite, this.menuHelpPdnSearch }; base.DropDownItems.AddRange(toolStripItems); if (!WinAppModel.HasCurrentPackage) { base.DropDownItems.Add(this.menuHelpDonate); } ToolStripItem[] itemArray2 = new ToolStripItem[] { this.menuHelpForum, this.menuHelpTutorials, this.menuHelpPlugins, this.menuHelpSendFeedback, this.menuHelpSeparator2, this.menuHelpAbout }; base.DropDownItems.AddRange(itemArray2); base.Name = "Menu.Help"; this.Text = PdnResources.GetString("Menu.Help.Text"); this.Image = PdnResources.GetImageResource("Icons.MenuHelpIcon.png").Reference; this.DisplayStyle = ToolStripItemDisplayStyle.Image; base.AutoToolTip = true; base.AutoSize = false; this.Size = new Size(UIUtil.ScaleWidth(0x10) + 6, UIUtil.ScaleHeight(0x10) + 6); this.menuHelpHelpTopics.Name = "HelpTopics"; this.menuHelpHelpTopics.ShortcutKeys = Keys.F1; this.menuHelpHelpTopics.Click += new EventHandler(this.OnMenuHelpHelpTopicsClick); this.menuHelpPdnWebsite.Name = "PdnWebsite"; this.menuHelpPdnWebsite.Click += new EventHandler(this.OnMenuHelpPdnWebsiteClick); this.menuHelpPdnSearch.Name = "PdnSearch"; this.menuHelpPdnSearch.Click += new EventHandler(this.OnMenuHelpPdnSearchEngineClick); this.menuHelpPdnSearch.ShortcutKeys = Keys.Control | Keys.E; this.menuHelpDonate.Name = "Donate"; this.menuHelpDonate.Click += new EventHandler(this.OnMenuHelpDonateClick); this.menuHelpDonate.Font = FontUtil.CreateGdipFont(this.menuHelpDonate.Font.Name, this.menuHelpDonate.Font.Size, this.menuHelpDonate.Font.Style | FontStyle.Italic); this.menuHelpForum.Name = "Forum"; this.menuHelpForum.Click += new EventHandler(this.OnMenuHelpForumClick); this.menuHelpTutorials.Name = "Tutorials"; this.menuHelpTutorials.Click += new EventHandler(this.OnMenuHelpTutorialsClick); this.menuHelpPlugins.Name = "Plugins"; this.menuHelpPlugins.Click += new EventHandler(this.OnMenuHelpPluginsClick); this.menuHelpSendFeedback.Name = "SendFeedback"; this.menuHelpSendFeedback.Click += new EventHandler(this.OnMenuHelpSendFeedbackClick); this.menuHelpAbout.Name = "About"; this.menuHelpAbout.Click += new EventHandler(this.OnMenuHelpAboutClick); }
private void AddEffectToMenu(Effect effect, bool withShortcut) { if (!FilterEffects(effect)) { return; } string name = effect.Name; if (effect.CheckForEffectFlags(EffectFlags.Configurable)) { string configurableFormat = PdnResources.GetString("Effects.Name.Format.Configurable"); name = string.Format(configurableFormat, name); } PdnMenuItem mi = new PdnMenuItem(name, effect.Image, EffectMenuItem_Click) { ShortcutKeys = withShortcut ? GetEffectShortcutKeys(effect) : Keys.None, Tag = (object)effect.GetType(), Name = "Effect(" + effect.GetType().FullName + ")" }; PdnMenuItem addEffectHere = this; if (effect.SubMenuName != null) { PdnMenuItem subMenu = null; // search for this subMenu foreach (ToolStripItem sub in DropDownItems) { if (sub is PdnMenuItem subpmi && subpmi.Text == effect.SubMenuName) { subMenu = subpmi; break; } } if (subMenu == null) { subMenu = new PdnMenuItem(effect.SubMenuName, null, null); DropDownItems.Add(subMenu); } addEffectHere = subMenu; } addEffectHere.DropDownItems.Add(mi); }
private void InitializeComponent() { this.menuViewZoomIn = new PdnMenuItem(); this.menuViewZoomOut = new PdnMenuItem(); this.menuViewZoomToWindow = new PdnMenuItem(); this.menuViewZoomToSelection = new PdnMenuItem(); this.menuViewActualSize = new PdnMenuItem(); this.menuViewSeparator1 = new ToolStripSeparator(); this.menuViewGrid = new PdnMenuItem(); this.menuViewRulers = new PdnMenuItem(); this.menuViewSeparator2 = new ToolStripSeparator(); this.menuViewPixels = new PdnMenuItem(); this.menuViewInches = new PdnMenuItem(); this.menuViewCentimeters = new PdnMenuItem(); ToolStripItem[] toolStripItems = new ToolStripItem[] { this.menuViewZoomIn, this.menuViewZoomOut, this.menuViewZoomToWindow, this.menuViewZoomToSelection, this.menuViewActualSize, this.menuViewSeparator1, this.menuViewGrid, this.menuViewRulers, this.menuViewSeparator2, this.menuViewPixels, this.menuViewInches, this.menuViewCentimeters }; base.DropDownItems.AddRange(toolStripItems); base.Name = "Menu.View"; this.Text = PdnResources.GetString("Menu.View.Text"); this.menuViewZoomIn.Name = "ZoomIn"; this.menuViewZoomIn.ShortcutKeys = Keys.Control | Keys.Add; this.menuViewZoomIn.ShortcutKeyDisplayString = PdnResources.GetString("Menu.View.ZoomIn.ShortcutKeyDisplayString"); this.menuViewZoomIn.Click += new EventHandler(this.OnMenuViewZoomInClick); this.menuViewZoomOut.Name = "ZoomOut"; this.menuViewZoomOut.ShortcutKeys = Keys.Control | Keys.Subtract; this.menuViewZoomOut.ShortcutKeyDisplayString = PdnResources.GetString("Menu.View.ZoomOut.ShortcutKeyDisplayString"); this.menuViewZoomOut.Click += new EventHandler(this.OnMenuViewZoomOutClick); this.menuViewZoomToWindow.Name = "ZoomToWindow"; this.menuViewZoomToWindow.ShortcutKeys = Keys.Control | Keys.B; this.menuViewZoomToWindow.Click += new EventHandler(this.OnMenuViewZoomToWindowClick); this.menuViewZoomToSelection.Name = "ZoomToSelection"; this.menuViewZoomToSelection.ShortcutKeys = Keys.Control | Keys.Shift | Keys.B; this.menuViewZoomToSelection.Click += new EventHandler(this.OnMenuViewZoomToSelectionClick); this.menuViewActualSize.Name = "ActualSize"; this.menuViewActualSize.ShortcutKeys = Keys.Control | Keys.D0; this.menuViewActualSize.Click += new EventHandler(this.OnMenuViewActualSizeClick); this.menuViewGrid.Name = "Grid"; this.menuViewGrid.Click += new EventHandler(this.OnMenuViewGridClick); this.menuViewRulers.Name = "Rulers"; this.menuViewRulers.Click += new EventHandler(this.OnMenuViewRulersClick); this.menuViewPixels.Name = "Pixels"; this.menuViewPixels.Click += new EventHandler(this.OnMenuViewPixelsClick); this.menuViewPixels.Text = PdnResources.GetString("MeasurementUnit.Pixel.Plural"); this.menuViewInches.Name = "Inches"; this.menuViewInches.Text = PdnResources.GetString("MeasurementUnit.Inch.Plural"); this.menuViewInches.Click += new EventHandler(this.OnMenuViewInchesClick); this.menuViewCentimeters.Name = "Centimeters"; this.menuViewCentimeters.Click += new EventHandler(this.OnMenuViewCentimetersClick); this.menuViewCentimeters.Text = PdnResources.GetString("MeasurementUnit.Centimeter.Plural"); }
private void PopulateMenu() { this.DropDownItems.Clear(); if (EnableRepeatEffectMenuItem && this.lastEffect != null) { string repeatFormat = PdnResources.GetString("Effects.RepeatMenuItem.Format"); string menuName = string.Format(repeatFormat, lastEffect.Name); PdnMenuItem pmi = new PdnMenuItem(menuName, this.lastEffect.Image, RepeatEffectMenuItem_Click); pmi.ShortcutKeys = Keys.Control | Keys.F; this.DropDownItems.Add(pmi); ToolStripSeparator tss = new ToolStripSeparator(); this.DropDownItems.Add(tss); } AddEffectsToMenu(); }
private void InitializeComponent() { this.menuImageCrop = new PdnMenuItem(); this.menuImageResize = new PdnMenuItem(); this.menuImageCanvasSize = new PdnMenuItem(); this.menuImageSeparator1 = new ToolStripSeparator(); this.menuImageFlipHorizontal = new PdnMenuItem(); this.menuImageFlipVertical = new PdnMenuItem(); this.menuImageSeparator2 = new ToolStripSeparator(); this.menuImageRotate90CW = new PdnMenuItem(); this.menuImageRotate90CCW = new PdnMenuItem(); this.menuImageRotate180 = new PdnMenuItem(); this.menuImageSeparator3 = new ToolStripSeparator(); this.menuImageFlatten = new PdnMenuItem(); ToolStripItem[] toolStripItems = new ToolStripItem[] { this.menuImageCrop, this.menuImageResize, this.menuImageCanvasSize, this.menuImageSeparator1, this.menuImageFlipHorizontal, this.menuImageFlipVertical, this.menuImageSeparator2, this.menuImageRotate90CW, this.menuImageRotate90CCW, this.menuImageRotate180, this.menuImageSeparator3, this.menuImageFlatten }; base.DropDownItems.AddRange(toolStripItems); base.Name = "Menu.Image"; this.Text = PdnResources.GetString("Menu.Image.Text"); this.menuImageCrop.Name = "Crop"; this.menuImageCrop.Click += new EventHandler(this.OnMenuImageCropClick); this.menuImageCrop.ShortcutKeys = Keys.Control | Keys.Shift | Keys.X; this.menuImageResize.Name = "Resize"; this.menuImageResize.ShortcutKeys = Keys.Control | Keys.R; this.menuImageResize.Click += new EventHandler(this.OnMenuImageResizeClick); this.menuImageCanvasSize.Name = "CanvasSize"; this.menuImageCanvasSize.ShortcutKeys = Keys.Control | Keys.Shift | Keys.R; this.menuImageCanvasSize.Click += new EventHandler(this.OnMenuImageCanvasSizeClick); this.menuImageFlipHorizontal.Name = "FlipHorizontal"; this.menuImageFlipHorizontal.Click += new EventHandler(this.OnMenuImageFlipHorizontalClick); this.menuImageFlipVertical.Name = "FlipVertical"; this.menuImageFlipVertical.Click += new EventHandler(this.OnMenuImageFlipVerticalClick); this.menuImageRotate90CW.Name = "Rotate90CW"; this.menuImageRotate90CW.ShortcutKeys = Keys.Control | Keys.H; this.menuImageRotate90CW.Click += new EventHandler(this.OnMenuImageRotate90CWClick); this.menuImageRotate90CCW.Name = "Rotate90CCW"; this.menuImageRotate90CCW.ShortcutKeys = Keys.Control | Keys.G; this.menuImageRotate90CCW.Click += new EventHandler(this.OnMenuImageRotate90CCWClick); this.menuImageRotate180.Name = "Rotate180"; this.menuImageRotate180.Click += new EventHandler(this.OnMenuImageRotate180Click); this.menuImageRotate180.ShortcutKeys = Keys.Control | Keys.J; this.menuImageFlatten.Name = "Flatten"; this.menuImageFlatten.ShortcutKeys = Keys.Control | Keys.Shift | Keys.F; this.menuImageFlatten.Click += new EventHandler(this.OnMenuImageFlattenClick); }
public void LoadIcons() { foreach (FieldInfo info in base.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) { if (info.FieldType.IsSubclassOf(typeof(PdnMenuItem)) || (info.FieldType == typeof(PdnMenuItem))) { char ch = info.Name[0]; string fileName = "Icons." + ch.ToString().ToUpper() + info.Name.Substring(1) + "Icon.png"; PdnMenuItem item = (PdnMenuItem)info.GetValue(this); Stream stream = PdnResources.CreateResourceStream(fileName); if (stream != null) { stream.Dispose(); item.SetIcon(fileName); } } } this.iconsLoaded = true; }
public void LoadNames(string baseName) { foreach (ToolStripItem item in base.DropDownItems) { string str = baseName + "." + item.Name; string stringName = str + ".Text"; string str3 = PdnResources.GetString(stringName); if (str3 != null) { item.Text = str3; } PdnMenuItem item2 = item as PdnMenuItem; if (item2 != null) { item2.textResourceName = stringName; item2.LoadNames(str); } } this.namesLoaded = true; }
private void InitializeComponent() { this.menuLayersAddNewLayer = new PdnMenuItem(); this.menuLayersDeleteLayer = new PdnMenuItem(); this.menuLayersDuplicateLayer = new PdnMenuItem(); this.menuLayersMergeLayerDown = new PdnMenuItem(); this.menuLayersImportFromFile = new PdnMenuItem(); this.menuLayersSeparator1 = new ToolStripSeparator(); this.menuLayersFlipHorizontal = new PdnMenuItem(); this.menuLayersFlipVertical = new PdnMenuItem(); this.menuLayersRotateZoom = new PdnMenuItem(); this.menuLayersSeparator2 = new ToolStripSeparator(); this.menuLayersLayerProperties = new PdnMenuItem(); ToolStripItem[] toolStripItems = new ToolStripItem[] { this.menuLayersAddNewLayer, this.menuLayersDeleteLayer, this.menuLayersDuplicateLayer, this.menuLayersMergeLayerDown, this.menuLayersImportFromFile, this.menuLayersSeparator1, this.menuLayersFlipHorizontal, this.menuLayersFlipVertical, this.menuLayersRotateZoom, this.menuLayersSeparator2, this.menuLayersLayerProperties }; base.DropDownItems.AddRange(toolStripItems); base.Name = "Menu.Layers"; this.Text = PdnResources.GetString("Menu.Layers.Text"); this.menuLayersAddNewLayer.Name = "AddNewLayer"; this.menuLayersAddNewLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.N; this.menuLayersAddNewLayer.Click += new EventHandler(this.OnMenuLayersAddNewLayerClick); this.menuLayersDeleteLayer.Name = "DeleteLayer"; this.menuLayersDeleteLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.Delete; this.menuLayersDeleteLayer.Click += new EventHandler(this.OnMenuLayersDeleteLayerClick); this.menuLayersDuplicateLayer.Name = "DuplicateLayer"; this.menuLayersDuplicateLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.D; this.menuLayersDuplicateLayer.Click += new EventHandler(this.OnMenuLayersDuplicateLayerClick); this.menuLayersMergeLayerDown.Name = "MergeLayerDown"; this.menuLayersMergeLayerDown.ShortcutKeys = Keys.Control | Keys.M; this.menuLayersMergeLayerDown.Click += new EventHandler(this.OnMenuLayersMergeDownClick); this.menuLayersImportFromFile.Name = "ImportFromFile"; this.menuLayersImportFromFile.Click += new EventHandler(this.OnMenuLayersImportFromFileClick); this.menuLayersFlipHorizontal.Name = "FlipHorizontal"; this.menuLayersFlipHorizontal.Click += new EventHandler(this.OnMenuLayersFlipHorizontalClick); this.menuLayersFlipVertical.Name = "FlipVertical"; this.menuLayersFlipVertical.Click += new EventHandler(this.OnMenuLayersFlipVerticalClick); this.menuLayersRotateZoom.Name = "RotateZoom"; this.menuLayersRotateZoom.Click += new EventHandler(this.OnMenuLayersRotateZoomClick); this.menuLayersLayerProperties.Name = "LayerProperties"; this.menuLayersLayerProperties.ShortcutKeys = Keys.F4; this.menuLayersLayerProperties.Click += new EventHandler(this.OnMenuLayersLayerPropertiesClick); }
private void InitializeComponent() { this.sentinel = new PdnMenuItem(); // // sentinel // this.sentinel.Name = null; // // components // this.components = new System.ComponentModel.Container(); // // invalidateTimer // this.invalidateTimer = new System.Windows.Forms.Timer(this.components); this.invalidateTimer.Enabled = false; this.invalidateTimer.Tick += InvalidateTimer_Tick; this.invalidateTimer.Interval = effectRefreshInterval; // // EffectMenuBase // this.DropDownItems.Add(sentinel); }
private void InitializeComponent() { this.menuWindowResetWindowLocations = new PdnMenuItem(); this.menuWindowSeperator1 = new ToolStripSeparator(); this.menuWindowTranslucent = new PdnMenuItem(); this.menuWindowSeperator2 = new ToolStripSeparator(); this.menuWindowTools = new PdnMenuItem(); this.menuWindowHistory = new PdnMenuItem(); this.menuWindowLayers = new PdnMenuItem(); this.menuWindowColors = new PdnMenuItem(); this.menuWindowSeparator3 = new ToolStripSeparator(); this.menuWindowOpenMdiList = new PdnMenuItem(); this.menuWindowNextTab = new PdnMenuItem(); this.menuWindowPreviousTab = new PdnMenuItem(); // // WindowMenu // this.DropDownItems.AddRange( new ToolStripItem[] { this.menuWindowResetWindowLocations, this.menuWindowSeperator1, this.menuWindowTranslucent, this.menuWindowSeperator2, this.menuWindowTools, this.menuWindowHistory, this.menuWindowLayers, this.menuWindowColors, this.menuWindowSeparator3, this.menuWindowOpenMdiList, this.menuWindowNextTab, this.menuWindowPreviousTab }); this.Name = "Menu.Window"; this.Text = PdnResources.GetString("Menu.Window.Text"); // // menuWindowResetWindowLocations // this.menuWindowResetWindowLocations.Name = "ResetWindowLocations"; this.menuWindowResetWindowLocations.Click += new System.EventHandler(this.MenuWindowResetWindowLocations_Click); // // menuWindowTranslucent // this.menuWindowTranslucent.Name = "Translucent"; this.menuWindowTranslucent.Click += new System.EventHandler(this.MenuWindowTranslucent_Click); // // menuWindowTools // this.menuWindowTools.Name = "Tools"; this.menuWindowTools.ShortcutKeys = Keys.F5; this.menuWindowTools.Click += new System.EventHandler(this.MenuWindowTools_Click); // // menuWindowHistory // this.menuWindowHistory.Name = "History"; this.menuWindowHistory.ShortcutKeys = Keys.F6; this.menuWindowHistory.Click += new System.EventHandler(this.MenuWindowHistory_Click); // // menuWindowLayers // this.menuWindowLayers.Name = "Layers"; this.menuWindowLayers.ShortcutKeys = Keys.F7; this.menuWindowLayers.Click += new System.EventHandler(this.MenuWindowLayers_Click); // // menuWindowColors // this.menuWindowColors.Name = "Colors"; this.menuWindowColors.ShortcutKeys = Keys.F8; this.menuWindowColors.Click += new System.EventHandler(this.MenuWindowColors_Click); // // menuWindowOpenMdiList // this.menuWindowOpenMdiList.Name = "OpenMdiList"; this.menuWindowOpenMdiList.ShortcutKeys = Keys.Control | Keys.Q; this.menuWindowOpenMdiList.Click += new EventHandler(MenuWindowOpenMdiList_Click); // // menuWindowNextTab // this.menuWindowNextTab.Name = "NextTab"; this.menuWindowNextTab.ShortcutKeys = Keys.Control | Keys.Tab; this.menuWindowNextTab.Click += new EventHandler(MenuWindowNextTab_Click); // // menuWindowPreviousTab // this.menuWindowPreviousTab.Name = "PreviousTab"; this.menuWindowPreviousTab.ShortcutKeys = Keys.Control | Keys.Shift | Keys.Tab; this.menuWindowPreviousTab.Click += new EventHandler(MenuWindowPreviousTab_Click); }
private void AddEffectsToMenu() { // Fill the menu with the effect names, and "..." if it is configurable EffectsCollection effectsCollection = this.Effects; Type[] effectTypes = effectsCollection.Effects; bool withShortcuts = EnableEffectShortcuts; List <Effect> newEffects = new List <Effect>(); foreach (Type type in effectsCollection.Effects) { try { ConstructorInfo ci = type.GetConstructor(Type.EmptyTypes); Effect effect = (Effect)ci.Invoke(null); if (FilterEffects(effect)) { newEffects.Add(effect); } } catch { // We don't want a DLL that can't be figured out to cause the app to crash continue; } } newEffects.Sort( delegate(Effect lhs, Effect rhs) { return(string.Compare(lhs.Name, rhs.Name, true)); }); List <string> subMenuNames = new List <string>(); foreach (Effect effect in newEffects) { if (!string.IsNullOrEmpty(effect.SubMenuName)) { subMenuNames.Add(effect.SubMenuName); } } subMenuNames.Sort( delegate(string lhs, string rhs) { return(string.Compare(lhs, rhs, true)); }); string lastSubMenuName = null; foreach (string subMenuName in subMenuNames) { if (subMenuName == lastSubMenuName) { // skip duplicate names continue; } PdnMenuItem subMenu = new PdnMenuItem(subMenuName, null, null); DropDownItems.Add(subMenu); lastSubMenuName = subMenuName; } foreach (Effect effect in newEffects) { AddEffectToMenu(effect, withShortcuts); } }
private void InitializeComponent() { this.menuEditUndo = new PdnMenuItem(); this.menuEditRedo = new PdnMenuItem(); this.menuEditSeparator1 = new ToolStripSeparator(); this.menuEditCut = new PdnMenuItem(); this.menuEditCopy = new PdnMenuItem(); this.menuEditCopyMerged = new PdnMenuItem(); this.menuEditPaste = new PdnMenuItem(); this.menuEditPasteInToNewLayer = new PdnMenuItem(); this.menuEditPasteInToNewImage = new PdnMenuItem(); this.menuEditSeparator2 = new ToolStripSeparator(); this.menuEditEraseSelection = new PdnMenuItem(); this.menuEditFillSelection = new PdnMenuItem(); this.menuEditInvertSelection = new PdnMenuItem(); this.menuEditSelectAll = new PdnMenuItem(); this.menuEditDeselect = new PdnMenuItem(); ToolStripItem[] toolStripItems = new ToolStripItem[] { this.menuEditUndo, this.menuEditRedo, this.menuEditSeparator1, this.menuEditCut, this.menuEditCopy, this.menuEditCopyMerged, this.menuEditPaste, this.menuEditPasteInToNewLayer, this.menuEditPasteInToNewImage, this.menuEditSeparator2, this.menuEditEraseSelection, this.menuEditFillSelection, this.menuEditInvertSelection, this.menuEditSelectAll, this.menuEditDeselect }; base.DropDownItems.AddRange(toolStripItems); base.Name = "Menu.Edit"; this.Text = PdnResources.GetString("Menu.Edit.Text"); this.menuEditUndo.Name = "Undo"; this.menuEditUndo.ShortcutKeys = Keys.Control | Keys.Z; this.menuEditUndo.Click += new EventHandler(this.OnMenuEditUndoClick); this.menuEditRedo.Name = "Redo"; this.menuEditRedo.ShortcutKeys = Keys.Control | Keys.Y; this.menuEditRedo.Click += new EventHandler(this.OnMenuEditRedoClick); this.menuEditCut.Name = "Cut"; this.menuEditCut.ShortcutKeys = Keys.Control | Keys.X; this.menuEditCut.Click += new EventHandler(this.OnMenuEditCutClick); this.menuEditCopy.Name = "Copy"; this.menuEditCopy.ShortcutKeys = Keys.Control | Keys.C; this.menuEditCopy.Click += new EventHandler(this.OnMenuEditCopyClick); this.menuEditCopyMerged.Name = "CopyMerged"; this.menuEditCopyMerged.ShortcutKeys = Keys.Control | Keys.Shift | Keys.C; this.menuEditCopyMerged.Click += new EventHandler(this.OnMenuEditCopyMergedClick); this.menuEditPaste.Name = "Paste"; this.menuEditPaste.ShortcutKeys = Keys.Control | Keys.V; this.menuEditPaste.Click += new EventHandler(this.OnMenuEditPasteClick); this.menuEditPasteInToNewLayer.Name = "PasteInToNewLayer"; this.menuEditPasteInToNewLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.V; this.menuEditPasteInToNewLayer.Click += new EventHandler(this.OnMenuEditPasteInToNewLayerClick); this.menuEditPasteInToNewImage.Name = "PasteInToNewImage"; this.menuEditPasteInToNewImage.ShortcutKeys = Keys.Alt | Keys.Control | Keys.V; this.menuEditPasteInToNewImage.Click += new EventHandler(this.OnMenuEditPasteInToNewImageClick); this.menuEditEraseSelection.Name = "EraseSelection"; this.menuEditEraseSelection.ShortcutKeys = Keys.Delete; this.menuEditEraseSelection.Click += new EventHandler(this.OnMenuEditClearSelectionClick); this.menuEditFillSelection.Name = "FillSelection"; this.menuEditFillSelection.ShortcutKeyDisplayString = PdnResources.GetString("Menu.Edit.FillSelection.ShortcutKeysDisplayString"); this.menuEditFillSelection.Click += new EventHandler(this.OnMenuEditFillSelectionClick); this.menuEditInvertSelection.Name = "InvertSelection"; this.menuEditInvertSelection.Click += new EventHandler(this.OnMenuEditInvertSelectionClick); this.menuEditInvertSelection.ShortcutKeys = Keys.Control | Keys.I; this.menuEditSelectAll.Name = "SelectAll"; this.menuEditSelectAll.ShortcutKeys = Keys.Control | Keys.A; this.menuEditSelectAll.Click += new EventHandler(this.OnMenuEditSelectAllClick); this.menuEditDeselect.Name = "Deselect"; this.menuEditDeselect.ShortcutKeys = Keys.Control | Keys.D; this.menuEditDeselect.Click += new EventHandler(this.OnMenuEditDeselectClick); }
private void InitializeComponent() { this.menuEditUndo = new PdnMenuItem(); this.menuEditRedo = new PdnMenuItem(); this.menuEditSeparator1 = new ToolStripSeparator(); this.menuEditCut = new PdnMenuItem(); this.menuEditCopy = new PdnMenuItem(); this.menuEditPaste = new PdnMenuItem(); this.menuEditPasteInToNewLayer = new PdnMenuItem(); this.menuEditPasteInToNewImage = new PdnMenuItem(); this.menuEditSeparator2 = new ToolStripSeparator(); this.menuEditEraseSelection = new PdnMenuItem(); this.menuEditFillSelection = new PdnMenuItem(); this.menuEditInvertSelection = new PdnMenuItem(); this.menuEditSelectAll = new PdnMenuItem(); this.menuEditDeselect = new PdnMenuItem(); // // EditMenu // this.DropDownItems.AddRange( new ToolStripItem[] { this.menuEditUndo, this.menuEditRedo, this.menuEditSeparator1, this.menuEditCut, this.menuEditCopy, this.menuEditPaste, this.menuEditPasteInToNewLayer, this.menuEditPasteInToNewImage, this.menuEditSeparator2, this.menuEditEraseSelection, this.menuEditFillSelection, this.menuEditInvertSelection, this.menuEditSelectAll, this.menuEditDeselect }); this.Name = "Menu.Edit"; this.Text = PdnResources.GetString("Menu.Edit.Text"); // // menuEditUndo // this.menuEditUndo.Name = "Undo"; this.menuEditUndo.ShortcutKeys = Keys.Control | Keys.Z; this.menuEditUndo.Click += new System.EventHandler(this.MenuEditUndo_Click); // // menuEditRedo // this.menuEditRedo.Name = "Redo"; this.menuEditRedo.ShortcutKeys = Keys.Control | Keys.Y; this.menuEditRedo.Click += new System.EventHandler(this.MenuEditRedo_Click); // // menuEditCut // this.menuEditCut.Name = "Cut"; this.menuEditCut.ShortcutKeys = Keys.Control | Keys.X; this.menuEditCut.Click += new System.EventHandler(this.MenuEditCut_Click); // // menuEditCopy // this.menuEditCopy.Name = "Copy"; this.menuEditCopy.ShortcutKeys = Keys.Control | Keys.C; this.menuEditCopy.Click += new System.EventHandler(this.MenuEditCopy_Click); // // menuEditPaste // this.menuEditPaste.Name = "Paste"; this.menuEditPaste.ShortcutKeys = Keys.Control | Keys.V; this.menuEditPaste.Click += new System.EventHandler(this.MenuEditPaste_Click); // // menuEditPasteInToNewLayer // this.menuEditPasteInToNewLayer.Name = "PasteInToNewLayer"; this.menuEditPasteInToNewLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.V; this.menuEditPasteInToNewLayer.Click += new System.EventHandler(this.MenuEditPasteInToNewLayer_Click); // // menuEditPasteInToNewImage // this.menuEditPasteInToNewImage.Name = "PasteInToNewImage"; this.menuEditPasteInToNewImage.ShortcutKeys = Keys.Control | Keys.Alt | Keys.V; this.menuEditPasteInToNewImage.Click += new EventHandler(MenuEditPasteInToNewImage_Click); // // menuEditEraseSelection // this.menuEditEraseSelection.Name = "EraseSelection"; this.menuEditEraseSelection.ShortcutKeys = Keys.Delete; this.menuEditEraseSelection.Click += new System.EventHandler(this.MenuEditClearSelection_Click); // // menuEditFillSelection // this.menuEditFillSelection.Name = "FillSelection"; this.menuEditFillSelection.ShortcutKeyDisplayString = PdnResources.GetString("Menu.Edit.FillSelection.ShortcutKeysDisplayString"); this.menuEditFillSelection.Click += new EventHandler(MenuEditFillSelection_Click); // // menuEditInvertSelection // this.menuEditInvertSelection.Name = "InvertSelection"; this.menuEditInvertSelection.Click += new System.EventHandler(this.MenuEditInvertSelection_Click); this.menuEditInvertSelection.ShortcutKeys = Keys.Control | Keys.I; // // menuEditSelectAll // this.menuEditSelectAll.Name = "SelectAll"; this.menuEditSelectAll.ShortcutKeys = Keys.Control | Keys.A; this.menuEditSelectAll.Click += new System.EventHandler(this.MenuEditSelectAll_Click); // // menuEditDeselect // this.menuEditDeselect.Name = "Deselect"; this.menuEditDeselect.ShortcutKeys = Keys.Control | Keys.D; this.menuEditDeselect.Click += new System.EventHandler(this.MenuEditDeselect_Click); }
private void InitializeComponent() { this.menuViewZoomIn = new PdnMenuItem(); this.menuViewZoomOut = new PdnMenuItem(); this.menuViewZoomToWindow = new PdnMenuItem(); this.menuViewZoomToSelection = new PdnMenuItem(); this.menuViewActualSize = new PdnMenuItem(); this.menuViewSeperator = new ToolStripSeparator(); this.menuViewGrid = new PdnMenuItem(); this.menuViewRulers = new PdnMenuItem(); this.menuViewUnits = new PdnMenuItem(); this.menuViewUnitsPixels = new PdnMenuItem(); this.menuViewUnitsInches = new PdnMenuItem(); this.menuViewUnitsCentimeters = new PdnMenuItem(); // // menuView // this.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { this.menuViewZoomIn, this.menuViewZoomOut, this.menuViewZoomToWindow, this.menuViewZoomToSelection, this.menuViewActualSize, this.menuViewSeperator, this.menuViewGrid, this.menuViewRulers, this.menuViewUnits }); this.Name = "Menu.View"; this.Text = PdnResources.GetString("Menu.View.Text"); // // menuViewZoomIn // this.menuViewZoomIn.Name = "ZoomIn"; this.menuViewZoomIn.ShortcutKeys = Keys.Control | Keys.Add; this.menuViewZoomIn.ShortcutKeyDisplayString = PdnResources.GetString("Menu.View.ZoomIn.ShortcutKeyDisplayString"); this.menuViewZoomIn.Click += new System.EventHandler(this.MenuViewZoomIn_Click); // // menuViewZoomOut // this.menuViewZoomOut.Name = "ZoomOut"; this.menuViewZoomOut.ShortcutKeys = Keys.Control | Keys.Subtract; this.menuViewZoomOut.ShortcutKeyDisplayString = PdnResources.GetString("Menu.View.ZoomOut.ShortcutKeyDisplayString"); this.menuViewZoomOut.Click += new System.EventHandler(this.MenuViewZoomOut_Click); // // menuViewZoomToWindow // this.menuViewZoomToWindow.Name = "ZoomToWindow"; this.menuViewZoomToWindow.ShortcutKeys = Keys.Control | Keys.B; this.menuViewZoomToWindow.Click += new System.EventHandler(this.MenuViewZoomToWindow_Click); // // menuViewZoomToSelection // this.menuViewZoomToSelection.Name = "ZoomToSelection"; this.menuViewZoomToSelection.ShortcutKeys = Keys.Control | Keys.Shift | Keys.B; this.menuViewZoomToSelection.Click += new System.EventHandler(this.MenuViewZoomToSelection_Click); // // menuViewActualSize // this.menuViewActualSize.Name = "ActualSize"; this.menuViewActualSize.ShortcutKeys = Keys.Control | Keys.Shift | Keys.A; this.menuViewActualSize.Click += new System.EventHandler(this.MenuViewActualSize_Click); // // menuViewGrid // this.menuViewGrid.Name = "Grid"; this.menuViewGrid.Click += new System.EventHandler(this.MenuViewGrid_Click); // // menuViewRulers // this.menuViewRulers.Name = "Rulers"; this.menuViewRulers.Click += new System.EventHandler(this.MenuViewRulers_Click); // // menuViewUnits // this.menuViewUnits.Name = "Units"; this.menuViewUnits.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuViewUnitsPixels, this.menuViewUnitsInches, this.menuViewUnitsCentimeters }); this.menuViewUnits.DropDownOpening += new EventHandler(MenuViewUnits_DropDownOpening); // // menuViewUnitsPixels // this.menuViewUnitsPixels.Name = "Pixels"; this.menuViewUnitsPixels.Click += new EventHandler(MenuViewUnitsPixels_Click); this.menuViewUnitsPixels.Text = PdnResources.GetString("MeasurementUnit.Pixel.Plural"); // // menuViewUnitsInches // this.menuViewUnitsInches.Name = "Inches"; this.menuViewUnitsInches.Text = PdnResources.GetString("MeasurementUnit.Inch.Plural"); this.menuViewUnitsInches.Click += new EventHandler(MenuViewUnitsInches_Click); // // menuViewUnitsCentimeters // this.menuViewUnitsCentimeters.Name = "Centimeters"; this.menuViewUnitsCentimeters.Click += new EventHandler(MenuViewUnitsCentimeters_Click); this.menuViewUnitsCentimeters.Text = PdnResources.GetString("MeasurementUnit.Centimeter.Plural"); }
private void InitializeComponent() { this.menuFileNew = new PdnMenuItem(); this.menuFileOpen = new PdnMenuItem(); this.menuFileOpenRecent = new PdnMenuItem(); this.menuFileOpenRecentSentinel = new PdnMenuItem(); this.menuFileAcquire = new PdnMenuItem(); this.menuFileAcquireFromScannerOrCamera = new PdnMenuItem(); this.menuFileClose = new PdnMenuItem(); this.menuFileSeparator1 = new ToolStripSeparator(); this.menuFileSave = new PdnMenuItem(); this.menuFileSaveAs = new PdnMenuItem(); this.menuFileSeparator2 = new ToolStripSeparator(); this.menuFilePrint = new PdnMenuItem(); this.menuFileSeparator3 = new ToolStripSeparator(); this.menuFileViewPluginLoadErrors = new PdnMenuItem(); this.menuFileSeparator4 = new ToolStripSeparator(); this.menuFileExit = new PdnMenuItem(); // // FileMenu // this.DropDownItems.AddRange(GetMenuItemsToAdd(true)); this.Name = "Menu.File"; this.Text = PdnResources.GetString("Menu.File.Text"); // // menuFileNew // this.menuFileNew.Name = "New"; this.menuFileNew.ShortcutKeys = Keys.Control | Keys.N; this.menuFileNew.Click += new System.EventHandler(this.MenuFileNew_Click); // // menuFileOpen // this.menuFileOpen.Name = "Open"; this.menuFileOpen.ShortcutKeys = Keys.Control | Keys.O; this.menuFileOpen.Click += new System.EventHandler(this.MenuFileOpen_Click); // // menuFileOpenRecent // this.menuFileOpenRecent.Name = "OpenRecent"; this.menuFileOpenRecent.DropDownItems.AddRange( new ToolStripItem[] { this.menuFileOpenRecentSentinel }); this.menuFileOpenRecent.DropDownOpening += new System.EventHandler(this.MenuFileOpenRecent_DropDownOpening); // // menuFileOpenRecentSentinel // this.menuFileOpenRecentSentinel.Text = "sentinel"; // // menuFileAcquire // this.menuFileAcquire.Name = "Acquire"; this.menuFileAcquire.DropDownItems.AddRange( new ToolStripItem[] { this.menuFileAcquireFromScannerOrCamera }); this.menuFileAcquire.DropDownOpening += new System.EventHandler(this.MenuFileAcquire_DropDownOpening); // // menuFileAcquireFromScannerOrCamera // this.menuFileAcquireFromScannerOrCamera.Name = "FromScannerOrCamera"; this.menuFileAcquireFromScannerOrCamera.Click += new System.EventHandler(this.MenuFileAcquireFromScannerOrCamera_Click); // // menuFileClose // this.menuFileClose.Name = "Close"; this.menuFileClose.Click += new EventHandler(MenuFileClose_Click); this.menuFileClose.ShortcutKeys = Keys.Control | Keys.W; // // menuFileSave // this.menuFileSave.Name = "Save"; this.menuFileSave.ShortcutKeys = Keys.Control | Keys.S; this.menuFileSave.Click += new System.EventHandler(this.MenuFileSave_Click); // // menuFileSaveAs // this.menuFileSaveAs.Name = "SaveAs"; this.menuFileSaveAs.ShortcutKeys = Keys.Control | Keys.Shift | Keys.S; this.menuFileSaveAs.Click += new System.EventHandler(this.MenuFileSaveAs_Click); // // menuFilePrint // this.menuFilePrint.Name = "Print"; this.menuFilePrint.ShortcutKeys = Keys.Control | Keys.P; this.menuFilePrint.Click += new System.EventHandler(this.MenuFilePrint_Click); // // menuFileViewPluginLoadErrors // this.menuFileViewPluginLoadErrors.Name = "ViewPluginLoadErrors"; this.menuFileViewPluginLoadErrors.Click += new EventHandler(MenuFileViewPluginLoadErrors_Click); // // menuFileExit // this.menuFileExit.Name = "Exit"; this.menuFileExit.Click += new System.EventHandler(this.MenuFileExit_Click); }
private void InitializeComponent() { this.menuLayersAddNewLayer = new PdnMenuItem(); this.menuLayersDeleteLayer = new PdnMenuItem(); this.menuLayersDuplicateLayer = new PdnMenuItem(); this.menuLayersMergeLayerDown = new PdnMenuItem(); this.menuLayersImportFromFile = new PdnMenuItem(); this.menuLayersSeparator1 = new ToolStripSeparator(); this.menuLayersFlip = new PdnMenuItem(); this.menuLayersFlipHorizontal = new PdnMenuItem(); this.menuLayersFlipVertical = new PdnMenuItem(); this.menuLayersRotateZoom = new PdnMenuItem(); this.menuLayersSeparator2 = new ToolStripSeparator(); this.menuLayersLayerProperties = new PdnMenuItem(); // // LayersMenu // this.DropDownItems.AddRange( new ToolStripItem[] { this.menuLayersAddNewLayer, this.menuLayersDeleteLayer, this.menuLayersDuplicateLayer, this.menuLayersMergeLayerDown, this.menuLayersImportFromFile, this.menuLayersSeparator1, this.menuLayersFlip, this.menuLayersRotateZoom, this.menuLayersSeparator2, this.menuLayersLayerProperties }); this.Name = "Menu.Layers"; this.Text = PdnResources.GetString("Menu.Layers.Text"); // // menuLayersAddNewLayer // this.menuLayersAddNewLayer.Name = "AddNewLayer"; this.menuLayersAddNewLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.N; this.menuLayersAddNewLayer.Click += new System.EventHandler(this.MenuLayersAddNewLayer_Click); // // menuLayersDeleteLayer // this.menuLayersDeleteLayer.Name = "DeleteLayer"; this.menuLayersDeleteLayer.ShortcutKeys = Keys.Shift | Keys.Delete; this.menuLayersDeleteLayer.Click += new System.EventHandler(this.MenuLayersDeleteLayer_Click); // // menuLayersDuplicateLayer // this.menuLayersDuplicateLayer.Name = "DuplicateLayer"; this.menuLayersDuplicateLayer.ShortcutKeys = Keys.Control | Keys.Shift | Keys.D; this.menuLayersDuplicateLayer.Click += new System.EventHandler(this.MenuLayersDuplicateLayer_Click); // // menuLayersMergeDown // this.menuLayersMergeLayerDown.Name = "MergeLayerDown"; this.menuLayersMergeLayerDown.ShortcutKeys = Keys.Control | Keys.M; this.menuLayersMergeLayerDown.Click += new EventHandler(MenuLayersMergeDown_Click); // // menuLayersImportFromFile // this.menuLayersImportFromFile.Name = "ImportFromFile"; this.menuLayersImportFromFile.Click += new System.EventHandler(this.MenuLayersImportFromFile_Click); // // menuLayersFlip // this.menuLayersFlip.Name = "Flip"; this.menuLayersFlip.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuLayersFlipHorizontal, this.menuLayersFlipVertical }); // // menuLayersFlipHorizontal // this.menuLayersFlipHorizontal.Name = "Horizontal"; this.menuLayersFlipHorizontal.Click += new System.EventHandler(this.MenuLayersFlipHorizontal_Click); // // menuLayersFlipVertical // this.menuLayersFlipVertical.Name = "Vertical"; this.menuLayersFlipVertical.Click += new System.EventHandler(this.MenuLayersFlipVertical_Click); // // menuLayersRotateZoom // this.menuLayersRotateZoom.Name = "RotateZoom"; this.menuLayersRotateZoom.Click += new EventHandler(MenuLayersRotateZoom_Click); // // menuLayersLayerProperties // this.menuLayersLayerProperties.Name = "LayerProperties"; this.menuLayersLayerProperties.ShortcutKeys = Keys.F4; this.menuLayersLayerProperties.Click += new System.EventHandler(this.MenuLayersLayerProperties_Click); }
private void InitializeComponent() { this.menuHelpHelpTopics = new PdnMenuItem(); this.menuHelpSeparator1 = new ToolStripSeparator(); this.menuHelpPdnWebsite = new PdnMenuItem(); this.menuHelpDonate = new PdnMenuItem(); this.menuHelpForum = new PdnMenuItem(); this.menuHelpTutorials = new PdnMenuItem(); this.menuHelpPlugins = new PdnMenuItem(); this.menuHelpSendFeedback = new PdnMenuItem(); this.menuHelpSeparator2 = new ToolStripSeparator(); this.menuHelpLanguage = new PdnMenuItem(); this.menuHelpLanguageSentinel = new PdnMenuItem(); this.menuHelpCheckForUpdates = new CheckForUpdatesMenuItem(); this.menuHelpSeparator3 = new ToolStripSeparator(); this.menuHelpAbout = new PdnMenuItem(); // // HelpMenu // this.DropDownItems.AddRange( new ToolStripItem[] { this.menuHelpHelpTopics, this.menuHelpSeparator1, this.menuHelpPdnWebsite, this.menuHelpDonate, this.menuHelpForum, this.menuHelpTutorials, this.menuHelpPlugins, this.menuHelpSendFeedback, this.menuHelpSeparator2, this.menuHelpLanguage, this.menuHelpCheckForUpdates, this.menuHelpSeparator3, this.menuHelpAbout }); this.Name = "Menu.Help"; this.Text = PdnResources.GetString("Menu.Help.Text"); // // menuHelpHelpTopics // this.menuHelpHelpTopics.Name = "HelpTopics"; this.menuHelpHelpTopics.ShortcutKeys = Keys.F1; this.menuHelpHelpTopics.Click += new System.EventHandler(this.MenuHelpHelpTopics_Click); // // menuHelpPdnWebsite // this.menuHelpPdnWebsite.Name = "PdnWebsite"; this.menuHelpPdnWebsite.Click += new EventHandler(MenuHelpPdnWebsite_Click); // // menuHelpDonate // this.menuHelpDonate.Name = "Donate"; this.menuHelpDonate.Click += new EventHandler(MenuHelpDonate_Click); this.menuHelpDonate.Font = Utility.CreateFont(this.menuHelpDonate.Font.Name, this.menuHelpDonate.Font.Size, this.menuHelpDonate.Font.Style | FontStyle.Italic); // // menuHelpForum // this.menuHelpForum.Name = "Forum"; this.menuHelpForum.Click += new EventHandler(MenuHelpForum_Click); // // menuHelpTutorials // this.menuHelpTutorials.Name = "Tutorials"; this.menuHelpTutorials.Click += new EventHandler(MenuHelpTutorials_Click); // // menuHelpPlugins // this.menuHelpPlugins.Name = "Plugins"; this.menuHelpPlugins.Click += new EventHandler(MenuHelpPlugins_Click); // // menuHelpSendFeedback // this.menuHelpSendFeedback.Name = "SendFeedback"; this.menuHelpSendFeedback.Click += new EventHandler(MenuHelpSendFeedback_Click); // // menuHelpLanguage // this.menuHelpLanguage.Name = "Language"; this.menuHelpLanguage.DropDownItems.AddRange( new ToolStripItem[] { this.menuHelpLanguageSentinel }); this.menuHelpLanguage.DropDownOpening += new EventHandler(MenuHelpLanguage_DropDownOpening); // // menuHelpLanguageSentinel // this.menuHelpLanguageSentinel.Text = "(sentinel)"; // // menuHelpCheckForUpdates // // (left blank on purpose) // // menuHelpAbout // this.menuHelpAbout.Name = "About"; this.menuHelpAbout.Click += new System.EventHandler(this.MenuHelpAbout_Click); }
private void InitializeComponent() { this.menuImageCrop = new PdnMenuItem(); this.menuImageResize = new PdnMenuItem(); this.menuImageCanvasSize = new PdnMenuItem(); this.menuImageSeparator1 = new ToolStripSeparator(); this.menuImageFlipHorizontal = new PdnMenuItem(); this.menuImageFlipVertical = new PdnMenuItem(); this.menuImageSeparator2 = new ToolStripSeparator(); this.menuImageRotate90CW = new PdnMenuItem(); this.menuImageRotate90CCW = new PdnMenuItem(); this.menuImageRotate180 = new PdnMenuItem(); this.menuImageSeparator3 = new ToolStripSeparator(); this.menuImageFlatten = new PdnMenuItem(); // // ImageMenu // this.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { this.menuImageCrop, this.menuImageResize, this.menuImageCanvasSize, this.menuImageSeparator1, this.menuImageFlipHorizontal, this.menuImageFlipVertical, this.menuImageSeparator2, this.menuImageRotate90CW, this.menuImageRotate90CCW, this.menuImageRotate180, this.menuImageSeparator3, this.menuImageFlatten }); this.Name = "Menu.Image"; this.Text = PdnResources.GetString("Menu.Image.Text"); // // menuImageCrop // this.menuImageCrop.Name = "Crop"; this.menuImageCrop.Click += new System.EventHandler(this.MenuImageCrop_Click); this.menuImageCrop.ShortcutKeys = Keys.Control | Keys.Shift | Keys.X; // // menuImageResize // this.menuImageResize.Name = "Resize"; this.menuImageResize.ShortcutKeys = Keys.Control | Keys.R; this.menuImageResize.Click += new System.EventHandler(this.MenuImageResize_Click); // // menuImageCanvasSize // this.menuImageCanvasSize.Name = "CanvasSize"; this.menuImageCanvasSize.ShortcutKeys = Keys.Control | Keys.Shift | Keys.R; this.menuImageCanvasSize.Click += new System.EventHandler(this.MenuImageCanvasSize_Click); // // menuImageFlipHorizontal // this.menuImageFlipHorizontal.Name = "FlipHorizontal"; this.menuImageFlipHorizontal.Click += new System.EventHandler(this.MenuImageFlipHorizontal_Click); // // menuImageFlipVertical // this.menuImageFlipVertical.Name = "FlipVertical"; this.menuImageFlipVertical.Click += new System.EventHandler(this.MenuImageFlipVertical_Click); // // menuImageRotate90CW // this.menuImageRotate90CW.Name = "Rotate90CW"; this.menuImageRotate90CW.ShortcutKeys = Keys.Control | Keys.H; this.menuImageRotate90CW.Click += new System.EventHandler(this.MenuImageRotate90CW_Click); // // menuImageRotate90CCW // this.menuImageRotate90CCW.Name = "Rotate90CCW"; this.menuImageRotate90CCW.ShortcutKeys = Keys.Control | Keys.G; this.menuImageRotate90CCW.Click += new System.EventHandler(this.MenuImageRotate90CCW_Click); // // menuImageRotate180 // this.menuImageRotate180.Name = "Rotate180"; this.menuImageRotate180.Click += new System.EventHandler(this.MenuImageRotate180_Click); this.menuImageRotate180.ShortcutKeys = Keys.Control | Keys.J; // // menuImageFlatten // this.menuImageFlatten.Name = "Flatten"; this.menuImageFlatten.ShortcutKeys = Keys.Control | Keys.Shift | Keys.F; this.menuImageFlatten.Click += new System.EventHandler(this.MenuImageFlatten_Click); }