123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561 |
- using Resources;
- using SmartCoalApplication.Base.Enum;
- using SmartCoalApplication.Core;
- using System;
- using System.Windows.Forms;
- namespace SmartCoalApplication.Menus
- {
- /// <summary>
- /// 编辑菜单
- /// </summary>
- internal sealed class EditMenu : PdnMenuItem
- {
- private PdnMenuItem menuEditUndo;
- private PdnMenuItem menuEditRedo;
- private PdnMenuItem menuEditCopy;
- private PdnMenuItem menuEditPaste;
- private PdnMenuItem menuEditDelete;
- private ToolStripSeparator menuEditSeparator1;
- private PdnMenuItem menuViewZoomIn;
- private PdnMenuItem menuViewZoomOut;
- private PdnMenuItem menuViewActualSize;
- private PdnMenuItem menuViewZoomToWindow;
- private PdnMenuItem menuViewZoomToWidth;
- private PdnMenuItem menuViewZoomToHeight;
- private ToolStripSeparator menuEditSeparator2;
- private PdnMenuItem menuImageCut;
- private PdnMenuItem menuLockZoom;
- private PdnMenuItem menuFixedMultiple;
- private ToolStripSeparator menuEditSeparator3;
- private PdnMenuItem menuImageFlipHorizontal;
- private PdnMenuItem menuImageFlipVertical;
- private PdnMenuItem menuImageFlipCenter;
- private ToolStripSeparator menuEditSeparator4;
- private PdnMenuItem menuImageRotate90CW;
- private PdnMenuItem menuImageRotate180;
- private PdnMenuItem menuImageRotate90CCW;
- public EditMenu(int menuId)
- {
- PdnBaseForm.RegisterFormHotKey(Keys.Control | Keys.Insert, OnLeftHandedCopyHotKey);
- PdnBaseForm.RegisterFormHotKey(Keys.Shift | Keys.Insert, OnLeftHandedPasteHotKey);
- InitializeComponent();
- this.MenuId = menuId;
- }
- private bool OnLeftHandedCopyHotKey(Keys keys)
- {
- this.menuEditCopy.PerformClick();
- return true;
- }
- private bool OnLeftHandedPasteHotKey(Keys keys)
- {
- this.menuEditPaste.PerformClick();
- return true;
- }
- private void InitializeComponent()
- {
- this.menuEditUndo = new PdnMenuItem(ActionType.Undo);
- this.menuEditRedo = new PdnMenuItem(ActionType.Redo);
- this.menuEditCopy = new PdnMenuItem(ActionType.Copy);
- this.menuEditPaste = new PdnMenuItem(ActionType.Paste);
- this.menuEditDelete = new PdnMenuItem(ActionType.Delete);
- this.menuEditSeparator1 = new ToolStripSeparator();
- this.menuViewZoomIn = new PdnMenuItem(ActionType.ZoomIn);
- this.menuViewZoomOut = new PdnMenuItem(ActionType.ZoomOut);
- this.menuViewActualSize = new PdnMenuItem(ActionType.ActualSize, true);
- this.menuViewZoomToWindow = new PdnMenuItem(ActionType.ZoomToWindow, true);
- this.menuViewZoomToWidth = new PdnMenuItem(ActionType.ZoomToWidth, true);
- this.menuViewZoomToHeight = new PdnMenuItem(ActionType.ZoomToHeight, true);
- this.menuEditSeparator2 = new ToolStripSeparator();
- this.menuImageCut = new PdnMenuItem(ActionType.ImageCut);
- this.menuLockZoom = new PdnMenuItem(ActionType.LockZoom);
- this.menuFixedMultiple = new PdnMenuItem(ActionType.FixedMultiple);
- //this.menuFixedMultiple.Visible = false;
- this.menuEditSeparator3 = new ToolStripSeparator();
- this.menuImageFlipHorizontal = new PdnMenuItem(ActionType.FlipHorizontal);
- this.menuImageFlipVertical = new PdnMenuItem(ActionType.FlipVertical);
- this.menuImageFlipCenter = new PdnMenuItem(ActionType.FlipCenter);
- this.menuEditSeparator4 = new ToolStripSeparator();
- this.menuImageRotate90CW = new PdnMenuItem(ActionType.Rotate90CW);
- this.menuImageRotate180 = new PdnMenuItem(ActionType.Rotate180);
- this.menuImageRotate90CCW = new PdnMenuItem(ActionType.Rotate90CCW);
- //
- // EditMenu
- //
- this.DropDownItems.AddRange(
- new ToolStripItem[]
- {
- this.menuEditUndo,
- this.menuEditRedo,
- this.menuEditCopy,
- this.menuEditPaste,
- this.menuEditDelete,
- this.menuEditSeparator1,
- this.menuViewZoomIn,
- this.menuViewZoomOut,
- this.menuViewActualSize,
- this.menuViewZoomToWindow,
- this.menuViewZoomToWidth,
- this.menuViewZoomToHeight,
- this.menuEditSeparator2,
- this.menuImageCut,
- this.menuLockZoom,
- this.menuFixedMultiple,
- this.menuEditSeparator3,
- this.menuImageFlipHorizontal,
- this.menuImageFlipVertical,
- this.menuImageFlipCenter,
- this.menuEditSeparator4,
- this.menuImageRotate90CW,
- this.menuImageRotate180,
- this.menuImageRotate90CCW
- }); ;
- this.Name = "Menu.Edit";
- this.Text = PdnResources.GetString("Menu.Edit.Text");
- //
- // 撤销
- //
- this.menuEditUndo.Click += new EventHandler(this.MenuEditUndo_Click);
- //
- // 恢复
- //
- this.menuEditRedo.Click += new EventHandler(this.MenuEditRedo_Click);
- //
- // 复制
- //
- this.menuEditCopy.Click += new EventHandler(this.MenuEditCopy_Click);
- //
- // 粘贴
- //
- this.menuEditPaste.Click += new EventHandler(this.MenuEditPaste_Click);
- //
- // 删除
- //
- this.menuEditDelete.Click += new EventHandler(this.MenuEditDelete_Click);
- //
- // 放大
- //
- this.menuViewZoomIn.ShortcutKeyDisplayString = PdnResources.GetString("Menu.View.ZoomIn.ShortcutKeyDisplayString");
- this.menuViewZoomIn.NeedWaitKey = true;
- this.menuViewZoomIn.Click += new EventHandler(this.MenuViewZoomIn_Click);
- //
- // 缩小
- //
- this.menuViewZoomOut.ShortcutKeyDisplayString = PdnResources.GetString("Menu.View.ZoomOut.ShortcutKeyDisplayString");
- this.menuViewZoomOut.NeedWaitKey = true;
- this.menuViewZoomOut.Click += new EventHandler(this.MenuViewZoomOut_Click);
- //
- // 实际大小
- //
- this.menuViewActualSize.NeedWaitKey = true;
- this.menuViewActualSize.Click += new EventHandler(this.MenuViewActualSize_Click);
- //
- // 合适大小
- //
- this.menuViewZoomToWindow.NeedWaitKey = true;
- this.menuViewZoomToWindow.Click += new EventHandler(this.MenuViewZoomToWindow_Click);
- //
- // 合适宽度
- //
- this.menuViewZoomToWidth.NeedWaitKey = true;
- this.menuViewZoomToWidth.Click += new EventHandler(this.MenuViewZoomToWidth_Click);
- //
- //
- // 合适高度
- this.menuViewZoomToHeight.NeedWaitKey = true;
- this.menuViewZoomToHeight.Click += new EventHandler(this.MenuViewZoomToHeight_Click);
- //
- // 图片裁剪
- //
- this.menuImageCut.NeedWaitKey = true;
- this.menuImageCut.Click += new EventHandler(this.MenuImageCut_Click);
- //
- // 锁定扩缩
- //
- this.menuLockZoom.Click += new EventHandler(this.MenuLockZoom_Click);
- //
- // 定倍显示
- //
- this.menuFixedMultiple.Click += new EventHandler(this.MenuFixedMultiple_Click);
- //
- // 水平翻转
- //
- this.menuImageFlipHorizontal.Click += new EventHandler(this.MenuImageFlipHorizontal_Click);
- //
- // 垂直翻转
- //
- this.menuImageFlipVertical.Click += new EventHandler(this.MenuImageFlipVertical_Click);
- //
- // 中心翻转
- //
- this.menuImageFlipCenter.Click += new EventHandler(this.MenuImageFlipCenter_Click);
- //
- // 旋转90度
- //
- this.menuImageRotate90CW.Click += new EventHandler(this.MenuImageRotate90_Click);
- //this.menuImageRotate90CW.ShortcutKeys = Keys.Control | Keys.J;
- //
- // 旋转180度
- //
- this.menuImageRotate180.Click += new EventHandler(this.MenuImageRotate180_Click);
- //this.menuImageRotate180.ShortcutKeys = Keys.Control | Keys.J;
- //
- // 旋转270度
- //
- this.menuImageRotate90CCW.Click += new EventHandler(this.MenuImageRotate270_Click);
- //this.menuImageRotate90CCW.ShortcutKeys = Keys.Control | Keys.J;
- //
- // 加载菜单的文字和icon
- //
- this.LoadNames(this.Name);
- this.LoadIcons();
- }
- protected override void OnDropDownOpening(EventArgs e)
- {
- this.menuViewActualSize.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.ActualSize : false;
- this.menuViewZoomToWindow.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.SuitableSize : false;
- this.menuViewZoomToWidth.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.SuitableWidth : false;
- this.menuViewZoomToHeight.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.SuitableHeight : false;
- this.menuLockZoom.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.LockZoom : false;
- this.menuFixedMultiple.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.FixedMultiple : false;
- if (AppWorkspace.ActiveDocumentWorkspace == null/* || AppWorkspace.ScriptRunning*/)
- {
- this.menuViewZoomToWindow.Enabled = false;
- this.menuViewActualSize.Enabled = false;
- this.menuEditCopy.Enabled = false;
- this.menuEditDelete.Enabled = false;
- this.menuLockZoom.Checked = false;
- this.menuFixedMultiple.Enabled = false;
- }
- else
- {
- this.menuViewZoomToWindow.Enabled = true;
- this.menuViewActualSize.Enabled = true;
- this.menuEditCopy.Enabled = true;
- this.menuEditDelete.Enabled = false;
- this.menuFixedMultiple.Enabled = true;
- }
- base.OnDropDownOpening(e);
- }
- /// <summary>
- /// 撤销
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuEditUndo_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 恢复
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuEditRedo_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 复制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuEditCopy_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 粘贴
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuEditPaste_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuEditDelete_Click(object sender, EventArgs e)
- {
-
- }
- private void MenuViewZoomIn_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- AppWorkspace.ActiveDocumentWorkspace.ZoomIn();
- }
- }
- private void MenuViewZoomOut_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- AppWorkspace.ActiveDocumentWorkspace.ZoomOut();
- }
- }
- private void MenuViewActualSize_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (!AppWorkspace.ActiveDocumentWorkspace.ActualSize)
- {
- AppWorkspace.ActiveDocumentWorkspace.ActualSize = !AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.menuViewActualSize.Checked = AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- AppWorkspace.ActiveDocumentWorkspace.SuitableSize = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.menuViewZoomToWindow.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- AppWorkspace.ActiveDocumentWorkspace.SuitableWidth = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.menuViewZoomToWidth.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- AppWorkspace.ActiveDocumentWorkspace.SuitableHeight = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.menuViewZoomToHeight.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- }
- else
- {
- AppWorkspace.ActiveDocumentWorkspace.ActualSize = !AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.menuViewActualSize.Checked = AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- AppWorkspace.UpdateBottomButtonSelectionStatus();
- AppWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
- AppWorkspace.ActiveDocumentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
- }
- }
- private void MenuViewZoomToWindow_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (!AppWorkspace.ActiveDocumentWorkspace.SuitableSize)
- {
- AppWorkspace.ActiveDocumentWorkspace.SuitableSize = !AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.menuViewZoomToWindow.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- AppWorkspace.ActiveDocumentWorkspace.ActualSize = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.menuViewActualSize.Checked = AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- AppWorkspace.ActiveDocumentWorkspace.SuitableWidth = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.menuViewZoomToWidth.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- AppWorkspace.ActiveDocumentWorkspace.SuitableHeight = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.menuViewZoomToHeight.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- else
- {
- AppWorkspace.ActiveDocumentWorkspace.SuitableSize = !AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.menuViewZoomToWindow.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- AppWorkspace.UpdateBottomButtonSelectionStatus();
- AppWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
- }
- }
- private void MenuViewZoomToWidth_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (!AppWorkspace.ActiveDocumentWorkspace.SuitableWidth)
- {
- AppWorkspace.ActiveDocumentWorkspace.SuitableWidth = !AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.menuViewZoomToWidth.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- AppWorkspace.ActiveDocumentWorkspace.SuitableSize = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.menuViewZoomToWindow.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- AppWorkspace.ActiveDocumentWorkspace.ActualSize = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.menuViewActualSize.Checked = AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- AppWorkspace.ActiveDocumentWorkspace.SuitableHeight = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.menuViewZoomToHeight.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- else
- {
- AppWorkspace.ActiveDocumentWorkspace.SuitableWidth = !AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.menuViewZoomToWidth.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- AppWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.FitToWidth;
- }
- }
- private void MenuViewZoomToHeight_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (!AppWorkspace.ActiveDocumentWorkspace.SuitableHeight)
- {
- AppWorkspace.ActiveDocumentWorkspace.SuitableHeight = !AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.menuViewZoomToHeight.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- AppWorkspace.ActiveDocumentWorkspace.SuitableWidth = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableWidth, "ZoomToWidth");
- this.menuViewZoomToWidth.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableWidth;
- AppWorkspace.ActiveDocumentWorkspace.SuitableSize = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableSize, "ZoomToWindow");
- this.menuViewZoomToWindow.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableSize;
- AppWorkspace.ActiveDocumentWorkspace.ActualSize = false;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ActualSize, "ActualSize");
- this.menuViewActualSize.Checked = AppWorkspace.ActiveDocumentWorkspace.ActualSize;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- else
- {
- AppWorkspace.ActiveDocumentWorkspace.SuitableHeight = !AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.SuitableHeight, "ZoomToHeight");
- this.menuViewZoomToHeight.Checked = AppWorkspace.ActiveDocumentWorkspace.SuitableHeight;
- this.AppWorkspace.UpdateBottomButtonSelectionStatus();
- }
- AppWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.FitToHeight;
- }
- }
- private void MenuImageCut_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 锁定扩缩
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuLockZoom_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- AppWorkspace.ActiveDocumentWorkspace.LockZoom = !AppWorkspace.ActiveDocumentWorkspace.LockZoom;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.LockZoom, "LockZoom");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.LockZoom, "LockZoom");
- this.menuLockZoom.Checked = !this.menuLockZoom.Checked;
- AppWorkspace.UpdateBottomButtonSelectionStatus();
- AppWorkspace.isLockZoom = this.menuLockZoom.Checked;
- AppWorkspace.lockScaleRatio = AppWorkspace.ActiveDocumentWorkspace.ScaleFactor.Ratio;
- }
- }
- /// <summary>
- /// 定倍显示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuFixedMultiple_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 水平镜像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuImageFlipHorizontal_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 垂直镜像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuImageFlipVertical_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 中心镜像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuImageFlipCenter_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 旋转90度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuImageRotate90_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 旋转180度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuImageRotate180_Click(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 旋转270度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuImageRotate270_Click(object sender, EventArgs e)
- {
-
- }
- }
- }
|