| | |
| | | BackColor = Color.Transparent; |
| | | |
| | | } |
| | | public void SetViewMode(bool isViewMode) |
| | | { |
| | | if (this.mapOption!=null) mapOption.isViewMode= isViewMode; |
| | | } |
| | | private void MapViewer_Load(object sender, EventArgs e) |
| | | { |
| | | this.panel1.Visible = _showToolBar; |
| | |
| | | } |
| | | |
| | | //移动 |
| | | if (selectedObjs.Count >= 1) //&& selectedObjs[0].isNode()) |
| | | if (!mapOption.isViewMode && selectedObjs.Count >= 1) //&& selectedObjs[0].isNode()) |
| | | { |
| | | |
| | | List<NodeViewModel> nodes = selectedNodes; |
| | | foreach (NodeViewModel node in nodes) |
| | | { |
| | |
| | | if (!isMouseMoved) |
| | | { |
| | | 右键_Menu.Show(this, e.Location); |
| | | 转换为ToolStripMenuItem.Enabled = selectedNodes.Count > 0; //(selectedObjs.Count == 1); |
| | | |
| | | 转换为ToolStripMenuItem.Enabled = !mapOption.isViewMode && selectedNodes.Count > 0; //(selectedObjs.Count == 1); |
| | | 删除ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 删除ToolStripMenuItem1.Visible = !mapOption.isViewMode; |
| | | 删除ToolStripMenuItem.Enabled = selectedObjs.Count > 0; |
| | | 删除ToolStripMenuItem1.Enabled = selectedObjs.Count > 0; |
| | | 复制ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 复制ToolStripMenuItem1.Visible = !mapOption.isViewMode; |
| | | 粘贴ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 粘贴ToolStripMenuItem1.Visible = !mapOption.isViewMode; |
| | | 设置长度ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 设为关闭ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 设为立管点ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 对齐ToolStripMenuItem.Visible = !mapOption.isViewMode; |
| | | 对齐ToolStripMenuItem1.Visible = !mapOption.isViewMode; |
| | | } |
| | | |
| | | if (recordView) MapObjectExtensions.AddCommand(mapOption, "Map", mapOption0, mapOption); |
| | |
| | | |
| | | |
| | | } |
| | | if (e.KeyCode == Keys.Delete) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.Delete) |
| | | { |
| | | DeleteChoosedObj(); |
| | | } |
| | |
| | | SetMapInvalidate(); |
| | | } |
| | | |
| | | if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.C && e.Modifiers == Keys.Control) |
| | | { |
| | | 复制ToolStripMenuItem_Click(1, new EventArgs()); |
| | | } |
| | | if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.V && e.Modifiers == Keys.Control) |
| | | { |
| | | _ClickStartPos = Cursor.Position; |
| | | 粘贴ToolStripMenuItem1_Click(1, new EventArgs()); |
| | | } |
| | | if (e.KeyCode == Keys.D1 && e.Modifiers == Keys.Control) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.D1 && e.Modifiers == Keys.Control) |
| | | { |
| | | 南北对齐ToolStripMenuItem_Click(1, new EventArgs()); |
| | | |
| | | } |
| | | if (e.KeyCode == Keys.Oemtilde && e.Modifiers == Keys.Control) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.Oemtilde && e.Modifiers == Keys.Control) |
| | | { |
| | | 东西对齐ToolStripMenuItem_Click(1, new EventArgs()); |
| | | } |
| | | if (e.KeyCode == Keys.D2 && e.Modifiers == Keys.Control) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.D2 && e.Modifiers == Keys.Control) |
| | | { |
| | | 竖直对齐ToolStripMenuItem_Click(1, new EventArgs()); |
| | | } |
| | | if (e.KeyCode == Keys.D3 && e.Modifiers == Keys.Control) |
| | | if (!this.mapOption.isViewMode && e.KeyCode == Keys.D3 && e.Modifiers == Keys.Control) |
| | | { |
| | | 自动对齐ToolStripMenuItem_Click(1, new EventArgs()); |
| | | } |
| | |
| | | |
| | | private void MapViewer_KeyPress(object sender, KeyPressEventArgs e) |
| | | { |
| | | if (ctrlPressed && e.KeyChar == 'Z' - 64) |
| | | if (!this.mapOption.isViewMode && ctrlPressed && e.KeyChar == 'Z' - 64) |
| | | { |
| | | // 执行相应的操作 |
| | | buttonUndo_Click(sender, e); |
| | |
| | | // 防止默认操作 |
| | | e.Handled = true; |
| | | } |
| | | if (ctrlPressed && e.KeyChar == 'Y' - 64) |
| | | if (!this.mapOption.isViewMode && ctrlPressed && e.KeyChar == 'Y' - 64) |
| | | { |
| | | // 执行相应的操作 |
| | | buttonRedo_Click(sender, e); |
| | |
| | | } |
| | | private void MapViewer_PreKeyPress(object sender, PreviewKeyDownEventArgs e) |
| | | { |
| | | if (e.Control && e.KeyCode == Keys.Z) |
| | | if (!this.mapOption.isViewMode && e.Control && e.KeyCode == Keys.Z) |
| | | { |
| | | ctrlPressed = true; |
| | | // 防止默认操作 |
| | | e.IsInputKey = true; |
| | | |
| | | } |
| | | if (e.Control && e.KeyCode == Keys.Y) |
| | | if (!this.mapOption.isViewMode && e.Control && e.KeyCode == Keys.Y) |
| | | { |
| | | ctrlPressed = true; |
| | | // 防止默认操作 |
| | |
| | | form_EditFloors.Show(this); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | private void 切换viewModelToolStripMenuItem_Click(object sender, EventArgs e) |
| | | { |
| | | this.mapOption.isViewMode = !this.mapOption.isViewMode; |
| | | } |
| | | } |
| | | } |